aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800lib.h
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2012-09-02 21:25:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-07 15:08:40 -0400
commitad417a533a5bddedbf6b64c12cc26af7c80866f8 (patch)
tree2cdb9a20ade6b59e2ce5cbadf2221483240918af /drivers/net/wireless/rt2x00/rt2800lib.h
parent99bdf51a6892e7fdff8d879890f075b3bf51d4ef (diff)
rt2x00: rt2800 - Make probe_hw function common between PCI and USB.
Refactor the probe_hw code so that more code can be shared between rt2800pci and rt2800usb. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800lib.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h
index 18a0b67b4c68..a128ceadcb3e 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.h
+++ b/drivers/net/wireless/rt2x00/rt2800lib.h
@@ -43,6 +43,9 @@ struct rt2800_ops {
43 const unsigned int offset, 43 const unsigned int offset,
44 const struct rt2x00_field32 field, u32 *reg); 44 const struct rt2x00_field32 field, u32 *reg);
45 45
46 void (*read_eeprom)(struct rt2x00_dev *rt2x00dev);
47 bool (*hwcrypt_disabled)(struct rt2x00_dev *rt2x00dev);
48
46 int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, 49 int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev,
47 const u8 *data, const size_t len); 50 const u8 *data, const size_t len);
48 int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); 51 int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev);
@@ -114,6 +117,20 @@ static inline int rt2800_regbusy_read(struct rt2x00_dev *rt2x00dev,
114 return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg); 117 return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg);
115} 118}
116 119
120static inline void rt2800_read_eeprom(struct rt2x00_dev *rt2x00dev)
121{
122 const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
123
124 rt2800ops->read_eeprom(rt2x00dev);
125}
126
127static inline bool rt2800_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev)
128{
129 const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
130
131 return rt2800ops->hwcrypt_disabled(rt2x00dev);
132}
133
117static inline int rt2800_drv_write_firmware(struct rt2x00_dev *rt2x00dev, 134static inline int rt2800_drv_write_firmware(struct rt2x00_dev *rt2x00dev,
118 const u8 *data, const size_t len) 135 const u8 *data, const size_t len)
119{ 136{
@@ -191,9 +208,8 @@ void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
191 208
192int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev); 209int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev);
193void rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev); 210void rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev);
194int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev); 211
195int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev); 212int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev);
196int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev);
197 213
198void rt2800_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx, u32 *iv32, 214void rt2800_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx, u32 *iv32,
199 u16 *iv16); 215 u16 *iv16);