ethtool.c 733 B

12345678910111213141516171819202122232425
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/utsname.h>
  3. #include <net/cfg80211.h>
  4. #include "core.h"
  5. #include "rdev-ops.h"
  6. void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
  7. {
  8. struct wireless_dev *wdev = dev->ieee80211_ptr;
  9. strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
  10. sizeof(info->driver));
  11. strlcpy(info->version, init_utsname()->release, sizeof(info->version));
  12. if (wdev->wiphy->fw_version[0])
  13. strlcpy(info->fw_version, wdev->wiphy->fw_version,
  14. sizeof(info->fw_version));
  15. else
  16. strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
  17. strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
  18. sizeof(info->bus_info));
  19. }
  20. EXPORT_SYMBOL(cfg80211_get_drvinfo);