aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-24 14:13:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-27 15:24:21 -0400
commitc2acea8e9b86ba5a5469ff477445676a223af4e2 (patch)
tree3c4705b13dd5c85817a1132a17743757135b7047 /drivers/net/wireless/iwlwifi/iwl-scan.c
parentfbf3a2af3834e8e93e9c2876de62c5b49988e352 (diff)
iwlwifi: fix up command sending
The current command sending in iwlwifi is a bit of a mess: 1) there is a struct, iwl_cmd, that contains both driver and device data in a single packed structure -- this is very confusing 2) the on-stack data and the command metadata share a structure by embedding the latter in the former, which is also rather confusing because it leads to weird unions and similarly odd constructs 3) each txq always has enough space for 256 commands, even if only 32 end up being used This patch fixes these things: 1) rename iwl_cmd to iwl_device_cmd and keep track of command metadata and device command separately, in two arrays in each tx queue 2) remove the 'meta' member from iwl_host_cmd and only put in the required members 3) allocate the cmd/meta arrays separately instead of embedding them into the txq structure Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 00398d973a07..c4c916df4a43 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -115,7 +115,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
115 struct iwl_rx_packet *res; 115 struct iwl_rx_packet *res;
116 struct iwl_host_cmd cmd = { 116 struct iwl_host_cmd cmd = {
117 .id = REPLY_SCAN_ABORT_CMD, 117 .id = REPLY_SCAN_ABORT_CMD,
118 .meta.flags = CMD_WANT_SKB, 118 .flags = CMD_WANT_SKB,
119 }; 119 };
120 120
121 /* If there isn't a scan actively going on in the hardware 121 /* If there isn't a scan actively going on in the hardware
@@ -132,7 +132,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
132 return ret; 132 return ret;
133 } 133 }
134 134
135 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 135 res = (struct iwl_rx_packet *)cmd.reply_skb->data;
136 if (res->u.status != CAN_ABORT_STATUS) { 136 if (res->u.status != CAN_ABORT_STATUS) {
137 /* The scan abort will return 1 for success or 137 /* The scan abort will return 1 for success or
138 * 2 for "failure". A failure condition can be 138 * 2 for "failure". A failure condition can be
@@ -146,7 +146,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
146 } 146 }
147 147
148 priv->alloc_rxb_skb--; 148 priv->alloc_rxb_skb--;
149 dev_kfree_skb_any(cmd.meta.u.skb); 149 dev_kfree_skb_any(cmd.reply_skb);
150 150
151 return ret; 151 return ret;
152} 152}
@@ -567,7 +567,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
567 struct iwl_host_cmd cmd = { 567 struct iwl_host_cmd cmd = {
568 .id = REPLY_SCAN_CMD, 568 .id = REPLY_SCAN_CMD,
569 .len = sizeof(struct iwl_scan_cmd), 569 .len = sizeof(struct iwl_scan_cmd),
570 .meta.flags = CMD_SIZE_HUGE, 570 .flags = CMD_SIZE_HUGE,
571 }; 571 };
572 struct iwl_scan_cmd *scan; 572 struct iwl_scan_cmd *scan;
573 struct ieee80211_conf *conf = NULL; 573 struct ieee80211_conf *conf = NULL;