aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c19
-rw-r--r--net/mac80211/driver-ops.h37
-rw-r--r--net/mac80211/driver-trace.h15
3 files changed, 68 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 31023ca17575..a38b26730652 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -463,10 +463,17 @@ static int ieee80211_get_et_sset_count(struct wiphy *wiphy,
463 struct net_device *dev, 463 struct net_device *dev,
464 int sset) 464 int sset)
465{ 465{
466 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
467 int rv = 0;
468
466 if (sset == ETH_SS_STATS) 469 if (sset == ETH_SS_STATS)
467 return STA_STATS_LEN; 470 rv += STA_STATS_LEN;
468 471
469 return -EOPNOTSUPP; 472 rv += drv_get_et_sset_count(sdata, sset);
473
474 if (rv == 0)
475 return -EOPNOTSUPP;
476 return rv;
470} 477}
471 478
472static void ieee80211_get_et_stats(struct wiphy *wiphy, 479static void ieee80211_get_et_stats(struct wiphy *wiphy,
@@ -527,16 +534,22 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy,
527 } 534 }
528 535
529 rcu_read_unlock(); 536 rcu_read_unlock();
537
538 drv_get_et_stats(sdata, stats, &(data[STA_STATS_LEN]));
530} 539}
531 540
532static void ieee80211_get_et_strings(struct wiphy *wiphy, 541static void ieee80211_get_et_strings(struct wiphy *wiphy,
533 struct net_device *dev, 542 struct net_device *dev,
534 u32 sset, u8 *data) 543 u32 sset, u8 *data)
535{ 544{
545 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
546 int sz_sta_stats = 0;
547
536 if (sset == ETH_SS_STATS) { 548 if (sset == ETH_SS_STATS) {
537 int sz_sta_stats = sizeof(ieee80211_gstrings_sta_stats); 549 sz_sta_stats = sizeof(ieee80211_gstrings_sta_stats);
538 memcpy(data, *ieee80211_gstrings_sta_stats, sz_sta_stats); 550 memcpy(data, *ieee80211_gstrings_sta_stats, sz_sta_stats);
539 } 551 }
552 drv_get_et_strings(sdata, sset, &(data[sz_sta_stats]));
540} 553}
541 554
542static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev, 555static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 4a0e559cb26b..6d33a0c743ab 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -35,6 +35,43 @@ static inline void drv_tx_frags(struct ieee80211_local *local,
35 local->ops->tx_frags(&local->hw, vif, sta, skbs); 35 local->ops->tx_frags(&local->hw, vif, sta, skbs);
36} 36}
37 37
38static inline void drv_get_et_strings(struct ieee80211_sub_if_data *sdata,
39 u32 sset, u8 *data)
40{
41 struct ieee80211_local *local = sdata->local;
42 if (local->ops->get_et_strings) {
43 trace_drv_get_et_strings(local, sset);
44 local->ops->get_et_strings(&local->hw, &sdata->vif, sset, data);
45 trace_drv_return_void(local);
46 }
47}
48
49static inline void drv_get_et_stats(struct ieee80211_sub_if_data *sdata,
50 struct ethtool_stats *stats,
51 u64 *data)
52{
53 struct ieee80211_local *local = sdata->local;
54 if (local->ops->get_et_stats) {
55 trace_drv_get_et_stats(local);
56 local->ops->get_et_stats(&local->hw, &sdata->vif, stats, data);
57 trace_drv_return_void(local);
58 }
59}
60
61static inline int drv_get_et_sset_count(struct ieee80211_sub_if_data *sdata,
62 int sset)
63{
64 struct ieee80211_local *local = sdata->local;
65 int rv = 0;
66 if (local->ops->get_et_sset_count) {
67 trace_drv_get_et_sset_count(local, sset);
68 rv = local->ops->get_et_sset_count(&local->hw, &sdata->vif,
69 sset);
70 trace_drv_return_int(local, rv);
71 }
72 return rv;
73}
74
38static inline int drv_start(struct ieee80211_local *local) 75static inline int drv_start(struct ieee80211_local *local)
39{ 76{
40 int ret; 77 int ret;
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 7c0754bed61b..6de00b2c268c 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -161,6 +161,21 @@ DEFINE_EVENT(local_only_evt, drv_start,
161 TP_ARGS(local) 161 TP_ARGS(local)
162); 162);
163 163
164DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
165 TP_PROTO(struct ieee80211_local *local, u32 sset),
166 TP_ARGS(local, sset)
167);
168
169DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
170 TP_PROTO(struct ieee80211_local *local, u32 sset),
171 TP_ARGS(local, sset)
172);
173
174DEFINE_EVENT(local_only_evt, drv_get_et_stats,
175 TP_PROTO(struct ieee80211_local *local),
176 TP_ARGS(local)
177);
178
164DEFINE_EVENT(local_only_evt, drv_suspend, 179DEFINE_EVENT(local_only_evt, drv_suspend,
165 TP_PROTO(struct ieee80211_local *local), 180 TP_PROTO(struct ieee80211_local *local),
166 TP_ARGS(local) 181 TP_ARGS(local)