qtnfmac: inform wireless core about supported extended capabilities

Driver retrieves information about supported extended capabilities
from wireless card. However this information is not propagated
further to Linux wireless core. Fix this by setting extended
capabilities fields of wiphy structure.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Sergey Matyukevich 2018-10-05 10:11:38 +00:00 committed by Kalle Valo
parent d5657b709e
commit ab1c64a1d3
4 changed files with 25 additions and 4 deletions

View File

@ -1129,6 +1129,15 @@ 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;
} }
if (mac->macinfo.extended_capabilities_len) {
wiphy->extended_capabilities =
mac->macinfo.extended_capabilities;
wiphy->extended_capabilities_mask =
mac->macinfo.extended_capabilities_mask;
wiphy->extended_capabilities_len =
mac->macinfo.extended_capabilities_len;
}
strlcpy(wiphy->fw_version, hw_info->fw_version, strlcpy(wiphy->fw_version, hw_info->fw_version,
sizeof(wiphy->fw_version)); sizeof(wiphy->fw_version));
wiphy->hw_version = hw_info->hw_version; wiphy->hw_version = hw_info->hw_version;

View File

@ -1273,8 +1273,7 @@ static int qtnf_parse_variable_mac_info(struct qtnf_wmac *mac,
ext_capa_mask = NULL; ext_capa_mask = NULL;
} }
kfree(mac->macinfo.extended_capabilities); qtnf_mac_ext_caps_free(mac);
kfree(mac->macinfo.extended_capabilities_mask);
mac->macinfo.extended_capabilities = ext_capa; mac->macinfo.extended_capabilities = ext_capa;
mac->macinfo.extended_capabilities_mask = ext_capa_mask; mac->macinfo.extended_capabilities_mask = ext_capa_mask;
mac->macinfo.extended_capabilities_len = ext_capa_len; mac->macinfo.extended_capabilities_len = ext_capa_len;

View File

@ -304,6 +304,19 @@ void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac)
} }
} }
void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac)
{
if (mac->macinfo.extended_capabilities_len) {
kfree(mac->macinfo.extended_capabilities);
mac->macinfo.extended_capabilities = NULL;
kfree(mac->macinfo.extended_capabilities_mask);
mac->macinfo.extended_capabilities_mask = NULL;
mac->macinfo.extended_capabilities_len = 0;
}
}
static void qtnf_vif_reset_handler(struct work_struct *work) static void qtnf_vif_reset_handler(struct work_struct *work)
{ {
struct qtnf_vif *vif = container_of(work, struct qtnf_vif, reset_work); struct qtnf_vif *vif = container_of(work, struct qtnf_vif, reset_work);
@ -496,8 +509,7 @@ static void qtnf_core_mac_detach(struct qtnf_bus *bus, unsigned int macid)
} }
qtnf_mac_iface_comb_free(mac); qtnf_mac_iface_comb_free(mac);
kfree(mac->macinfo.extended_capabilities); qtnf_mac_ext_caps_free(mac);
kfree(mac->macinfo.extended_capabilities_mask);
kfree(mac->macinfo.wowlan); kfree(mac->macinfo.wowlan);
wiphy_free(wiphy); wiphy_free(wiphy);
bus->mac[macid] = NULL; bus->mac[macid] = NULL;

View File

@ -144,6 +144,7 @@ struct qtnf_hw_info {
struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac); struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac);
struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac); struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac);
void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac); void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac);
void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac);
struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus); struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus);
int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv, int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv,
const char *name, unsigned char name_assign_type); const char *name, unsigned char name_assign_type);