rt2800pci: add rt2800_regbusy_read() wrapper
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 4 Nov 2009 17:33:41 +0000 (18:33 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 6 Nov 2009 21:48:49 +0000 (16:48 -0500)
Part of preparations for later code unification.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800pci.c
drivers/net/wireless/rt2x00/rt2800pci.h

index 8b98ff822f1945b500d341166e411d4d19108a37..cb55e6d10b67253adef3c602054fcb19bf71a746 100644 (file)
@@ -69,14 +69,14 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
  * The _lock versions must be used if you already hold the csr_mutex
  */
 #define WAIT_FOR_BBP(__dev, __reg) \
-       rt2x00pci_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg))
+       rt2800_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg))
 #define WAIT_FOR_RFCSR(__dev, __reg) \
-       rt2x00pci_regbusy_read((__dev), RF_CSR_CFG, RF_CSR_CFG_BUSY, (__reg))
+       rt2800_regbusy_read((__dev), RF_CSR_CFG, RF_CSR_CFG_BUSY, (__reg))
 #define WAIT_FOR_RF(__dev, __reg) \
-       rt2x00pci_regbusy_read((__dev), RF_CSR_CFG0, RF_CSR_CFG0_BUSY, (__reg))
+       rt2800_regbusy_read((__dev), RF_CSR_CFG0, RF_CSR_CFG0_BUSY, (__reg))
 #define WAIT_FOR_MCU(__dev, __reg) \
-       rt2x00pci_regbusy_read((__dev), H2M_MAILBOX_CSR, \
-                              H2M_MAILBOX_CSR_OWNER, (__reg))
+       rt2800_regbusy_read((__dev), H2M_MAILBOX_CSR, \
+                           H2M_MAILBOX_CSR_OWNER, (__reg))
 
 static void rt2800pci_bbp_write(struct rt2x00_dev *rt2x00dev,
                                const unsigned int word, const u8 value)
@@ -350,7 +350,7 @@ static void rt2800pci_efuse_read(struct rt2x00_dev *rt2x00dev,
        rt2800_register_write(rt2x00dev, EFUSE_CTRL, reg);
 
        /* Wait until the EEPROM has been loaded */
-       rt2x00pci_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, &reg);
+       rt2800_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, &reg);
 
        /* Apparently the data is read from end to start */
        rt2800_register_read(rt2x00dev, EFUSE_DATA3,
index bace4921e8cdc76b5d77e8e577be2f0aeeb2d284..392f580cbb6008664061c34bdad500e59048f9d3 100644 (file)
@@ -63,6 +63,14 @@ static inline void rt2800_register_multiwrite(struct rt2x00_dev *rt2x00dev,
        rt2x00pci_register_multiwrite(rt2x00dev, offset, value, length);
 }
 
+static inline int rt2800_regbusy_read(struct rt2x00_dev *rt2x00dev,
+                                     const unsigned int offset,
+                                     const struct rt2x00_field32 field,
+                                     u32 *reg)
+{
+       return rt2x00pci_regbusy_read(rt2x00dev, offset, field, reg);
+}
+
 /*
  * RF chip defines.
  *