OSDN Git Service

qtnfmac: do not cache channel info from "connect" command
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Thu, 21 Sep 2017 21:34:32 +0000 (14:34 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 25 Sep 2017 08:27:15 +0000 (11:27 +0300)
This makes no sense because real operational channel is choosen based
on AP operation, not on what STA is configured to.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
drivers/net/wireless/quantenna/qtnfmac/commands.c

index 0ef1285..17b323e 100644 (file)
@@ -613,8 +613,6 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev,
             struct cfg80211_connect_params *sme)
 {
        struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
-       struct qtnf_wmac *mac = wiphy_priv(wiphy);
-       struct cfg80211_chan_def chandef;
        struct qtnf_bss_config *bss_cfg;
        int ret;
 
@@ -627,18 +625,6 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev,
        bss_cfg = &vif->bss_cfg;
        memset(bss_cfg, 0, sizeof(*bss_cfg));
 
-       if (sme->channel) {
-               /* FIXME: need to set proper nl80211_channel_type value */
-               cfg80211_chandef_create(&chandef, sme->channel,
-                                       NL80211_CHAN_HT20);
-               /* fall-back to minimal safe chandef description */
-               if (!cfg80211_chandef_valid(&chandef))
-                       cfg80211_chandef_create(&chandef, sme->channel,
-                                               NL80211_CHAN_HT20);
-
-               memcpy(&mac->chandef, &chandef, sizeof(mac->chandef));
-       }
-
        bss_cfg->ssid_len = sme->ssid_len;
        memcpy(&bss_cfg->ssid, sme->ssid, bss_cfg->ssid_len);
        bss_cfg->auth_type = sme->auth_type;
@@ -663,6 +649,7 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev,
                bss_cfg->connect_flags |= QLINK_STA_CONNECT_USE_RRM;
 
        memcpy(&bss_cfg->crypto, &sme->crypto, sizeof(bss_cfg->crypto));
+
        if (sme->bssid)
                ether_addr_copy(bss_cfg->bssid, sme->bssid);
        else
index 806b88b..c55bae1 100644 (file)
@@ -2055,8 +2055,10 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
 
        ether_addr_copy(cmd->bssid, bss_cfg->bssid);
 
-       if (vif->mac->chandef.chan)
-               cmd->channel = cpu_to_le16(vif->mac->chandef.chan->hw_value);
+       if (sme->channel)
+               cmd->channel = cpu_to_le16(sme->channel->hw_value);
+       else
+               cmd->channel = 0;
 
        cmd->bg_scan_period = cpu_to_le16(bss_cfg->bg_scan_period);