mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
b7ffbd7ef6
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>
25 lines
697 B
C
25 lines
697 B
C
#include <linux/utsname.h>
|
|
#include <net/cfg80211.h>
|
|
#include "core.h"
|
|
#include "rdev-ops.h"
|
|
|
|
void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
|
{
|
|
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
|
|
|
strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
|
|
sizeof(info->driver));
|
|
|
|
strlcpy(info->version, init_utsname()->release, sizeof(info->version));
|
|
|
|
if (wdev->wiphy->fw_version[0])
|
|
strlcpy(info->fw_version, wdev->wiphy->fw_version,
|
|
sizeof(info->fw_version));
|
|
else
|
|
strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
|
|
|
|
strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
|
|
sizeof(info->bus_info));
|
|
}
|
|
EXPORT_SYMBOL(cfg80211_get_drvinfo);
|