Skip to content

Commit ef81e8e

Browse files
imitsyanko-qtnKalle Valo
authored andcommitted
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 <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent d23d136 commit ef81e8e

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,15 +630,15 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev,
630630
int idx, struct survey_info *survey)
631631
{
632632
struct qtnf_wmac *mac = wiphy_priv(wiphy);
633+
struct wireless_dev *wdev = dev->ieee80211_ptr;
633634
struct ieee80211_supported_band *sband;
634-
struct cfg80211_chan_def *chandef;
635+
const struct cfg80211_chan_def *chandef = &wdev->chandef;
635636
struct ieee80211_channel *chan;
636637
struct qtnf_chan_stats stats;
637638
struct qtnf_vif *vif;
638639
int ret;
639640

640641
vif = qtnf_netdev_get_priv(dev);
641-
chandef = &mac->chandef;
642642

643643
sband = wiphy->bands[NL80211_BAND_2GHZ];
644644
if (sband && idx >= sband->n_channels) {
@@ -705,7 +705,6 @@ static int
705705
qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
706706
struct cfg80211_chan_def *chandef)
707707
{
708-
struct qtnf_wmac *mac = wiphy_priv(wiphy);
709708
struct net_device *ndev = wdev->netdev;
710709
struct qtnf_vif *vif;
711710
int ret;
@@ -728,8 +727,6 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
728727
ret = -ENODATA;
729728
}
730729

731-
memcpy(&mac->chandef, chandef, sizeof(mac->chandef));
732-
733730
out:
734731
return ret;
735732
}

drivers/net/wireless/quantenna/qtnfmac/core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ struct qtnf_wmac {
126126
struct qtnf_mac_info macinfo;
127127
struct qtnf_vif iflist[QTNF_MAX_INTF];
128128
struct cfg80211_scan_request *scan_req;
129-
struct cfg80211_chan_def chandef;
130129
struct mutex mac_lock; /* lock during wmac speicific ops */
131130
struct timer_list scan_timeout;
132131
};

drivers/net/wireless/quantenna/qtnfmac/event.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,6 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
372372
mac->macid, chandef.chan->hw_value, chandef.center_freq1,
373373
chandef.center_freq2, chandef.width);
374374

375-
memcpy(&mac->chandef, &chandef, sizeof(mac->chandef));
376-
377375
for (i = 0; i < QTNF_MAX_INTF; i++) {
378376
vif = &mac->iflist[i];
379377
if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)

0 commit comments

Comments
 (0)