OSDN Git Service

qtnfmac: enable multiple SSIDs scan support
authorAndrey Shevchenko <ashevchenko@quantenna.com>
Thu, 31 May 2018 09:11:00 +0000 (12:11 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 30 Jul 2018 14:12:17 +0000 (17:12 +0300)
Enable support for multiple SSIDs scans. Get max number of supported
SSIDs from firmware and report to cfg80211 core.

Signed-off-by: Andrey Shevchenko <ashevchenko@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/core.h
drivers/net/wireless/quantenna/qtnfmac/qlink.h

index b1dfcc8..0032fa9 100644 (file)
@@ -995,7 +995,8 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
        wiphy->retry_long = macinfo->lretry_limit;
        wiphy->coverage_class = macinfo->coverage_class;
 
-       wiphy->max_scan_ssids = QTNF_MAX_SSID_LIST_LENGTH;
+       wiphy->max_scan_ssids =
+               (hw_info->max_scan_ssids) ? hw_info->max_scan_ssids : 1;
        wiphy->max_scan_ie_len = QTNF_MAX_VSIE_LEN;
        wiphy->mgmt_stypes = qtnf_mgmt_stypes;
        wiphy->max_remain_on_channel_duration = 5000;
index e6894c5..7942261 100644 (file)
@@ -1092,6 +1092,9 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus,
                case QTN_TLV_ID_UBOOT_VER:
                        uboot_ver = (const void *)tlv->val;
                        break;
+               case QTN_TLV_ID_MAX_SCAN_SSIDS:
+                       hwinfo->max_scan_ssids = *tlv->val;
+                       break;
                default:
                        break;
                }
@@ -2260,11 +2263,6 @@ int qtnf_cmd_send_scan(struct qtnf_wmac *mac)
        int count = 0;
        int ret;
 
-       if (scan_req->n_ssids > QTNF_MAX_SSID_LIST_LENGTH) {
-               pr_err("MAC%u: too many SSIDs in scan request\n", mac->macid);
-               return -EINVAL;
-       }
-
        cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD,
                                            QLINK_CMD_SCAN,
                                            sizeof(struct qlink_cmd));
index 2144354..c4808f1 100644 (file)
@@ -40,7 +40,6 @@
 #undef pr_fmt
 #define pr_fmt(fmt)    KBUILD_MODNAME ": %s: " fmt, __func__
 
-#define QTNF_MAX_SSID_LIST_LENGTH      2
 #define QTNF_MAX_VSIE_LEN              255
 #define QTNF_MAX_INTF                  8
 #define QTNF_MAX_EVENT_QUEUE_LEN       255
@@ -145,6 +144,7 @@ struct qtnf_hw_info {
        u8 total_rx_chain;
        char fw_version[ETHTOOL_FWVERS_LEN];
        u32 hw_version;
+       u8 max_scan_ssids;
 };
 
 struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac);
index cbdebf0..8fbef67 100644 (file)
@@ -1091,6 +1091,8 @@ struct qlink_event_radar {
  * @QTN_TLV_ID_STA_STATS: per-STA statistics as defined by
  *     &struct qlink_sta_stats. Valid values are marked as such in a bitmap
  *     carried by QTN_TLV_ID_STA_STATS_MAP.
+ * @QTN_TLV_ID_MAX_SCAN_SSIDS: maximum number of SSIDs the device can scan
+ *     for in any given scan.
  */
 enum qlink_tlv_id {
        QTN_TLV_ID_FRAG_THRESH          = 0x0201,
@@ -1119,6 +1121,7 @@ enum qlink_tlv_id {
        QTN_TLV_ID_CALIBRATION_VER      = 0x0406,
        QTN_TLV_ID_UBOOT_VER            = 0x0407,
        QTN_TLV_ID_RANDOM_MAC_ADDR      = 0x0408,
+       QTN_TLV_ID_MAX_SCAN_SSIDS       = 0x0409,
 };
 
 struct qlink_tlv_hdr {