Commit b4a77d0d authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by John W. Linville

rt2800pci: add rt2800_regbusy_read() wrapper

Part of preparations for later code unification.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ab209b98
...@@ -69,13 +69,13 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); ...@@ -69,13 +69,13 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
* The _lock versions must be used if you already hold the csr_mutex * The _lock versions must be used if you already hold the csr_mutex
*/ */
#define WAIT_FOR_BBP(__dev, __reg) \ #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) \ #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) \ #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) \ #define WAIT_FOR_MCU(__dev, __reg) \
rt2x00pci_regbusy_read((__dev), H2M_MAILBOX_CSR, \ rt2800_regbusy_read((__dev), H2M_MAILBOX_CSR, \
H2M_MAILBOX_CSR_OWNER, (__reg)) H2M_MAILBOX_CSR_OWNER, (__reg))
static void rt2800pci_bbp_write(struct rt2x00_dev *rt2x00dev, static void rt2800pci_bbp_write(struct rt2x00_dev *rt2x00dev,
...@@ -350,7 +350,7 @@ static void rt2800pci_efuse_read(struct rt2x00_dev *rt2x00dev, ...@@ -350,7 +350,7 @@ static void rt2800pci_efuse_read(struct rt2x00_dev *rt2x00dev,
rt2800_register_write(rt2x00dev, EFUSE_CTRL, reg); rt2800_register_write(rt2x00dev, EFUSE_CTRL, reg);
/* Wait until the EEPROM has been loaded */ /* 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 */ /* Apparently the data is read from end to start */
rt2800_register_read(rt2x00dev, EFUSE_DATA3, rt2800_register_read(rt2x00dev, EFUSE_DATA3,
......
...@@ -63,6 +63,14 @@ static inline void rt2800_register_multiwrite(struct rt2x00_dev *rt2x00dev, ...@@ -63,6 +63,14 @@ static inline void rt2800_register_multiwrite(struct rt2x00_dev *rt2x00dev,
rt2x00pci_register_multiwrite(rt2x00dev, offset, value, length); 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. * RF chip defines.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment