All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>,
	Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Subject: [PATCH 03/14] qtnfmac: include full channels info to regulatory notifier
Date: Wed, 20 Mar 2019 10:03:51 +0000	[thread overview]
Message-ID: <20190320100340.14168-4-sergey.matyukevich.os@quantenna.com> (raw)
In-Reply-To: <20190320100340.14168-1-sergey.matyukevich.os@quantenna.com>

From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>

Before regulatory notifier is invoked by a wireless core, it will
update band information for the wiphy. Pass this information to
firmware together with new region alpha2 code.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 20 ++++++++++++++++++++
 drivers/net/wireless/quantenna/qtnfmac/qlink.h    |  8 +++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 9aabba7429ed..b1b622019f12 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -2406,10 +2406,13 @@ int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up)
 
 int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req)
 {
+	struct wiphy *wiphy = priv_to_wiphy(mac);
 	struct qtnf_bus *bus = mac->bus;
 	struct sk_buff *cmd_skb;
 	int ret;
 	struct qlink_cmd_reg_notify *cmd;
+	enum nl80211_band band;
+	const struct ieee80211_supported_band *cfg_band;
 
 	cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD,
 					    QLINK_CMD_REG_NOTIFY,
@@ -2448,6 +2451,23 @@ int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req)
 		break;
 	}
 
+	cmd->num_channels = 0;
+
+	for (band = 0; band < NUM_NL80211_BANDS; band++) {
+		unsigned int i;
+
+		cfg_band = wiphy->bands[band];
+		if (!cfg_band)
+			continue;
+
+		cmd->num_channels += cfg_band->n_channels;
+
+		for (i = 0; i < cfg_band->n_channels; ++i) {
+			qtnf_cmd_channel_tlv_add(cmd_skb,
+						 &cfg_band->channels[i]);
+		}
+	}
+
 	qtnf_bus_lock(bus);
 	ret = qtnf_cmd_send(bus, cmd_skb);
 	qtnf_bus_unlock(bus);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 7798edcf7980..ca84684a1a93 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -6,7 +6,7 @@
 
 #include <linux/ieee80211.h>
 
-#define QLINK_PROTO_VER		13
+#define QLINK_PROTO_VER		14
 
 #define QLINK_MACID_RSVD		0xFF
 #define QLINK_VIFID_RSVD		0xFF
@@ -580,12 +580,18 @@ enum qlink_user_reg_hint_type {
  * @initiator: which entity sent the request, one of &enum qlink_reg_initiator.
  * @user_reg_hint_type: type of hint for QLINK_REGDOM_SET_BY_USER request, one
  *	of &enum qlink_user_reg_hint_type.
+ * @num_channels: number of &struct qlink_tlv_channel in a variable portion of a
+ *	payload.
+ * @info: variable portion of regulatory notifier callback.
  */
 struct qlink_cmd_reg_notify {
 	struct qlink_cmd chdr;
 	u8 alpha2[2];
 	u8 initiator;
 	u8 user_reg_hint_type;
+	u8 num_channels;
+	u8 rsvd[3];
+	u8 info[0];
 } __packed;
 
 /**
-- 
2.11.0


  parent reply	other threads:[~2019-03-20 10:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 10:03 [PATCH 00/14] qtnfmac: regulatory rework and misc fixes Sergey Matyukevich
2019-03-20 10:03 ` [PATCH 01/14] qtnfmac: make regulatory notifier work on per-phy basis Sergey Matyukevich
2019-04-04  9:58   ` Kalle Valo
2019-03-20 10:03 ` [PATCH 02/14] qtnfmac: simplify error reporting in regulatory notifier Sergey Matyukevich
2019-03-20 10:03 ` Sergey Matyukevich [this message]
2019-03-20 10:03 ` [PATCH 04/14] qtnfmac: pass complete channel info " Sergey Matyukevich
2019-03-20 10:03 ` [PATCH 05/14] qtnfmac: flexible regulatory domain registration logic Sergey Matyukevich
2019-03-20 10:03 ` [PATCH 06/14] qtnfmac: allow each MAC to specify its own regulatory rules Sergey Matyukevich
2019-03-20 10:03 ` [PATCH 07/14] qtnfmac: pass DFS region to firmware on region update Sergey Matyukevich
2019-03-20 10:04 ` [PATCH 08/14] qtnfmac: update bands information on CHANGE_INTF command Sergey Matyukevich
2019-03-20 10:04 ` [PATCH 09/14] qtnfmac: fix core attach error path in pcie backend Sergey Matyukevich
2019-03-20 10:04 ` [PATCH 10/14] qtnfmac: simplify firmware state tracking Sergey Matyukevich
2019-03-20 10:04 ` [PATCH 11/14] qtnfmac: allow changing the netns Sergey Matyukevich
2019-03-20 10:04 ` [PATCH 12/14] qtnfmac: fix debugfs entries for multiple cards on the same host Sergey Matyukevich
2019-03-20 14:05   ` Kalle Valo
2019-03-20 15:16     ` Sergey Matyukevich
2019-03-21  7:35       ` Kalle Valo
2019-03-21  8:26         ` Sergey Matyukevich
2019-03-22  8:44           ` Kalle Valo
2019-03-21 10:14         ` Arend Van Spriel
2019-03-21 15:46           ` Sergey Matyukevich
2019-03-21 17:06           ` Kalle Valo
2019-03-20 10:04 ` [PATCH 13/14] qtnfmac: send EAPOL frames via control path Sergey Matyukevich
2019-03-20 10:04 ` [PATCH 14/14] qtnfmac: use scan duration param for different scan types Sergey Matyukevich
2019-03-20 14:08   ` Kalle Valo
2019-03-20 15:21     ` 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=20190320100340.14168-4-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.