diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2008-04-01 08:50:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-16 15:59:56 -0400 |
commit | 7919b89c8276d657976d4d4d6b7cb58ea1aa08c3 (patch) | |
tree | 31fc24e2f8b7d8eeee67347333e078591796d4b7 /drivers/net/wireless/libertas/dev.h | |
parent | 98dd6a575928ed9c42130d208e6bfb0f7a914d5a (diff) |
libertas: convert libertas driver to use an event/cmdresp queue
This patch (co-developed by Dan Williams and Holger Schurig) uses a kfifo
object for events and a swapping buffer scheme for the command response to
preserve the zero-copy semantics of the CF driver and keep memory usage low.
The main thread should only ever touch the buffer indexed by priv->resp_idx,
while the interface code is free to write to the second buffer, then swap
priv->resp_idx under the driver spinlock. The firmware specs only permit
one in-flight command, so there will only ever be one command response to
process at a time.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/dev.h')
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 1e6bae80396b..0d9edb9b11f5 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -129,10 +129,6 @@ struct lbs_private { | |||
129 | u32 bbp_offset; | 129 | u32 bbp_offset; |
130 | u32 rf_offset; | 130 | u32 rf_offset; |
131 | 131 | ||
132 | /** Upload length */ | ||
133 | u32 upld_len; | ||
134 | /* Upload buffer */ | ||
135 | u8 upld_buf[LBS_UPLD_SIZE]; | ||
136 | /* Download sent: | 132 | /* Download sent: |
137 | bit0 1/0=data_sent/data_tx_done, | 133 | bit0 1/0=data_sent/data_tx_done, |
138 | bit1 1/0=cmd_sent/cmd_tx_done, | 134 | bit1 1/0=cmd_sent/cmd_tx_done, |
@@ -155,21 +151,16 @@ struct lbs_private { | |||
155 | 151 | ||
156 | /** Hardware access */ | 152 | /** Hardware access */ |
157 | int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); | 153 | int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); |
158 | int (*hw_get_int_status) (struct lbs_private *priv, u8 *); | ||
159 | int (*hw_read_event_cause) (struct lbs_private *); | ||
160 | 154 | ||
161 | /* Wake On LAN */ | 155 | /* Wake On LAN */ |
162 | uint32_t wol_criteria; | 156 | uint32_t wol_criteria; |
163 | uint8_t wol_gpio; | 157 | uint8_t wol_gpio; |
164 | uint8_t wol_gap; | 158 | uint8_t wol_gap; |
165 | 159 | ||
166 | /* was struct lbs_adapter from here... */ | ||
167 | |||
168 | /** Wlan adapter data structure*/ | 160 | /** Wlan adapter data structure*/ |
169 | /** STATUS variables */ | 161 | /** STATUS variables */ |
170 | u32 fwrelease; | 162 | u32 fwrelease; |
171 | u32 fwcapinfo; | 163 | u32 fwcapinfo; |
172 | /* protected with big lock */ | ||
173 | 164 | ||
174 | struct mutex lock; | 165 | struct mutex lock; |
175 | 166 | ||
@@ -181,7 +172,6 @@ struct lbs_private { | |||
181 | 172 | ||
182 | /** command-related variables */ | 173 | /** command-related variables */ |
183 | u16 seqnum; | 174 | u16 seqnum; |
184 | /* protected by big lock */ | ||
185 | 175 | ||
186 | struct cmd_ctrl_node *cmd_array; | 176 | struct cmd_ctrl_node *cmd_array; |
187 | /** Current command */ | 177 | /** Current command */ |
@@ -194,12 +184,17 @@ struct lbs_private { | |||
194 | struct list_head cmdpendingq; | 184 | struct list_head cmdpendingq; |
195 | 185 | ||
196 | wait_queue_head_t cmd_pending; | 186 | wait_queue_head_t cmd_pending; |
197 | /* command related variables protected by priv->driver_lock */ | ||
198 | 187 | ||
199 | /** Async and Sync Event variables */ | 188 | /* Command responses sent from the hardware to the driver */ |
200 | u32 intcounter; | 189 | u8 resp_idx; |
201 | u32 eventcause; | 190 | u8 resp_buf[2][LBS_UPLD_SIZE]; |
202 | u8 nodename[16]; /* nickname */ | 191 | u32 resp_len[2]; |
192 | |||
193 | /* Events sent from hardware to driver */ | ||
194 | struct kfifo *event_fifo; | ||
195 | |||
196 | /* nickname */ | ||
197 | u8 nodename[16]; | ||
203 | 198 | ||
204 | /** spin locks */ | 199 | /** spin locks */ |
205 | spinlock_t driver_lock; | 200 | spinlock_t driver_lock; |
@@ -209,8 +204,6 @@ struct lbs_private { | |||
209 | int nr_retries; | 204 | int nr_retries; |
210 | int cmd_timed_out; | 205 | int cmd_timed_out; |
211 | 206 | ||
212 | u8 hisregcpy; | ||
213 | |||
214 | /** current ssid/bssid related parameters*/ | 207 | /** current ssid/bssid related parameters*/ |
215 | struct current_bss_params curbssparams; | 208 | struct current_bss_params curbssparams; |
216 | 209 | ||