diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2012-03-13 22:22:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-14 14:39:39 -0400 |
commit | 500f747c73ec9bff7692db0031a3fb726166f4d5 (patch) | |
tree | f33f236d0612ae0df024202b094190107d798a13 | |
parent | 9c05fd72042bafdf86c6273e3b63bb8571f66177 (diff) |
mwifiex: fix checkpatch --strict warnings/errors Part 8
For files sta_event.c and sta_ioctl.c
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_event.c | 41 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 102 |
2 files changed, 73 insertions, 70 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index b9b59db60454..cc531b536a56 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -93,11 +93,11 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv) | |||
93 | */ | 93 | */ |
94 | 94 | ||
95 | dev_dbg(adapter->dev, "info: previous SSID=%s, SSID len=%u\n", | 95 | dev_dbg(adapter->dev, "info: previous SSID=%s, SSID len=%u\n", |
96 | priv->prev_ssid.ssid, priv->prev_ssid.ssid_len); | 96 | priv->prev_ssid.ssid, priv->prev_ssid.ssid_len); |
97 | 97 | ||
98 | dev_dbg(adapter->dev, "info: current SSID=%s, SSID len=%u\n", | 98 | dev_dbg(adapter->dev, "info: current SSID=%s, SSID len=%u\n", |
99 | priv->curr_bss_params.bss_descriptor.ssid.ssid, | 99 | priv->curr_bss_params.bss_descriptor.ssid.ssid, |
100 | priv->curr_bss_params.bss_descriptor.ssid.ssid_len); | 100 | priv->curr_bss_params.bss_descriptor.ssid.ssid_len); |
101 | 101 | ||
102 | memcpy(&priv->prev_ssid, | 102 | memcpy(&priv->prev_ssid, |
103 | &priv->curr_bss_params.bss_descriptor.ssid, | 103 | &priv->curr_bss_params.bss_descriptor.ssid, |
@@ -115,9 +115,9 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv) | |||
115 | if (adapter->num_cmd_timeout && adapter->curr_cmd) | 115 | if (adapter->num_cmd_timeout && adapter->curr_cmd) |
116 | return; | 116 | return; |
117 | priv->media_connected = false; | 117 | priv->media_connected = false; |
118 | dev_dbg(adapter->dev, "info: successfully disconnected from" | 118 | dev_dbg(adapter->dev, |
119 | " %pM: reason code %d\n", priv->cfg_bssid, | 119 | "info: successfully disconnected from %pM: reason code %d\n", |
120 | WLAN_REASON_DEAUTH_LEAVING); | 120 | priv->cfg_bssid, WLAN_REASON_DEAUTH_LEAVING); |
121 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { | 121 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { |
122 | cfg80211_disconnected(priv->netdev, WLAN_REASON_DEAUTH_LEAVING, | 122 | cfg80211_disconnected(priv->netdev, WLAN_REASON_DEAUTH_LEAVING, |
123 | NULL, 0, GFP_KERNEL); | 123 | NULL, 0, GFP_KERNEL); |
@@ -192,8 +192,8 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
192 | 192 | ||
193 | switch (eventcause) { | 193 | switch (eventcause) { |
194 | case EVENT_DUMMY_HOST_WAKEUP_SIGNAL: | 194 | case EVENT_DUMMY_HOST_WAKEUP_SIGNAL: |
195 | dev_err(adapter->dev, "invalid EVENT: DUMMY_HOST_WAKEUP_SIGNAL," | 195 | dev_err(adapter->dev, |
196 | " ignoring it\n"); | 196 | "invalid EVENT: DUMMY_HOST_WAKEUP_SIGNAL, ignore it\n"); |
197 | break; | 197 | break; |
198 | case EVENT_LINK_SENSED: | 198 | case EVENT_LINK_SENSED: |
199 | dev_dbg(adapter->dev, "event: LINK_SENSED\n"); | 199 | dev_dbg(adapter->dev, "event: LINK_SENSED\n"); |
@@ -235,8 +235,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
235 | case EVENT_PS_AWAKE: | 235 | case EVENT_PS_AWAKE: |
236 | dev_dbg(adapter->dev, "info: EVENT: AWAKE\n"); | 236 | dev_dbg(adapter->dev, "info: EVENT: AWAKE\n"); |
237 | if (!adapter->pps_uapsd_mode && | 237 | if (!adapter->pps_uapsd_mode && |
238 | priv->media_connected && | 238 | priv->media_connected && adapter->sleep_period.period) { |
239 | adapter->sleep_period.period) { | ||
240 | adapter->pps_uapsd_mode = true; | 239 | adapter->pps_uapsd_mode = true; |
241 | dev_dbg(adapter->dev, | 240 | dev_dbg(adapter->dev, |
242 | "event: PPS/UAPSD mode activated\n"); | 241 | "event: PPS/UAPSD mode activated\n"); |
@@ -244,15 +243,19 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
244 | adapter->tx_lock_flag = false; | 243 | adapter->tx_lock_flag = false; |
245 | if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { | 244 | if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { |
246 | if (mwifiex_check_last_packet_indication(priv)) { | 245 | if (mwifiex_check_last_packet_indication(priv)) { |
247 | if (!adapter->data_sent) { | 246 | if (adapter->data_sent) { |
248 | if (!mwifiex_send_null_packet(priv, | 247 | adapter->ps_state = PS_STATE_AWAKE; |
249 | MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET | 248 | adapter->pm_wakeup_card_req = false; |
250 | | | 249 | adapter->pm_wakeup_fw_try = false; |
251 | MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET)) | 250 | break; |
251 | } | ||
252 | if (!mwifiex_send_null_packet | ||
253 | (priv, | ||
254 | MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET | | ||
255 | MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET)) | ||
252 | adapter->ps_state = | 256 | adapter->ps_state = |
253 | PS_STATE_SLEEP; | 257 | PS_STATE_SLEEP; |
254 | return 0; | 258 | return 0; |
255 | } | ||
256 | } | 259 | } |
257 | } | 260 | } |
258 | adapter->ps_state = PS_STATE_AWAKE; | 261 | adapter->ps_state = PS_STATE_AWAKE; |
@@ -371,12 +374,12 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
371 | break; | 374 | break; |
372 | case EVENT_AMSDU_AGGR_CTRL: | 375 | case EVENT_AMSDU_AGGR_CTRL: |
373 | dev_dbg(adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", | 376 | dev_dbg(adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", |
374 | *(u16 *) adapter->event_body); | 377 | *(u16 *) adapter->event_body); |
375 | adapter->tx_buf_size = | 378 | adapter->tx_buf_size = |
376 | min(adapter->curr_tx_buf_size, | 379 | min(adapter->curr_tx_buf_size, |
377 | le16_to_cpu(*(__le16 *) adapter->event_body)); | 380 | le16_to_cpu(*(__le16 *) adapter->event_body)); |
378 | dev_dbg(adapter->dev, "event: tx_buf_size %d\n", | 381 | dev_dbg(adapter->dev, "event: tx_buf_size %d\n", |
379 | adapter->tx_buf_size); | 382 | adapter->tx_buf_size); |
380 | break; | 383 | break; |
381 | 384 | ||
382 | case EVENT_WEP_ICV_ERR: | 385 | case EVENT_WEP_ICV_ERR: |
@@ -392,7 +395,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
392 | break; | 395 | break; |
393 | default: | 396 | default: |
394 | dev_dbg(adapter->dev, "event: unknown event id: %#x\n", | 397 | dev_dbg(adapter->dev, "event: unknown event id: %#x\n", |
395 | eventcause); | 398 | eventcause); |
396 | break; | 399 | break; |
397 | } | 400 | } |
398 | 401 | ||
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index a3d79f4a6192..64e0b1010850 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -71,7 +71,7 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | |||
71 | 71 | ||
72 | /* Wait for completion */ | 72 | /* Wait for completion */ |
73 | wait_event_interruptible(adapter->cmd_wait_q.wait, | 73 | wait_event_interruptible(adapter->cmd_wait_q.wait, |
74 | *(cmd_queued->condition)); | 74 | *(cmd_queued->condition)); |
75 | if (!*(cmd_queued->condition)) | 75 | if (!*(cmd_queued->condition)) |
76 | cancel_flag = true; | 76 | cancel_flag = true; |
77 | 77 | ||
@@ -266,9 +266,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
266 | /* Adhoc mode */ | 266 | /* Adhoc mode */ |
267 | /* If the requested SSID matches current SSID, return */ | 267 | /* If the requested SSID matches current SSID, return */ |
268 | if (bss_desc && bss_desc->ssid.ssid_len && | 268 | if (bss_desc && bss_desc->ssid.ssid_len && |
269 | (!mwifiex_ssid_cmp | 269 | (!mwifiex_ssid_cmp(&priv->curr_bss_params.bss_descriptor. |
270 | (&priv->curr_bss_params.bss_descriptor.ssid, | 270 | ssid, &bss_desc->ssid))) { |
271 | &bss_desc->ssid))) { | ||
272 | kfree(bss_desc); | 271 | kfree(bss_desc); |
273 | kfree(beacon_ie); | 272 | kfree(beacon_ie); |
274 | return 0; | 273 | return 0; |
@@ -350,9 +349,8 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, | |||
350 | adapter->hs_cfg.gpio = (u8)hs_cfg->gpio; | 349 | adapter->hs_cfg.gpio = (u8)hs_cfg->gpio; |
351 | if (hs_cfg->gap) | 350 | if (hs_cfg->gap) |
352 | adapter->hs_cfg.gap = (u8)hs_cfg->gap; | 351 | adapter->hs_cfg.gap = (u8)hs_cfg->gap; |
353 | } else if (adapter->hs_cfg.conditions == | 352 | } else if (adapter->hs_cfg.conditions |
354 | cpu_to_le32( | 353 | == cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) { |
355 | HOST_SLEEP_CFG_CANCEL)) { | ||
356 | /* Return failure if no parameters for HS | 354 | /* Return failure if no parameters for HS |
357 | enable */ | 355 | enable */ |
358 | status = -1; | 356 | status = -1; |
@@ -374,7 +372,7 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, | |||
374 | cpu_to_le32(prev_cond); | 372 | cpu_to_le32(prev_cond); |
375 | } else { | 373 | } else { |
376 | adapter->hs_cfg.conditions = | 374 | adapter->hs_cfg.conditions = |
377 | cpu_to_le32(hs_cfg->conditions); | 375 | cpu_to_le32(hs_cfg->conditions); |
378 | adapter->hs_cfg.gpio = (u8)hs_cfg->gpio; | 376 | adapter->hs_cfg.gpio = (u8)hs_cfg->gpio; |
379 | adapter->hs_cfg.gap = (u8)hs_cfg->gap; | 377 | adapter->hs_cfg.gap = (u8)hs_cfg->gap; |
380 | } | 378 | } |
@@ -431,7 +429,7 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter) | |||
431 | hscfg.is_invoke_hostcmd = true; | 429 | hscfg.is_invoke_hostcmd = true; |
432 | 430 | ||
433 | if (mwifiex_set_hs_params(mwifiex_get_priv(adapter, | 431 | if (mwifiex_set_hs_params(mwifiex_get_priv(adapter, |
434 | MWIFIEX_BSS_ROLE_STA), | 432 | MWIFIEX_BSS_ROLE_STA), |
435 | HostCmd_ACT_GEN_SET, MWIFIEX_SYNC_CMD, | 433 | HostCmd_ACT_GEN_SET, MWIFIEX_SYNC_CMD, |
436 | &hscfg)) { | 434 | &hscfg)) { |
437 | dev_err(adapter->dev, "IOCTL request HS enable failed\n"); | 435 | dev_err(adapter->dev, "IOCTL request HS enable failed\n"); |
@@ -439,7 +437,7 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter) | |||
439 | } | 437 | } |
440 | 438 | ||
441 | wait_event_interruptible(adapter->hs_activate_wait_q, | 439 | wait_event_interruptible(adapter->hs_activate_wait_q, |
442 | adapter->hs_activate_wait_q_woken); | 440 | adapter->hs_activate_wait_q_woken); |
443 | 441 | ||
444 | return true; | 442 | return true; |
445 | } | 443 | } |
@@ -536,7 +534,7 @@ int mwifiex_bss_set_channel(struct mwifiex_private *priv, | |||
536 | if (cfp) { | 534 | if (cfp) { |
537 | if (adapter->adhoc_11n_enabled) | 535 | if (adapter->adhoc_11n_enabled) |
538 | adapter->adhoc_start_band = BAND_A | 536 | adapter->adhoc_start_band = BAND_A |
539 | | BAND_AN; | 537 | | BAND_AN; |
540 | else | 538 | else |
541 | adapter->adhoc_start_band = BAND_A; | 539 | adapter->adhoc_start_band = BAND_A; |
542 | } | 540 | } |
@@ -549,7 +547,7 @@ int mwifiex_bss_set_channel(struct mwifiex_private *priv, | |||
549 | if (cfp) { | 547 | if (cfp) { |
550 | if (adapter->adhoc_11n_enabled) | 548 | if (adapter->adhoc_11n_enabled) |
551 | adapter->adhoc_start_band = BAND_A | 549 | adapter->adhoc_start_band = BAND_A |
552 | | BAND_AN; | 550 | | BAND_AN; |
553 | else | 551 | else |
554 | adapter->adhoc_start_band = BAND_A; | 552 | adapter->adhoc_start_band = BAND_A; |
555 | } | 553 | } |
@@ -585,7 +583,7 @@ static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv, | |||
585 | } | 583 | } |
586 | 584 | ||
587 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_RF_CHANNEL, | 585 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_RF_CHANNEL, |
588 | action, 0, channel); | 586 | action, 0, channel); |
589 | } | 587 | } |
590 | 588 | ||
591 | /* | 589 | /* |
@@ -631,7 +629,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel) | |||
631 | goto done; | 629 | goto done; |
632 | } | 630 | } |
633 | dev_dbg(priv->adapter->dev, "cmd: updating channel from %d to %d\n", | 631 | dev_dbg(priv->adapter->dev, "cmd: updating channel from %d to %d\n", |
634 | curr_chan, channel); | 632 | curr_chan, channel); |
635 | 633 | ||
636 | if (!bss_info.media_connected) { | 634 | if (!bss_info.media_connected) { |
637 | ret = 0; | 635 | ret = 0; |
@@ -653,7 +651,8 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel) | |||
653 | 651 | ||
654 | band = mwifiex_band_to_radio_type(priv->curr_bss_params.band); | 652 | band = mwifiex_band_to_radio_type(priv->curr_bss_params.band); |
655 | chan = __ieee80211_get_channel(priv->wdev->wiphy, | 653 | chan = __ieee80211_get_channel(priv->wdev->wiphy, |
656 | ieee80211_channel_to_frequency(channel, band)); | 654 | ieee80211_channel_to_frequency(channel, |
655 | band)); | ||
657 | 656 | ||
658 | /* Find the BSS we want using available scan results */ | 657 | /* Find the BSS we want using available scan results */ |
659 | bss = cfg80211_get_bss(priv->wdev->wiphy, chan, bss_info.bssid, | 658 | bss = cfg80211_get_bss(priv->wdev->wiphy, chan, bss_info.bssid, |
@@ -661,7 +660,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel) | |||
661 | WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); | 660 | WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); |
662 | if (!bss) | 661 | if (!bss) |
663 | wiphy_warn(priv->wdev->wiphy, "assoc: bss %pM not in scan results\n", | 662 | wiphy_warn(priv->wdev->wiphy, "assoc: bss %pM not in scan results\n", |
664 | bss_info.bssid); | 663 | bss_info.bssid); |
665 | 664 | ||
666 | ret = mwifiex_bss_start(priv, bss, &bss_info.ssid); | 665 | ret = mwifiex_bss_start(priv, bss, &bss_info.ssid); |
667 | done: | 666 | done: |
@@ -790,7 +789,9 @@ int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, | |||
790 | if (!ret) { | 789 | if (!ret) { |
791 | if (rate->is_rate_auto) | 790 | if (rate->is_rate_auto) |
792 | rate->rate = mwifiex_index_to_data_rate(priv, | 791 | rate->rate = mwifiex_index_to_data_rate(priv, |
793 | priv->tx_rate, priv->tx_htinfo); | 792 | priv->tx_rate, |
793 | priv->tx_htinfo | ||
794 | ); | ||
794 | else | 795 | else |
795 | rate->rate = priv->data_rate; | 796 | rate->rate = priv->data_rate; |
796 | } else { | 797 | } else { |
@@ -827,16 +828,16 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, | |||
827 | if ((dbm < priv->min_tx_power_level) || | 828 | if ((dbm < priv->min_tx_power_level) || |
828 | (dbm > priv->max_tx_power_level)) { | 829 | (dbm > priv->max_tx_power_level)) { |
829 | dev_err(priv->adapter->dev, "txpower value %d dBm" | 830 | dev_err(priv->adapter->dev, "txpower value %d dBm" |
830 | " is out of range (%d dBm-%d dBm)\n", | 831 | " is out of range (%d dBm-%d dBm)\n", |
831 | dbm, priv->min_tx_power_level, | 832 | dbm, priv->min_tx_power_level, |
832 | priv->max_tx_power_level); | 833 | priv->max_tx_power_level); |
833 | return -1; | 834 | return -1; |
834 | } | 835 | } |
835 | } | 836 | } |
836 | buf = kzalloc(MWIFIEX_SIZE_OF_CMD_BUFFER, GFP_KERNEL); | 837 | buf = kzalloc(MWIFIEX_SIZE_OF_CMD_BUFFER, GFP_KERNEL); |
837 | if (!buf) { | 838 | if (!buf) { |
838 | dev_err(priv->adapter->dev, "%s: failed to alloc cmd buffer\n", | 839 | dev_err(priv->adapter->dev, "%s: failed to alloc cmd buffer\n", |
839 | __func__); | 840 | __func__); |
840 | return -ENOMEM; | 841 | return -ENOMEM; |
841 | } | 842 | } |
842 | 843 | ||
@@ -844,13 +845,13 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, | |||
844 | txp_cfg->action = cpu_to_le16(HostCmd_ACT_GEN_SET); | 845 | txp_cfg->action = cpu_to_le16(HostCmd_ACT_GEN_SET); |
845 | if (!power_cfg->is_power_auto) { | 846 | if (!power_cfg->is_power_auto) { |
846 | txp_cfg->mode = cpu_to_le32(1); | 847 | txp_cfg->mode = cpu_to_le32(1); |
847 | pg_tlv = (struct mwifiex_types_power_group *) (buf + | 848 | pg_tlv = (struct mwifiex_types_power_group *) |
848 | sizeof(struct host_cmd_ds_txpwr_cfg)); | 849 | (buf + sizeof(struct host_cmd_ds_txpwr_cfg)); |
849 | pg_tlv->type = TLV_TYPE_POWER_GROUP; | 850 | pg_tlv->type = TLV_TYPE_POWER_GROUP; |
850 | pg_tlv->length = 4 * sizeof(struct mwifiex_power_group); | 851 | pg_tlv->length = 4 * sizeof(struct mwifiex_power_group); |
851 | pg = (struct mwifiex_power_group *) (buf + | 852 | pg = (struct mwifiex_power_group *) |
852 | sizeof(struct host_cmd_ds_txpwr_cfg) + | 853 | (buf + sizeof(struct host_cmd_ds_txpwr_cfg) |
853 | sizeof(struct mwifiex_types_power_group)); | 854 | + sizeof(struct mwifiex_types_power_group)); |
854 | /* Power group for modulation class HR/DSSS */ | 855 | /* Power group for modulation class HR/DSSS */ |
855 | pg->first_rate_code = 0x00; | 856 | pg->first_rate_code = 0x00; |
856 | pg->last_rate_code = 0x03; | 857 | pg->last_rate_code = 0x03; |
@@ -913,8 +914,8 @@ int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode) | |||
913 | sub_cmd, BITMAP_STA_PS, NULL); | 914 | sub_cmd, BITMAP_STA_PS, NULL); |
914 | if ((!ret) && (sub_cmd == DIS_AUTO_PS)) | 915 | if ((!ret) && (sub_cmd == DIS_AUTO_PS)) |
915 | ret = mwifiex_send_cmd_async(priv, | 916 | ret = mwifiex_send_cmd_async(priv, |
916 | HostCmd_CMD_802_11_PS_MODE_ENH, GET_PS, | 917 | HostCmd_CMD_802_11_PS_MODE_ENH, |
917 | 0, NULL); | 918 | GET_PS, 0, NULL); |
918 | 919 | ||
919 | return ret; | 920 | return ret; |
920 | } | 921 | } |
@@ -938,7 +939,7 @@ static int mwifiex_set_wpa_ie_helper(struct mwifiex_private *priv, | |||
938 | memcpy(priv->wpa_ie, ie_data_ptr, ie_len); | 939 | memcpy(priv->wpa_ie, ie_data_ptr, ie_len); |
939 | priv->wpa_ie_len = (u8) ie_len; | 940 | priv->wpa_ie_len = (u8) ie_len; |
940 | dev_dbg(priv->adapter->dev, "cmd: Set Wpa_ie_len=%d IE=%#x\n", | 941 | dev_dbg(priv->adapter->dev, "cmd: Set Wpa_ie_len=%d IE=%#x\n", |
941 | priv->wpa_ie_len, priv->wpa_ie[0]); | 942 | priv->wpa_ie_len, priv->wpa_ie[0]); |
942 | 943 | ||
943 | if (priv->wpa_ie[0] == WLAN_EID_WPA) { | 944 | if (priv->wpa_ie[0] == WLAN_EID_WPA) { |
944 | priv->sec_info.wpa_enabled = true; | 945 | priv->sec_info.wpa_enabled = true; |
@@ -979,7 +980,7 @@ static int mwifiex_set_wapi_ie(struct mwifiex_private *priv, | |||
979 | memcpy(priv->wapi_ie, ie_data_ptr, ie_len); | 980 | memcpy(priv->wapi_ie, ie_data_ptr, ie_len); |
980 | priv->wapi_ie_len = ie_len; | 981 | priv->wapi_ie_len = ie_len; |
981 | dev_dbg(priv->adapter->dev, "cmd: Set wapi_ie_len=%d IE=%#x\n", | 982 | dev_dbg(priv->adapter->dev, "cmd: Set wapi_ie_len=%d IE=%#x\n", |
982 | priv->wapi_ie_len, priv->wapi_ie[0]); | 983 | priv->wapi_ie_len, priv->wapi_ie[0]); |
983 | 984 | ||
984 | if (priv->wapi_ie[0] == WLAN_EID_BSS_AC_ACCESS_DELAY) | 985 | if (priv->wapi_ie[0] == WLAN_EID_BSS_AC_ACCESS_DELAY) |
985 | priv->sec_info.wapi_enabled = true; | 986 | priv->sec_info.wapi_enabled = true; |
@@ -1005,8 +1006,8 @@ static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private *priv, | |||
1005 | { | 1006 | { |
1006 | 1007 | ||
1007 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_KEY_MATERIAL, | 1008 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_KEY_MATERIAL, |
1008 | HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED, | 1009 | HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED, |
1009 | encrypt_key); | 1010 | encrypt_key); |
1010 | } | 1011 | } |
1011 | 1012 | ||
1012 | /* | 1013 | /* |
@@ -1100,9 +1101,9 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv, | |||
1100 | /* Send the key as PTK to firmware */ | 1101 | /* Send the key as PTK to firmware */ |
1101 | encrypt_key->key_index = MWIFIEX_KEY_INDEX_UNICAST; | 1102 | encrypt_key->key_index = MWIFIEX_KEY_INDEX_UNICAST; |
1102 | ret = mwifiex_send_cmd_async(priv, | 1103 | ret = mwifiex_send_cmd_async(priv, |
1103 | HostCmd_CMD_802_11_KEY_MATERIAL, | 1104 | HostCmd_CMD_802_11_KEY_MATERIAL, |
1104 | HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED, | 1105 | HostCmd_ACT_GEN_SET, |
1105 | encrypt_key); | 1106 | KEY_INFO_ENABLED, encrypt_key); |
1106 | if (ret) | 1107 | if (ret) |
1107 | return ret; | 1108 | return ret; |
1108 | 1109 | ||
@@ -1127,14 +1128,14 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv, | |||
1127 | 1128 | ||
1128 | if (remove_key) | 1129 | if (remove_key) |
1129 | ret = mwifiex_send_cmd_sync(priv, | 1130 | ret = mwifiex_send_cmd_sync(priv, |
1130 | HostCmd_CMD_802_11_KEY_MATERIAL, | 1131 | HostCmd_CMD_802_11_KEY_MATERIAL, |
1131 | HostCmd_ACT_GEN_SET, !(KEY_INFO_ENABLED), | 1132 | HostCmd_ACT_GEN_SET, |
1132 | encrypt_key); | 1133 | !KEY_INFO_ENABLED, encrypt_key); |
1133 | else | 1134 | else |
1134 | ret = mwifiex_send_cmd_sync(priv, | 1135 | ret = mwifiex_send_cmd_sync(priv, |
1135 | HostCmd_CMD_802_11_KEY_MATERIAL, | 1136 | HostCmd_CMD_802_11_KEY_MATERIAL, |
1136 | HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED, | 1137 | HostCmd_ACT_GEN_SET, |
1137 | encrypt_key); | 1138 | KEY_INFO_ENABLED, encrypt_key); |
1138 | 1139 | ||
1139 | return ret; | 1140 | return ret; |
1140 | } | 1141 | } |
@@ -1253,7 +1254,7 @@ mwifiex_get_ver_ext(struct mwifiex_private *priv) | |||
1253 | 1254 | ||
1254 | memset(&ver_ext, 0, sizeof(struct host_cmd_ds_version_ext)); | 1255 | memset(&ver_ext, 0, sizeof(struct host_cmd_ds_version_ext)); |
1255 | if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_VERSION_EXT, | 1256 | if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_VERSION_EXT, |
1256 | HostCmd_ACT_GEN_GET, 0, &ver_ext)) | 1257 | HostCmd_ACT_GEN_GET, 0, &ver_ext)) |
1257 | return -1; | 1258 | return -1; |
1258 | 1259 | ||
1259 | return 0; | 1260 | return 0; |
@@ -1270,7 +1271,7 @@ mwifiex_get_stats_info(struct mwifiex_private *priv, | |||
1270 | struct mwifiex_ds_get_stats *log) | 1271 | struct mwifiex_ds_get_stats *log) |
1271 | { | 1272 | { |
1272 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, | 1273 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, |
1273 | HostCmd_ACT_GEN_GET, 0, log); | 1274 | HostCmd_ACT_GEN_GET, 0, log); |
1274 | } | 1275 | } |
1275 | 1276 | ||
1276 | /* | 1277 | /* |
@@ -1410,9 +1411,9 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr, | |||
1410 | } | 1411 | } |
1411 | pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr; | 1412 | pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr; |
1412 | /* Test to see if it is a WPA IE, if not, then it is a gen IE */ | 1413 | /* Test to see if it is a WPA IE, if not, then it is a gen IE */ |
1413 | if (((pvendor_ie->element_id == WLAN_EID_WPA) | 1414 | if (((pvendor_ie->element_id == WLAN_EID_WPA) && |
1414 | && (!memcmp(pvendor_ie->oui, wpa_oui, sizeof(wpa_oui)))) | 1415 | (!memcmp(pvendor_ie->oui, wpa_oui, sizeof(wpa_oui)))) || |
1415 | || (pvendor_ie->element_id == WLAN_EID_RSN)) { | 1416 | (pvendor_ie->element_id == WLAN_EID_RSN)) { |
1416 | 1417 | ||
1417 | /* IE is a WPA/WPA2 IE so call set_wpa function */ | 1418 | /* IE is a WPA/WPA2 IE so call set_wpa function */ |
1418 | ret = mwifiex_set_wpa_ie_helper(priv, ie_data_ptr, ie_len); | 1419 | ret = mwifiex_set_wpa_ie_helper(priv, ie_data_ptr, ie_len); |
@@ -1435,9 +1436,8 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr, | |||
1435 | * wps session flag | 1436 | * wps session flag |
1436 | */ | 1437 | */ |
1437 | pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr; | 1438 | pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr; |
1438 | if ((pvendor_ie->element_id == WLAN_EID_VENDOR_SPECIFIC) | 1439 | if ((pvendor_ie->element_id == WLAN_EID_VENDOR_SPECIFIC) && |
1439 | && (!memcmp(pvendor_ie->oui, wps_oui, | 1440 | (!memcmp(pvendor_ie->oui, wps_oui, sizeof(wps_oui)))) { |
1440 | sizeof(wps_oui)))) { | ||
1441 | priv->wps.session_enable = true; | 1441 | priv->wps.session_enable = true; |
1442 | dev_dbg(priv->adapter->dev, | 1442 | dev_dbg(priv->adapter->dev, |
1443 | "info: WPS Session Enabled.\n"); | 1443 | "info: WPS Session Enabled.\n"); |
@@ -1446,7 +1446,7 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr, | |||
1446 | /* Append the passed data to the end of the | 1446 | /* Append the passed data to the end of the |
1447 | genIeBuffer */ | 1447 | genIeBuffer */ |
1448 | memcpy(priv->gen_ie_buf + priv->gen_ie_buf_len, ie_data_ptr, | 1448 | memcpy(priv->gen_ie_buf + priv->gen_ie_buf_len, ie_data_ptr, |
1449 | ie_len); | 1449 | ie_len); |
1450 | /* Increment the stored buffer length by the | 1450 | /* Increment the stored buffer length by the |
1451 | size passed */ | 1451 | size passed */ |
1452 | priv->gen_ie_buf_len += ie_len; | 1452 | priv->gen_ie_buf_len += ie_len; |
@@ -1490,7 +1490,7 @@ static int mwifiex_misc_ioctl_gen_ie(struct mwifiex_private *priv, | |||
1490 | return -1; | 1490 | return -1; |
1491 | } else { | 1491 | } else { |
1492 | memcpy(adapter->arp_filter, gen_ie->ie_data, | 1492 | memcpy(adapter->arp_filter, gen_ie->ie_data, |
1493 | gen_ie->len); | 1493 | gen_ie->len); |
1494 | adapter->arp_filter_size = gen_ie->len; | 1494 | adapter->arp_filter_size = gen_ie->len; |
1495 | } | 1495 | } |
1496 | break; | 1496 | break; |