diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2010-07-11 06:30:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-12 16:05:37 -0400 |
commit | f31c9a8c1380e20e95d06925f2e42baf61af4db7 (patch) | |
tree | 266ad6eb4cfe9fcd5951d9ed5bdeae958c904486 /drivers/net/wireless/rt2x00/rt2800lib.h | |
parent | ab8966ddc2f7fa3e631efa7478ea2c76d6c9942f (diff) |
rt2x00: Move common firmware loading into rt2800lib
Large parts of the firmware initialization are shared
between rt2800pci and rt2800usb. Move this code into
rt2800lib.
Signed-off-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.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h index 10f8f2f8d65b..cecbd3abc35b 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/rt2x00/rt2800lib.h | |||
@@ -41,6 +41,8 @@ struct rt2800_ops { | |||
41 | const unsigned int offset, | 41 | const unsigned int offset, |
42 | const struct rt2x00_field32 field, u32 *reg); | 42 | const struct rt2x00_field32 field, u32 *reg); |
43 | 43 | ||
44 | int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, | ||
45 | const u8 *data, const size_t len); | ||
44 | int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); | 46 | int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); |
45 | }; | 47 | }; |
46 | 48 | ||
@@ -109,6 +111,14 @@ static inline int rt2800_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
109 | return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg); | 111 | return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg); |
110 | } | 112 | } |
111 | 113 | ||
114 | static inline int rt2800_drv_write_firmware(struct rt2x00_dev *rt2x00dev, | ||
115 | const u8 *data, const size_t len) | ||
116 | { | ||
117 | const struct rt2800_ops *rt2800ops = rt2x00dev->priv; | ||
118 | |||
119 | return rt2800ops->drv_write_firmware(rt2x00dev, data, len); | ||
120 | } | ||
121 | |||
112 | static inline int rt2800_drv_init_registers(struct rt2x00_dev *rt2x00dev) | 122 | static inline int rt2800_drv_init_registers(struct rt2x00_dev *rt2x00dev) |
113 | { | 123 | { |
114 | const struct rt2800_ops *rt2800ops = rt2x00dev->priv; | 124 | const struct rt2800_ops *rt2800ops = rt2x00dev->priv; |
@@ -120,6 +130,11 @@ void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, | |||
120 | const u8 command, const u8 token, | 130 | const u8 command, const u8 token, |
121 | const u8 arg0, const u8 arg1); | 131 | const u8 arg0, const u8 arg1); |
122 | 132 | ||
133 | int rt2800_check_firmware(struct rt2x00_dev *rt2x00dev, | ||
134 | const u8 *data, const size_t len); | ||
135 | int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, | ||
136 | const u8 *data, const size_t len); | ||
137 | |||
123 | void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc); | 138 | void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc); |
124 | void rt2800_process_rxwi(struct queue_entry *entry, struct rxdone_entry_desc *txdesc); | 139 | void rt2800_process_rxwi(struct queue_entry *entry, struct rxdone_entry_desc *txdesc); |
125 | 140 | ||