]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
qtnfmac: include full channels info to regulatory notifier
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Wed, 20 Mar 2019 10:03:51 +0000 (10:03 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 4 Apr 2019 09:57:26 +0000 (12:57 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/commands.c
drivers/net/wireless/quantenna/qtnfmac/qlink.h

index 9aabba7429edfb86c4a3b67e57cc340bd34d74f3..b1b622019f123cdbe0340329575c46ba646b109c 100644 (file)
@@ -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);
index 7798edcf7980250e75ff3c28d582b95e580517a1..ca84684a1a93cdef085682d22608d3c36c3ed826 100644 (file)
@@ -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;
 
 /**