aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/mac80211.h17
-rw-r--r--net/mac80211/cfg.c19
-rw-r--r--net/mac80211/driver-ops.h37
-rw-r--r--net/mac80211/driver-trace.h15
4 files changed, 85 insertions, 3 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index da3658177997..4d6e6c6818d0 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2223,6 +2223,14 @@ enum ieee80211_rate_control_changed {
2223 * The @tids parameter is a bitmap and tells the driver which TIDs the 2223 * The @tids parameter is a bitmap and tells the driver which TIDs the
2224 * frames will be on; it will at most have two bits set. 2224 * frames will be on; it will at most have two bits set.
2225 * This callback must be atomic. 2225 * This callback must be atomic.
2226 *
2227 * @get_et_sset_count: Ethtool API to get string-set count.
2228 *
2229 * @get_et_stats: Ethtool API to get a set of u64 stats.
2230 *
2231 * @get_et_strings: Ethtool API to get a set of strings to describe stats
2232 * and perhaps other supported types of ethtool data-sets.
2233 *
2226 */ 2234 */
2227struct ieee80211_ops { 2235struct ieee80211_ops {
2228 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 2236 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -2353,6 +2361,15 @@ struct ieee80211_ops {
2353 u16 tids, int num_frames, 2361 u16 tids, int num_frames,
2354 enum ieee80211_frame_release_type reason, 2362 enum ieee80211_frame_release_type reason,
2355 bool more_data); 2363 bool more_data);
2364
2365 int (*get_et_sset_count)(struct ieee80211_hw *hw,
2366 struct ieee80211_vif *vif, int sset);
2367 void (*get_et_stats)(struct ieee80211_hw *hw,
2368 struct ieee80211_vif *vif,
2369 struct ethtool_stats *stats, u64 *data);
2370 void (*get_et_strings)(struct ieee80211_hw *hw,
2371 struct ieee80211_vif *vif,
2372 u32 sset, u8 *data);
2356}; 2373};
2357 2374
2358/** 2375/**
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)