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/tx.c | |
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/tx.c')
-rw-r--r-- | drivers/net/wireless/libertas/tx.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index 77f1f9525b81..a4972fed2941 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c | |||
@@ -179,31 +179,17 @@ int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
179 | * | 179 | * |
180 | * @returns void | 180 | * @returns void |
181 | */ | 181 | */ |
182 | void lbs_send_tx_feedback(struct lbs_private *priv) | 182 | void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count) |
183 | { | 183 | { |
184 | struct tx_radiotap_hdr *radiotap_hdr; | 184 | struct tx_radiotap_hdr *radiotap_hdr; |
185 | u32 status = priv->eventcause; | ||
186 | int txfail; | ||
187 | int try_count; | ||
188 | 185 | ||
189 | if (!priv->monitormode || priv->currenttxskb == NULL) | 186 | if (!priv->monitormode || priv->currenttxskb == NULL) |
190 | return; | 187 | return; |
191 | 188 | ||
192 | radiotap_hdr = (struct tx_radiotap_hdr *)priv->currenttxskb->data; | 189 | radiotap_hdr = (struct tx_radiotap_hdr *)priv->currenttxskb->data; |
193 | 190 | ||
194 | txfail = (status >> 24); | 191 | radiotap_hdr->data_retries = try_count ? |
195 | 192 | (1 + priv->txretrycount - try_count) : 0; | |
196 | #if 0 | ||
197 | /* The version of roofnet that we've tested does not use this yet | ||
198 | * But it may be used in the future. | ||
199 | */ | ||
200 | if (txfail) | ||
201 | radiotap_hdr->flags &= IEEE80211_RADIOTAP_F_TX_FAIL; | ||
202 | #endif | ||
203 | try_count = (status >> 16) & 0xff; | ||
204 | radiotap_hdr->data_retries = (try_count) ? | ||
205 | (1 + priv->txretrycount - try_count) : 0; | ||
206 | |||
207 | 193 | ||
208 | priv->currenttxskb->protocol = eth_type_trans(priv->currenttxskb, | 194 | priv->currenttxskb->protocol = eth_type_trans(priv->currenttxskb, |
209 | priv->rtap_net_dev); | 195 | priv->rtap_net_dev); |