diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:55:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 19:32:19 -0400 |
commit | e00cf3b9eb7839b952e434a75bff6b99e47337ac (patch) | |
tree | ef583ab8ac09bf703026650d4bc7777e6a3864d3 /drivers/net/wireless/mwifiex | |
parent | 1a8218e96271790a07dd7065a2ef173e0f67e328 (diff) | |
parent | 3b8ab88acaceb505aa06ef3bbf3a73b92470ae78 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
net/mac80211/sta_info.h
Diffstat (limited to 'drivers/net/wireless/mwifiex')
22 files changed, 232 insertions, 492 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c index 1d294cfa6c9b..916183d39009 100644 --- a/drivers/net/wireless/mwifiex/11n.c +++ b/drivers/net/wireless/mwifiex/11n.c | |||
@@ -187,7 +187,7 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv, | |||
187 | */ | 187 | */ |
188 | int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf) | 188 | int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf) |
189 | { | 189 | { |
190 | struct mwifiex_ds_11n_tx_cfg *tx_cfg = NULL; | 190 | struct mwifiex_ds_11n_tx_cfg *tx_cfg; |
191 | struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg; | 191 | struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg; |
192 | 192 | ||
193 | if (data_buf) { | 193 | if (data_buf) { |
@@ -274,7 +274,7 @@ int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd, | |||
274 | int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp, | 274 | int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp, |
275 | void *data_buf) | 275 | void *data_buf) |
276 | { | 276 | { |
277 | struct mwifiex_ds_11n_amsdu_aggr_ctrl *amsdu_aggr_ctrl = NULL; | 277 | struct mwifiex_ds_11n_amsdu_aggr_ctrl *amsdu_aggr_ctrl; |
278 | struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl = | 278 | struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl = |
279 | &resp->params.amsdu_aggr_ctrl; | 279 | &resp->params.amsdu_aggr_ctrl; |
280 | 280 | ||
@@ -461,8 +461,7 @@ mwifiex_cfg_tx_buf(struct mwifiex_private *priv, | |||
461 | struct mwifiex_bssdescriptor *bss_desc) | 461 | struct mwifiex_bssdescriptor *bss_desc) |
462 | { | 462 | { |
463 | u16 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_2K; | 463 | u16 max_amsdu = MWIFIEX_TX_DATA_BUF_SIZE_2K; |
464 | u16 tx_buf = 0; | 464 | u16 tx_buf, curr_tx_buf_size = 0; |
465 | u16 curr_tx_buf_size = 0; | ||
466 | 465 | ||
467 | if (bss_desc->bcn_ht_cap) { | 466 | if (bss_desc->bcn_ht_cap) { |
468 | if (le16_to_cpu(bss_desc->bcn_ht_cap->cap_info) & | 467 | if (le16_to_cpu(bss_desc->bcn_ht_cap->cap_info) & |
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c index c9fb0627de43..d3d5e0853c45 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.c +++ b/drivers/net/wireless/mwifiex/11n_aggr.c | |||
@@ -60,7 +60,7 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr, | |||
60 | * later with ethertype | 60 | * later with ethertype |
61 | */ | 61 | */ |
62 | }; | 62 | }; |
63 | struct tx_packet_hdr *tx_header = NULL; | 63 | struct tx_packet_hdr *tx_header; |
64 | 64 | ||
65 | skb_put(skb_aggr, sizeof(*tx_header)); | 65 | skb_put(skb_aggr, sizeof(*tx_header)); |
66 | 66 | ||
@@ -136,131 +136,6 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv, | |||
136 | } | 136 | } |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * Counts the number of subframes in an aggregate packet. | ||
140 | * | ||
141 | * This function parses an aggregate packet buffer, looking for | ||
142 | * subframes and counting the number of such subframe found. The | ||
143 | * function automatically skips the DA/SA fields at the beginning | ||
144 | * of each subframe and padding at the end. | ||
145 | */ | ||
146 | static int | ||
147 | mwifiex_11n_get_num_aggr_pkts(u8 *data, int total_pkt_len) | ||
148 | { | ||
149 | int pkt_count = 0, pkt_len, pad; | ||
150 | |||
151 | while (total_pkt_len > 0) { | ||
152 | /* Length will be in network format, change it to host */ | ||
153 | pkt_len = ntohs((*(__be16 *)(data + 2 * ETH_ALEN))); | ||
154 | pad = (((pkt_len + sizeof(struct ethhdr)) & 3)) ? | ||
155 | (4 - ((pkt_len + sizeof(struct ethhdr)) & 3)) : 0; | ||
156 | data += pkt_len + pad + sizeof(struct ethhdr); | ||
157 | total_pkt_len -= pkt_len + pad + sizeof(struct ethhdr); | ||
158 | ++pkt_count; | ||
159 | } | ||
160 | |||
161 | return pkt_count; | ||
162 | } | ||
163 | |||
164 | /* | ||
165 | * De-aggregate received packets. | ||
166 | * | ||
167 | * This function parses the received aggregate buffer, extracts each subframe, | ||
168 | * strips off the SNAP header from them and sends the data portion for further | ||
169 | * processing. | ||
170 | * | ||
171 | * Each subframe body is copied onto a separate buffer, which are freed by | ||
172 | * upper layer after processing. The function also performs sanity tests on | ||
173 | * the received buffer. | ||
174 | */ | ||
175 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, | ||
176 | struct sk_buff *skb) | ||
177 | { | ||
178 | u16 pkt_len; | ||
179 | int total_pkt_len; | ||
180 | u8 *data; | ||
181 | int pad; | ||
182 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); | ||
183 | struct rxpd *local_rx_pd = (struct rxpd *) skb->data; | ||
184 | struct sk_buff *skb_daggr; | ||
185 | struct mwifiex_rxinfo *rx_info_daggr = NULL; | ||
186 | int ret = -1; | ||
187 | struct rx_packet_hdr *rx_pkt_hdr; | ||
188 | struct mwifiex_adapter *adapter = priv->adapter; | ||
189 | u8 rfc1042_eth_hdr[ETH_ALEN] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; | ||
190 | |||
191 | data = (u8 *) (local_rx_pd + local_rx_pd->rx_pkt_offset); | ||
192 | total_pkt_len = local_rx_pd->rx_pkt_length; | ||
193 | |||
194 | /* Sanity test */ | ||
195 | if (total_pkt_len > MWIFIEX_RX_DATA_BUF_SIZE) { | ||
196 | dev_err(adapter->dev, "total pkt len greater than buffer" | ||
197 | " size %d\n", total_pkt_len); | ||
198 | return -1; | ||
199 | } | ||
200 | |||
201 | rx_info->use_count = mwifiex_11n_get_num_aggr_pkts(data, total_pkt_len); | ||
202 | |||
203 | while (total_pkt_len > 0) { | ||
204 | rx_pkt_hdr = (struct rx_packet_hdr *) data; | ||
205 | /* Length will be in network format, change it to host */ | ||
206 | pkt_len = ntohs((*(__be16 *) (data + 2 * ETH_ALEN))); | ||
207 | if (pkt_len > total_pkt_len) { | ||
208 | dev_err(adapter->dev, "pkt_len %d > total_pkt_len %d\n", | ||
209 | total_pkt_len, pkt_len); | ||
210 | break; | ||
211 | } | ||
212 | |||
213 | pad = (((pkt_len + sizeof(struct ethhdr)) & 3)) ? | ||
214 | (4 - ((pkt_len + sizeof(struct ethhdr)) & 3)) : 0; | ||
215 | |||
216 | total_pkt_len -= pkt_len + pad + sizeof(struct ethhdr); | ||
217 | |||
218 | if (memcmp(&rx_pkt_hdr->rfc1042_hdr, | ||
219 | rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr)) == 0) { | ||
220 | memmove(data + LLC_SNAP_LEN, data, 2 * ETH_ALEN); | ||
221 | data += LLC_SNAP_LEN; | ||
222 | pkt_len += sizeof(struct ethhdr) - LLC_SNAP_LEN; | ||
223 | } else { | ||
224 | *(u16 *) (data + 2 * ETH_ALEN) = (u16) 0; | ||
225 | pkt_len += sizeof(struct ethhdr); | ||
226 | } | ||
227 | |||
228 | skb_daggr = dev_alloc_skb(pkt_len); | ||
229 | if (!skb_daggr) { | ||
230 | dev_err(adapter->dev, "%s: failed to alloc skb_daggr\n", | ||
231 | __func__); | ||
232 | return -1; | ||
233 | } | ||
234 | rx_info_daggr = MWIFIEX_SKB_RXCB(skb_daggr); | ||
235 | |||
236 | rx_info_daggr->bss_index = rx_info->bss_index; | ||
237 | skb_daggr->tstamp = skb->tstamp; | ||
238 | rx_info_daggr->parent = skb; | ||
239 | skb_daggr->priority = skb->priority; | ||
240 | skb_put(skb_daggr, pkt_len); | ||
241 | memcpy(skb_daggr->data, data, pkt_len); | ||
242 | |||
243 | ret = mwifiex_recv_packet(adapter, skb_daggr); | ||
244 | |||
245 | switch (ret) { | ||
246 | case -EINPROGRESS: | ||
247 | break; | ||
248 | case -1: | ||
249 | dev_err(adapter->dev, "deaggr: host_to_card failed\n"); | ||
250 | case 0: | ||
251 | mwifiex_recv_packet_complete(adapter, skb_daggr, ret); | ||
252 | break; | ||
253 | default: | ||
254 | break; | ||
255 | } | ||
256 | |||
257 | data += pkt_len + pad; | ||
258 | } | ||
259 | |||
260 | return ret; | ||
261 | } | ||
262 | |||
263 | /* | ||
264 | * Create aggregated packet. | 139 | * Create aggregated packet. |
265 | * | 140 | * |
266 | * This function creates an aggregated MSDU packet, by combining buffers | 141 | * This function creates an aggregated MSDU packet, by combining buffers |
@@ -285,8 +160,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
285 | struct mwifiex_adapter *adapter = priv->adapter; | 160 | struct mwifiex_adapter *adapter = priv->adapter; |
286 | struct sk_buff *skb_aggr, *skb_src; | 161 | struct sk_buff *skb_aggr, *skb_src; |
287 | struct mwifiex_txinfo *tx_info_aggr, *tx_info_src; | 162 | struct mwifiex_txinfo *tx_info_aggr, *tx_info_src; |
288 | int pad = 0; | 163 | int pad = 0, ret; |
289 | int ret = 0; | ||
290 | struct mwifiex_tx_param tx_param; | 164 | struct mwifiex_tx_param tx_param; |
291 | struct txpd *ptx_pd = NULL; | 165 | struct txpd *ptx_pd = NULL; |
292 | 166 | ||
@@ -319,7 +193,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
319 | else | 193 | else |
320 | skb_src = NULL; | 194 | skb_src = NULL; |
321 | 195 | ||
322 | pra_list->total_pkts_size -= skb_src->len; | 196 | if (skb_src) |
197 | pra_list->total_pkts_size -= skb_src->len; | ||
323 | 198 | ||
324 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, | 199 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, |
325 | ra_list_flags); | 200 | ra_list_flags); |
@@ -374,7 +249,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
374 | (adapter->pps_uapsd_mode) && | 249 | (adapter->pps_uapsd_mode) && |
375 | (adapter->tx_lock_flag)) { | 250 | (adapter->tx_lock_flag)) { |
376 | priv->adapter->tx_lock_flag = false; | 251 | priv->adapter->tx_lock_flag = false; |
377 | ptx_pd->flags = 0; | 252 | if (ptx_pd) |
253 | ptx_pd->flags = 0; | ||
378 | } | 254 | } |
379 | 255 | ||
380 | skb_queue_tail(&pra_list->skb_head, skb_aggr); | 256 | skb_queue_tail(&pra_list->skb_head, skb_aggr); |
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c index a93c03fdea82..e5dfdc39a921 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c | |||
@@ -39,7 +39,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv, | |||
39 | *rx_reor_tbl_ptr, int start_win) | 39 | *rx_reor_tbl_ptr, int start_win) |
40 | { | 40 | { |
41 | int no_pkt_to_send, i; | 41 | int no_pkt_to_send, i; |
42 | void *rx_tmp_ptr = NULL; | 42 | void *rx_tmp_ptr; |
43 | unsigned long flags; | 43 | unsigned long flags; |
44 | 44 | ||
45 | no_pkt_to_send = (start_win > rx_reor_tbl_ptr->start_win) ? | 45 | no_pkt_to_send = (start_win > rx_reor_tbl_ptr->start_win) ? |
@@ -88,7 +88,7 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv, | |||
88 | struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr) | 88 | struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr) |
89 | { | 89 | { |
90 | int i, j, xchg; | 90 | int i, j, xchg; |
91 | void *rx_tmp_ptr = NULL; | 91 | void *rx_tmp_ptr; |
92 | unsigned long flags; | 92 | unsigned long flags; |
93 | 93 | ||
94 | for (i = 0; i < rx_reor_tbl_ptr->win_size; ++i) { | 94 | for (i = 0; i < rx_reor_tbl_ptr->win_size; ++i) { |
@@ -335,8 +335,8 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv, | |||
335 | &cmd->params.add_ba_rsp; | 335 | &cmd->params.add_ba_rsp; |
336 | struct host_cmd_ds_11n_addba_req *cmd_addba_req = | 336 | struct host_cmd_ds_11n_addba_req *cmd_addba_req = |
337 | (struct host_cmd_ds_11n_addba_req *) data_buf; | 337 | (struct host_cmd_ds_11n_addba_req *) data_buf; |
338 | u8 tid = 0; | 338 | u8 tid; |
339 | int win_size = 0; | 339 | int win_size; |
340 | uint16_t block_ack_param_set; | 340 | uint16_t block_ack_param_set; |
341 | 341 | ||
342 | cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_RSP); | 342 | cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_RSP); |
@@ -406,9 +406,8 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, | |||
406 | u8 *ta, u8 pkt_type, void *payload) | 406 | u8 *ta, u8 pkt_type, void *payload) |
407 | { | 407 | { |
408 | struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr; | 408 | struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr; |
409 | int start_win, end_win, win_size; | 409 | int start_win, end_win, win_size, ret; |
410 | int ret = 0; | 410 | u16 pkt_index; |
411 | u16 pkt_index = 0; | ||
412 | 411 | ||
413 | rx_reor_tbl_ptr = | 412 | rx_reor_tbl_ptr = |
414 | mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv, | 413 | mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv, |
@@ -540,7 +539,7 @@ int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv, | |||
540 | (struct host_cmd_ds_11n_addba_rsp *) | 539 | (struct host_cmd_ds_11n_addba_rsp *) |
541 | &resp->params.add_ba_rsp; | 540 | &resp->params.add_ba_rsp; |
542 | int tid, win_size; | 541 | int tid, win_size; |
543 | struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr = NULL; | 542 | struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr; |
544 | uint16_t block_ack_param_set; | 543 | uint16_t block_ack_param_set; |
545 | 544 | ||
546 | block_ack_param_set = le16_to_cpu(add_ba_rsp->block_ack_param_set); | 545 | block_ack_param_set = le16_to_cpu(add_ba_rsp->block_ack_param_set); |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 98009e2194c5..660831ce293c 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -77,18 +77,15 @@ mwifiex_channels_to_cfg80211_channel_type(int channel_type) | |||
77 | static int | 77 | static int |
78 | mwifiex_is_alg_wep(u32 cipher) | 78 | mwifiex_is_alg_wep(u32 cipher) |
79 | { | 79 | { |
80 | int alg = 0; | ||
81 | |||
82 | switch (cipher) { | 80 | switch (cipher) { |
83 | case WLAN_CIPHER_SUITE_WEP40: | 81 | case WLAN_CIPHER_SUITE_WEP40: |
84 | case WLAN_CIPHER_SUITE_WEP104: | 82 | case WLAN_CIPHER_SUITE_WEP104: |
85 | alg = 1; | 83 | return 1; |
86 | break; | ||
87 | default: | 84 | default: |
88 | alg = 0; | ||
89 | break; | 85 | break; |
90 | } | 86 | } |
91 | return alg; | 87 | |
88 | return 0; | ||
92 | } | 89 | } |
93 | 90 | ||
94 | /* | 91 | /* |
@@ -408,7 +405,7 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, | |||
408 | static int | 405 | static int |
409 | mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr) | 406 | mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr) |
410 | { | 407 | { |
411 | int ret = 0; | 408 | int ret; |
412 | 409 | ||
413 | if (frag_thr < MWIFIEX_FRAG_MIN_VALUE | 410 | if (frag_thr < MWIFIEX_FRAG_MIN_VALUE |
414 | || frag_thr > MWIFIEX_FRAG_MAX_VALUE) | 411 | || frag_thr > MWIFIEX_FRAG_MAX_VALUE) |
@@ -449,7 +446,6 @@ static int | |||
449 | mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) | 446 | mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) |
450 | { | 447 | { |
451 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 448 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); |
452 | |||
453 | int ret = 0; | 449 | int ret = 0; |
454 | 450 | ||
455 | if (changed & WIPHY_PARAM_RTS_THRESHOLD) { | 451 | if (changed & WIPHY_PARAM_RTS_THRESHOLD) { |
@@ -473,7 +469,7 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy, | |||
473 | enum nl80211_iftype type, u32 *flags, | 469 | enum nl80211_iftype type, u32 *flags, |
474 | struct vif_params *params) | 470 | struct vif_params *params) |
475 | { | 471 | { |
476 | int ret = 0; | 472 | int ret; |
477 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); | 473 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
478 | 474 | ||
479 | if (priv->bss_mode == type) { | 475 | if (priv->bss_mode == type) { |
@@ -717,7 +713,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv) | |||
717 | { | 713 | { |
718 | struct ieee80211_channel *chan; | 714 | struct ieee80211_channel *chan; |
719 | struct mwifiex_bss_info bss_info; | 715 | struct mwifiex_bss_info bss_info; |
720 | int ie_len = 0; | 716 | int ie_len; |
721 | u8 ie_buf[IEEE80211_MAX_SSID_LEN + sizeof(struct ieee_types_header)]; | 717 | u8 ie_buf[IEEE80211_MAX_SSID_LEN + sizeof(struct ieee_types_header)]; |
722 | 718 | ||
723 | if (mwifiex_get_bss_info(priv, &bss_info)) | 719 | if (mwifiex_get_bss_info(priv, &bss_info)) |
@@ -765,7 +761,6 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv) | |||
765 | static int mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv, | 761 | static int mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv, |
766 | struct mwifiex_802_11_ssid *ssid) | 762 | struct mwifiex_802_11_ssid *ssid) |
767 | { | 763 | { |
768 | struct mwifiex_scan_resp scan_resp; | ||
769 | struct mwifiex_bssdescriptor *scan_table; | 764 | struct mwifiex_bssdescriptor *scan_table; |
770 | int i, j; | 765 | int i, j; |
771 | struct ieee80211_channel *chan; | 766 | struct ieee80211_channel *chan; |
@@ -775,10 +770,6 @@ static int mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv, | |||
775 | int beacon_size; | 770 | int beacon_size; |
776 | u8 element_id, element_len; | 771 | u8 element_id, element_len; |
777 | 772 | ||
778 | memset(&scan_resp, 0, sizeof(scan_resp)); | ||
779 | scan_resp.scan_table = (u8 *) priv->adapter->scan_table; | ||
780 | scan_resp.num_in_scan_table = priv->adapter->num_in_scan_table; | ||
781 | |||
782 | #define MAX_IE_BUF 2048 | 773 | #define MAX_IE_BUF 2048 |
783 | ie_buf = kzalloc(MAX_IE_BUF, GFP_KERNEL); | 774 | ie_buf = kzalloc(MAX_IE_BUF, GFP_KERNEL); |
784 | if (!ie_buf) { | 775 | if (!ie_buf) { |
@@ -787,8 +778,8 @@ static int mwifiex_inform_bss_from_scan_result(struct mwifiex_private *priv, | |||
787 | return -ENOMEM; | 778 | return -ENOMEM; |
788 | } | 779 | } |
789 | 780 | ||
790 | scan_table = (struct mwifiex_bssdescriptor *) scan_resp.scan_table; | 781 | scan_table = priv->adapter->scan_table; |
791 | for (i = 0; i < scan_resp.num_in_scan_table; i++) { | 782 | for (i = 0; i < priv->adapter->num_in_scan_table; i++) { |
792 | if (ssid) { | 783 | if (ssid) { |
793 | /* Inform specific BSS only */ | 784 | /* Inform specific BSS only */ |
794 | if (memcmp(ssid->ssid, scan_table[i].ssid.ssid, | 785 | if (memcmp(ssid->ssid, scan_table[i].ssid.ssid, |
@@ -903,8 +894,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
903 | { | 894 | { |
904 | struct mwifiex_802_11_ssid req_ssid; | 895 | struct mwifiex_802_11_ssid req_ssid; |
905 | struct mwifiex_ssid_bssid ssid_bssid; | 896 | struct mwifiex_ssid_bssid ssid_bssid; |
906 | int ret = 0; | 897 | int ret, auth_type = 0; |
907 | int auth_type = 0; | ||
908 | 898 | ||
909 | memset(&req_ssid, 0, sizeof(struct mwifiex_802_11_ssid)); | 899 | memset(&req_ssid, 0, sizeof(struct mwifiex_802_11_ssid)); |
910 | memset(&ssid_bssid, 0, sizeof(struct mwifiex_ssid_bssid)); | 900 | memset(&ssid_bssid, 0, sizeof(struct mwifiex_ssid_bssid)); |
@@ -1044,7 +1034,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1044 | goto done; | 1034 | goto done; |
1045 | } | 1035 | } |
1046 | 1036 | ||
1047 | priv->assoc_request = 1; | 1037 | priv->assoc_request = -EINPROGRESS; |
1048 | 1038 | ||
1049 | wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n", | 1039 | wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n", |
1050 | (char *) sme->ssid, sme->bssid); | 1040 | (char *) sme->ssid, sme->bssid); |
@@ -1052,6 +1042,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1052 | ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, | 1042 | ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, |
1053 | priv->bss_mode, sme->channel, sme, 0); | 1043 | priv->bss_mode, sme->channel, sme, 0); |
1054 | 1044 | ||
1045 | priv->assoc_request = 1; | ||
1055 | done: | 1046 | done: |
1056 | priv->assoc_result = ret; | 1047 | priv->assoc_result = ret; |
1057 | queue_work(priv->workqueue, &priv->cfg_workqueue); | 1048 | queue_work(priv->workqueue, &priv->cfg_workqueue); |
@@ -1080,7 +1071,7 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1080 | goto done; | 1071 | goto done; |
1081 | } | 1072 | } |
1082 | 1073 | ||
1083 | priv->ibss_join_request = 1; | 1074 | priv->ibss_join_request = -EINPROGRESS; |
1084 | 1075 | ||
1085 | wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n", | 1076 | wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n", |
1086 | (char *) params->ssid, params->bssid); | 1077 | (char *) params->ssid, params->bssid); |
@@ -1088,6 +1079,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1088 | ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid, | 1079 | ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid, |
1089 | params->bssid, priv->bss_mode, | 1080 | params->bssid, priv->bss_mode, |
1090 | params->channel, NULL, params->privacy); | 1081 | params->channel, NULL, params->privacy); |
1082 | |||
1083 | priv->ibss_join_request = 1; | ||
1091 | done: | 1084 | done: |
1092 | priv->ibss_join_result = ret; | 1085 | priv->ibss_join_result = ret; |
1093 | queue_work(priv->workqueue, &priv->cfg_workqueue); | 1086 | queue_work(priv->workqueue, &priv->cfg_workqueue); |
@@ -1244,8 +1237,8 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = { | |||
1244 | int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, | 1237 | int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, |
1245 | struct mwifiex_private *priv) | 1238 | struct mwifiex_private *priv) |
1246 | { | 1239 | { |
1247 | int ret = 0; | 1240 | int ret; |
1248 | void *wdev_priv = NULL; | 1241 | void *wdev_priv; |
1249 | struct wireless_dev *wdev; | 1242 | struct wireless_dev *wdev; |
1250 | 1243 | ||
1251 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1244 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
@@ -1257,8 +1250,10 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, | |||
1257 | wdev->wiphy = | 1250 | wdev->wiphy = |
1258 | wiphy_new(&mwifiex_cfg80211_ops, | 1251 | wiphy_new(&mwifiex_cfg80211_ops, |
1259 | sizeof(struct mwifiex_private *)); | 1252 | sizeof(struct mwifiex_private *)); |
1260 | if (!wdev->wiphy) | 1253 | if (!wdev->wiphy) { |
1254 | kfree(wdev); | ||
1261 | return -ENOMEM; | 1255 | return -ENOMEM; |
1256 | } | ||
1262 | wdev->iftype = NL80211_IFTYPE_STATION; | 1257 | wdev->iftype = NL80211_IFTYPE_STATION; |
1263 | wdev->wiphy->max_scan_ssids = 10; | 1258 | wdev->wiphy->max_scan_ssids = 10; |
1264 | wdev->wiphy->interface_modes = | 1259 | wdev->wiphy->interface_modes = |
@@ -1298,6 +1293,7 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, | |||
1298 | dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n", | 1293 | dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n", |
1299 | __func__); | 1294 | __func__); |
1300 | wiphy_free(wdev->wiphy); | 1295 | wiphy_free(wdev->wiphy); |
1296 | kfree(wdev); | ||
1301 | return ret; | 1297 | return ret; |
1302 | } else { | 1298 | } else { |
1303 | dev_dbg(priv->adapter->dev, | 1299 | dev_dbg(priv->adapter->dev, |
@@ -1380,7 +1376,7 @@ done: | |||
1380 | kfree(scan_req); | 1376 | kfree(scan_req); |
1381 | } | 1377 | } |
1382 | 1378 | ||
1383 | if (priv->assoc_request) { | 1379 | if (priv->assoc_request == 1) { |
1384 | if (!priv->assoc_result) { | 1380 | if (!priv->assoc_result) { |
1385 | cfg80211_connect_result(priv->netdev, priv->cfg_bssid, | 1381 | cfg80211_connect_result(priv->netdev, priv->cfg_bssid, |
1386 | NULL, 0, NULL, 0, | 1382 | NULL, 0, NULL, 0, |
@@ -1399,7 +1395,7 @@ done: | |||
1399 | priv->assoc_result = 0; | 1395 | priv->assoc_result = 0; |
1400 | } | 1396 | } |
1401 | 1397 | ||
1402 | if (priv->ibss_join_request) { | 1398 | if (priv->ibss_join_request == 1) { |
1403 | if (!priv->ibss_join_result) { | 1399 | if (!priv->ibss_join_result) { |
1404 | cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, | 1400 | cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, |
1405 | GFP_KERNEL); | 1401 | GFP_KERNEL); |
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 776146a104ec..cd89fed206ae 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -91,7 +91,7 @@ mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter, | |||
91 | cmd_node->wait_q_enabled = false; | 91 | cmd_node->wait_q_enabled = false; |
92 | 92 | ||
93 | if (cmd_node->resp_skb) { | 93 | if (cmd_node->resp_skb) { |
94 | mwifiex_recv_complete(adapter, cmd_node->resp_skb, 0); | 94 | dev_kfree_skb_any(cmd_node->resp_skb); |
95 | cmd_node->resp_skb = NULL; | 95 | cmd_node->resp_skb = NULL; |
96 | } | 96 | } |
97 | } | 97 | } |
@@ -128,7 +128,7 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, | |||
128 | { | 128 | { |
129 | 129 | ||
130 | struct mwifiex_adapter *adapter = priv->adapter; | 130 | struct mwifiex_adapter *adapter = priv->adapter; |
131 | int ret = 0; | 131 | int ret; |
132 | struct host_cmd_ds_command *host_cmd; | 132 | struct host_cmd_ds_command *host_cmd; |
133 | uint16_t cmd_code; | 133 | uint16_t cmd_code; |
134 | uint16_t cmd_size; | 134 | uint16_t cmd_size; |
@@ -222,25 +222,24 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, | |||
222 | */ | 222 | */ |
223 | static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) | 223 | static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) |
224 | { | 224 | { |
225 | int ret = 0; | 225 | int ret; |
226 | u16 cmd_len = 0; | ||
227 | struct mwifiex_private *priv; | 226 | struct mwifiex_private *priv; |
228 | struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = | 227 | struct mwifiex_opt_sleep_confirm *sleep_cfm_buf = |
229 | (struct mwifiex_opt_sleep_confirm_buffer *) | 228 | (struct mwifiex_opt_sleep_confirm *) |
230 | adapter->sleep_cfm->data; | 229 | adapter->sleep_cfm->data; |
231 | cmd_len = sizeof(struct mwifiex_opt_sleep_confirm); | ||
232 | priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); | 230 | priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); |
233 | 231 | ||
234 | sleep_cfm_buf->ps_cfm_sleep.seq_num = | 232 | sleep_cfm_buf->seq_num = |
235 | cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO | 233 | cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO |
236 | (adapter->seq_num, priv->bss_num, | 234 | (adapter->seq_num, priv->bss_num, |
237 | priv->bss_type))); | 235 | priv->bss_type))); |
238 | adapter->seq_num++; | 236 | adapter->seq_num++; |
239 | 237 | ||
238 | skb_push(adapter->sleep_cfm, INTF_HEADER_LEN); | ||
240 | ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, | 239 | ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, |
241 | adapter->sleep_cfm->data, | 240 | adapter->sleep_cfm->data, |
242 | adapter->sleep_cfm->len + | 241 | adapter->sleep_cfm->len, NULL); |
243 | INTF_HEADER_LEN, NULL); | 242 | skb_pull(adapter->sleep_cfm, INTF_HEADER_LEN); |
244 | 243 | ||
245 | if (ret == -1) { | 244 | if (ret == -1) { |
246 | dev_err(adapter->dev, "SLEEP_CFM: failed\n"); | 245 | dev_err(adapter->dev, "SLEEP_CFM: failed\n"); |
@@ -249,14 +248,14 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) | |||
249 | } | 248 | } |
250 | if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY)) | 249 | if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY)) |
251 | == MWIFIEX_BSS_ROLE_STA) { | 250 | == MWIFIEX_BSS_ROLE_STA) { |
252 | if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl) | 251 | if (!sleep_cfm_buf->resp_ctrl) |
253 | /* Response is not needed for sleep | 252 | /* Response is not needed for sleep |
254 | confirm command */ | 253 | confirm command */ |
255 | adapter->ps_state = PS_STATE_SLEEP; | 254 | adapter->ps_state = PS_STATE_SLEEP; |
256 | else | 255 | else |
257 | adapter->ps_state = PS_STATE_SLEEP_CFM; | 256 | adapter->ps_state = PS_STATE_SLEEP_CFM; |
258 | 257 | ||
259 | if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl | 258 | if (!sleep_cfm_buf->resp_ctrl |
260 | && (adapter->is_hs_configured | 259 | && (adapter->is_hs_configured |
261 | && !adapter->sleep_period.period)) { | 260 | && !adapter->sleep_period.period)) { |
262 | adapter->pm_wakeup_card_req = true; | 261 | adapter->pm_wakeup_card_req = true; |
@@ -292,7 +291,7 @@ int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter) | |||
292 | if (!cmd_array) { | 291 | if (!cmd_array) { |
293 | dev_err(adapter->dev, "%s: failed to alloc cmd_array\n", | 292 | dev_err(adapter->dev, "%s: failed to alloc cmd_array\n", |
294 | __func__); | 293 | __func__); |
295 | return -1; | 294 | return -ENOMEM; |
296 | } | 295 | } |
297 | 296 | ||
298 | adapter->cmd_pool = cmd_array; | 297 | adapter->cmd_pool = cmd_array; |
@@ -340,7 +339,7 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter) | |||
340 | } | 339 | } |
341 | if (!cmd_array[i].resp_skb) | 340 | if (!cmd_array[i].resp_skb) |
342 | continue; | 341 | continue; |
343 | mwifiex_recv_complete(adapter, cmd_array[i].resp_skb, 0); | 342 | dev_kfree_skb_any(cmd_array[i].resp_skb); |
344 | } | 343 | } |
345 | /* Release struct cmd_ctrl_node */ | 344 | /* Release struct cmd_ctrl_node */ |
346 | if (adapter->cmd_pool) { | 345 | if (adapter->cmd_pool) { |
@@ -364,13 +363,13 @@ int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter) | |||
364 | */ | 363 | */ |
365 | int mwifiex_process_event(struct mwifiex_adapter *adapter) | 364 | int mwifiex_process_event(struct mwifiex_adapter *adapter) |
366 | { | 365 | { |
367 | int ret = 0; | 366 | int ret; |
368 | struct mwifiex_private *priv = | 367 | struct mwifiex_private *priv = |
369 | mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); | 368 | mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); |
370 | struct sk_buff *skb = adapter->event_skb; | 369 | struct sk_buff *skb = adapter->event_skb; |
371 | u32 eventcause = adapter->event_cause; | 370 | u32 eventcause = adapter->event_cause; |
372 | struct timeval tstamp; | 371 | struct timeval tstamp; |
373 | struct mwifiex_rxinfo *rx_info = NULL; | 372 | struct mwifiex_rxinfo *rx_info; |
374 | 373 | ||
375 | /* Save the last event to debug log */ | 374 | /* Save the last event to debug log */ |
376 | adapter->dbg.last_event_index = | 375 | adapter->dbg.last_event_index = |
@@ -403,7 +402,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter) | |||
403 | adapter->event_cause = 0; | 402 | adapter->event_cause = 0; |
404 | adapter->event_skb = NULL; | 403 | adapter->event_skb = NULL; |
405 | 404 | ||
406 | mwifiex_recv_complete(adapter, skb, 0); | 405 | dev_kfree_skb_any(skb); |
407 | 406 | ||
408 | return ret; | 407 | return ret; |
409 | } | 408 | } |
@@ -446,10 +445,10 @@ int mwifiex_send_cmd_sync(struct mwifiex_private *priv, uint16_t cmd_no, | |||
446 | int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no, | 445 | int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no, |
447 | u16 cmd_action, u32 cmd_oid, void *data_buf) | 446 | u16 cmd_action, u32 cmd_oid, void *data_buf) |
448 | { | 447 | { |
449 | int ret = 0; | 448 | int ret; |
450 | struct mwifiex_adapter *adapter = priv->adapter; | 449 | struct mwifiex_adapter *adapter = priv->adapter; |
451 | struct cmd_ctrl_node *cmd_node = NULL; | 450 | struct cmd_ctrl_node *cmd_node; |
452 | struct host_cmd_ds_command *cmd_ptr = NULL; | 451 | struct host_cmd_ds_command *cmd_ptr; |
453 | 452 | ||
454 | if (!adapter) { | 453 | if (!adapter) { |
455 | pr_err("PREP_CMD: adapter is NULL\n"); | 454 | pr_err("PREP_CMD: adapter is NULL\n"); |
@@ -605,8 +604,8 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, | |||
605 | */ | 604 | */ |
606 | int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter) | 605 | int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter) |
607 | { | 606 | { |
608 | struct mwifiex_private *priv = NULL; | 607 | struct mwifiex_private *priv; |
609 | struct cmd_ctrl_node *cmd_node = NULL; | 608 | struct cmd_ctrl_node *cmd_node; |
610 | int ret = 0; | 609 | int ret = 0; |
611 | struct host_cmd_ds_command *host_cmd; | 610 | struct host_cmd_ds_command *host_cmd; |
612 | unsigned long cmd_flags; | 611 | unsigned long cmd_flags; |
@@ -673,7 +672,7 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter) | |||
673 | */ | 672 | */ |
674 | int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) | 673 | int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) |
675 | { | 674 | { |
676 | struct host_cmd_ds_command *resp = NULL; | 675 | struct host_cmd_ds_command *resp; |
677 | struct mwifiex_private *priv = | 676 | struct mwifiex_private *priv = |
678 | mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); | 677 | mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); |
679 | int ret = 0; | 678 | int ret = 0; |
@@ -805,7 +804,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context) | |||
805 | { | 804 | { |
806 | struct mwifiex_adapter *adapter = | 805 | struct mwifiex_adapter *adapter = |
807 | (struct mwifiex_adapter *) function_context; | 806 | (struct mwifiex_adapter *) function_context; |
808 | struct cmd_ctrl_node *cmd_node = NULL; | 807 | struct cmd_ctrl_node *cmd_node; |
809 | struct timeval tstamp; | 808 | struct timeval tstamp; |
810 | 809 | ||
811 | adapter->num_cmd_timeout++; | 810 | adapter->num_cmd_timeout++; |
@@ -877,7 +876,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context) | |||
877 | void | 876 | void |
878 | mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter) | 877 | mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter) |
879 | { | 878 | { |
880 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL; | 879 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; |
881 | unsigned long flags; | 880 | unsigned long flags; |
882 | 881 | ||
883 | /* Cancel current cmd */ | 882 | /* Cancel current cmd */ |
@@ -1160,7 +1159,7 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv, | |||
1160 | { | 1159 | { |
1161 | struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh = | 1160 | struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh = |
1162 | &cmd->params.psmode_enh; | 1161 | &cmd->params.psmode_enh; |
1163 | u8 *tlv = NULL; | 1162 | u8 *tlv; |
1164 | u16 cmd_size = 0; | 1163 | u16 cmd_size = 0; |
1165 | 1164 | ||
1166 | cmd->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); | 1165 | cmd->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); |
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c index 7ddcb062f103..46d65e02c7ba 100644 --- a/drivers/net/wireless/mwifiex/debugfs.c +++ b/drivers/net/wireless/mwifiex/debugfs.c | |||
@@ -193,7 +193,7 @@ mwifiex_info_read(struct file *file, char __user *ubuf, | |||
193 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 193 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
194 | char *p = (char *) page, fmt[64]; | 194 | char *p = (char *) page, fmt[64]; |
195 | struct mwifiex_bss_info info; | 195 | struct mwifiex_bss_info info; |
196 | ssize_t ret = 0; | 196 | ssize_t ret; |
197 | int i = 0; | 197 | int i = 0; |
198 | 198 | ||
199 | if (!p) | 199 | if (!p) |
@@ -288,7 +288,7 @@ mwifiex_getlog_read(struct file *file, char __user *ubuf, | |||
288 | (struct mwifiex_private *) file->private_data; | 288 | (struct mwifiex_private *) file->private_data; |
289 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 289 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
290 | char *p = (char *) page; | 290 | char *p = (char *) page; |
291 | ssize_t ret = 0; | 291 | ssize_t ret; |
292 | struct mwifiex_ds_get_stats stats; | 292 | struct mwifiex_ds_get_stats stats; |
293 | 293 | ||
294 | if (!p) | 294 | if (!p) |
@@ -400,7 +400,7 @@ mwifiex_debug_read(struct file *file, char __user *ubuf, | |||
400 | struct mwifiex_debug_data *d = &items[0]; | 400 | struct mwifiex_debug_data *d = &items[0]; |
401 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 401 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
402 | char *p = (char *) page; | 402 | char *p = (char *) page; |
403 | ssize_t ret = 0; | 403 | ssize_t ret; |
404 | size_t size, addr; | 404 | size_t size, addr; |
405 | long val; | 405 | long val; |
406 | int i, j; | 406 | int i, j; |
@@ -507,7 +507,7 @@ mwifiex_regrdwr_write(struct file *file, | |||
507 | unsigned long addr = get_zeroed_page(GFP_KERNEL); | 507 | unsigned long addr = get_zeroed_page(GFP_KERNEL); |
508 | char *buf = (char *) addr; | 508 | char *buf = (char *) addr; |
509 | size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1)); | 509 | size_t buf_size = min(count, (size_t) (PAGE_SIZE - 1)); |
510 | int ret = 0; | 510 | int ret; |
511 | u32 reg_type = 0, reg_offset = 0, reg_value = UINT_MAX; | 511 | u32 reg_type = 0, reg_offset = 0, reg_value = UINT_MAX; |
512 | 512 | ||
513 | if (!buf) | 513 | if (!buf) |
@@ -650,7 +650,7 @@ mwifiex_rdeeprom_read(struct file *file, char __user *ubuf, | |||
650 | (struct mwifiex_private *) file->private_data; | 650 | (struct mwifiex_private *) file->private_data; |
651 | unsigned long addr = get_zeroed_page(GFP_KERNEL); | 651 | unsigned long addr = get_zeroed_page(GFP_KERNEL); |
652 | char *buf = (char *) addr; | 652 | char *buf = (char *) addr; |
653 | int pos = 0, ret = 0, i = 0; | 653 | int pos = 0, ret = 0, i; |
654 | u8 value[MAX_EEPROM_DATA]; | 654 | u8 value[MAX_EEPROM_DATA]; |
655 | 655 | ||
656 | if (!buf) | 656 | if (!buf) |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 6d1c4545eda6..afdd145dff0b 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -816,14 +816,7 @@ struct host_cmd_ds_txpwr_cfg { | |||
816 | 816 | ||
817 | struct mwifiex_scan_cmd_config { | 817 | struct mwifiex_scan_cmd_config { |
818 | /* | 818 | /* |
819 | * BSS Type to be sent in the firmware command | 819 | * BSS mode to be sent in the firmware command |
820 | * | ||
821 | * Field can be used to restrict the types of networks returned in the | ||
822 | * scan. Valid settings are: | ||
823 | * | ||
824 | * - MWIFIEX_SCAN_MODE_BSS (infrastructure) | ||
825 | * - MWIFIEX_SCAN_MODE_IBSS (adhoc) | ||
826 | * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure) | ||
827 | */ | 820 | */ |
828 | u8 bss_mode; | 821 | u8 bss_mode; |
829 | 822 | ||
@@ -866,13 +859,6 @@ struct mwifiex_user_scan_cfg { | |||
866 | u8 keep_previous_scan; | 859 | u8 keep_previous_scan; |
867 | /* | 860 | /* |
868 | * BSS mode to be sent in the firmware command | 861 | * BSS mode to be sent in the firmware command |
869 | * | ||
870 | * Field can be used to restrict the types of networks returned in the | ||
871 | * scan. Valid settings are: | ||
872 | * | ||
873 | * - MWIFIEX_SCAN_MODE_BSS (infrastructure) | ||
874 | * - MWIFIEX_SCAN_MODE_IBSS (adhoc) | ||
875 | * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure) | ||
876 | */ | 862 | */ |
877 | u8 bss_mode; | 863 | u8 bss_mode; |
878 | /* Configure the number of probe requests for active chan scans */ | 864 | /* Configure the number of probe requests for active chan scans */ |
@@ -1198,9 +1184,4 @@ struct mwifiex_opt_sleep_confirm { | |||
1198 | __le16 action; | 1184 | __le16 action; |
1199 | __le16 resp_ctrl; | 1185 | __le16 resp_ctrl; |
1200 | } __packed; | 1186 | } __packed; |
1201 | |||
1202 | struct mwifiex_opt_sleep_confirm_buffer { | ||
1203 | u8 hdr[4]; | ||
1204 | struct mwifiex_opt_sleep_confirm ps_cfm_sleep; | ||
1205 | } __packed; | ||
1206 | #endif /* !_MWIFIEX_FW_H_ */ | 1187 | #endif /* !_MWIFIEX_FW_H_ */ |
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index fc2c0c5728d9..3f1559e61320 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -41,7 +41,7 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) | |||
41 | if (!bss_prio) { | 41 | if (!bss_prio) { |
42 | dev_err(adapter->dev, "%s: failed to alloc bss_prio\n", | 42 | dev_err(adapter->dev, "%s: failed to alloc bss_prio\n", |
43 | __func__); | 43 | __func__); |
44 | return -1; | 44 | return -ENOMEM; |
45 | } | 45 | } |
46 | 46 | ||
47 | bss_prio->priv = priv; | 47 | bss_prio->priv = priv; |
@@ -151,7 +151,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv) | |||
151 | */ | 151 | */ |
152 | static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) | 152 | static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) |
153 | { | 153 | { |
154 | int ret = 0; | 154 | int ret; |
155 | u32 buf_size; | 155 | u32 buf_size; |
156 | struct mwifiex_bssdescriptor *temp_scan_table; | 156 | struct mwifiex_bssdescriptor *temp_scan_table; |
157 | 157 | ||
@@ -161,7 +161,7 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) | |||
161 | if (!temp_scan_table) { | 161 | if (!temp_scan_table) { |
162 | dev_err(adapter->dev, "%s: failed to alloc temp_scan_table\n", | 162 | dev_err(adapter->dev, "%s: failed to alloc temp_scan_table\n", |
163 | __func__); | 163 | __func__); |
164 | return -1; | 164 | return -ENOMEM; |
165 | } | 165 | } |
166 | 166 | ||
167 | adapter->scan_table = temp_scan_table; | 167 | adapter->scan_table = temp_scan_table; |
@@ -175,7 +175,7 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) | |||
175 | } | 175 | } |
176 | 176 | ||
177 | adapter->sleep_cfm = | 177 | adapter->sleep_cfm = |
178 | dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm_buffer) | 178 | dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm) |
179 | + INTF_HEADER_LEN); | 179 | + INTF_HEADER_LEN); |
180 | 180 | ||
181 | if (!adapter->sleep_cfm) { | 181 | if (!adapter->sleep_cfm) { |
@@ -197,10 +197,10 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) | |||
197 | */ | 197 | */ |
198 | static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) | 198 | static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) |
199 | { | 199 | { |
200 | struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = NULL; | 200 | struct mwifiex_opt_sleep_confirm *sleep_cfm_buf = NULL; |
201 | 201 | ||
202 | skb_put(adapter->sleep_cfm, sizeof(sleep_cfm_buf->ps_cfm_sleep)); | 202 | skb_put(adapter->sleep_cfm, sizeof(struct mwifiex_opt_sleep_confirm)); |
203 | sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm_buffer *) | 203 | sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *) |
204 | (adapter->sleep_cfm->data); | 204 | (adapter->sleep_cfm->data); |
205 | 205 | ||
206 | adapter->cmd_sent = false; | 206 | adapter->cmd_sent = false; |
@@ -268,16 +268,14 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) | |||
268 | mwifiex_wmm_init(adapter); | 268 | mwifiex_wmm_init(adapter); |
269 | 269 | ||
270 | if (adapter->sleep_cfm) { | 270 | if (adapter->sleep_cfm) { |
271 | memset(&sleep_cfm_buf->ps_cfm_sleep, 0, | 271 | memset(sleep_cfm_buf, 0, adapter->sleep_cfm->len); |
272 | adapter->sleep_cfm->len); | 272 | sleep_cfm_buf->command = |
273 | sleep_cfm_buf->ps_cfm_sleep.command = | 273 | cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); |
274 | cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); | 274 | sleep_cfm_buf->size = |
275 | sleep_cfm_buf->ps_cfm_sleep.size = | 275 | cpu_to_le16(adapter->sleep_cfm->len); |
276 | cpu_to_le16(adapter->sleep_cfm->len); | 276 | sleep_cfm_buf->result = 0; |
277 | sleep_cfm_buf->ps_cfm_sleep.result = 0; | 277 | sleep_cfm_buf->action = cpu_to_le16(SLEEP_CONFIRM); |
278 | sleep_cfm_buf->ps_cfm_sleep.action = cpu_to_le16(SLEEP_CONFIRM); | 278 | sleep_cfm_buf->resp_ctrl = cpu_to_le16(RESP_NEEDED); |
279 | sleep_cfm_buf->ps_cfm_sleep.resp_ctrl = | ||
280 | cpu_to_le16(RESP_NEEDED); | ||
281 | } | 279 | } |
282 | memset(&adapter->sleep_params, 0, sizeof(adapter->sleep_params)); | 280 | memset(&adapter->sleep_params, 0, sizeof(adapter->sleep_params)); |
283 | memset(&adapter->sleep_period, 0, sizeof(adapter->sleep_period)); | 281 | memset(&adapter->sleep_period, 0, sizeof(adapter->sleep_period)); |
@@ -342,9 +340,8 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter) | |||
342 | */ | 340 | */ |
343 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) | 341 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) |
344 | { | 342 | { |
345 | struct mwifiex_private *priv = NULL; | 343 | struct mwifiex_private *priv; |
346 | s32 i = 0; | 344 | s32 i, j; |
347 | u32 j = 0; | ||
348 | 345 | ||
349 | spin_lock_init(&adapter->mwifiex_lock); | 346 | spin_lock_init(&adapter->mwifiex_lock); |
350 | spin_lock_init(&adapter->int_lock); | 347 | spin_lock_init(&adapter->int_lock); |
@@ -400,9 +397,8 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) | |||
400 | */ | 397 | */ |
401 | void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) | 398 | void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) |
402 | { | 399 | { |
403 | struct mwifiex_private *priv = NULL; | 400 | struct mwifiex_private *priv; |
404 | s32 i = 0; | 401 | s32 i, j; |
405 | s32 j = 0; | ||
406 | 402 | ||
407 | /* Free lists */ | 403 | /* Free lists */ |
408 | list_del(&adapter->cmd_free_q); | 404 | list_del(&adapter->cmd_free_q); |
@@ -436,10 +432,9 @@ void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) | |||
436 | */ | 432 | */ |
437 | int mwifiex_init_fw(struct mwifiex_adapter *adapter) | 433 | int mwifiex_init_fw(struct mwifiex_adapter *adapter) |
438 | { | 434 | { |
439 | int ret = 0; | 435 | int ret; |
440 | struct mwifiex_private *priv = NULL; | 436 | struct mwifiex_private *priv; |
441 | u8 i = 0; | 437 | u8 i, first_sta = true; |
442 | u8 first_sta = true; | ||
443 | int is_cmd_pend_q_empty; | 438 | int is_cmd_pend_q_empty; |
444 | unsigned long flags; | 439 | unsigned long flags; |
445 | 440 | ||
@@ -497,8 +492,7 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv) | |||
497 | { | 492 | { |
498 | int i; | 493 | int i; |
499 | struct mwifiex_adapter *adapter = priv->adapter; | 494 | struct mwifiex_adapter *adapter = priv->adapter; |
500 | struct mwifiex_bss_prio_node *bssprio_node = NULL, *tmp_node = NULL, | 495 | struct mwifiex_bss_prio_node *bssprio_node, *tmp_node, **cur; |
501 | **cur = NULL; | ||
502 | struct list_head *head; | 496 | struct list_head *head; |
503 | spinlock_t *lock; | 497 | spinlock_t *lock; |
504 | unsigned long flags; | 498 | unsigned long flags; |
@@ -552,8 +546,8 @@ int | |||
552 | mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) | 546 | mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) |
553 | { | 547 | { |
554 | int ret = -EINPROGRESS; | 548 | int ret = -EINPROGRESS; |
555 | struct mwifiex_private *priv = NULL; | 549 | struct mwifiex_private *priv; |
556 | s32 i = 0; | 550 | s32 i; |
557 | unsigned long flags; | 551 | unsigned long flags; |
558 | 552 | ||
559 | /* mwifiex already shutdown */ | 553 | /* mwifiex already shutdown */ |
@@ -608,9 +602,8 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) | |||
608 | int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, | 602 | int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, |
609 | struct mwifiex_fw_image *pmfw) | 603 | struct mwifiex_fw_image *pmfw) |
610 | { | 604 | { |
611 | int ret = 0; | 605 | int ret, winner; |
612 | u32 poll_num = 1; | 606 | u32 poll_num = 1; |
613 | int winner; | ||
614 | 607 | ||
615 | /* Check if firmware is already running */ | 608 | /* Check if firmware is already running */ |
616 | ret = adapter->if_ops.check_fw_status(adapter, poll_num, &winner); | 609 | ret = adapter->if_ops.check_fw_status(adapter, poll_num, &winner); |
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h index 5488e111fd2c..7c1c5ee40eb9 100644 --- a/drivers/net/wireless/mwifiex/ioctl.h +++ b/drivers/net/wireless/mwifiex/ioctl.h | |||
@@ -23,49 +23,16 @@ | |||
23 | #include <net/mac80211.h> | 23 | #include <net/mac80211.h> |
24 | 24 | ||
25 | enum { | 25 | enum { |
26 | MWIFIEX_SCAN_MODE_UNCHANGED = 0, | ||
27 | MWIFIEX_SCAN_MODE_BSS, | ||
28 | MWIFIEX_SCAN_MODE_IBSS, | ||
29 | MWIFIEX_SCAN_MODE_ANY | ||
30 | }; | ||
31 | |||
32 | enum { | ||
33 | MWIFIEX_SCAN_TYPE_UNCHANGED = 0, | 26 | MWIFIEX_SCAN_TYPE_UNCHANGED = 0, |
34 | MWIFIEX_SCAN_TYPE_ACTIVE, | 27 | MWIFIEX_SCAN_TYPE_ACTIVE, |
35 | MWIFIEX_SCAN_TYPE_PASSIVE | 28 | MWIFIEX_SCAN_TYPE_PASSIVE |
36 | }; | 29 | }; |
37 | 30 | ||
38 | struct mwifiex_get_scan_table_fixed { | ||
39 | u8 bssid[ETH_ALEN]; | ||
40 | u8 channel; | ||
41 | u8 rssi; | ||
42 | long long network_tsf; | ||
43 | }; | ||
44 | |||
45 | struct mwifiex_scan_time_params { | ||
46 | u32 specific_scan_time; | ||
47 | u32 active_scan_time; | ||
48 | u32 passive_scan_time; | ||
49 | }; | ||
50 | |||
51 | struct mwifiex_user_scan { | 31 | struct mwifiex_user_scan { |
52 | u32 scan_cfg_len; | 32 | u32 scan_cfg_len; |
53 | u8 scan_cfg_buf[1]; | 33 | u8 scan_cfg_buf[1]; |
54 | }; | 34 | }; |
55 | 35 | ||
56 | struct mwifiex_scan_req { | ||
57 | u32 scan_mode; | ||
58 | u32 scan_type; | ||
59 | struct mwifiex_802_11_ssid scan_ssid; | ||
60 | struct mwifiex_scan_time_params scan_time; | ||
61 | struct mwifiex_user_scan user_scan; | ||
62 | }; | ||
63 | |||
64 | struct mwifiex_scan_resp { | ||
65 | u32 num_in_scan_table; | ||
66 | u8 *scan_table; | ||
67 | }; | ||
68 | |||
69 | #define MWIFIEX_PROMISC_MODE 1 | 36 | #define MWIFIEX_PROMISC_MODE 1 |
70 | #define MWIFIEX_MULTICAST_MODE 2 | 37 | #define MWIFIEX_MULTICAST_MODE 2 |
71 | #define MWIFIEX_ALL_MULTI_MODE 4 | 38 | #define MWIFIEX_ALL_MULTI_MODE 4 |
@@ -77,18 +44,11 @@ struct mwifiex_multicast_list { | |||
77 | u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN]; | 44 | u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN]; |
78 | }; | 45 | }; |
79 | 46 | ||
80 | #define MWIFIEX_MAX_CHANNEL_NUM 128 | ||
81 | |||
82 | struct mwifiex_chan_freq { | 47 | struct mwifiex_chan_freq { |
83 | u32 channel; | 48 | u32 channel; |
84 | u32 freq; | 49 | u32 freq; |
85 | }; | 50 | }; |
86 | 51 | ||
87 | struct mwifiex_chan_list { | ||
88 | u32 num_of_chan; | ||
89 | struct mwifiex_chan_freq cf[MWIFIEX_MAX_CHANNEL_NUM]; | ||
90 | }; | ||
91 | |||
92 | struct mwifiex_ssid_bssid { | 52 | struct mwifiex_ssid_bssid { |
93 | struct mwifiex_802_11_ssid ssid; | 53 | struct mwifiex_802_11_ssid ssid; |
94 | u8 bssid[ETH_ALEN]; | 54 | u8 bssid[ETH_ALEN]; |
@@ -136,18 +96,8 @@ struct mwifiex_ds_get_stats { | |||
136 | u32 wep_icv_error[4]; | 96 | u32 wep_icv_error[4]; |
137 | }; | 97 | }; |
138 | 98 | ||
139 | #define BCN_RSSI_LAST_MASK 0x00000001 | ||
140 | #define BCN_RSSI_AVG_MASK 0x00000002 | 99 | #define BCN_RSSI_AVG_MASK 0x00000002 |
141 | #define DATA_RSSI_LAST_MASK 0x00000004 | ||
142 | #define DATA_RSSI_AVG_MASK 0x00000008 | ||
143 | #define BCN_SNR_LAST_MASK 0x00000010 | ||
144 | #define BCN_SNR_AVG_MASK 0x00000020 | ||
145 | #define DATA_SNR_LAST_MASK 0x00000040 | ||
146 | #define DATA_SNR_AVG_MASK 0x00000080 | ||
147 | #define BCN_NF_LAST_MASK 0x00000100 | ||
148 | #define BCN_NF_AVG_MASK 0x00000200 | 100 | #define BCN_NF_AVG_MASK 0x00000200 |
149 | #define DATA_NF_LAST_MASK 0x00000400 | ||
150 | #define DATA_NF_AVG_MASK 0x00000800 | ||
151 | #define ALL_RSSI_INFO_MASK 0x00000fff | 101 | #define ALL_RSSI_INFO_MASK 0x00000fff |
152 | 102 | ||
153 | struct mwifiex_ds_get_signal { | 103 | struct mwifiex_ds_get_signal { |
@@ -174,11 +124,6 @@ struct mwifiex_ds_get_signal { | |||
174 | s16 data_nf_avg; | 124 | s16 data_nf_avg; |
175 | }; | 125 | }; |
176 | 126 | ||
177 | struct mwifiex_fw_info { | ||
178 | u32 fw_ver; | ||
179 | u8 mac_addr[ETH_ALEN]; | ||
180 | }; | ||
181 | |||
182 | #define MWIFIEX_MAX_VER_STR_LEN 128 | 127 | #define MWIFIEX_MAX_VER_STR_LEN 128 |
183 | 128 | ||
184 | struct mwifiex_ver_ext { | 129 | struct mwifiex_ver_ext { |
@@ -286,11 +231,6 @@ struct mwifiex_rate_cfg { | |||
286 | u32 rate; | 231 | u32 rate; |
287 | }; | 232 | }; |
288 | 233 | ||
289 | struct mwifiex_data_rate { | ||
290 | u32 tx_data_rate; | ||
291 | u32 rx_data_rate; | ||
292 | }; | ||
293 | |||
294 | struct mwifiex_power_cfg { | 234 | struct mwifiex_power_cfg { |
295 | u32 is_power_auto; | 235 | u32 is_power_auto; |
296 | u32 power_level; | 236 | u32 power_level; |
@@ -309,21 +249,14 @@ struct mwifiex_ds_hs_cfg { | |||
309 | }; | 249 | }; |
310 | 250 | ||
311 | #define DEEP_SLEEP_ON 1 | 251 | #define DEEP_SLEEP_ON 1 |
312 | #define DEEP_SLEEP_OFF 0 | ||
313 | |||
314 | #define DEEP_SLEEP_IDLE_TIME 100 | 252 | #define DEEP_SLEEP_IDLE_TIME 100 |
253 | #define PS_MODE_AUTO 1 | ||
315 | 254 | ||
316 | struct mwifiex_ds_auto_ds { | 255 | struct mwifiex_ds_auto_ds { |
317 | u16 auto_ds; | 256 | u16 auto_ds; |
318 | u16 idle_time; | 257 | u16 idle_time; |
319 | }; | 258 | }; |
320 | 259 | ||
321 | #define PS_MODE_UNCHANGED 0 | ||
322 | #define PS_MODE_AUTO 1 | ||
323 | #define PS_MODE_POLL 2 | ||
324 | #define PS_MODE_NULL 3 | ||
325 | |||
326 | |||
327 | struct mwifiex_ds_pm_cfg { | 260 | struct mwifiex_ds_pm_cfg { |
328 | union { | 261 | union { |
329 | u32 ps_mode; | 262 | u32 ps_mode; |
@@ -333,18 +266,6 @@ struct mwifiex_ds_pm_cfg { | |||
333 | } param; | 266 | } param; |
334 | }; | 267 | }; |
335 | 268 | ||
336 | struct mwifiex_ioctl_wmm_queue_status_ac { | ||
337 | u8 wmm_acm; | ||
338 | u8 flow_required; | ||
339 | u8 flow_created; | ||
340 | u8 disabled; | ||
341 | }; | ||
342 | |||
343 | struct mwifiex_ds_wmm_queue_status { | ||
344 | struct mwifiex_ioctl_wmm_queue_status_ac | ||
345 | ac_status[IEEE80211_MAX_QUEUES]; | ||
346 | }; | ||
347 | |||
348 | struct mwifiex_ds_11n_tx_cfg { | 269 | struct mwifiex_ds_11n_tx_cfg { |
349 | u16 tx_htcap; | 270 | u16 tx_htcap; |
350 | u16 tx_htinfo; | 271 | u16 tx_htinfo; |
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 85fca5eb4195..5eab3dc29b1c 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -143,9 +143,8 @@ mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer, | |||
143 | static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1, | 143 | static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1, |
144 | u32 rate1_size, u8 *rate2, u32 rate2_size) | 144 | u32 rate1_size, u8 *rate2, u32 rate2_size) |
145 | { | 145 | { |
146 | int ret = 0; | 146 | int ret; |
147 | u8 *ptr = rate1; | 147 | u8 *ptr = rate1, *tmp; |
148 | u8 *tmp = NULL; | ||
149 | u32 i, j; | 148 | u32 i, j; |
150 | 149 | ||
151 | tmp = kmalloc(rate1_size, GFP_KERNEL); | 150 | tmp = kmalloc(rate1_size, GFP_KERNEL); |
@@ -203,7 +202,7 @@ mwifiex_setup_rates_from_bssdesc(struct mwifiex_private *priv, | |||
203 | u8 *out_rates, u32 *out_rates_size) | 202 | u8 *out_rates, u32 *out_rates_size) |
204 | { | 203 | { |
205 | u8 card_rates[MWIFIEX_SUPPORTED_RATES]; | 204 | u8 card_rates[MWIFIEX_SUPPORTED_RATES]; |
206 | u32 card_rates_size = 0; | 205 | u32 card_rates_size; |
207 | 206 | ||
208 | /* Copy AP supported rates */ | 207 | /* Copy AP supported rates */ |
209 | memcpy(out_rates, bss_desc->supported_rates, MWIFIEX_SUPPORTED_RATES); | 208 | memcpy(out_rates, bss_desc->supported_rates, MWIFIEX_SUPPORTED_RATES); |
@@ -1359,7 +1358,7 @@ int mwifiex_adhoc_join(struct mwifiex_private *priv, | |||
1359 | static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) | 1358 | static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) |
1360 | { | 1359 | { |
1361 | u8 mac_address[ETH_ALEN]; | 1360 | u8 mac_address[ETH_ALEN]; |
1362 | int ret = 0; | 1361 | int ret; |
1363 | u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; | 1362 | u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; |
1364 | 1363 | ||
1365 | if (mac) { | 1364 | if (mac) { |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index d16cea770fa3..f0582259c935 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -69,7 +69,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, | |||
69 | 69 | ||
70 | adapter = kzalloc(sizeof(struct mwifiex_adapter), GFP_KERNEL); | 70 | adapter = kzalloc(sizeof(struct mwifiex_adapter), GFP_KERNEL); |
71 | if (!adapter) | 71 | if (!adapter) |
72 | return -1; | 72 | return -ENOMEM; |
73 | 73 | ||
74 | g_adapter = adapter; | 74 | g_adapter = adapter; |
75 | adapter->card = card; | 75 | adapter->card = card; |
@@ -150,7 +150,7 @@ error: | |||
150 | */ | 150 | */ |
151 | static int mwifiex_unregister(struct mwifiex_adapter *adapter) | 151 | static int mwifiex_unregister(struct mwifiex_adapter *adapter) |
152 | { | 152 | { |
153 | s32 i = 0; | 153 | s32 i; |
154 | 154 | ||
155 | del_timer(&adapter->cmd_timer); | 155 | del_timer(&adapter->cmd_timer); |
156 | 156 | ||
@@ -379,8 +379,7 @@ static void mwifiex_free_adapter(struct mwifiex_adapter *adapter) | |||
379 | */ | 379 | */ |
380 | static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter) | 380 | static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter) |
381 | { | 381 | { |
382 | int ret = 0; | 382 | int ret, err; |
383 | int err; | ||
384 | struct mwifiex_fw_image fw; | 383 | struct mwifiex_fw_image fw; |
385 | 384 | ||
386 | memset(&fw, 0, sizeof(struct mwifiex_fw_image)); | 385 | memset(&fw, 0, sizeof(struct mwifiex_fw_image)); |
@@ -449,7 +448,7 @@ done: | |||
449 | static void | 448 | static void |
450 | mwifiex_fill_buffer(struct sk_buff *skb) | 449 | mwifiex_fill_buffer(struct sk_buff *skb) |
451 | { | 450 | { |
452 | struct ethhdr *eth = NULL; | 451 | struct ethhdr *eth; |
453 | struct iphdr *iph; | 452 | struct iphdr *iph; |
454 | struct timeval tv; | 453 | struct timeval tv; |
455 | u8 tid = 0; | 454 | u8 tid = 0; |
@@ -510,20 +509,20 @@ static int | |||
510 | mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | 509 | mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) |
511 | { | 510 | { |
512 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); | 511 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
513 | struct sk_buff *new_skb = NULL; | 512 | struct sk_buff *new_skb; |
514 | struct mwifiex_txinfo *tx_info; | 513 | struct mwifiex_txinfo *tx_info; |
515 | 514 | ||
516 | dev_dbg(priv->adapter->dev, "data: %lu BSS(%d): Data <= kernel\n", | 515 | dev_dbg(priv->adapter->dev, "data: %lu BSS(%d): Data <= kernel\n", |
517 | jiffies, priv->bss_index); | 516 | jiffies, priv->bss_index); |
518 | 517 | ||
519 | if (priv->adapter->surprise_removed) { | 518 | if (priv->adapter->surprise_removed) { |
520 | kfree(skb); | 519 | kfree_skb(skb); |
521 | priv->stats.tx_dropped++; | 520 | priv->stats.tx_dropped++; |
522 | return 0; | 521 | return 0; |
523 | } | 522 | } |
524 | if (!skb->len || (skb->len > ETH_FRAME_LEN)) { | 523 | if (!skb->len || (skb->len > ETH_FRAME_LEN)) { |
525 | dev_err(priv->adapter->dev, "Tx: bad skb len %d\n", skb->len); | 524 | dev_err(priv->adapter->dev, "Tx: bad skb len %d\n", skb->len); |
526 | kfree(skb); | 525 | kfree_skb(skb); |
527 | priv->stats.tx_dropped++; | 526 | priv->stats.tx_dropped++; |
528 | return 0; | 527 | return 0; |
529 | } | 528 | } |
@@ -536,7 +535,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
536 | skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN); | 535 | skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN); |
537 | if (unlikely(!new_skb)) { | 536 | if (unlikely(!new_skb)) { |
538 | dev_err(priv->adapter->dev, "Tx: cannot alloca new_skb\n"); | 537 | dev_err(priv->adapter->dev, "Tx: cannot alloca new_skb\n"); |
539 | kfree(skb); | 538 | kfree_skb(skb); |
540 | priv->stats.tx_dropped++; | 539 | priv->stats.tx_dropped++; |
541 | return 0; | 540 | return 0; |
542 | } | 541 | } |
@@ -571,7 +570,7 @@ mwifiex_set_mac_address(struct net_device *dev, void *addr) | |||
571 | { | 570 | { |
572 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); | 571 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
573 | struct sockaddr *hw_addr = (struct sockaddr *) addr; | 572 | struct sockaddr *hw_addr = (struct sockaddr *) addr; |
574 | int ret = 0; | 573 | int ret; |
575 | 574 | ||
576 | memcpy(priv->curr_addr, hw_addr->sa_data, ETH_ALEN); | 575 | memcpy(priv->curr_addr, hw_addr->sa_data, ETH_ALEN); |
577 | 576 | ||
@@ -696,9 +695,9 @@ static struct mwifiex_private *mwifiex_add_interface( | |||
696 | struct mwifiex_adapter *adapter, | 695 | struct mwifiex_adapter *adapter, |
697 | u8 bss_index, u8 bss_type) | 696 | u8 bss_index, u8 bss_type) |
698 | { | 697 | { |
699 | struct net_device *dev = NULL; | 698 | struct net_device *dev; |
700 | struct mwifiex_private *priv = NULL; | 699 | struct mwifiex_private *priv; |
701 | void *mdev_priv = NULL; | 700 | void *mdev_priv; |
702 | 701 | ||
703 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d", | 702 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d", |
704 | ether_setup, 1); | 703 | ether_setup, 1); |
@@ -759,7 +758,7 @@ error: | |||
759 | static void | 758 | static void |
760 | mwifiex_remove_interface(struct mwifiex_adapter *adapter, u8 bss_index) | 759 | mwifiex_remove_interface(struct mwifiex_adapter *adapter, u8 bss_index) |
761 | { | 760 | { |
762 | struct net_device *dev = NULL; | 761 | struct net_device *dev; |
763 | struct mwifiex_private *priv = adapter->priv[bss_index]; | 762 | struct mwifiex_private *priv = adapter->priv[bss_index]; |
764 | 763 | ||
765 | if (!priv) | 764 | if (!priv) |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 5043fcd22565..672701dc2721 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -479,9 +479,9 @@ struct mwifiex_private { | |||
479 | u8 report_scan_result; | 479 | u8 report_scan_result; |
480 | struct cfg80211_scan_request *scan_request; | 480 | struct cfg80211_scan_request *scan_request; |
481 | int scan_result_status; | 481 | int scan_result_status; |
482 | bool assoc_request; | 482 | int assoc_request; |
483 | u16 assoc_result; | 483 | u16 assoc_result; |
484 | bool ibss_join_request; | 484 | int ibss_join_request; |
485 | u16 ibss_join_result; | 485 | u16 ibss_join_result; |
486 | bool disconnect; | 486 | bool disconnect; |
487 | u8 cfg_bssid[6]; | 487 | u8 cfg_bssid[6]; |
@@ -692,10 +692,6 @@ int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter); | |||
692 | 692 | ||
693 | int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *); | 693 | int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *); |
694 | 694 | ||
695 | int mwifiex_recv_complete(struct mwifiex_adapter *, | ||
696 | struct sk_buff *skb, | ||
697 | int status); | ||
698 | |||
699 | int mwifiex_recv_packet(struct mwifiex_adapter *, struct sk_buff *skb); | 695 | int mwifiex_recv_packet(struct mwifiex_adapter *, struct sk_buff *skb); |
700 | 696 | ||
701 | int mwifiex_process_event(struct mwifiex_adapter *adapter); | 697 | int mwifiex_process_event(struct mwifiex_adapter *adapter); |
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 31a529578805..5c22860fb40a 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -117,8 +117,8 @@ mwifiex_search_oui_in_ie(struct ie_body *iebody, u8 *oui) | |||
117 | static u8 | 117 | static u8 |
118 | mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) | 118 | mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) |
119 | { | 119 | { |
120 | u8 *oui = NULL; | 120 | u8 *oui; |
121 | struct ie_body *iebody = NULL; | 121 | struct ie_body *iebody; |
122 | u8 ret = MWIFIEX_OUI_NOT_PRESENT; | 122 | u8 ret = MWIFIEX_OUI_NOT_PRESENT; |
123 | 123 | ||
124 | if (((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)). | 124 | if (((bss_desc->bcn_rsn_ie) && ((*(bss_desc->bcn_rsn_ie)). |
@@ -144,8 +144,8 @@ mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) | |||
144 | static u8 | 144 | static u8 |
145 | mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) | 145 | mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) |
146 | { | 146 | { |
147 | u8 *oui = NULL; | 147 | u8 *oui; |
148 | struct ie_body *iebody = NULL; | 148 | struct ie_body *iebody; |
149 | u8 ret = MWIFIEX_OUI_NOT_PRESENT; | 149 | u8 ret = MWIFIEX_OUI_NOT_PRESENT; |
150 | 150 | ||
151 | if (((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)). | 151 | if (((bss_desc->bcn_wpa_ie) && ((*(bss_desc->bcn_wpa_ie)). |
@@ -181,7 +181,7 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv, | |||
181 | struct mwifiex_ssid_bssid *ssid_bssid) | 181 | struct mwifiex_ssid_bssid *ssid_bssid) |
182 | { | 182 | { |
183 | struct mwifiex_ssid_bssid tmp_ssid_bssid; | 183 | struct mwifiex_ssid_bssid tmp_ssid_bssid; |
184 | u8 *mac = NULL; | 184 | u8 *mac; |
185 | 185 | ||
186 | if (!ssid_bssid) | 186 | if (!ssid_bssid) |
187 | return -1; | 187 | return -1; |
@@ -213,7 +213,7 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv, | |||
213 | int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, | 213 | int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, |
214 | struct mwifiex_user_scan_cfg *scan_req) | 214 | struct mwifiex_user_scan_cfg *scan_req) |
215 | { | 215 | { |
216 | int status = 0; | 216 | int status; |
217 | 217 | ||
218 | priv->adapter->cmd_wait_q.condition = false; | 218 | priv->adapter->cmd_wait_q.condition = false; |
219 | 219 | ||
@@ -2253,8 +2253,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, | |||
2253 | { | 2253 | { |
2254 | int ret = 0; | 2254 | int ret = 0; |
2255 | struct mwifiex_adapter *adapter = priv->adapter; | 2255 | struct mwifiex_adapter *adapter = priv->adapter; |
2256 | struct cmd_ctrl_node *cmd_node = NULL; | 2256 | struct cmd_ctrl_node *cmd_node; |
2257 | union mwifiex_scan_cmd_config_tlv *scan_cfg_out = NULL; | 2257 | union mwifiex_scan_cmd_config_tlv *scan_cfg_out; |
2258 | struct mwifiex_ie_types_chan_list_param_set *chan_list_out; | 2258 | struct mwifiex_ie_types_chan_list_param_set *chan_list_out; |
2259 | u32 buf_size; | 2259 | u32 buf_size; |
2260 | struct mwifiex_chan_scan_param_set *scan_chan_list; | 2260 | struct mwifiex_chan_scan_param_set *scan_chan_list; |
@@ -2283,7 +2283,7 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, | |||
2283 | GFP_KERNEL); | 2283 | GFP_KERNEL); |
2284 | if (!scan_cfg_out) { | 2284 | if (!scan_cfg_out) { |
2285 | dev_err(adapter->dev, "failed to alloc scan_cfg_out\n"); | 2285 | dev_err(adapter->dev, "failed to alloc scan_cfg_out\n"); |
2286 | return -1; | 2286 | return -ENOMEM; |
2287 | } | 2287 | } |
2288 | 2288 | ||
2289 | buf_size = sizeof(struct mwifiex_chan_scan_param_set) * | 2289 | buf_size = sizeof(struct mwifiex_chan_scan_param_set) * |
@@ -2292,7 +2292,7 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, | |||
2292 | if (!scan_chan_list) { | 2292 | if (!scan_chan_list) { |
2293 | dev_err(adapter->dev, "failed to alloc scan_chan_list\n"); | 2293 | dev_err(adapter->dev, "failed to alloc scan_chan_list\n"); |
2294 | kfree(scan_cfg_out); | 2294 | kfree(scan_cfg_out); |
2295 | return -1; | 2295 | return -ENOMEM; |
2296 | } | 2296 | } |
2297 | 2297 | ||
2298 | keep_previous_scan = false; | 2298 | keep_previous_scan = false; |
@@ -2404,8 +2404,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
2404 | { | 2404 | { |
2405 | int ret = 0; | 2405 | int ret = 0; |
2406 | struct mwifiex_adapter *adapter = priv->adapter; | 2406 | struct mwifiex_adapter *adapter = priv->adapter; |
2407 | struct cmd_ctrl_node *cmd_node = NULL; | 2407 | struct cmd_ctrl_node *cmd_node; |
2408 | struct host_cmd_ds_802_11_scan_rsp *scan_rsp = NULL; | 2408 | struct host_cmd_ds_802_11_scan_rsp *scan_rsp; |
2409 | struct mwifiex_bssdescriptor *bss_new_entry = NULL; | 2409 | struct mwifiex_bssdescriptor *bss_new_entry = NULL; |
2410 | struct mwifiex_ie_types_data *tlv_data; | 2410 | struct mwifiex_ie_types_data *tlv_data; |
2411 | struct mwifiex_ie_types_tsf_timestamp *tsf_tlv; | 2411 | struct mwifiex_ie_types_tsf_timestamp *tsf_tlv; |
@@ -2491,7 +2491,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
2491 | GFP_KERNEL); | 2491 | GFP_KERNEL); |
2492 | if (!bss_new_entry) { | 2492 | if (!bss_new_entry) { |
2493 | dev_err(adapter->dev, " failed to alloc bss_new_entry\n"); | 2493 | dev_err(adapter->dev, " failed to alloc bss_new_entry\n"); |
2494 | return -1; | 2494 | return -ENOMEM; |
2495 | } | 2495 | } |
2496 | 2496 | ||
2497 | for (idx = 0; idx < scan_rsp->number_of_sets && bytes_left; idx++) { | 2497 | for (idx = 0; idx < scan_rsp->number_of_sets && bytes_left; idx++) { |
@@ -2881,7 +2881,7 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, | |||
2881 | scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), GFP_KERNEL); | 2881 | scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), GFP_KERNEL); |
2882 | if (!scan_cfg) { | 2882 | if (!scan_cfg) { |
2883 | dev_err(adapter->dev, "failed to alloc scan_cfg\n"); | 2883 | dev_err(adapter->dev, "failed to alloc scan_cfg\n"); |
2884 | return -1; | 2884 | return -ENOMEM; |
2885 | } | 2885 | } |
2886 | 2886 | ||
2887 | memcpy(scan_cfg->ssid_list[0].ssid, req_ssid->ssid, | 2887 | memcpy(scan_cfg->ssid_list[0].ssid, req_ssid->ssid, |
@@ -2906,7 +2906,7 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, | |||
2906 | int mwifiex_request_scan(struct mwifiex_private *priv, | 2906 | int mwifiex_request_scan(struct mwifiex_private *priv, |
2907 | struct mwifiex_802_11_ssid *req_ssid) | 2907 | struct mwifiex_802_11_ssid *req_ssid) |
2908 | { | 2908 | { |
2909 | int ret = 0; | 2909 | int ret; |
2910 | 2910 | ||
2911 | if (down_interruptible(&priv->async_sem)) { | 2911 | if (down_interruptible(&priv->async_sem)) { |
2912 | dev_err(priv->adapter->dev, "%s: acquire semaphore\n", | 2912 | dev_err(priv->adapter->dev, "%s: acquire semaphore\n", |
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 5148d0e0fad6..d425dbd91d19 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -46,7 +46,7 @@ static struct semaphore add_remove_card_sem; | |||
46 | static int | 46 | static int |
47 | mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) | 47 | mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) |
48 | { | 48 | { |
49 | int ret = 0; | 49 | int ret; |
50 | struct sdio_mmc_card *card = NULL; | 50 | struct sdio_mmc_card *card = NULL; |
51 | 51 | ||
52 | pr_debug("info: vendor=0x%4.04X device=0x%4.04X class=%d function=%d\n", | 52 | pr_debug("info: vendor=0x%4.04X device=0x%4.04X class=%d function=%d\n", |
@@ -68,6 +68,7 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) | |||
68 | 68 | ||
69 | if (ret) { | 69 | if (ret) { |
70 | pr_err("%s: failed to enable function\n", __func__); | 70 | pr_err("%s: failed to enable function\n", __func__); |
71 | kfree(card); | ||
71 | return -EIO; | 72 | return -EIO; |
72 | } | 73 | } |
73 | 74 | ||
@@ -119,7 +120,7 @@ static int mwifiex_sdio_suspend(struct device *dev) | |||
119 | { | 120 | { |
120 | struct sdio_func *func = dev_to_sdio_func(dev); | 121 | struct sdio_func *func = dev_to_sdio_func(dev); |
121 | struct sdio_mmc_card *card; | 122 | struct sdio_mmc_card *card; |
122 | struct mwifiex_adapter *adapter = NULL; | 123 | struct mwifiex_adapter *adapter; |
123 | mmc_pm_flag_t pm_flag = 0; | 124 | mmc_pm_flag_t pm_flag = 0; |
124 | int hs_actived = 0; | 125 | int hs_actived = 0; |
125 | int i; | 126 | int i; |
@@ -177,7 +178,7 @@ static int mwifiex_sdio_resume(struct device *dev) | |||
177 | { | 178 | { |
178 | struct sdio_func *func = dev_to_sdio_func(dev); | 179 | struct sdio_func *func = dev_to_sdio_func(dev); |
179 | struct sdio_mmc_card *card; | 180 | struct sdio_mmc_card *card; |
180 | struct mwifiex_adapter *adapter = NULL; | 181 | struct mwifiex_adapter *adapter; |
181 | mmc_pm_flag_t pm_flag = 0; | 182 | mmc_pm_flag_t pm_flag = 0; |
182 | int i; | 183 | int i; |
183 | 184 | ||
@@ -420,7 +421,7 @@ static int mwifiex_write_data_to_card(struct mwifiex_adapter *adapter, | |||
420 | u8 *payload, u32 pkt_len, u32 port) | 421 | u8 *payload, u32 pkt_len, u32 port) |
421 | { | 422 | { |
422 | u32 i = 0; | 423 | u32 i = 0; |
423 | int ret = 0; | 424 | int ret; |
424 | 425 | ||
425 | do { | 426 | do { |
426 | ret = mwifiex_write_data_sync(adapter, payload, pkt_len, port); | 427 | ret = mwifiex_write_data_sync(adapter, payload, pkt_len, port); |
@@ -531,7 +532,7 @@ static int | |||
531 | mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits) | 532 | mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits) |
532 | { | 533 | { |
533 | u32 tries; | 534 | u32 tries; |
534 | u32 cs = 0; | 535 | u32 cs; |
535 | 536 | ||
536 | for (tries = 0; tries < MAX_POLL_TRIES; tries++) { | 537 | for (tries = 0; tries < MAX_POLL_TRIES; tries++) { |
537 | if (mwifiex_read_reg(adapter, CARD_STATUS_REG, &cs)) | 538 | if (mwifiex_read_reg(adapter, CARD_STATUS_REG, &cs)) |
@@ -553,7 +554,7 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits) | |||
553 | static int | 554 | static int |
554 | mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat) | 555 | mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat) |
555 | { | 556 | { |
556 | u32 fws0 = 0, fws1 = 0; | 557 | u32 fws0, fws1; |
557 | 558 | ||
558 | if (mwifiex_read_reg(adapter, CARD_FW_STATUS0_REG, &fws0)) | 559 | if (mwifiex_read_reg(adapter, CARD_FW_STATUS0_REG, &fws0)) |
559 | return -1; | 560 | return -1; |
@@ -574,7 +575,7 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat) | |||
574 | */ | 575 | */ |
575 | static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) | 576 | static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) |
576 | { | 577 | { |
577 | u32 host_int_mask = 0; | 578 | u32 host_int_mask; |
578 | 579 | ||
579 | /* Read back the host_int_mask register */ | 580 | /* Read back the host_int_mask register */ |
580 | if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask)) | 581 | if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask)) |
@@ -614,7 +615,7 @@ static int mwifiex_sdio_card_to_host(struct mwifiex_adapter *adapter, | |||
614 | u32 *type, u8 *buffer, | 615 | u32 *type, u8 *buffer, |
615 | u32 npayload, u32 ioport) | 616 | u32 npayload, u32 ioport) |
616 | { | 617 | { |
617 | int ret = 0; | 618 | int ret; |
618 | u32 nb; | 619 | u32 nb; |
619 | 620 | ||
620 | if (!buffer) { | 621 | if (!buffer) { |
@@ -652,14 +653,14 @@ static int mwifiex_sdio_card_to_host(struct mwifiex_adapter *adapter, | |||
652 | static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, | 653 | static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, |
653 | struct mwifiex_fw_image *fw) | 654 | struct mwifiex_fw_image *fw) |
654 | { | 655 | { |
655 | int ret = 0; | 656 | int ret; |
656 | u8 *firmware = fw->fw_buf; | 657 | u8 *firmware = fw->fw_buf; |
657 | u32 firmware_len = fw->fw_len; | 658 | u32 firmware_len = fw->fw_len; |
658 | u32 offset = 0; | 659 | u32 offset = 0; |
659 | u32 base0, base1; | 660 | u32 base0, base1; |
660 | u8 *fwbuf; | 661 | u8 *fwbuf; |
661 | u16 len = 0; | 662 | u16 len = 0; |
662 | u32 txlen = 0, tx_blocks = 0, tries = 0; | 663 | u32 txlen, tx_blocks = 0, tries; |
663 | u32 i = 0; | 664 | u32 i = 0; |
664 | 665 | ||
665 | if (!firmware_len) { | 666 | if (!firmware_len) { |
@@ -676,7 +677,7 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, | |||
676 | if (!fwbuf) { | 677 | if (!fwbuf) { |
677 | dev_err(adapter->dev, "unable to alloc buffer for firmware." | 678 | dev_err(adapter->dev, "unable to alloc buffer for firmware." |
678 | " Terminating download\n"); | 679 | " Terminating download\n"); |
679 | return -1; | 680 | return -ENOMEM; |
680 | } | 681 | } |
681 | 682 | ||
682 | /* Perform firmware data transfer */ | 683 | /* Perform firmware data transfer */ |
@@ -830,7 +831,7 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter, | |||
830 | static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter) | 831 | static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter) |
831 | { | 832 | { |
832 | struct sdio_mmc_card *card = adapter->card; | 833 | struct sdio_mmc_card *card = adapter->card; |
833 | u32 sdio_ireg = 0; | 834 | u32 sdio_ireg; |
834 | unsigned long flags; | 835 | unsigned long flags; |
835 | 836 | ||
836 | if (mwifiex_read_data_sync(adapter, card->mp_regs, MAX_MP_REGS, | 837 | if (mwifiex_read_data_sync(adapter, card->mp_regs, MAX_MP_REGS, |
@@ -964,7 +965,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter, | |||
964 | s32 f_do_rx_cur = 0; | 965 | s32 f_do_rx_cur = 0; |
965 | s32 f_aggr_cur = 0; | 966 | s32 f_aggr_cur = 0; |
966 | struct sk_buff *skb_deaggr; | 967 | struct sk_buff *skb_deaggr; |
967 | u32 pind = 0; | 968 | u32 pind; |
968 | u32 pkt_len, pkt_type = 0; | 969 | u32 pkt_len, pkt_type = 0; |
969 | u8 *curr_ptr; | 970 | u8 *curr_ptr; |
970 | u32 rx_len = skb->len; | 971 | u32 rx_len = skb->len; |
@@ -1114,7 +1115,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter) | |||
1114 | struct sdio_mmc_card *card = adapter->card; | 1115 | struct sdio_mmc_card *card = adapter->card; |
1115 | int ret = 0; | 1116 | int ret = 0; |
1116 | u8 sdio_ireg; | 1117 | u8 sdio_ireg; |
1117 | struct sk_buff *skb = NULL; | 1118 | struct sk_buff *skb; |
1118 | u8 port = CTRL_PORT; | 1119 | u8 port = CTRL_PORT; |
1119 | u32 len_reg_l, len_reg_u; | 1120 | u32 len_reg_l, len_reg_u; |
1120 | u32 rx_blocks; | 1121 | u32 rx_blocks; |
@@ -1377,7 +1378,7 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter, | |||
1377 | struct mwifiex_tx_param *tx_param) | 1378 | struct mwifiex_tx_param *tx_param) |
1378 | { | 1379 | { |
1379 | struct sdio_mmc_card *card = adapter->card; | 1380 | struct sdio_mmc_card *card = adapter->card; |
1380 | int ret = 0; | 1381 | int ret; |
1381 | u32 buf_block_len; | 1382 | u32 buf_block_len; |
1382 | u32 blk_size; | 1383 | u32 blk_size; |
1383 | u8 port = CTRL_PORT; | 1384 | u8 port = CTRL_PORT; |
@@ -1560,7 +1561,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter) | |||
1560 | { | 1561 | { |
1561 | struct sdio_mmc_card *card = adapter->card; | 1562 | struct sdio_mmc_card *card = adapter->card; |
1562 | int ret; | 1563 | int ret; |
1563 | u32 sdio_ireg = 0; | 1564 | u32 sdio_ireg; |
1564 | 1565 | ||
1565 | /* | 1566 | /* |
1566 | * Read the HOST_INT_STATUS_REG for ACK the first interrupt got | 1567 | * Read the HOST_INT_STATUS_REG for ACK the first interrupt got |
@@ -1605,7 +1606,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter) | |||
1605 | card->mp_regs = kzalloc(MAX_MP_REGS, GFP_KERNEL); | 1606 | card->mp_regs = kzalloc(MAX_MP_REGS, GFP_KERNEL); |
1606 | if (!card->mp_regs) { | 1607 | if (!card->mp_regs) { |
1607 | dev_err(adapter->dev, "failed to alloc mp_regs\n"); | 1608 | dev_err(adapter->dev, "failed to alloc mp_regs\n"); |
1608 | return -1; | 1609 | return -ENOMEM; |
1609 | } | 1610 | } |
1610 | 1611 | ||
1611 | ret = mwifiex_alloc_sdio_mpa_buffers(adapter, | 1612 | ret = mwifiex_alloc_sdio_mpa_buffers(adapter, |
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c index 33c8ba1f5e33..8af3a78d2723 100644 --- a/drivers/net/wireless/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/mwifiex/sta_cmd.c | |||
@@ -274,8 +274,8 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv, | |||
274 | static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd, | 274 | static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd, |
275 | u16 cmd_action, void *data_buf) | 275 | u16 cmd_action, void *data_buf) |
276 | { | 276 | { |
277 | struct mwifiex_types_power_group *pg_tlv = NULL; | 277 | struct mwifiex_types_power_group *pg_tlv; |
278 | struct host_cmd_ds_txpwr_cfg *txp = NULL; | 278 | struct host_cmd_ds_txpwr_cfg *txp; |
279 | struct host_cmd_ds_txpwr_cfg *cmd_txp_cfg = &cmd->params.txp_cfg; | 279 | struct host_cmd_ds_txpwr_cfg *cmd_txp_cfg = &cmd->params.txp_cfg; |
280 | 280 | ||
281 | cmd->command = cpu_to_le16(HostCmd_CMD_TXPWR_CFG); | 281 | cmd->command = cpu_to_le16(HostCmd_CMD_TXPWR_CFG); |
@@ -478,7 +478,7 @@ mwifiex_set_keyparamset_wep(struct mwifiex_private *priv, | |||
478 | struct mwifiex_ie_type_key_param_set *key_param_set, | 478 | struct mwifiex_ie_type_key_param_set *key_param_set, |
479 | u16 *key_param_len) | 479 | u16 *key_param_len) |
480 | { | 480 | { |
481 | int cur_key_param_len = 0; | 481 | int cur_key_param_len; |
482 | u8 i; | 482 | u8 i; |
483 | 483 | ||
484 | /* Multi-key_param_set TLV is supported */ | 484 | /* Multi-key_param_set TLV is supported */ |
@@ -1121,7 +1121,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, | |||
1121 | */ | 1121 | */ |
1122 | int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) | 1122 | int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) |
1123 | { | 1123 | { |
1124 | int ret = 0; | 1124 | int ret; |
1125 | u16 enable = true; | 1125 | u16 enable = true; |
1126 | struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl; | 1126 | struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl; |
1127 | struct mwifiex_ds_auto_ds auto_ds; | 1127 | struct mwifiex_ds_auto_ds auto_ds; |
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 7f4f10b752fb..d08f76429a0a 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c | |||
@@ -43,7 +43,7 @@ static void | |||
43 | mwifiex_process_cmdresp_error(struct mwifiex_private *priv, | 43 | mwifiex_process_cmdresp_error(struct mwifiex_private *priv, |
44 | struct host_cmd_ds_command *resp) | 44 | struct host_cmd_ds_command *resp) |
45 | { | 45 | { |
46 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL; | 46 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; |
47 | struct mwifiex_adapter *adapter = priv->adapter; | 47 | struct mwifiex_adapter *adapter = priv->adapter; |
48 | struct host_cmd_ds_802_11_ps_mode_enh *pm; | 48 | struct host_cmd_ds_802_11_ps_mode_enh *pm; |
49 | unsigned long flags; | 49 | unsigned long flags; |
@@ -124,7 +124,7 @@ static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv, | |||
124 | { | 124 | { |
125 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = | 125 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = |
126 | &resp->params.rssi_info_rsp; | 126 | &resp->params.rssi_info_rsp; |
127 | struct mwifiex_ds_get_signal *signal = NULL; | 127 | struct mwifiex_ds_get_signal *signal; |
128 | 128 | ||
129 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); | 129 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); |
130 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); | 130 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); |
@@ -232,7 +232,7 @@ static int mwifiex_ret_get_log(struct mwifiex_private *priv, | |||
232 | { | 232 | { |
233 | struct host_cmd_ds_802_11_get_log *get_log = | 233 | struct host_cmd_ds_802_11_get_log *get_log = |
234 | (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log; | 234 | (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log; |
235 | struct mwifiex_ds_get_stats *stats = NULL; | 235 | struct mwifiex_ds_get_stats *stats; |
236 | 236 | ||
237 | if (data_buf) { | 237 | if (data_buf) { |
238 | stats = (struct mwifiex_ds_get_stats *) data_buf; | 238 | stats = (struct mwifiex_ds_get_stats *) data_buf; |
@@ -280,10 +280,10 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv, | |||
280 | struct host_cmd_ds_command *resp, | 280 | struct host_cmd_ds_command *resp, |
281 | void *data_buf) | 281 | void *data_buf) |
282 | { | 282 | { |
283 | struct mwifiex_rate_cfg *ds_rate = NULL; | 283 | struct mwifiex_rate_cfg *ds_rate; |
284 | struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; | 284 | struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; |
285 | struct mwifiex_rate_scope *rate_scope; | 285 | struct mwifiex_rate_scope *rate_scope; |
286 | struct mwifiex_ie_types_header *head = NULL; | 286 | struct mwifiex_ie_types_header *head; |
287 | u16 tlv, tlv_buf_len; | 287 | u16 tlv, tlv_buf_len; |
288 | u8 *tlv_buf; | 288 | u8 *tlv_buf; |
289 | u32 i; | 289 | u32 i; |
@@ -368,9 +368,9 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv, | |||
368 | */ | 368 | */ |
369 | static int mwifiex_get_power_level(struct mwifiex_private *priv, void *data_buf) | 369 | static int mwifiex_get_power_level(struct mwifiex_private *priv, void *data_buf) |
370 | { | 370 | { |
371 | int length = -1, max_power = -1, min_power = -1; | 371 | int length, max_power = -1, min_power = -1; |
372 | struct mwifiex_types_power_group *pg_tlv_hdr = NULL; | 372 | struct mwifiex_types_power_group *pg_tlv_hdr; |
373 | struct mwifiex_power_group *pg = NULL; | 373 | struct mwifiex_power_group *pg; |
374 | 374 | ||
375 | if (data_buf) { | 375 | if (data_buf) { |
376 | pg_tlv_hdr = | 376 | pg_tlv_hdr = |
@@ -418,8 +418,8 @@ static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv, | |||
418 | { | 418 | { |
419 | struct mwifiex_adapter *adapter = priv->adapter; | 419 | struct mwifiex_adapter *adapter = priv->adapter; |
420 | struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg; | 420 | struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg; |
421 | struct mwifiex_types_power_group *pg_tlv_hdr = NULL; | 421 | struct mwifiex_types_power_group *pg_tlv_hdr; |
422 | struct mwifiex_power_group *pg = NULL; | 422 | struct mwifiex_power_group *pg; |
423 | u16 action = le16_to_cpu(txp_cfg->action); | 423 | u16 action = le16_to_cpu(txp_cfg->action); |
424 | 424 | ||
425 | switch (action) { | 425 | switch (action) { |
@@ -593,7 +593,7 @@ static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv, | |||
593 | &resp->params.domain_info_resp; | 593 | &resp->params.domain_info_resp; |
594 | struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain; | 594 | struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain; |
595 | u16 action = le16_to_cpu(domain_info->action); | 595 | u16 action = le16_to_cpu(domain_info->action); |
596 | u8 no_of_triplet = 0; | 596 | u8 no_of_triplet; |
597 | 597 | ||
598 | no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) - | 598 | no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) - |
599 | IEEE80211_COUNTRY_STRING_LEN) / | 599 | IEEE80211_COUNTRY_STRING_LEN) / |
@@ -661,7 +661,7 @@ static int mwifiex_ret_ver_ext(struct mwifiex_private *priv, | |||
661 | void *data_buf) | 661 | void *data_buf) |
662 | { | 662 | { |
663 | struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext; | 663 | struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext; |
664 | struct host_cmd_ds_version_ext *version_ext = NULL; | 664 | struct host_cmd_ds_version_ext *version_ext; |
665 | 665 | ||
666 | if (data_buf) { | 666 | if (data_buf) { |
667 | version_ext = (struct host_cmd_ds_version_ext *)data_buf; | 667 | version_ext = (struct host_cmd_ds_version_ext *)data_buf; |
@@ -682,8 +682,8 @@ static int mwifiex_ret_ver_ext(struct mwifiex_private *priv, | |||
682 | static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp, | 682 | static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp, |
683 | void *data_buf) | 683 | void *data_buf) |
684 | { | 684 | { |
685 | struct mwifiex_ds_reg_rw *reg_rw = NULL; | 685 | struct mwifiex_ds_reg_rw *reg_rw; |
686 | struct mwifiex_ds_read_eeprom *eeprom = NULL; | 686 | struct mwifiex_ds_read_eeprom *eeprom; |
687 | 687 | ||
688 | if (data_buf) { | 688 | if (data_buf) { |
689 | reg_rw = (struct mwifiex_ds_reg_rw *) data_buf; | 689 | reg_rw = (struct mwifiex_ds_reg_rw *) data_buf; |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index e7adaab35226..d05907d05039 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -149,7 +149,7 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, | |||
149 | int mwifiex_bss_start(struct mwifiex_private *priv, | 149 | int mwifiex_bss_start(struct mwifiex_private *priv, |
150 | struct mwifiex_ssid_bssid *ssid_bssid) | 150 | struct mwifiex_ssid_bssid *ssid_bssid) |
151 | { | 151 | { |
152 | int ret = 0; | 152 | int ret; |
153 | struct mwifiex_adapter *adapter = priv->adapter; | 153 | struct mwifiex_adapter *adapter = priv->adapter; |
154 | s32 i = -1; | 154 | s32 i = -1; |
155 | 155 | ||
@@ -376,7 +376,7 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv, | |||
376 | { | 376 | { |
377 | struct mwifiex_adapter *adapter = priv->adapter; | 377 | struct mwifiex_adapter *adapter = priv->adapter; |
378 | struct mwifiex_bssdescriptor *bss_desc; | 378 | struct mwifiex_bssdescriptor *bss_desc; |
379 | s32 tbl_idx = 0; | 379 | s32 tbl_idx; |
380 | 380 | ||
381 | if (!info) | 381 | if (!info) |
382 | return -1; | 382 | return -1; |
@@ -436,9 +436,8 @@ int mwifiex_set_radio_band_cfg(struct mwifiex_private *priv, | |||
436 | struct mwifiex_ds_band_cfg *radio_cfg) | 436 | struct mwifiex_ds_band_cfg *radio_cfg) |
437 | { | 437 | { |
438 | struct mwifiex_adapter *adapter = priv->adapter; | 438 | struct mwifiex_adapter *adapter = priv->adapter; |
439 | u8 infra_band = 0; | 439 | u8 infra_band, adhoc_band; |
440 | u8 adhoc_band = 0; | 440 | u32 adhoc_channel; |
441 | u32 adhoc_channel = 0; | ||
442 | 441 | ||
443 | infra_band = (u8) radio_cfg->config_bands; | 442 | infra_band = (u8) radio_cfg->config_bands; |
444 | adhoc_band = (u8) radio_cfg->adhoc_start_band; | 443 | adhoc_band = (u8) radio_cfg->adhoc_start_band; |
@@ -636,7 +635,7 @@ int mwifiex_bss_ioctl_find_bss(struct mwifiex_private *priv, | |||
636 | int | 635 | int |
637 | mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel) | 636 | mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel) |
638 | { | 637 | { |
639 | int ret = 0; | 638 | int ret; |
640 | struct mwifiex_bss_info bss_info; | 639 | struct mwifiex_bss_info bss_info; |
641 | struct mwifiex_ssid_bssid ssid_bssid; | 640 | struct mwifiex_ssid_bssid ssid_bssid; |
642 | u16 curr_chan = 0; | 641 | u16 curr_chan = 0; |
@@ -755,11 +754,10 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv, | |||
755 | struct mwifiex_rate_cfg *rate_cfg) | 754 | struct mwifiex_rate_cfg *rate_cfg) |
756 | { | 755 | { |
757 | u8 rates[MWIFIEX_SUPPORTED_RATES]; | 756 | u8 rates[MWIFIEX_SUPPORTED_RATES]; |
758 | u8 *rate = NULL; | 757 | u8 *rate; |
759 | int rate_index = 0; | 758 | int rate_index, ret; |
760 | u16 bitmap_rates[MAX_BITMAP_RATES_SIZE]; | 759 | u16 bitmap_rates[MAX_BITMAP_RATES_SIZE]; |
761 | u32 i = 0; | 760 | u32 i; |
762 | int ret = 0; | ||
763 | struct mwifiex_adapter *adapter = priv->adapter; | 761 | struct mwifiex_adapter *adapter = priv->adapter; |
764 | 762 | ||
765 | if (rate_cfg->is_rate_auto) { | 763 | if (rate_cfg->is_rate_auto) { |
@@ -819,7 +817,7 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv, | |||
819 | static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv, | 817 | static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv, |
820 | struct mwifiex_rate_cfg *rate_cfg) | 818 | struct mwifiex_rate_cfg *rate_cfg) |
821 | { | 819 | { |
822 | int status = 0; | 820 | int status; |
823 | 821 | ||
824 | if (!rate_cfg) | 822 | if (!rate_cfg) |
825 | return -1; | 823 | return -1; |
@@ -841,7 +839,7 @@ static int mwifiex_rate_ioctl_cfg(struct mwifiex_private *priv, | |||
841 | int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, | 839 | int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, |
842 | struct mwifiex_rate_cfg *rate) | 840 | struct mwifiex_rate_cfg *rate) |
843 | { | 841 | { |
844 | int ret = 0; | 842 | int ret; |
845 | 843 | ||
846 | memset(rate, 0, sizeof(struct mwifiex_rate_cfg)); | 844 | memset(rate, 0, sizeof(struct mwifiex_rate_cfg)); |
847 | rate->action = HostCmd_ACT_GEN_GET; | 845 | rate->action = HostCmd_ACT_GEN_GET; |
@@ -875,11 +873,11 @@ int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, | |||
875 | int mwifiex_set_tx_power(struct mwifiex_private *priv, | 873 | int mwifiex_set_tx_power(struct mwifiex_private *priv, |
876 | struct mwifiex_power_cfg *power_cfg) | 874 | struct mwifiex_power_cfg *power_cfg) |
877 | { | 875 | { |
878 | int ret = 0; | 876 | int ret; |
879 | struct host_cmd_ds_txpwr_cfg *txp_cfg = NULL; | 877 | struct host_cmd_ds_txpwr_cfg *txp_cfg; |
880 | struct mwifiex_types_power_group *pg_tlv = NULL; | 878 | struct mwifiex_types_power_group *pg_tlv; |
881 | struct mwifiex_power_group *pg = NULL; | 879 | struct mwifiex_power_group *pg; |
882 | u8 *buf = NULL; | 880 | u8 *buf; |
883 | u16 dbm = 0; | 881 | u16 dbm = 0; |
884 | 882 | ||
885 | if (!power_cfg->is_power_auto) { | 883 | if (!power_cfg->is_power_auto) { |
@@ -897,7 +895,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, | |||
897 | if (!buf) { | 895 | if (!buf) { |
898 | dev_err(priv->adapter->dev, "%s: failed to alloc cmd buffer\n", | 896 | dev_err(priv->adapter->dev, "%s: failed to alloc cmd buffer\n", |
899 | __func__); | 897 | __func__); |
900 | return -1; | 898 | return -ENOMEM; |
901 | } | 899 | } |
902 | 900 | ||
903 | txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf; | 901 | txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf; |
@@ -960,7 +958,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, | |||
960 | */ | 958 | */ |
961 | int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode) | 959 | int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode) |
962 | { | 960 | { |
963 | int ret = 0; | 961 | int ret; |
964 | struct mwifiex_adapter *adapter = priv->adapter; | 962 | struct mwifiex_adapter *adapter = priv->adapter; |
965 | u16 sub_cmd; | 963 | u16 sub_cmd; |
966 | 964 | ||
@@ -1078,8 +1076,8 @@ static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private *priv, | |||
1078 | static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv, | 1076 | static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv, |
1079 | struct mwifiex_ds_encrypt_key *encrypt_key) | 1077 | struct mwifiex_ds_encrypt_key *encrypt_key) |
1080 | { | 1078 | { |
1081 | int ret = 0; | 1079 | int ret; |
1082 | struct mwifiex_wep_key *wep_key = NULL; | 1080 | struct mwifiex_wep_key *wep_key; |
1083 | int index; | 1081 | int index; |
1084 | 1082 | ||
1085 | if (priv->wep_key_curr_index >= NUM_WEP_KEYS) | 1083 | if (priv->wep_key_curr_index >= NUM_WEP_KEYS) |
@@ -1142,7 +1140,7 @@ static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv, | |||
1142 | static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv, | 1140 | static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv, |
1143 | struct mwifiex_ds_encrypt_key *encrypt_key) | 1141 | struct mwifiex_ds_encrypt_key *encrypt_key) |
1144 | { | 1142 | { |
1145 | int ret = 0; | 1143 | int ret; |
1146 | u8 remove_key = false; | 1144 | u8 remove_key = false; |
1147 | struct host_cmd_ds_802_11_key_material *ibss_key; | 1145 | struct host_cmd_ds_802_11_key_material *ibss_key; |
1148 | 1146 | ||
@@ -1209,7 +1207,7 @@ static int | |||
1209 | mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv, | 1207 | mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv, |
1210 | struct mwifiex_ds_encrypt_key *encrypt_key) | 1208 | struct mwifiex_ds_encrypt_key *encrypt_key) |
1211 | { | 1209 | { |
1212 | int status = 0; | 1210 | int status; |
1213 | 1211 | ||
1214 | if (encrypt_key->is_wapi_key) | 1212 | if (encrypt_key->is_wapi_key) |
1215 | status = mwifiex_sec_ioctl_set_wapi_key(priv, encrypt_key); | 1213 | status = mwifiex_sec_ioctl_set_wapi_key(priv, encrypt_key); |
@@ -1252,11 +1250,9 @@ mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, char *version, | |||
1252 | int mwifiex_get_signal_info(struct mwifiex_private *priv, | 1250 | int mwifiex_get_signal_info(struct mwifiex_private *priv, |
1253 | struct mwifiex_ds_get_signal *signal) | 1251 | struct mwifiex_ds_get_signal *signal) |
1254 | { | 1252 | { |
1255 | struct mwifiex_ds_get_signal info; | 1253 | int status; |
1256 | int status = 0; | ||
1257 | 1254 | ||
1258 | memset(&info, 0, sizeof(struct mwifiex_ds_get_signal)); | 1255 | signal->selector = ALL_RSSI_INFO_MASK; |
1259 | info.selector = ALL_RSSI_INFO_MASK; | ||
1260 | 1256 | ||
1261 | /* Signal info can be obtained only if connected */ | 1257 | /* Signal info can be obtained only if connected */ |
1262 | if (!priv->media_connected) { | 1258 | if (!priv->media_connected) { |
@@ -1269,13 +1265,10 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv, | |||
1269 | HostCmd_ACT_GEN_GET, 0, signal); | 1265 | HostCmd_ACT_GEN_GET, 0, signal); |
1270 | 1266 | ||
1271 | if (!status) { | 1267 | if (!status) { |
1272 | if (signal) | 1268 | if (signal->selector & BCN_RSSI_AVG_MASK) |
1273 | memcpy(signal, &info, | 1269 | priv->w_stats.qual.level = signal->bcn_rssi_avg; |
1274 | sizeof(struct mwifiex_ds_get_signal)); | 1270 | if (signal->selector & BCN_NF_AVG_MASK) |
1275 | if (info.selector & BCN_RSSI_AVG_MASK) | 1271 | priv->w_stats.qual.noise = signal->bcn_nf_avg; |
1276 | priv->w_stats.qual.level = info.bcn_rssi_avg; | ||
1277 | if (info.selector & BCN_NF_AVG_MASK) | ||
1278 | priv->w_stats.qual.noise = info.bcn_nf_avg; | ||
1279 | } | 1272 | } |
1280 | 1273 | ||
1281 | return status; | 1274 | return status; |
@@ -1334,20 +1327,15 @@ int | |||
1334 | mwifiex_get_stats_info(struct mwifiex_private *priv, | 1327 | mwifiex_get_stats_info(struct mwifiex_private *priv, |
1335 | struct mwifiex_ds_get_stats *log) | 1328 | struct mwifiex_ds_get_stats *log) |
1336 | { | 1329 | { |
1337 | int ret = 0; | 1330 | int ret; |
1338 | struct mwifiex_ds_get_stats get_log; | ||
1339 | 1331 | ||
1340 | memset(&get_log, 0, sizeof(struct mwifiex_ds_get_stats)); | ||
1341 | ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, | 1332 | ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, |
1342 | HostCmd_ACT_GEN_GET, 0, &get_log); | 1333 | HostCmd_ACT_GEN_GET, 0, log); |
1343 | 1334 | ||
1344 | if (!ret) { | 1335 | if (!ret) { |
1345 | if (log) | 1336 | priv->w_stats.discard.fragment = log->fcs_error; |
1346 | memcpy(log, &get_log, sizeof(struct | 1337 | priv->w_stats.discard.retries = log->retry; |
1347 | mwifiex_ds_get_stats)); | 1338 | priv->w_stats.discard.misc = log->ack_failure; |
1348 | priv->w_stats.discard.fragment = get_log.fcs_error; | ||
1349 | priv->w_stats.discard.retries = get_log.retry; | ||
1350 | priv->w_stats.discard.misc = get_log.ack_failure; | ||
1351 | } | 1339 | } |
1352 | 1340 | ||
1353 | return ret; | 1341 | return ret; |
@@ -1425,7 +1413,7 @@ int | |||
1425 | mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type, | 1413 | mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type, |
1426 | u32 reg_offset, u32 *value) | 1414 | u32 reg_offset, u32 *value) |
1427 | { | 1415 | { |
1428 | int ret = 0; | 1416 | int ret; |
1429 | struct mwifiex_ds_reg_rw reg_rw; | 1417 | struct mwifiex_ds_reg_rw reg_rw; |
1430 | 1418 | ||
1431 | reg_rw.type = cpu_to_le32(reg_type); | 1419 | reg_rw.type = cpu_to_le32(reg_type); |
@@ -1451,7 +1439,7 @@ int | |||
1451 | mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes, | 1439 | mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes, |
1452 | u8 *value) | 1440 | u8 *value) |
1453 | { | 1441 | { |
1454 | int ret = 0; | 1442 | int ret; |
1455 | struct mwifiex_ds_read_eeprom rd_eeprom; | 1443 | struct mwifiex_ds_read_eeprom rd_eeprom; |
1456 | 1444 | ||
1457 | rd_eeprom.offset = cpu_to_le16((u16) offset); | 1445 | rd_eeprom.offset = cpu_to_le16((u16) offset); |
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c index 8282679e64fd..1fdddece7479 100644 --- a/drivers/net/wireless/mwifiex/sta_rx.c +++ b/drivers/net/wireless/mwifiex/sta_rx.c | |||
@@ -41,7 +41,7 @@ | |||
41 | int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, | 41 | int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, |
42 | struct sk_buff *skb) | 42 | struct sk_buff *skb) |
43 | { | 43 | { |
44 | int ret = 0; | 44 | int ret; |
45 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); | 45 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); |
46 | struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; | 46 | struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; |
47 | struct rx_packet_hdr *rx_pkt_hdr; | 47 | struct rx_packet_hdr *rx_pkt_hdr; |
@@ -123,7 +123,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, | |||
123 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); | 123 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); |
124 | struct rx_packet_hdr *rx_pkt_hdr; | 124 | struct rx_packet_hdr *rx_pkt_hdr; |
125 | u8 ta[ETH_ALEN]; | 125 | u8 ta[ETH_ALEN]; |
126 | u16 rx_pkt_type = 0; | 126 | u16 rx_pkt_type; |
127 | struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; | 127 | struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; |
128 | 128 | ||
129 | local_rx_pd = (struct rxpd *) (skb->data); | 129 | local_rx_pd = (struct rxpd *) (skb->data); |
@@ -141,10 +141,28 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, | |||
141 | dev_kfree_skb_any(skb); | 141 | dev_kfree_skb_any(skb); |
142 | return ret; | 142 | return ret; |
143 | } | 143 | } |
144 | |||
144 | if (local_rx_pd->rx_pkt_type == PKT_TYPE_AMSDU) { | 145 | if (local_rx_pd->rx_pkt_type == PKT_TYPE_AMSDU) { |
145 | mwifiex_11n_deaggregate_pkt(priv, skb); | 146 | struct sk_buff_head list; |
146 | return ret; | 147 | struct sk_buff *rx_skb; |
148 | |||
149 | __skb_queue_head_init(&list); | ||
150 | |||
151 | skb_pull(skb, local_rx_pd->rx_pkt_offset); | ||
152 | skb_trim(skb, local_rx_pd->rx_pkt_length); | ||
153 | |||
154 | ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, | ||
155 | priv->wdev->iftype, 0, false); | ||
156 | |||
157 | while (!skb_queue_empty(&list)) { | ||
158 | rx_skb = __skb_dequeue(&list); | ||
159 | ret = mwifiex_recv_packet(adapter, rx_skb); | ||
160 | if (ret == -1) | ||
161 | dev_err(adapter->dev, "Rx of A-MSDU failed"); | ||
162 | } | ||
163 | return 0; | ||
147 | } | 164 | } |
165 | |||
148 | /* | 166 | /* |
149 | * If the packet is not an unicast packet then send the packet | 167 | * If the packet is not an unicast packet then send the packet |
150 | * directly to os. Don't pass thru rx reordering | 168 | * directly to os. Don't pass thru rx reordering |
diff --git a/drivers/net/wireless/mwifiex/sta_tx.c b/drivers/net/wireless/mwifiex/sta_tx.c index 5d37ef160121..fa6221bc9104 100644 --- a/drivers/net/wireless/mwifiex/sta_tx.c +++ b/drivers/net/wireless/mwifiex/sta_tx.c | |||
@@ -113,8 +113,8 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags) | |||
113 | /* sizeof(struct txpd) + Interface specific header */ | 113 | /* sizeof(struct txpd) + Interface specific header */ |
114 | #define NULL_PACKET_HDR 64 | 114 | #define NULL_PACKET_HDR 64 |
115 | u32 data_len = NULL_PACKET_HDR; | 115 | u32 data_len = NULL_PACKET_HDR; |
116 | struct sk_buff *skb = NULL; | 116 | struct sk_buff *skb; |
117 | int ret = 0; | 117 | int ret; |
118 | struct mwifiex_txinfo *tx_info = NULL; | 118 | struct mwifiex_txinfo *tx_info = NULL; |
119 | 119 | ||
120 | if (adapter->surprise_removed) | 120 | if (adapter->surprise_removed) |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index ce772e078db8..210120889dfe 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -68,7 +68,7 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
68 | { | 68 | { |
69 | int ret = -1; | 69 | int ret = -1; |
70 | struct mwifiex_adapter *adapter = priv->adapter; | 70 | struct mwifiex_adapter *adapter = priv->adapter; |
71 | u8 *head_ptr = NULL; | 71 | u8 *head_ptr; |
72 | struct txpd *local_tx_pd = NULL; | 72 | struct txpd *local_tx_pd = NULL; |
73 | 73 | ||
74 | head_ptr = (u8 *) mwifiex_process_sta_txpd(priv, skb); | 74 | head_ptr = (u8 *) mwifiex_process_sta_txpd(priv, skb); |
@@ -121,8 +121,8 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
121 | int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, | 121 | int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, |
122 | struct sk_buff *skb, int status) | 122 | struct sk_buff *skb, int status) |
123 | { | 123 | { |
124 | struct mwifiex_private *priv = NULL, *tpriv = NULL; | 124 | struct mwifiex_private *priv, *tpriv; |
125 | struct mwifiex_txinfo *tx_info = NULL; | 125 | struct mwifiex_txinfo *tx_info; |
126 | int i; | 126 | int i; |
127 | 127 | ||
128 | if (!skb) | 128 | if (!skb) |
@@ -169,9 +169,9 @@ int mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter, | |||
169 | struct sk_buff *skb, int status) | 169 | struct sk_buff *skb, int status) |
170 | { | 170 | { |
171 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); | 171 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); |
172 | struct mwifiex_rxinfo *rx_info_parent = NULL; | 172 | struct mwifiex_rxinfo *rx_info_parent; |
173 | struct mwifiex_private *priv; | 173 | struct mwifiex_private *priv; |
174 | struct sk_buff *skb_parent = NULL; | 174 | struct sk_buff *skb_parent; |
175 | unsigned long flags; | 175 | unsigned long flags; |
176 | 176 | ||
177 | priv = adapter->priv[rx_info->bss_index]; | 177 | priv = adapter->priv[rx_info->bss_index]; |
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c index 7ab4fb279f8a..d41291529bc0 100644 --- a/drivers/net/wireless/mwifiex/util.c +++ b/drivers/net/wireless/mwifiex/util.c | |||
@@ -152,8 +152,8 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv, | |||
152 | */ | 152 | */ |
153 | int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) | 153 | int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) |
154 | { | 154 | { |
155 | struct mwifiex_rxinfo *rx_info = NULL; | 155 | struct mwifiex_rxinfo *rx_info; |
156 | struct mwifiex_private *priv = NULL; | 156 | struct mwifiex_private *priv; |
157 | 157 | ||
158 | if (!skb) | 158 | if (!skb) |
159 | return -1; | 159 | return -1; |
@@ -177,31 +177,6 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * Receive packet completion callback handler. | ||
181 | * | ||
182 | * This function updates the statistics and frees the buffer SKB. | ||
183 | */ | ||
184 | int mwifiex_recv_complete(struct mwifiex_adapter *adapter, | ||
185 | struct sk_buff *skb, int status) | ||
186 | { | ||
187 | struct mwifiex_private *priv = NULL; | ||
188 | struct mwifiex_rxinfo *rx_info = NULL; | ||
189 | |||
190 | if (!skb) | ||
191 | return 0; | ||
192 | |||
193 | rx_info = MWIFIEX_SKB_RXCB(skb); | ||
194 | priv = mwifiex_bss_index_to_priv(adapter, rx_info->bss_index); | ||
195 | |||
196 | if (priv && (status == -1)) | ||
197 | priv->stats.rx_dropped++; | ||
198 | |||
199 | dev_kfree_skb_any(skb); | ||
200 | |||
201 | return 0; | ||
202 | } | ||
203 | |||
204 | /* | ||
205 | * IOCTL completion callback handler. | 180 | * IOCTL completion callback handler. |
206 | * | 181 | * |
207 | * This function is called when a pending IOCTL is completed. | 182 | * This function is called when a pending IOCTL is completed. |
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index c009370f309e..faa09e32902e 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -799,7 +799,7 @@ u8 | |||
799 | mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, | 799 | mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, |
800 | const struct sk_buff *skb) | 800 | const struct sk_buff *skb) |
801 | { | 801 | { |
802 | u8 ret_val = 0; | 802 | u8 ret_val; |
803 | struct timeval out_tstamp, in_tstamp; | 803 | struct timeval out_tstamp, in_tstamp; |
804 | u32 queue_delay; | 804 | u32 queue_delay; |
805 | 805 | ||