blob: a9c0f368db5d27ed72159a2395a4a4ec60234ed0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
John W. Linville4890e3b2009-09-30 14:50:17 -04002#include <linux/utsname.h>
3#include <net/cfg80211.h>
John W. Linville36777132011-03-07 16:17:59 -05004#include "core.h"
Hila Gonene35e4d22012-06-27 17:19:42 +03005#include "rdev-ops.h"
John W. Linville4890e3b2009-09-30 14:50:17 -04006
Johannes Bergb7ffbd72014-06-04 17:31:56 +02007void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
John W. Linville4890e3b2009-09-30 14:50:17 -04008{
9 struct wireless_dev *wdev = dev->ieee80211_ptr;
10
11 strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
12 sizeof(info->driver));
13
14 strlcpy(info->version, init_utsname()->release, sizeof(info->version));
15
Kalle Valodfce95f2009-09-24 11:02:42 -070016 if (wdev->wiphy->fw_version[0])
Jiri Pirko7826d432013-01-06 00:44:26 +000017 strlcpy(info->fw_version, wdev->wiphy->fw_version,
Kalle Valodfce95f2009-09-24 11:02:42 -070018 sizeof(info->fw_version));
19 else
Jiri Pirko7826d432013-01-06 00:44:26 +000020 strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
John W. Linville4890e3b2009-09-30 14:50:17 -040021
22 strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
23 sizeof(info->bus_info));
24}
Johannes Bergb7ffbd72014-06-04 17:31:56 +020025EXPORT_SYMBOL(cfg80211_get_drvinfo);