提交 97397633 编写于 作者: I Igor Mitsyanko 提交者: Kalle Valo

qtnfmac: do not cache CSA chandef info

It is never used for anything useful, and all logic is handled by
either WiFi card or higher layers.
Signed-off-by: NIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 8c015b90
...@@ -809,7 +809,6 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -809,7 +809,6 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev, static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_csa_settings *params) struct cfg80211_csa_settings *params)
{ {
struct qtnf_wmac *mac = wiphy_priv(wiphy);
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
int ret; int ret;
...@@ -830,17 +829,6 @@ static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev, ...@@ -830,17 +829,6 @@ static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (vif->vifid != 0) {
if (!(mac->status & QTNF_MAC_CSA_ACTIVE))
return -EOPNOTSUPP;
if (!cfg80211_chandef_identical(&params->chandef,
&mac->csa_chandef))
return -EINVAL;
return 0;
}
if (!cfg80211_chandef_valid(&params->chandef)) { if (!cfg80211_chandef_valid(&params->chandef)) {
pr_err("%s: invalid channel\n", dev->name); pr_err("%s: invalid channel\n", dev->name);
return -EINVAL; return -EINVAL;
......
...@@ -2337,8 +2337,6 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif, ...@@ -2337,8 +2337,6 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif,
switch (res_code) { switch (res_code) {
case QLINK_CMD_RESULT_OK: case QLINK_CMD_RESULT_OK:
memcpy(&mac->csa_chandef, &params->chandef,
sizeof(mac->csa_chandef));
mac->status |= QTNF_MAC_CSA_ACTIVE; mac->status |= QTNF_MAC_CSA_ACTIVE;
ret = 0; ret = 0;
break; break;
......
...@@ -147,7 +147,6 @@ struct qtnf_wmac { ...@@ -147,7 +147,6 @@ struct qtnf_wmac {
struct qtnf_vif iflist[QTNF_MAX_INTF]; struct qtnf_vif iflist[QTNF_MAX_INTF];
struct cfg80211_scan_request *scan_req; struct cfg80211_scan_request *scan_req;
struct cfg80211_chan_def chandef; struct cfg80211_chan_def chandef;
struct cfg80211_chan_def csa_chandef;
struct mutex mac_lock; /* lock during wmac speicific ops */ struct mutex mac_lock; /* lock during wmac speicific ops */
struct timer_list scan_timeout; struct timer_list scan_timeout;
}; };
......
...@@ -381,13 +381,7 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac, ...@@ -381,13 +381,7 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
mac->macid, chandef.chan->hw_value, chandef.center_freq1, mac->macid, chandef.chan->hw_value, chandef.center_freq1,
chandef.center_freq2, chandef.width); chandef.center_freq2, chandef.width);
if (mac->status & QTNF_MAC_CSA_ACTIVE) {
mac->status &= ~QTNF_MAC_CSA_ACTIVE; mac->status &= ~QTNF_MAC_CSA_ACTIVE;
if (chandef.chan->hw_value != mac->csa_chandef.chan->hw_value)
pr_warn("unexpected switch to %u during CSA to %u\n",
chandef.chan->hw_value,
mac->csa_chandef.chan->hw_value);
}
memcpy(&mac->chandef, &chandef, sizeof(mac->chandef)); memcpy(&mac->chandef, &chandef, sizeof(mac->chandef));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册