blob: e9e91298c70de7bdab61b31b795df213c5a71461 [file] [log] [blame]
John W. Linville4890e3b2009-09-30 14:50:17 -04001#include <linux/utsname.h>
2#include <net/cfg80211.h>
John W. Linville36777132011-03-07 16:17:59 -05003#include "core.h"
Hila Gonene35e4d22012-06-27 17:19:42 +03004#include "rdev-ops.h"
John W. Linville4890e3b2009-09-30 14:50:17 -04005
Johannes Bergb7ffbd72014-06-04 17:31:56 +02006void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
John W. Linville4890e3b2009-09-30 14:50:17 -04007{
8 struct wireless_dev *wdev = dev->ieee80211_ptr;
9
10 strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
11 sizeof(info->driver));
12
13 strlcpy(info->version, init_utsname()->release, sizeof(info->version));
14
Kalle Valodfce95f2009-09-24 11:02:42 -070015 if (wdev->wiphy->fw_version[0])
Jiri Pirko7826d432013-01-06 00:44:26 +000016 strlcpy(info->fw_version, wdev->wiphy->fw_version,
Kalle Valodfce95f2009-09-24 11:02:42 -070017 sizeof(info->fw_version));
18 else
Jiri Pirko7826d432013-01-06 00:44:26 +000019 strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
John W. Linville4890e3b2009-09-30 14:50:17 -040020
21 strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
22 sizeof(info->bus_info));
23}
Johannes Bergb7ffbd72014-06-04 17:31:56 +020024EXPORT_SYMBOL(cfg80211_get_drvinfo);