]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
qtnfmac: inform wireless core about supported extended capabilities
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Fri, 5 Oct 2018 10:11:38 +0000 (10:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:20 +0000 (08:20 +0100)
[ Upstream commit ab1c64a1d349cc7f1090a60ce85a53298e3d371d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
drivers/net/wireless/quantenna/qtnfmac/commands.c
drivers/net/wireless/quantenna/qtnfmac/core.c
drivers/net/wireless/quantenna/qtnfmac/core.h

index 1519d986b74a4695aca851d7ac38e3a2681bd611..05b93f301ca08295816cdc4d7d98fc6b72454ad7 100644 (file)
@@ -1126,6 +1126,15 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
                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,
                sizeof(wiphy->fw_version));
        wiphy->hw_version = hw_info->hw_version;
index 7fe22bb53bfc4e8e1eb5370ffab6801aebea9377..734844b34c2667fc77a5667906ecf5acea2eea93 100644 (file)
@@ -1356,8 +1356,7 @@ static int qtnf_parse_variable_mac_info(struct qtnf_wmac *mac,
                ext_capa_mask = NULL;
        }
 
-       kfree(mac->macinfo.extended_capabilities);
-       kfree(mac->macinfo.extended_capabilities_mask);
+       qtnf_mac_ext_caps_free(mac);
        mac->macinfo.extended_capabilities = ext_capa;
        mac->macinfo.extended_capabilities_mask = ext_capa_mask;
        mac->macinfo.extended_capabilities_len = ext_capa_len;
index 19abbc4e23e068498118b562833197c053e999c4..08928d5e252d7a83944658ffd1bbb6540bcd52bc 100644 (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)
 {
        struct qtnf_vif *vif = container_of(work, struct qtnf_vif, reset_work);
@@ -493,8 +506,7 @@ static void qtnf_core_mac_detach(struct qtnf_bus *bus, unsigned int macid)
        }
 
        qtnf_mac_iface_comb_free(mac);
-       kfree(mac->macinfo.extended_capabilities);
-       kfree(mac->macinfo.extended_capabilities_mask);
+       qtnf_mac_ext_caps_free(mac);
        kfree(mac->macinfo.wowlan);
        wiphy_free(wiphy);
        bus->mac[macid] = NULL;
index a1e338a1f055a7ea906c5fc8ecfd979db84efe03..ecb5c41c8ed7618467d6a4bbdc47fc50182330aa 100644 (file)
@@ -151,6 +151,7 @@ struct qtnf_hw_info {
 struct qtnf_vif *qtnf_mac_get_free_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_ext_caps_free(struct qtnf_wmac *mac);
 struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus);
 int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv,
                         const char *name, unsigned char name_assign_type);