summaryrefslogtreecommitdiff
path: root/drivers/net/sky2.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-02-22 11:45:02 -0800
committerFrancois Romieu <romieu@fr.zoreil.com>2006-02-23 01:25:23 +0100
commit56a645cc1bc16ab33b33a3e0854a46c5d2c864f3 (patch)
tree22ecf36723c1a60d87168583dd2f85f049ccfd88 /drivers/net/sky2.h
parent9a6d343188f5f1e9537e700fc4139c2d905ff129 (diff)
[PATCH] sky2: use device iomem to access PCI config
To avoid problems with PCI config access without ACPI (or busted ACPI tables), use the device's window into PCI config space. I know this probably will upset the purists, but I would rather have users than ACPI testers. It also generates less code. Signed-off-by: Stephen Hemminger <shemminger@osdl.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 d1c71f50d8b9..9e40766150b4 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1951,4 +1951,25 @@ static inline void gma_set_addr(struct sky2_hw *hw, unsigned port, unsigned reg,
gma_write16(hw, port, reg+4,(u16) addr[2] | ((u16) addr[3] << 8));
gma_write16(hw, port, reg+8,(u16) addr[4] | ((u16) addr[5] << 8));
}
+
+/* PCI config space access */
+static inline u32 sky2_pci_read32(const struct sky2_hw *hw, unsigned reg)
+{
+ return sky2_read32(hw, Y2_CFG_SPC + reg);
+}
+
+static inline u16 sky2_pci_read16(const struct sky2_hw *hw, unsigned reg)
+{
+ return sky2_read16(hw, Y2_CFG_SPC + reg);
+}
+
+static inline void sky2_pci_write32(struct sky2_hw *hw, unsigned reg, u32 val)
+{
+ sky2_write32(hw, Y2_CFG_SPC + reg, val);
+}
+
+static inline void sky2_pci_write16(struct sky2_hw *hw, unsigned reg, u16 val)
+{
+ sky2_write16(hw, Y2_CFG_SPC + reg, val);
+}
#endif