mwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS
[deliverable/linux.git] / drivers / net / wireless / mwifiex / join.c
index 62b4c2938608d67873d66afb8be9e288247820b9..ee439fc2f4f361eb0ee233351c26f8309468b40e 100644 (file)
@@ -417,7 +417,7 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
        auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
        auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE);
        auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type));
-       if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED)
+       if (priv->sec_info.wep_enabled)
                auth_tlv->auth_type = cpu_to_le16(
                                (u16) priv->sec_info.authentication_mode);
        else
@@ -724,8 +724,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
        u32 cmd_append_size = 0;
        u32 i;
        u16 tmp_cap;
-       uint16_t ht_cap_info;
        struct mwifiex_ie_types_chan_list_param_set *chan_tlv;
+       u8 radio_type;
 
        struct mwifiex_ie_types_htcap *ht_cap;
        struct mwifiex_ie_types_htinfo *ht_info;
@@ -837,8 +837,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
                bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
        }
 
-       memset(adhoc_start->DataRate, 0, sizeof(adhoc_start->DataRate));
-       mwifiex_get_active_data_rates(priv, adhoc_start->DataRate);
+       memset(adhoc_start->data_rate, 0, sizeof(adhoc_start->data_rate));
+       mwifiex_get_active_data_rates(priv, adhoc_start->data_rate);
        if ((adapter->adhoc_start_band & BAND_G) &&
            (priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) {
                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,
                }
        }
        /* Find the last non zero */
-       for (i = 0; i < sizeof(adhoc_start->DataRate) &&
-                       adhoc_start->DataRate[i];
-                       i++)
-                       ;
+       for (i = 0; i < sizeof(adhoc_start->data_rate); i++)
+               if (!adhoc_start->data_rate[i])
+                       break;
 
        priv->curr_bss_params.num_of_rates = i;
 
        /* Copy the ad-hoc creating rates into Current BSS rate structure */
        memcpy(&priv->curr_bss_params.data_rates,
-              &adhoc_start->DataRate, priv->curr_bss_params.num_of_rates);
+              &adhoc_start->data_rate, priv->curr_bss_params.num_of_rates);
 
        dev_dbg(adapter->dev, "info: ADHOC_S_CMD: rates=%02x %02x %02x %02x\n",
-              adhoc_start->DataRate[0], adhoc_start->DataRate[1],
-              adhoc_start->DataRate[2], adhoc_start->DataRate[3]);
+              adhoc_start->data_rate[0], adhoc_start->data_rate[1],
+              adhoc_start->data_rate[2], adhoc_start->data_rate[3]);
 
        dev_dbg(adapter->dev, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n");
 
@@ -886,12 +885,14 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
                       = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
                if (adapter->adhoc_start_band & BAND_GN
                    || adapter->adhoc_start_band & BAND_AN) {
-                       if (adapter->chan_offset == SEC_CHANNEL_ABOVE)
+                       if (adapter->sec_chan_offset ==
+                                           IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
                                chan_tlv->chan_scan_param[0].radio_type |=
-                                       SECOND_CHANNEL_ABOVE;
-                       else if (adapter->chan_offset == SEC_CHANNEL_BELOW)
+                                       (IEEE80211_HT_PARAM_CHA_SEC_ABOVE << 4);
+                       else if (adapter->sec_chan_offset ==
+                                           IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
                                chan_tlv->chan_scan_param[0].radio_type |=
-                                       SECOND_CHANNEL_BELOW;
+                                       (IEEE80211_HT_PARAM_CHA_SEC_BELOW << 4);
                }
                dev_dbg(adapter->dev, "info: ADHOC_S_CMD: TLV Band = %d\n",
                       chan_tlv->chan_scan_param[0].radio_type);
@@ -914,55 +915,40 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
        }
 
        if (adapter->adhoc_11n_enabled) {
-               {
-                       ht_cap = (struct mwifiex_ie_types_htcap *) pos;
-                       memset(ht_cap, 0,
-                              sizeof(struct mwifiex_ie_types_htcap));
-                       ht_cap->header.type =
-                               cpu_to_le16(WLAN_EID_HT_CAPABILITY);
-                       ht_cap->header.len =
-                              cpu_to_le16(sizeof(struct ieee80211_ht_cap));
-                       ht_cap_info = le16_to_cpu(ht_cap->ht_cap.cap_info);
-
-                       ht_cap_info |= IEEE80211_HT_CAP_SGI_20;
-                       if (adapter->chan_offset) {
-                               ht_cap_info |= IEEE80211_HT_CAP_SGI_40;
-                               ht_cap_info |= IEEE80211_HT_CAP_DSSSCCK40;
-                               ht_cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
-                               SETHT_MCS32(ht_cap->ht_cap.mcs.rx_mask);
-                       }
+               /* Fill HT CAPABILITY */
+               ht_cap = (struct mwifiex_ie_types_htcap *) pos;
+               memset(ht_cap, 0, sizeof(struct mwifiex_ie_types_htcap));
+               ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
+               ht_cap->header.len =
+                      cpu_to_le16(sizeof(struct ieee80211_ht_cap));
+               radio_type = mwifiex_band_to_radio_type(
+                                       priv->adapter->config_bands);
+               mwifiex_fill_cap_info(priv, radio_type, ht_cap);
+
+               pos += sizeof(struct mwifiex_ie_types_htcap);
+               cmd_append_size +=
+                       sizeof(struct mwifiex_ie_types_htcap);
 
-                       ht_cap->ht_cap.ampdu_params_info
-                                       = IEEE80211_HT_MAX_AMPDU_64K;
-                       ht_cap->ht_cap.mcs.rx_mask[0] = 0xff;
-                       pos += sizeof(struct mwifiex_ie_types_htcap);
-                       cmd_append_size +=
-                               sizeof(struct mwifiex_ie_types_htcap);
-               }
-               {
-                       ht_info = (struct mwifiex_ie_types_htinfo *) pos;
-                       memset(ht_info, 0,
-                              sizeof(struct mwifiex_ie_types_htinfo));
-                       ht_info->header.type =
-                               cpu_to_le16(WLAN_EID_HT_INFORMATION);
-                       ht_info->header.len =
-                               cpu_to_le16(sizeof(struct ieee80211_ht_info));
-                       ht_info->ht_info.control_chan =
-                               (u8) priv->curr_bss_params.bss_descriptor.
-                               channel;
-                       if (adapter->chan_offset) {
-                               ht_info->ht_info.ht_param =
-                                       adapter->chan_offset;
-                               ht_info->ht_info.ht_param |=
+               /* Fill HT INFORMATION */
+               ht_info = (struct mwifiex_ie_types_htinfo *) pos;
+               memset(ht_info, 0, sizeof(struct mwifiex_ie_types_htinfo));
+               ht_info->header.type = cpu_to_le16(WLAN_EID_HT_INFORMATION);
+               ht_info->header.len =
+                       cpu_to_le16(sizeof(struct ieee80211_ht_info));
+
+               ht_info->ht_info.control_chan =
+                       (u8) priv->curr_bss_params.bss_descriptor.channel;
+               if (adapter->sec_chan_offset) {
+                       ht_info->ht_info.ht_param = adapter->sec_chan_offset;
+                       ht_info->ht_info.ht_param |=
                                        IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
-                       }
-                       ht_info->ht_info.operation_mode =
-                            cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
-                       ht_info->ht_info.basic_set[0] = 0xff;
-                       pos += sizeof(struct mwifiex_ie_types_htinfo);
-                       cmd_append_size +=
-                               sizeof(struct mwifiex_ie_types_htinfo);
                }
+               ht_info->ht_info.operation_mode =
+                    cpu_to_le16(IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
+               ht_info->ht_info.basic_set[0] = 0xff;
+               pos += sizeof(struct mwifiex_ie_types_htinfo);
+               cmd_append_size +=
+                       sizeof(struct mwifiex_ie_types_htinfo);
        }
 
        cmd->size = cpu_to_le16((u16)
@@ -1083,8 +1069,7 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
        priv->curr_bss_params.bss_descriptor.channel = bss_desc->channel;
        priv->curr_bss_params.band = (u8) bss_desc->bss_band;
 
-       if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_ENABLED
-           || priv->sec_info.wpa_enabled)
+       if (priv->sec_info.wep_enabled || priv->sec_info.wpa_enabled)
                tmp_cap |= WLAN_CAPABILITY_PRIVACY;
 
        if (IS_SUPPORT_MULTI_BANDS(priv->adapter)) {
This page took 0.02672 seconds and 5 git commands to generate.