aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-11-27 13:57:27 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-01 16:32:31 -0500
commitb32f40c4853cdbe3d722a959fb0dd1ea048b50d0 (patch)
tree9c7f4ba709fe8f96ef1ff3280b91bf073f859520 /drivers/net/sky2.h
parente0348b9ae5374f9a24424ae680bcd80724415f60 (diff)
sky2: revert to access PCI config via device space
Using the hardware window into PCI config space is more reliable and smaller/faster than using the pci_config routines. It avoids issues with MMCONFIG etc. Reverts: 167f53d05fccb47b6eeadac7f6705b3f2f042d03 Please apply for 2.6.24 Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sky2.h')
-rw-r--r--drivers/net/sky2.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 69525fd7908d..bc646a47edd2 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -2128,4 +2128,25 @@ static inline void gma_set_addr(struct sky2_hw *hw, unsigned port, unsigned reg,
2128 gma_write16(hw, port, reg+4,(u16) addr[2] | ((u16) addr[3] << 8)); 2128 gma_write16(hw, port, reg+4,(u16) addr[2] | ((u16) addr[3] << 8));
2129 gma_write16(hw, port, reg+8,(u16) addr[4] | ((u16) addr[5] << 8)); 2129 gma_write16(hw, port, reg+8,(u16) addr[4] | ((u16) addr[5] << 8));
2130} 2130}
2131
2132/* PCI config space access */
2133static inline u32 sky2_pci_read32(const struct sky2_hw *hw, unsigned reg)
2134{
2135 return sky2_read32(hw, Y2_CFG_SPC + reg);
2136}
2137
2138static inline u16 sky2_pci_read16(const struct sky2_hw *hw, unsigned reg)
2139{
2140 return sky2_read16(hw, Y2_CFG_SPC + reg);
2141}
2142
2143static inline void sky2_pci_write32(struct sky2_hw *hw, unsigned reg, u32 val)
2144{
2145 sky2_write32(hw, Y2_CFG_SPC + reg, val);
2146}
2147
2148static inline void sky2_pci_write16(struct sky2_hw *hw, unsigned reg, u16 val)
2149{
2150 sky2_write16(hw, Y2_CFG_SPC + reg, val);
2151}
2131#endif 2152#endif