mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
![Johannes Berg](/assets/img/avatar_default.png)
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>
24 lines
697 B
C
24 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);
|