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/decl.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/decl.h')
-rw-r--r-- | drivers/net/wireless/libertas/decl.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h index 4aea421f07ce..b652fa301e19 100644 --- a/drivers/net/wireless/libertas/decl.h +++ b/drivers/net/wireless/libertas/decl.h | |||
@@ -19,7 +19,7 @@ struct cmd_ds_command; | |||
19 | 19 | ||
20 | void lbs_set_mac_control(struct lbs_private *priv); | 20 | void lbs_set_mac_control(struct lbs_private *priv); |
21 | 21 | ||
22 | void lbs_send_tx_feedback(struct lbs_private *priv); | 22 | void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count); |
23 | 23 | ||
24 | int lbs_free_cmd_buffer(struct lbs_private *priv); | 24 | int lbs_free_cmd_buffer(struct lbs_private *priv); |
25 | 25 | ||
@@ -30,14 +30,16 @@ int lbs_prepare_and_send_command(struct lbs_private *priv, | |||
30 | 30 | ||
31 | int lbs_allocate_cmd_buffer(struct lbs_private *priv); | 31 | int lbs_allocate_cmd_buffer(struct lbs_private *priv); |
32 | int lbs_execute_next_command(struct lbs_private *priv); | 32 | int lbs_execute_next_command(struct lbs_private *priv); |
33 | int lbs_process_event(struct lbs_private *priv); | 33 | int lbs_process_event(struct lbs_private *priv, u32 event); |
34 | void lbs_interrupt(struct lbs_private *priv); | 34 | void lbs_queue_event(struct lbs_private *priv, u32 event); |
35 | void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx); | ||
36 | |||
35 | int lbs_set_radio_control(struct lbs_private *priv); | 37 | int lbs_set_radio_control(struct lbs_private *priv); |
36 | u32 lbs_fw_index_to_data_rate(u8 index); | 38 | u32 lbs_fw_index_to_data_rate(u8 index); |
37 | u8 lbs_data_rate_to_fw_index(u32 rate); | 39 | u8 lbs_data_rate_to_fw_index(u32 rate); |
38 | 40 | ||
39 | /** The proc fs interface */ | 41 | /** The proc fs interface */ |
40 | int lbs_process_rx_command(struct lbs_private *priv); | 42 | int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len); |
41 | void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, | 43 | void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, |
42 | int result); | 44 | int result); |
43 | int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); | 45 | int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); |