All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich OS <sergey.matyukevich.os@quantenna.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Igor Mitsyanko OS <igor.mitsyanko.os@quantenna.com>,
	Sergey Matyukevich OS <sergey.matyukevich.os@quantenna.com>
Subject: [PATCH 11/13] qtnfmac: add support for scan dwell time configuration
Date: Tue, 2 Oct 2018 09:26:07 +0000	[thread overview]
Message-ID: <20181002092542.18966-12-sergey.matyukevich.os@quantenna.com> (raw)
In-Reply-To: <20181002092542.18966-1-sergey.matyukevich.os@quantenna.com>

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>
---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 4 ++++
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 9 +++++++++
 drivers/net/wireless/quantenna/qtnfmac/qlink.h    | 2 ++
 3 files changed, 15 insertions(+)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 9845cf287118..18179965bd38 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -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;
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 8fb15cbf5005..bfdc1ad30c13 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -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;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 699157100309..8d62addea895 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -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 {
-- 
2.11.0


  parent reply	other threads:[~2018-10-02  9:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02  9:25 [PATCH 00/13] qtnfmac: fixes and cleanups for STA mode Sergey Matyukevich OS
2018-10-02  9:25 ` [PATCH 01/13] qtnfmac: do not track STA states in driver Sergey Matyukevich OS
2018-10-02  9:25 ` [PATCH 02/13] qtnfmac: generate local disconnect event in disconnect callback Sergey Matyukevich OS
2018-10-02  9:25 ` [PATCH 03/13] qtnfmac: request userspace to do OBSS scanning if FW can not Sergey Matyukevich OS
2018-10-02  9:25 ` [PATCH 04/13] qtnfmac: do not initialize per-MAC data multiple times Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 05/13] qtnfmac: cleanup and unify command error handling Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 06/13] qtnfmac: do not cancel scan in disconnect callback Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 07/13] qtnfmac: pass sgi rate info flag to wireless core Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 08/13] qtnfmac: pass supported extended capabilities to wiphy Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 09/13] qtnfmac: drop error reports for out-of-bounds key indexes Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 10/13] qtnfmac: add support for scan flush Sergey Matyukevich OS
2018-10-02  9:26 ` Sergey Matyukevich OS [this message]
2018-10-02  9:26 ` [PATCH 12/13] qtnfmac: drop redundant data copy in control path Sergey Matyukevich OS
2018-10-02  9:26 ` [PATCH 13/13] qtnfmac: implement dump_station support for STA mode Sergey Matyukevich OS
2018-10-05  8:19 ` [PATCH 00/13] qtnfmac: fixes and cleanups " Kalle Valo
2018-10-05  9:56   ` Sergey Matyukevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181002092542.18966-12-sergey.matyukevich.os@quantenna.com \
    --to=sergey.matyukevich.os@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.