ethtool.c 697 B

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