]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
qtnfmac: add support for scan dwell time configuration
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Fri, 5 Oct 2018 10:11:43 +0000 (10:11 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 5 Oct 2018 11:01:37 +0000 (14:01 +0300)
Firmware supports scan dwell time tuning for various types of scans.
Enable support for this feature:
- advertise capability to configure channel dwell time to host
- pass scan dwell parameters to wireless card in scan request

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
drivers/net/wireless/quantenna/qtnfmac/commands.c
drivers/net/wireless/quantenna/qtnfmac/qlink.h

index 9845cf287118b76cbbaff2dde693e35ec360696e..18179965bd3846cdc0b3c4e060c8d990e664f382 100644 (file)
@@ -1101,6 +1101,10 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
        if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)
                wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD);
 
+       if (hw_info->hw_capab & QLINK_HW_CAPAB_SCAN_DWELL)
+               wiphy_ext_feature_set(wiphy,
+                                     NL80211_EXT_FEATURE_SET_SCAN_DWELL);
+
        wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
                                    NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2;
 
index 8fb15cbf50052c24aff7d17529592ed5244e95bb..bfdc1ad30c13a7ffea95d95ead5b7961024999c6 100644 (file)
@@ -2203,6 +2203,15 @@ int qtnf_cmd_send_scan(struct qtnf_wmac *mac)
                qtnf_cmd_skb_put_tlv_tag(cmd_skb, QTN_TLV_ID_SCAN_FLUSH);
        }
 
+       if (scan_req->duration) {
+               pr_debug("MAC%u: %s scan duration %u\n", mac->macid,
+                        scan_req->duration_mandatory ? "mandatory" : "max",
+                        scan_req->duration);
+
+               qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_SCAN_DWELL,
+                                        scan_req->duration);
+       }
+
        ret = qtnf_cmd_send(mac->bus, cmd_skb);
        if (ret)
                goto out;
index 699157100309851d4a7562553afbade3fa3d665e..8d62addea895fbf35871f89ec6c0c33917ff8b21 100644 (file)
@@ -80,6 +80,7 @@ enum qlink_hw_capab {
        QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR     = BIT(3),
        QLINK_HW_CAPAB_PWR_MGMT                 = BIT(4),
        QLINK_HW_CAPAB_OBSS_SCAN                = BIT(5),
+       QLINK_HW_CAPAB_SCAN_DWELL               = BIT(6),
 };
 
 enum qlink_iface_type {
@@ -1152,6 +1153,7 @@ enum qlink_tlv_id {
        QTN_TLV_ID_WOWLAN_CAPAB         = 0x0410,
        QTN_TLV_ID_WOWLAN_PATTERN       = 0x0411,
        QTN_TLV_ID_SCAN_FLUSH           = 0x0412,
+       QTN_TLV_ID_SCAN_DWELL           = 0x0413,
 };
 
 struct qlink_tlv_hdr {