Commit 0b419d01 authored by Vasily Ulyanov's avatar Vasily Ulyanov Committed by Kalle Valo

qtnfmac: report hardware/firmware information via ethtool

Enable reporting of qtnfmac hardware and firmware details
using ethtool command.
Signed-off-by: default avatarVasily Ulyanov <vulyanov@quantenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 5ec5b532
...@@ -972,6 +972,10 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) ...@@ -972,6 +972,10 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
} }
strlcpy(wiphy->fw_version, hw_info->fw_version,
sizeof(wiphy->fw_version));
wiphy->hw_version = hw_info->hw_version;
ret = wiphy_register(wiphy); ret = wiphy_register(wiphy);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -1107,6 +1107,9 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, ...@@ -1107,6 +1107,9 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus,
(unsigned long)plat_id, (unsigned long)plat_id,
hw_id, calibration_ver, uboot_ver, hw_ver); hw_id, calibration_ver, uboot_ver, hw_ver);
strlcpy(hwinfo->fw_version, bld_label, sizeof(hwinfo->fw_version));
hwinfo->hw_version = hw_ver;
return 0; return 0;
} }
......
...@@ -331,6 +331,10 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, ...@@ -331,6 +331,10 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus,
return mac; return mac;
} }
static const struct ethtool_ops qtnf_ethtool_ops = {
.get_drvinfo = cfg80211_get_drvinfo,
};
int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif,
const char *name, unsigned char name_assign_type) const char *name, unsigned char name_assign_type)
{ {
...@@ -358,6 +362,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, ...@@ -358,6 +362,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif,
dev->flags |= IFF_BROADCAST | IFF_MULTICAST; dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT; dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT;
dev->tx_queue_len = 100; dev->tx_queue_len = 100;
dev->ethtool_ops = &qtnf_ethtool_ops;
qdev_vif = netdev_priv(dev); qdev_vif = netdev_priv(dev);
*((void **)qdev_vif) = vif; *((void **)qdev_vif) = vif;
......
...@@ -145,6 +145,8 @@ struct qtnf_hw_info { ...@@ -145,6 +145,8 @@ struct qtnf_hw_info {
struct ieee80211_regdomain *rd; struct ieee80211_regdomain *rd;
u8 total_tx_chain; u8 total_tx_chain;
u8 total_rx_chain; u8 total_rx_chain;
char fw_version[ETHTOOL_FWVERS_LEN];
u32 hw_version;
}; };
struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac); struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment