John W. Linville | 4890e3b | 2009-09-30 14:50:17 -0400 | [diff] [blame] | 1 | #include <linux/utsname.h> |
| 2 | #include <net/cfg80211.h> |
John W. Linville | 3677713 | 2011-03-07 16:17:59 -0500 | [diff] [blame] | 3 | #include "core.h" |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 4 | #include "rdev-ops.h" |
John W. Linville | 4890e3b | 2009-09-30 14:50:17 -0400 | [diff] [blame] | 5 | |
Johannes Berg | b7ffbd7 | 2014-06-04 17:31:56 +0200 | [diff] [blame] | 6 | void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) |
John W. Linville | 4890e3b | 2009-09-30 14:50:17 -0400 | [diff] [blame] | 7 | { |
| 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 Valo | dfce95f | 2009-09-24 11:02:42 -0700 | [diff] [blame] | 15 | if (wdev->wiphy->fw_version[0]) |
Jiri Pirko | 7826d43 | 2013-01-06 00:44:26 +0000 | [diff] [blame] | 16 | strlcpy(info->fw_version, wdev->wiphy->fw_version, |
Kalle Valo | dfce95f | 2009-09-24 11:02:42 -0700 | [diff] [blame] | 17 | sizeof(info->fw_version)); |
| 18 | else |
Jiri Pirko | 7826d43 | 2013-01-06 00:44:26 +0000 | [diff] [blame] | 19 | strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); |
John W. Linville | 4890e3b | 2009-09-30 14:50:17 -0400 | [diff] [blame] | 20 | |
| 21 | strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)), |
| 22 | sizeof(info->bus_info)); |
| 23 | } |
Johannes Berg | b7ffbd7 | 2014-06-04 17:31:56 +0200 | [diff] [blame] | 24 | EXPORT_SYMBOL(cfg80211_get_drvinfo); |