summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-06-14 13:22:49 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-06-20 12:57:08 +0200
commitce6893e917862cae669af52a440d086f416c4cc6 (patch)
tree7092dc588b4cdae5682e3e5ea77b7816fb57c242
parent7e60096f6733350ccb9f55c8084cb421e1934f81 (diff)
wifi: mac80211: ethtool: use deflink for now
Hardcoding link[0] is more confusing than using deflink, so use deflink for now, which requires making the macro a bit safer. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/ethtool.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index 6aa02ef06b6b..c2b38370bfb1 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -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
@@ -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);
}
}