summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>2017-10-04 18:38:13 -0700
committerKalle Valo <kvalo@codeaurora.org>2017-10-13 12:59:32 +0300
commitef81e8e9dbbb7f8348f3a62a6ab05e7aea33ea35 (patch)
tree968960a48f2d41c77fd9ae970d827ba151dafbdc /drivers
parentd23d1361316219621d146ba4b396a2ec4ddebfbf (diff)
qtnfmac: do not cache current channel info in driver's state
Linux Wireless device structure already has current channel information that can be used when needed. Start using it. Since driver's channel info is not used anymore, remove it. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/cfg80211.c7
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/core.h1
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/event.c2
3 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index cf0f19effd20..028bed1acd82 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -630,15 +630,15 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev,
int idx, struct survey_info *survey)
{
struct qtnf_wmac *mac = wiphy_priv(wiphy);
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
struct ieee80211_supported_band *sband;
- struct cfg80211_chan_def *chandef;
+ const struct cfg80211_chan_def *chandef = &wdev->chandef;
struct ieee80211_channel *chan;
struct qtnf_chan_stats stats;
struct qtnf_vif *vif;
int ret;
vif = qtnf_netdev_get_priv(dev);
- chandef = &mac->chandef;
sband = wiphy->bands[NL80211_BAND_2GHZ];
if (sband && idx >= sband->n_channels) {
@@ -705,7 +705,6 @@ static int
qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_chan_def *chandef)
{
- struct qtnf_wmac *mac = wiphy_priv(wiphy);
struct net_device *ndev = wdev->netdev;
struct qtnf_vif *vif;
int ret;
@@ -728,8 +727,6 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
ret = -ENODATA;
}
- memcpy(&mac->chandef, chandef, sizeof(mac->chandef));
-
out:
return ret;
}
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index 5234a9e3d746..44a2cbb19310 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -126,7 +126,6 @@ struct qtnf_wmac {
struct qtnf_mac_info macinfo;
struct qtnf_vif iflist[QTNF_MAX_INTF];
struct cfg80211_scan_request *scan_req;
- struct cfg80211_chan_def chandef;
struct mutex mac_lock; /* lock during wmac speicific ops */
struct timer_list scan_timeout;
};
diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index d7fb076350dd..f639ea39c682 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -372,8 +372,6 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
mac->macid, chandef.chan->hw_value, chandef.center_freq1,
chandef.center_freq2, chandef.width);
- memcpy(&mac->chandef, &chandef, sizeof(mac->chandef));
-
for (i = 0; i < QTNF_MAX_INTF; i++) {
vif = &mac->iflist[i];
if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)