aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/join.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/join.c')
-rw-r--r--drivers/net/wireless/mwifiex/join.c96
1 files changed, 40 insertions, 56 deletions
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 62b4c2938608..1c4981367e50 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -724,8 +724,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
724 u32 cmd_append_size = 0; 724 u32 cmd_append_size = 0;
725 u32 i; 725 u32 i;
726 u16 tmp_cap; 726 u16 tmp_cap;
727 uint16_t ht_cap_info;
728 struct mwifiex_ie_types_chan_list_param_set *chan_tlv; 727 struct mwifiex_ie_types_chan_list_param_set *chan_tlv;
728 u8 radio_type;
729 729
730 struct mwifiex_ie_types_htcap *ht_cap; 730 struct mwifiex_ie_types_htcap *ht_cap;
731 struct mwifiex_ie_types_htinfo *ht_info; 731 struct mwifiex_ie_types_htinfo *ht_info;
@@ -837,8 +837,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
837 bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL; 837 bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
838 } 838 }
839 839
840 memset(adhoc_start->DataRate, 0, sizeof(adhoc_start->DataRate)); 840 memset(adhoc_start->data_rate, 0, sizeof(adhoc_start->data_rate));
841 mwifiex_get_active_data_rates(priv, adhoc_start->DataRate); 841 mwifiex_get_active_data_rates(priv, adhoc_start->data_rate);
842 if ((adapter->adhoc_start_band & BAND_G) && 842 if ((adapter->adhoc_start_band & BAND_G) &&
843 (priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) { 843 (priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) {
844 if (mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL, 844 if (mwifiex_send_cmd_async(priv, HostCmd_CMD_MAC_CONTROL,
@@ -850,20 +850,19 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
850 } 850 }
851 } 851 }
852 /* Find the last non zero */ 852 /* Find the last non zero */
853 for (i = 0; i < sizeof(adhoc_start->DataRate) && 853 for (i = 0; i < sizeof(adhoc_start->data_rate); i++)
854 adhoc_start->DataRate[i]; 854 if (!adhoc_start->data_rate[i])
855 i++) 855 break;
856 ;
857 856
858 priv->curr_bss_params.num_of_rates = i; 857 priv->curr_bss_params.num_of_rates = i;
859 858
860 /* Copy the ad-hoc creating rates into Current BSS rate structure */ 859 /* Copy the ad-hoc creating rates into Current BSS rate structure */
861 memcpy(&priv->curr_bss_params.data_rates, 860 memcpy(&priv->curr_bss_params.data_rates,
862 &adhoc_start->DataRate, priv->curr_bss_params.num_of_rates); 861 &adhoc_start->data_rate, priv->curr_bss_params.num_of_rates);
863 862
864 dev_dbg(adapter->dev, "info: ADHOC_S_CMD: rates=%02x %02x %02x %02x\n", 863 dev_dbg(adapter->dev, "info: ADHOC_S_CMD: rates=%02x %02x %02x %02x\n",
865 adhoc_start->DataRate[0], adhoc_start->DataRate[1], 864 adhoc_start->data_rate[0], adhoc_start->data_rate[1],
866 adhoc_start->DataRate[2], adhoc_start->DataRate[3]); 865 adhoc_start->data_rate[2], adhoc_start->data_rate[3]);
867 866
868 dev_dbg(adapter->dev, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n"); 867 dev_dbg(adapter->dev, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n");
869 868
@@ -914,55 +913,40 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
914 } 913 }
915 914
916 if (adapter->adhoc_11n_enabled) { 915 if (adapter->adhoc_11n_enabled) {
917 { 916 /* Fill HT CAPABILITY */
918 ht_cap = (struct mwifiex_ie_types_htcap *) pos; 917 ht_cap = (struct mwifiex_ie_types_htcap *) pos;
919 memset(ht_cap, 0, 918 memset(ht_cap, 0, sizeof(struct mwifiex_ie_types_htcap));
920 sizeof(struct mwifiex_ie_types_htcap)); 919 ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
921 ht_cap->header.type = 920 ht_cap->header.len =
922 cpu_to_le16(WLAN_EID_HT_CAPABILITY); 921 cpu_to_le16(sizeof(struct ieee80211_ht_cap));
923 ht_cap->header.len = 922 radio_type = mwifiex_band_to_radio_type(
924 cpu_to_le16(sizeof(struct ieee80211_ht_cap)); 923 priv->adapter->config_bands);
925 ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info); 924 mwifiex_fill_cap_info(priv, radio_type, ht_cap);
926 925
927 ht_cap_info |= IEEE80211_HT_CAP_SGI_20; 926 pos += sizeof(struct mwifiex_ie_types_htcap);
928 if (adapter->chan_offset) { 927 cmd_append_size +=
929 ht_cap_info |= IEEE80211_HT_CAP_SGI_40; 928 sizeof(struct mwifiex_ie_types_htcap);
930 ht_cap_info |= IEEE80211_HT_CAP_DSSSCCK40;
931 ht_cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
932 SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask);
933 }
934 929
935 ht_cap->ht_cap.ampdu_params_info 930 /* Fill HT INFORMATION */
936 = IEEE80211_HT_MAX_AMPDU_64K; 931 ht_info = (struct mwifiex_ie_types_htinfo *) pos;
937 ht_cap->ht_cap.mcs.rx_mask[0] = 0xff; 932 memset(ht_info, 0, sizeof(struct mwifiex_ie_types_htinfo));
938 pos += sizeof(struct mwifiex_ie_types_htcap); 933 ht_info->header.type = cpu_to_le16(WLAN_EID_HT_INFORMATION);
939 cmd_append_size += 934 ht_info->header.len =
940 sizeof(struct mwifiex_ie_types_htcap); 935 cpu_to_le16(sizeof(struct ieee80211_ht_info));
941 } 936
942 { 937 ht_info->ht_info.control_chan =
943 ht_info = (struct mwifiex_ie_types_htinfo *) pos; 938 (u8) priv->curr_bss_params.bss_descriptor.channel;
944 memset(ht_info, 0, 939 if (adapter->chan_offset) {
945 sizeof(struct mwifiex_ie_types_htinfo)); 940 ht_info->ht_info.ht_param = adapter->chan_offset;
946 ht_info->header.type = 941 ht_info->ht_info.ht_param |=
947 cpu_to_le16(WLAN_EID_HT_INFORMATION);
948 ht_info->header.len =
949 cpu_to_le16(sizeof(struct ieee80211_ht_info));
950 ht_info->ht_info.control_chan =
951 (u8) priv->curr_bss_params.bss_descriptor.
952 channel;
953 if (adapter->chan_offset) {
954 ht_info->ht_info.ht_param =
955 adapter->chan_offset;
956 ht_info->ht_info.ht_param |=
957 IEEE80211_HT_PARAM_CHAN_WIDTH_ANY; 942 IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
958 }
959 ht_info->ht_info.operation_mode =
960 cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
961 ht_info->ht_info.basic_set[0] = 0xff;
962 pos += sizeof(struct mwifiex_ie_types_htinfo);
963 cmd_append_size +=
964 sizeof(struct mwifiex_ie_types_htinfo);
965 } 943 }
944 ht_info->ht_info.operation_mode =
945 cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
946 ht_info->ht_info.basic_set[0] = 0xff;
947 pos += sizeof(struct mwifiex_ie_types_htinfo);
948 cmd_append_size +=
949 sizeof(struct mwifiex_ie_types_htinfo);
966 } 950 }
967 951
968 cmd->size = cpu_to_le16((u16) 952 cmd->size = cpu_to_le16((u16)