aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.h
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2005-08-09 23:16:32 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:50:12 -0400
commit2009493065e01b1fe27c1b98ffbcfab98e185f72 (patch)
tree8a8981461a4f84a007f4725a027f3185055737ea /drivers/net/tg3.h
parent757f612e091e7d13707eedc3ff71f1a9b53f5537 (diff)
[TG3]: Add basic register access function pointers
This patch adds the basic function pointers to do register accesses in the fast path. This was suggested by David Miller. The idea is that various register access methods for different hardware errata can easily be implemented with these function pointers and performance will not be degraded on chips that use normal register access methods. The various register read write macros (e.g. tw32, tr32, tw32_mailbox) are redefined to call the function pointers. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.h')
-rw-r--r--drivers/net/tg3.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 5c4433c147fa..394acddd53b3 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2049,6 +2049,10 @@ struct tg3 {
2049 spinlock_t lock; 2049 spinlock_t lock;
2050 spinlock_t indirect_lock; 2050 spinlock_t indirect_lock;
2051 2051
2052 u32 (*read32) (struct tg3 *, u32);
2053 void (*write32) (struct tg3 *, u32, u32);
2054 void (*write32_mbox) (struct tg3 *, u32,
2055 u32);
2052 void __iomem *regs; 2056 void __iomem *regs;
2053 struct net_device *dev; 2057 struct net_device *dev;
2054 struct pci_dev *pdev; 2058 struct pci_dev *pdev;
@@ -2060,6 +2064,8 @@ struct tg3 {
2060 u32 msg_enable; 2064 u32 msg_enable;
2061 2065
2062 /* begin "tx thread" cacheline section */ 2066 /* begin "tx thread" cacheline section */
2067 void (*write32_tx_mbox) (struct tg3 *, u32,
2068 u32);
2063 u32 tx_prod; 2069 u32 tx_prod;
2064 u32 tx_cons; 2070 u32 tx_cons;
2065 u32 tx_pending; 2071 u32 tx_pending;
@@ -2071,6 +2077,8 @@ struct tg3 {
2071 dma_addr_t tx_desc_mapping; 2077 dma_addr_t tx_desc_mapping;
2072 2078
2073 /* begin "rx thread" cacheline section */ 2079 /* begin "rx thread" cacheline section */
2080 void (*write32_rx_mbox) (struct tg3 *, u32,
2081 u32);
2074 u32 rx_rcb_ptr; 2082 u32 rx_rcb_ptr;
2075 u32 rx_std_ptr; 2083 u32 rx_std_ptr;
2076 u32 rx_jumbo_ptr; 2084 u32 rx_jumbo_ptr;