Merge tag 'fuse-update-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
[linux-2.6-microblaze.git] / net / mac80211 / ethtool.c
index 31cd3c1..c2b3837 100644 (file)
@@ -5,7 +5,7 @@
  * Copied from cfg.c - originally
  * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2014      Intel Corporation (Author: Johannes Berg)
- * Copyright (C) 2018 Intel Corporation
+ * Copyright (C) 2018, 2022 Intel Corporation
  */
 #include <linux/types.h>
 #include <net/cfg80211.h>
@@ -83,17 +83,17 @@ static void ieee80211_get_stats(struct net_device *dev,
 
 #define ADD_STA_STATS(sta)                                     \
        do {                                                    \
-               data[i++] += sta->rx_stats.packets;             \
-               data[i++] += sta->rx_stats.bytes;               \
-               data[i++] += sta->rx_stats.num_duplicates;      \
-               data[i++] += sta->rx_stats.fragments;           \
-               data[i++] += sta->rx_stats.dropped;             \
+               data[i++] += (sta)->rx_stats.packets;           \
+               data[i++] += (sta)->rx_stats.bytes;             \
+               data[i++] += (sta)->rx_stats.num_duplicates;    \
+               data[i++] += (sta)->rx_stats.fragments;         \
+               data[i++] += (sta)->rx_stats.dropped;           \
                                                                \
                data[i++] += sinfo.tx_packets;                  \
                data[i++] += sinfo.tx_bytes;                    \
-               data[i++] += sta->status_stats.filtered;        \
-               data[i++] += sta->status_stats.retry_failed;    \
-               data[i++] += sta->status_stats.retry_count;     \
+               data[i++] += (sta)->status_stats.filtered;      \
+               data[i++] += (sta)->status_stats.retry_failed;  \
+               data[i++] += (sta)->status_stats.retry_count;   \
        } while (0)
 
        /* For Managed stations, find the single station based on BSSID
@@ -105,7 +105,7 @@ static void ieee80211_get_stats(struct net_device *dev,
        mutex_lock(&local->sta_mtx);
 
        if (sdata->vif.type == NL80211_IFTYPE_STATION) {
-               sta = sta_info_get_bss(sdata, sdata->u.mgd.bssid);
+               sta = sta_info_get_bss(sdata, sdata->deflink.u.mgd.bssid);
 
                if (!(sta && !WARN_ON(sta->sdata->dev != dev)))
                        goto do_survey;
@@ -114,7 +114,7 @@ static void ieee80211_get_stats(struct net_device *dev,
                sta_set_sinfo(sta, &sinfo, false);
 
                i = 0;
-               ADD_STA_STATS(sta->link[0]);
+               ADD_STA_STATS(&sta->deflink);
 
                data[i++] = sta->sta_state;
 
@@ -140,7 +140,7 @@ static void ieee80211_get_stats(struct net_device *dev,
                        memset(&sinfo, 0, sizeof(sinfo));
                        sta_set_sinfo(sta, &sinfo, false);
                        i = 0;
-                       ADD_STA_STATS(sta->link[0]);
+                       ADD_STA_STATS(&sta->deflink);
                }
        }
 
@@ -150,7 +150,7 @@ do_survey:
        survey.filled = 0;
 
        rcu_read_lock();
-       chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
+       chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
        if (chanctx_conf)
                channel = chanctx_conf->def.chan;
        else