Skip to content

Commit b7ffbd7

Browse files
committed
cfg80211: make ethtool the driver's responsibility
Currently, cfg80211 tries to implement ethtool, but that doesn't really scale well, with all the different operations. Make the lower-level driver responsible for it, which currently only has an effect on mac80211. It will similarly not scale well at that level though, since mac80211 also has many drivers. To cleanly implement this in mac80211, introduce a new file and move some code to appropriate places. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent ba9030c commit b7ffbd7

13 files changed

Lines changed: 391 additions & 555 deletions

File tree

‎include/net/cfg80211.h‎

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,10 +2266,6 @@ struct cfg80211_qos_map {
22662266
*
22672267
* @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant).
22682268
*
2269-
* @set_ringparam: Set tx and rx ring sizes.
2270-
*
2271-
* @get_ringparam: Get tx and rx ring current and maximum sizes.
2272-
*
22732269
* @tdls_mgmt: Transmit a TDLS management frame.
22742270
* @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup).
22752271
*
@@ -2278,16 +2274,6 @@ struct cfg80211_qos_map {
22782274
*
22792275
* @set_noack_map: Set the NoAck Map for the TIDs.
22802276
*
2281-
* @get_et_sset_count: Ethtool API to get string-set count.
2282-
* See @ethtool_ops.get_sset_count
2283-
*
2284-
* @get_et_stats: Ethtool API to get a set of u64 stats.
2285-
* See @ethtool_ops.get_ethtool_stats
2286-
*
2287-
* @get_et_strings: Ethtool API to get a set of strings to describe stats
2288-
* and perhaps other supported types of ethtool data-sets.
2289-
* See @ethtool_ops.get_strings
2290-
*
22912277
* @get_channel: Get the current operating channel for the virtual interface.
22922278
* For monitor interfaces, it should return %NULL unless there's a single
22932279
* current monitoring channel.
@@ -2503,10 +2489,6 @@ struct cfg80211_ops {
25032489
int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
25042490
int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
25052491

2506-
int (*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx);
2507-
void (*get_ringparam)(struct wiphy *wiphy,
2508-
u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
2509-
25102492
int (*sched_scan_start)(struct wiphy *wiphy,
25112493
struct net_device *dev,
25122494
struct cfg80211_sched_scan_request *request);
@@ -2529,13 +2511,6 @@ struct cfg80211_ops {
25292511
struct net_device *dev,
25302512
u16 noack_map);
25312513

2532-
int (*get_et_sset_count)(struct wiphy *wiphy,
2533-
struct net_device *dev, int sset);
2534-
void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev,
2535-
struct ethtool_stats *stats, u64 *data);
2536-
void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
2537-
u32 sset, u8 *data);
2538-
25392514
int (*get_channel)(struct wiphy *wiphy,
25402515
struct wireless_dev *wdev,
25412516
struct cfg80211_chan_def *chandef);
@@ -4843,6 +4818,10 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
48434818
*/
48444819
void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
48454820

4821+
4822+
/* ethtool helper */
4823+
void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
4824+
48464825
/* Logging, debugging and troubleshooting/diagnostic helpers. */
48474826

48484827
/* wiphy_printk helpers, similar to dev_printk */

‎net/mac80211/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mac80211-y := \
1717
aes_ccm.o \
1818
aes_cmac.o \
1919
cfg.o \
20+
ethtool.o \
2021
rx.o \
2122
spectmgmt.o \
2223
tx.o \

0 commit comments

Comments
 (0)