diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-03-09 14:57:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-09 14:57:30 -0500 |
commit | 74dd1521d0b4f940cdd3ce7b9d988836bef589b8 (patch) | |
tree | 42f3d4ee1d4e6d60a91aaadab771f766a3024bc0 /drivers/net/wireless/mwifiex | |
parent | 2f2d76cc3e938389feee671b46252dde6880b3b7 (diff) | |
parent | 1745e4405b2c0da6db2ec4b6bc0ad930612d8295 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cmdevt.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/decl.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/fw.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/ioctl.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/join.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 19 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 47 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_event.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 20 |
10 files changed, 74 insertions, 79 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index a460fb0cc503..84508b065265 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -613,7 +613,6 @@ static struct ieee80211_rate mwifiex_rates[] = { | |||
613 | {.bitrate = 20, .hw_value = 4, }, | 613 | {.bitrate = 20, .hw_value = 4, }, |
614 | {.bitrate = 55, .hw_value = 11, }, | 614 | {.bitrate = 55, .hw_value = 11, }, |
615 | {.bitrate = 110, .hw_value = 22, }, | 615 | {.bitrate = 110, .hw_value = 22, }, |
616 | {.bitrate = 220, .hw_value = 44, }, | ||
617 | {.bitrate = 60, .hw_value = 12, }, | 616 | {.bitrate = 60, .hw_value = 12, }, |
618 | {.bitrate = 90, .hw_value = 18, }, | 617 | {.bitrate = 90, .hw_value = 18, }, |
619 | {.bitrate = 120, .hw_value = 24, }, | 618 | {.bitrate = 120, .hw_value = 24, }, |
@@ -622,7 +621,6 @@ static struct ieee80211_rate mwifiex_rates[] = { | |||
622 | {.bitrate = 360, .hw_value = 72, }, | 621 | {.bitrate = 360, .hw_value = 72, }, |
623 | {.bitrate = 480, .hw_value = 96, }, | 622 | {.bitrate = 480, .hw_value = 96, }, |
624 | {.bitrate = 540, .hw_value = 108, }, | 623 | {.bitrate = 540, .hw_value = 108, }, |
625 | {.bitrate = 720, .hw_value = 144, }, | ||
626 | }; | 624 | }; |
627 | 625 | ||
628 | /* Channel definitions to be advertised to cfg80211 */ | 626 | /* Channel definitions to be advertised to cfg80211 */ |
@@ -648,7 +646,7 @@ static struct ieee80211_supported_band mwifiex_band_2ghz = { | |||
648 | .channels = mwifiex_channels_2ghz, | 646 | .channels = mwifiex_channels_2ghz, |
649 | .n_channels = ARRAY_SIZE(mwifiex_channels_2ghz), | 647 | .n_channels = ARRAY_SIZE(mwifiex_channels_2ghz), |
650 | .bitrates = mwifiex_rates, | 648 | .bitrates = mwifiex_rates, |
651 | .n_bitrates = 14, | 649 | .n_bitrates = ARRAY_SIZE(mwifiex_rates), |
652 | }; | 650 | }; |
653 | 651 | ||
654 | static struct ieee80211_channel mwifiex_channels_5ghz[] = { | 652 | static struct ieee80211_channel mwifiex_channels_5ghz[] = { |
@@ -688,8 +686,8 @@ static struct ieee80211_channel mwifiex_channels_5ghz[] = { | |||
688 | static struct ieee80211_supported_band mwifiex_band_5ghz = { | 686 | static struct ieee80211_supported_band mwifiex_band_5ghz = { |
689 | .channels = mwifiex_channels_5ghz, | 687 | .channels = mwifiex_channels_5ghz, |
690 | .n_channels = ARRAY_SIZE(mwifiex_channels_5ghz), | 688 | .n_channels = ARRAY_SIZE(mwifiex_channels_5ghz), |
691 | .bitrates = mwifiex_rates - 4, | 689 | .bitrates = mwifiex_rates + 4, |
692 | .n_bitrates = ARRAY_SIZE(mwifiex_rates) + 4, | 690 | .n_bitrates = ARRAY_SIZE(mwifiex_rates) - 4, |
693 | }; | 691 | }; |
694 | 692 | ||
695 | 693 | ||
@@ -841,12 +839,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
841 | u8 *bssid, int mode, struct ieee80211_channel *channel, | 839 | u8 *bssid, int mode, struct ieee80211_channel *channel, |
842 | struct cfg80211_connect_params *sme, bool privacy) | 840 | struct cfg80211_connect_params *sme, bool privacy) |
843 | { | 841 | { |
844 | struct mwifiex_802_11_ssid req_ssid; | 842 | struct cfg80211_ssid req_ssid; |
845 | int ret, auth_type = 0; | 843 | int ret, auth_type = 0; |
846 | struct cfg80211_bss *bss = NULL; | 844 | struct cfg80211_bss *bss = NULL; |
847 | u8 is_scanning_required = 0; | 845 | u8 is_scanning_required = 0; |
848 | 846 | ||
849 | memset(&req_ssid, 0, sizeof(struct mwifiex_802_11_ssid)); | 847 | memset(&req_ssid, 0, sizeof(struct cfg80211_ssid)); |
850 | 848 | ||
851 | req_ssid.ssid_len = ssid_len; | 849 | req_ssid.ssid_len = ssid_len; |
852 | if (ssid_len > IEEE80211_MAX_SSID_LEN) { | 850 | if (ssid_len > IEEE80211_MAX_SSID_LEN) { |
@@ -873,6 +871,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
873 | priv->sec_info.wpa2_enabled = false; | 871 | priv->sec_info.wpa2_enabled = false; |
874 | priv->wep_key_curr_index = 0; | 872 | priv->wep_key_curr_index = 0; |
875 | priv->sec_info.encryption_mode = 0; | 873 | priv->sec_info.encryption_mode = 0; |
874 | priv->sec_info.is_authtype_auto = 0; | ||
876 | ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); | 875 | ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); |
877 | 876 | ||
878 | if (mode == NL80211_IFTYPE_ADHOC) { | 877 | if (mode == NL80211_IFTYPE_ADHOC) { |
@@ -894,11 +893,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
894 | } | 893 | } |
895 | 894 | ||
896 | /* Now handle infra mode. "sme" is valid for infra mode only */ | 895 | /* Now handle infra mode. "sme" is valid for infra mode only */ |
897 | if (sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC | 896 | if (sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) { |
898 | || sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) | ||
899 | auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM; | 897 | auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM; |
900 | else if (sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) | 898 | priv->sec_info.is_authtype_auto = 1; |
901 | auth_type = NL80211_AUTHTYPE_SHARED_KEY; | 899 | } else { |
900 | auth_type = sme->auth_type; | ||
901 | } | ||
902 | 902 | ||
903 | if (sme->crypto.n_ciphers_pairwise) { | 903 | if (sme->crypto.n_ciphers_pairwise) { |
904 | priv->sec_info.encryption_mode = | 904 | priv->sec_info.encryption_mode = |
@@ -1106,12 +1106,10 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, | |||
1106 | dev_err(priv->adapter->dev, "failed to alloc scan_req\n"); | 1106 | dev_err(priv->adapter->dev, "failed to alloc scan_req\n"); |
1107 | return -ENOMEM; | 1107 | return -ENOMEM; |
1108 | } | 1108 | } |
1109 | for (i = 0; i < request->n_ssids; i++) { | 1109 | |
1110 | memcpy(priv->user_scan_cfg->ssid_list[i].ssid, | 1110 | priv->user_scan_cfg->num_ssids = request->n_ssids; |
1111 | request->ssids[i].ssid, request->ssids[i].ssid_len); | 1111 | priv->user_scan_cfg->ssid_list = request->ssids; |
1112 | priv->user_scan_cfg->ssid_list[i].max_len = | 1112 | |
1113 | request->ssids[i].ssid_len; | ||
1114 | } | ||
1115 | for (i = 0; i < request->n_channels; i++) { | 1113 | for (i = 0; i < request->n_channels; i++) { |
1116 | chan = request->channels[i]; | 1114 | chan = request->channels[i]; |
1117 | priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value; | 1115 | priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value; |
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 6623db69e157..c82eb7ff2fa2 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -771,7 +771,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) | |||
771 | 771 | ||
772 | /* Check init command response */ | 772 | /* Check init command response */ |
773 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { | 773 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { |
774 | if (ret == -1) { | 774 | if (ret) { |
775 | dev_err(adapter->dev, "%s: cmd %#x failed during " | 775 | dev_err(adapter->dev, "%s: cmd %#x failed during " |
776 | "initialization\n", __func__, cmdresp_no); | 776 | "initialization\n", __func__, cmdresp_no); |
777 | mwifiex_init_fw_complete(adapter); | 777 | mwifiex_init_fw_complete(adapter); |
@@ -781,10 +781,8 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) | |||
781 | } | 781 | } |
782 | 782 | ||
783 | if (adapter->curr_cmd) { | 783 | if (adapter->curr_cmd) { |
784 | if (adapter->curr_cmd->wait_q_enabled && (!ret)) | 784 | if (adapter->curr_cmd->wait_q_enabled) |
785 | adapter->cmd_wait_q.status = 0; | 785 | adapter->cmd_wait_q.status = ret; |
786 | else if (adapter->curr_cmd->wait_q_enabled && (ret == -1)) | ||
787 | adapter->cmd_wait_q.status = -1; | ||
788 | 786 | ||
789 | /* Clean up and put current command back to cmd_free_q */ | 787 | /* Clean up and put current command back to cmd_free_q */ |
790 | mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd); | 788 | mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd); |
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h index 3735c775495c..be5fd1652e53 100644 --- a/drivers/net/wireless/mwifiex/decl.h +++ b/drivers/net/wireless/mwifiex/decl.h | |||
@@ -91,11 +91,6 @@ struct mwifiex_fw_image { | |||
91 | u32 fw_len; | 91 | u32 fw_len; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | struct mwifiex_802_11_ssid { | ||
95 | u32 ssid_len; | ||
96 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
97 | }; | ||
98 | |||
99 | struct mwifiex_wait_queue { | 94 | struct mwifiex_wait_queue { |
100 | wait_queue_head_t wait; | 95 | wait_queue_head_t wait; |
101 | int status; | 96 | int status; |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index c82620094a53..fc4ffee6c6b9 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -852,11 +852,6 @@ struct mwifiex_user_scan_chan { | |||
852 | u32 scan_time; | 852 | u32 scan_time; |
853 | } __packed; | 853 | } __packed; |
854 | 854 | ||
855 | struct mwifiex_user_scan_ssid { | ||
856 | u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; | ||
857 | u8 max_len; | ||
858 | } __packed; | ||
859 | |||
860 | struct mwifiex_user_scan_cfg { | 855 | struct mwifiex_user_scan_cfg { |
861 | /* | 856 | /* |
862 | * BSS mode to be sent in the firmware command | 857 | * BSS mode to be sent in the firmware command |
@@ -867,8 +862,9 @@ struct mwifiex_user_scan_cfg { | |||
867 | u8 reserved; | 862 | u8 reserved; |
868 | /* BSSID filter sent in the firmware command to limit the results */ | 863 | /* BSSID filter sent in the firmware command to limit the results */ |
869 | u8 specific_bssid[ETH_ALEN]; | 864 | u8 specific_bssid[ETH_ALEN]; |
870 | /* SSID filter list used in the to limit the scan results */ | 865 | /* SSID filter list used in the firmware to limit the scan results */ |
871 | struct mwifiex_user_scan_ssid ssid_list[MWIFIEX_MAX_SSID_LIST_LENGTH]; | 866 | struct cfg80211_ssid *ssid_list; |
867 | u8 num_ssids; | ||
872 | /* Variable number (fixed maximum) of channels to scan up */ | 868 | /* Variable number (fixed maximum) of channels to scan up */ |
873 | struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX]; | 869 | struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX]; |
874 | } __packed; | 870 | } __packed; |
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h index d5d81f1fe41c..7ca4e8234f3e 100644 --- a/drivers/net/wireless/mwifiex/ioctl.h +++ b/drivers/net/wireless/mwifiex/ioctl.h | |||
@@ -50,7 +50,7 @@ struct mwifiex_chan_freq { | |||
50 | }; | 50 | }; |
51 | 51 | ||
52 | struct mwifiex_ssid_bssid { | 52 | struct mwifiex_ssid_bssid { |
53 | struct mwifiex_802_11_ssid ssid; | 53 | struct cfg80211_ssid ssid; |
54 | u8 bssid[ETH_ALEN]; | 54 | u8 bssid[ETH_ALEN]; |
55 | }; | 55 | }; |
56 | 56 | ||
@@ -122,7 +122,7 @@ struct mwifiex_ver_ext { | |||
122 | 122 | ||
123 | struct mwifiex_bss_info { | 123 | struct mwifiex_bss_info { |
124 | u32 bss_mode; | 124 | u32 bss_mode; |
125 | struct mwifiex_802_11_ssid ssid; | 125 | struct cfg80211_ssid ssid; |
126 | u32 bss_chan; | 126 | u32 bss_chan; |
127 | u32 region_code; | 127 | u32 region_code; |
128 | u32 media_connected; | 128 | u32 media_connected; |
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index ee439fc2f4f3..bce9991612c8 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -585,7 +585,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, | |||
585 | le16_to_cpu(assoc_rsp->cap_info_bitmap), | 585 | le16_to_cpu(assoc_rsp->cap_info_bitmap), |
586 | le16_to_cpu(assoc_rsp->a_id)); | 586 | le16_to_cpu(assoc_rsp->a_id)); |
587 | 587 | ||
588 | ret = -1; | 588 | ret = le16_to_cpu(assoc_rsp->status_code); |
589 | goto done; | 589 | goto done; |
590 | } | 590 | } |
591 | 591 | ||
@@ -714,7 +714,7 @@ done: | |||
714 | int | 714 | int |
715 | mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, | 715 | mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, |
716 | struct host_cmd_ds_command *cmd, | 716 | struct host_cmd_ds_command *cmd, |
717 | struct mwifiex_802_11_ssid *req_ssid) | 717 | struct cfg80211_ssid *req_ssid) |
718 | { | 718 | { |
719 | int rsn_ie_len = 0; | 719 | int rsn_ie_len = 0; |
720 | struct mwifiex_adapter *adapter = priv->adapter; | 720 | struct mwifiex_adapter *adapter = priv->adapter; |
@@ -1245,7 +1245,7 @@ int mwifiex_associate(struct mwifiex_private *priv, | |||
1245 | */ | 1245 | */ |
1246 | int | 1246 | int |
1247 | mwifiex_adhoc_start(struct mwifiex_private *priv, | 1247 | mwifiex_adhoc_start(struct mwifiex_private *priv, |
1248 | struct mwifiex_802_11_ssid *adhoc_ssid) | 1248 | struct cfg80211_ssid *adhoc_ssid) |
1249 | { | 1249 | { |
1250 | dev_dbg(priv->adapter->dev, "info: Adhoc Channel = %d\n", | 1250 | dev_dbg(priv->adapter->dev, "info: Adhoc Channel = %d\n", |
1251 | priv->adhoc_channel); | 1251 | priv->adhoc_channel); |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 4c8621706278..6dc116647411 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -219,6 +219,7 @@ struct mwifiex_802_11_security { | |||
219 | u8 wapi_key_on; | 219 | u8 wapi_key_on; |
220 | u8 wep_enabled; | 220 | u8 wep_enabled; |
221 | u32 authentication_mode; | 221 | u32 authentication_mode; |
222 | u8 is_authtype_auto; | ||
222 | u32 encryption_mode; | 223 | u32 encryption_mode; |
223 | }; | 224 | }; |
224 | 225 | ||
@@ -243,7 +244,7 @@ struct ieee_types_generic { | |||
243 | 244 | ||
244 | struct mwifiex_bssdescriptor { | 245 | struct mwifiex_bssdescriptor { |
245 | u8 mac_address[ETH_ALEN]; | 246 | u8 mac_address[ETH_ALEN]; |
246 | struct mwifiex_802_11_ssid ssid; | 247 | struct cfg80211_ssid ssid; |
247 | u32 privacy; | 248 | u32 privacy; |
248 | s32 rssi; | 249 | s32 rssi; |
249 | u32 channel; | 250 | u32 channel; |
@@ -387,7 +388,7 @@ struct mwifiex_private { | |||
387 | s16 bcn_rssi_avg; | 388 | s16 bcn_rssi_avg; |
388 | s16 bcn_nf_avg; | 389 | s16 bcn_nf_avg; |
389 | struct mwifiex_bssdescriptor *attempted_bss_desc; | 390 | struct mwifiex_bssdescriptor *attempted_bss_desc; |
390 | struct mwifiex_802_11_ssid prev_ssid; | 391 | struct cfg80211_ssid prev_ssid; |
391 | u8 prev_bssid[ETH_ALEN]; | 392 | u8 prev_bssid[ETH_ALEN]; |
392 | struct mwifiex_current_bss_params curr_bss_params; | 393 | struct mwifiex_current_bss_params curr_bss_params; |
393 | u16 beacon_period; | 394 | u16 beacon_period; |
@@ -746,8 +747,7 @@ void mwifiex_queue_scan_cmd(struct mwifiex_private *priv, | |||
746 | struct cmd_ctrl_node *cmd_node); | 747 | struct cmd_ctrl_node *cmd_node); |
747 | int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | 748 | int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, |
748 | struct host_cmd_ds_command *resp); | 749 | struct host_cmd_ds_command *resp); |
749 | s32 mwifiex_ssid_cmp(struct mwifiex_802_11_ssid *ssid1, | 750 | s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2); |
750 | struct mwifiex_802_11_ssid *ssid2); | ||
751 | int mwifiex_associate(struct mwifiex_private *priv, | 751 | int mwifiex_associate(struct mwifiex_private *priv, |
752 | struct mwifiex_bssdescriptor *bss_desc); | 752 | struct mwifiex_bssdescriptor *bss_desc); |
753 | int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, | 753 | int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, |
@@ -759,12 +759,12 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv); | |||
759 | u8 mwifiex_band_to_radio_type(u8 band); | 759 | u8 mwifiex_band_to_radio_type(u8 band); |
760 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac); | 760 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac); |
761 | int mwifiex_adhoc_start(struct mwifiex_private *priv, | 761 | int mwifiex_adhoc_start(struct mwifiex_private *priv, |
762 | struct mwifiex_802_11_ssid *adhoc_ssid); | 762 | struct cfg80211_ssid *adhoc_ssid); |
763 | int mwifiex_adhoc_join(struct mwifiex_private *priv, | 763 | int mwifiex_adhoc_join(struct mwifiex_private *priv, |
764 | struct mwifiex_bssdescriptor *bss_desc); | 764 | struct mwifiex_bssdescriptor *bss_desc); |
765 | int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, | 765 | int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, |
766 | struct host_cmd_ds_command *cmd, | 766 | struct host_cmd_ds_command *cmd, |
767 | struct mwifiex_802_11_ssid *req_ssid); | 767 | struct cfg80211_ssid *req_ssid); |
768 | int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, | 768 | int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, |
769 | struct host_cmd_ds_command *cmd, | 769 | struct host_cmd_ds_command *cmd, |
770 | struct mwifiex_bssdescriptor *bss_desc); | 770 | struct mwifiex_bssdescriptor *bss_desc); |
@@ -897,7 +897,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, | |||
897 | struct net_device *dev); | 897 | struct net_device *dev); |
898 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter); | 898 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter); |
899 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | 899 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, |
900 | struct mwifiex_802_11_ssid *req_ssid); | 900 | struct cfg80211_ssid *req_ssid); |
901 | int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); | 901 | int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); |
902 | int mwifiex_enable_hs(struct mwifiex_adapter *adapter); | 902 | int mwifiex_enable_hs(struct mwifiex_adapter *adapter); |
903 | int mwifiex_disable_auto_ds(struct mwifiex_private *priv); | 903 | int mwifiex_disable_auto_ds(struct mwifiex_private *priv); |
@@ -906,13 +906,12 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv, | |||
906 | int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, | 906 | int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, |
907 | struct mwifiex_rate_cfg *rate); | 907 | struct mwifiex_rate_cfg *rate); |
908 | int mwifiex_request_scan(struct mwifiex_private *priv, | 908 | int mwifiex_request_scan(struct mwifiex_private *priv, |
909 | struct mwifiex_802_11_ssid *req_ssid); | 909 | struct cfg80211_ssid *req_ssid); |
910 | int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, | 910 | int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, |
911 | struct mwifiex_user_scan_cfg *scan_req); | 911 | struct mwifiex_user_scan_cfg *scan_req); |
912 | int mwifiex_change_adhoc_chan(struct mwifiex_private *priv, int channel); | ||
913 | int mwifiex_set_radio(struct mwifiex_private *priv, u8 option); | 912 | int mwifiex_set_radio(struct mwifiex_private *priv, u8 option); |
914 | 913 | ||
915 | int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel); | 914 | int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel); |
916 | 915 | ||
917 | int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, | 916 | int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, |
918 | int key_len, u8 key_index, int disable); | 917 | int key_len, u8 key_index, int disable); |
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 8f10038d1b45..fd0302fe5bd8 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -163,8 +163,7 @@ mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) | |||
163 | * This function compares two SSIDs and checks if they match. | 163 | * This function compares two SSIDs and checks if they match. |
164 | */ | 164 | */ |
165 | s32 | 165 | s32 |
166 | mwifiex_ssid_cmp(struct mwifiex_802_11_ssid *ssid1, | 166 | mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2) |
167 | struct mwifiex_802_11_ssid *ssid2) | ||
168 | { | 167 | { |
169 | if (!ssid1 || !ssid2 || (ssid1->ssid_len != ssid2->ssid_len)) | 168 | if (!ssid1 || !ssid2 || (ssid1->ssid_len != ssid2->ssid_len)) |
170 | return -1; | 169 | return -1; |
@@ -738,7 +737,7 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv, | |||
738 | u16 scan_dur; | 737 | u16 scan_dur; |
739 | u8 channel; | 738 | u8 channel; |
740 | u8 radio_type; | 739 | u8 radio_type; |
741 | u32 ssid_idx; | 740 | int i; |
742 | u8 ssid_filter; | 741 | u8 ssid_filter; |
743 | u8 rates[MWIFIEX_SUPPORTED_RATES]; | 742 | u8 rates[MWIFIEX_SUPPORTED_RATES]; |
744 | u32 rates_size; | 743 | u32 rates_size; |
@@ -793,14 +792,8 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv, | |||
793 | user_scan_in->specific_bssid, | 792 | user_scan_in->specific_bssid, |
794 | sizeof(scan_cfg_out->specific_bssid)); | 793 | sizeof(scan_cfg_out->specific_bssid)); |
795 | 794 | ||
796 | for (ssid_idx = 0; | 795 | for (i = 0; i < user_scan_in->num_ssids; i++) { |
797 | ((ssid_idx < ARRAY_SIZE(user_scan_in->ssid_list)) | 796 | ssid_len = user_scan_in->ssid_list[i].ssid_len; |
798 | && (*user_scan_in->ssid_list[ssid_idx].ssid | ||
799 | || user_scan_in->ssid_list[ssid_idx].max_len)); | ||
800 | ssid_idx++) { | ||
801 | |||
802 | ssid_len = strlen(user_scan_in->ssid_list[ssid_idx]. | ||
803 | ssid) + 1; | ||
804 | 797 | ||
805 | wildcard_ssid_tlv = | 798 | wildcard_ssid_tlv = |
806 | (struct mwifiex_ie_types_wildcard_ssid_params *) | 799 | (struct mwifiex_ie_types_wildcard_ssid_params *) |
@@ -811,19 +804,26 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv, | |||
811 | (u16) (ssid_len + sizeof(wildcard_ssid_tlv-> | 804 | (u16) (ssid_len + sizeof(wildcard_ssid_tlv-> |
812 | max_ssid_length))); | 805 | max_ssid_length))); |
813 | 806 | ||
814 | /* max_ssid_length = 0 tells firmware to perform | 807 | /* |
815 | specific scan for the SSID filled */ | 808 | * max_ssid_length = 0 tells firmware to perform |
816 | wildcard_ssid_tlv->max_ssid_length = 0; | 809 | * specific scan for the SSID filled, whereas |
810 | * max_ssid_length = IEEE80211_MAX_SSID_LEN is for | ||
811 | * wildcard scan. | ||
812 | */ | ||
813 | if (ssid_len) | ||
814 | wildcard_ssid_tlv->max_ssid_length = 0; | ||
815 | else | ||
816 | wildcard_ssid_tlv->max_ssid_length = | ||
817 | IEEE80211_MAX_SSID_LEN; | ||
817 | 818 | ||
818 | memcpy(wildcard_ssid_tlv->ssid, | 819 | memcpy(wildcard_ssid_tlv->ssid, |
819 | user_scan_in->ssid_list[ssid_idx].ssid, | 820 | user_scan_in->ssid_list[i].ssid, ssid_len); |
820 | ssid_len); | ||
821 | 821 | ||
822 | tlv_pos += (sizeof(wildcard_ssid_tlv->header) | 822 | tlv_pos += (sizeof(wildcard_ssid_tlv->header) |
823 | + le16_to_cpu(wildcard_ssid_tlv->header.len)); | 823 | + le16_to_cpu(wildcard_ssid_tlv->header.len)); |
824 | 824 | ||
825 | dev_dbg(adapter->dev, "info: scan: ssid_list[%d]: %s, %d\n", | 825 | dev_dbg(adapter->dev, "info: scan: ssid[%d]: %s, %d\n", |
826 | ssid_idx, wildcard_ssid_tlv->ssid, | 826 | i, wildcard_ssid_tlv->ssid, |
827 | wildcard_ssid_tlv->max_ssid_length); | 827 | wildcard_ssid_tlv->max_ssid_length); |
828 | 828 | ||
829 | /* Empty wildcard ssid with a maxlen will match many or | 829 | /* Empty wildcard ssid with a maxlen will match many or |
@@ -832,7 +832,6 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv, | |||
832 | filtered. */ | 832 | filtered. */ |
833 | if (!ssid_len && wildcard_ssid_tlv->max_ssid_length) | 833 | if (!ssid_len && wildcard_ssid_tlv->max_ssid_length) |
834 | ssid_filter = false; | 834 | ssid_filter = false; |
835 | |||
836 | } | 835 | } |
837 | 836 | ||
838 | /* | 837 | /* |
@@ -841,7 +840,7 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv, | |||
841 | * truncate scan results. That is not an issue with an SSID | 840 | * truncate scan results. That is not an issue with an SSID |
842 | * or BSSID filter applied to the scan results in the firmware. | 841 | * or BSSID filter applied to the scan results in the firmware. |
843 | */ | 842 | */ |
844 | if ((ssid_idx && ssid_filter) | 843 | if ((i && ssid_filter) |
845 | || memcmp(scan_cfg_out->specific_bssid, &zero_mac, | 844 | || memcmp(scan_cfg_out->specific_bssid, &zero_mac, |
846 | sizeof(zero_mac))) | 845 | sizeof(zero_mac))) |
847 | *filtered_scan = true; | 846 | *filtered_scan = true; |
@@ -1851,7 +1850,7 @@ mwifiex_queue_scan_cmd(struct mwifiex_private *priv, | |||
1851 | * firmware, filtered on a specific SSID. | 1850 | * firmware, filtered on a specific SSID. |
1852 | */ | 1851 | */ |
1853 | static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, | 1852 | static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, |
1854 | struct mwifiex_802_11_ssid *req_ssid) | 1853 | struct cfg80211_ssid *req_ssid) |
1855 | { | 1854 | { |
1856 | struct mwifiex_adapter *adapter = priv->adapter; | 1855 | struct mwifiex_adapter *adapter = priv->adapter; |
1857 | int ret = 0; | 1856 | int ret = 0; |
@@ -1877,8 +1876,8 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, | |||
1877 | return -ENOMEM; | 1876 | return -ENOMEM; |
1878 | } | 1877 | } |
1879 | 1878 | ||
1880 | memcpy(scan_cfg->ssid_list[0].ssid, req_ssid->ssid, | 1879 | scan_cfg->ssid_list = req_ssid; |
1881 | req_ssid->ssid_len); | 1880 | scan_cfg->num_ssids = 1; |
1882 | 1881 | ||
1883 | ret = mwifiex_scan_networks(priv, scan_cfg); | 1882 | ret = mwifiex_scan_networks(priv, scan_cfg); |
1884 | 1883 | ||
@@ -1896,7 +1895,7 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, | |||
1896 | * scan, depending upon whether an SSID is provided or not. | 1895 | * scan, depending upon whether an SSID is provided or not. |
1897 | */ | 1896 | */ |
1898 | int mwifiex_request_scan(struct mwifiex_private *priv, | 1897 | int mwifiex_request_scan(struct mwifiex_private *priv, |
1899 | struct mwifiex_802_11_ssid *req_ssid) | 1898 | struct cfg80211_ssid *req_ssid) |
1900 | { | 1899 | { |
1901 | int ret; | 1900 | int ret; |
1902 | 1901 | ||
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index d7aa21da84d0..b9b59db60454 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -101,7 +101,7 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv) | |||
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, |
104 | sizeof(struct mwifiex_802_11_ssid)); | 104 | sizeof(struct cfg80211_ssid)); |
105 | 105 | ||
106 | memcpy(priv->prev_bssid, | 106 | memcpy(priv->prev_bssid, |
107 | priv->curr_bss_params.bss_descriptor.mac_address, ETH_ALEN); | 107 | priv->curr_bss_params.bss_descriptor.mac_address, ETH_ALEN); |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 866026ecca44..0ae1209646c1 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -192,7 +192,7 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, | |||
192 | * first. | 192 | * first. |
193 | */ | 193 | */ |
194 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | 194 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, |
195 | struct mwifiex_802_11_ssid *req_ssid) | 195 | struct cfg80211_ssid *req_ssid) |
196 | { | 196 | { |
197 | int ret; | 197 | int ret; |
198 | struct mwifiex_adapter *adapter = priv->adapter; | 198 | struct mwifiex_adapter *adapter = priv->adapter; |
@@ -249,6 +249,17 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
249 | * application retrieval */ | 249 | * application retrieval */ |
250 | priv->assoc_rsp_size = 0; | 250 | priv->assoc_rsp_size = 0; |
251 | ret = mwifiex_associate(priv, bss_desc); | 251 | ret = mwifiex_associate(priv, bss_desc); |
252 | |||
253 | /* If auth type is auto and association fails using open mode, | ||
254 | * try to connect using shared mode */ | ||
255 | if (ret == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG && | ||
256 | priv->sec_info.is_authtype_auto && | ||
257 | priv->sec_info.wep_enabled) { | ||
258 | priv->sec_info.authentication_mode = | ||
259 | NL80211_AUTHTYPE_SHARED_KEY; | ||
260 | ret = mwifiex_associate(priv, bss_desc); | ||
261 | } | ||
262 | |||
252 | if (bss) | 263 | if (bss) |
253 | cfg80211_put_bss(bss); | 264 | cfg80211_put_bss(bss); |
254 | } else { | 265 | } else { |
@@ -453,8 +464,7 @@ int mwifiex_get_bss_info(struct mwifiex_private *priv, | |||
453 | 464 | ||
454 | info->bss_mode = priv->bss_mode; | 465 | info->bss_mode = priv->bss_mode; |
455 | 466 | ||
456 | memcpy(&info->ssid, &bss_desc->ssid, | 467 | memcpy(&info->ssid, &bss_desc->ssid, sizeof(struct cfg80211_ssid)); |
457 | sizeof(struct mwifiex_802_11_ssid)); | ||
458 | 468 | ||
459 | memcpy(&info->bssid, &bss_desc->mac_address, ETH_ALEN); | 469 | memcpy(&info->bssid, &bss_desc->mac_address, ETH_ALEN); |
460 | 470 | ||
@@ -599,7 +609,7 @@ static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv, | |||
599 | * - Start/Join the IBSS | 609 | * - Start/Join the IBSS |
600 | */ | 610 | */ |
601 | int | 611 | int |
602 | mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel) | 612 | mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel) |
603 | { | 613 | { |
604 | int ret; | 614 | int ret; |
605 | struct mwifiex_bss_info bss_info; | 615 | struct mwifiex_bss_info bss_info; |
@@ -636,7 +646,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel) | |||
636 | ret = mwifiex_deauthenticate(priv, ssid_bssid.bssid); | 646 | ret = mwifiex_deauthenticate(priv, ssid_bssid.bssid); |
637 | 647 | ||
638 | ret = mwifiex_bss_ioctl_ibss_channel(priv, HostCmd_ACT_GEN_SET, | 648 | ret = mwifiex_bss_ioctl_ibss_channel(priv, HostCmd_ACT_GEN_SET, |
639 | (u16 *) &channel); | 649 | &channel); |
640 | 650 | ||
641 | /* Do specific SSID scanning */ | 651 | /* Do specific SSID scanning */ |
642 | if (mwifiex_request_scan(priv, &bss_info.ssid)) { | 652 | if (mwifiex_request_scan(priv, &bss_info.ssid)) { |