aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/decl.h
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-04-01 08:50:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 15:59:56 -0400
commit7919b89c8276d657976d4d4d6b7cb58ea1aa08c3 (patch)
tree31fc24e2f8b7d8eeee67347333e078591796d4b7 /drivers/net/wireless/libertas/decl.h
parent98dd6a575928ed9c42130d208e6bfb0f7a914d5a (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.h10
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
20void lbs_set_mac_control(struct lbs_private *priv); 20void lbs_set_mac_control(struct lbs_private *priv);
21 21
22void lbs_send_tx_feedback(struct lbs_private *priv); 22void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count);
23 23
24int lbs_free_cmd_buffer(struct lbs_private *priv); 24int 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
31int lbs_allocate_cmd_buffer(struct lbs_private *priv); 31int lbs_allocate_cmd_buffer(struct lbs_private *priv);
32int lbs_execute_next_command(struct lbs_private *priv); 32int lbs_execute_next_command(struct lbs_private *priv);
33int lbs_process_event(struct lbs_private *priv); 33int lbs_process_event(struct lbs_private *priv, u32 event);
34void lbs_interrupt(struct lbs_private *priv); 34void lbs_queue_event(struct lbs_private *priv, u32 event);
35void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx);
36
35int lbs_set_radio_control(struct lbs_private *priv); 37int lbs_set_radio_control(struct lbs_private *priv);
36u32 lbs_fw_index_to_data_rate(u8 index); 38u32 lbs_fw_index_to_data_rate(u8 index);
37u8 lbs_data_rate_to_fw_index(u32 rate); 39u8 lbs_data_rate_to_fw_index(u32 rate);
38 40
39/** The proc fs interface */ 41/** The proc fs interface */
40int lbs_process_rx_command(struct lbs_private *priv); 42int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len);
41void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, 43void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd,
42 int result); 44 int result);
43int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); 45int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);