cfg80211: Clean up connect params and channel fetching
[cascardo/linux.git] / drivers / net / wireless / mwifiex / cfg80211.c
index b994679..f4cf9c9 100644 (file)
@@ -563,14 +563,7 @@ static void mwifiex_reg_notifier(struct wiphy *wiphy,
                memcpy(adapter->country_code, request->alpha2,
                       sizeof(request->alpha2));
                mwifiex_send_domain_info_cmd_fw(wiphy);
-
-               if (adapter->dt_node) {
-                       char txpwr[] = {"marvell,00_txpwrlimit"};
-
-                       memcpy(&txpwr[8], adapter->country_code, 2);
-                       mwifiex_dnld_dt_cfgdata(priv, adapter->dt_node,
-                                               txpwr);
-               }
+               mwifiex_dnld_txpwr_table(priv);
        }
 }
 
@@ -1590,8 +1583,9 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
  * the function notifies the CFG802.11 subsystem of the new BSS connection.
  */
 static int
-mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
-                      u8 *bssid, int mode, struct ieee80211_channel *channel,
+mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len,
+                      const u8 *ssid, const u8 *bssid, int mode,
+                      struct ieee80211_channel *channel,
                       struct cfg80211_connect_params *sme, bool privacy)
 {
        struct cfg80211_ssid req_ssid;
@@ -2456,7 +2450,7 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
                       ETH_ALEN);
                mef_entry->filter[filt_num].byte_seq[MWIFIEX_MEF_MAX_BYTESEQ] =
                                                                ETH_ALEN;
-               mef_entry->filter[filt_num].offset = 14;
+               mef_entry->filter[filt_num].offset = 28;
                mef_entry->filter[filt_num].filt_type = TYPE_EQ;
                if (filt_num)
                        mef_entry->filter[filt_num].filt_action = TYPE_OR;
@@ -2684,6 +2678,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
        struct wiphy *wiphy;
        struct mwifiex_private *priv = adapter->priv[MWIFIEX_BSS_TYPE_STA];
        u8 *country_code;
+       u32 thr, retry;
 
        /* create a new wiphy for use with cfg80211 */
        wiphy = wiphy_new(&mwifiex_cfg80211_ops,
@@ -2773,6 +2768,19 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
                                   country_code);
        }
 
+       mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_SNMP_MIB,
+                             HostCmd_ACT_GEN_GET, FRAG_THRESH_I, &thr);
+       wiphy->frag_threshold = thr;
+       mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_SNMP_MIB,
+                             HostCmd_ACT_GEN_GET, RTS_THRESH_I, &thr);
+       wiphy->rts_threshold = thr;
+       mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_SNMP_MIB,
+                             HostCmd_ACT_GEN_GET, SHORT_RETRY_LIM_I, &retry);
+       wiphy->retry_short = (u8) retry;
+       mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_SNMP_MIB,
+                             HostCmd_ACT_GEN_GET, LONG_RETRY_LIM_I, &retry);
+       wiphy->retry_long = (u8) retry;
+
        adapter->wiphy = wiphy;
        return ret;
 }