diff options
author | Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> | 2019-03-20 10:03:51 +0000 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-04-04 12:57:26 +0300 |
commit | a2fbaaf757e312e9fa120908929f5bed6d5f81e5 (patch) | |
tree | 94ca9b3e9792dae70722516910b0b3f4ca1262c2 /drivers/net/wireless/quantenna | |
parent | 642f15a5cee74de7f4aab5e04f19045db8dcf871 (diff) | |
download | linux-stable-a2fbaaf757e312e9fa120908929f5bed6d5f81e5.tar.gz linux-stable-a2fbaaf757e312e9fa120908929f5bed6d5f81e5.tar.bz2 linux-stable-a2fbaaf757e312e9fa120908929f5bed6d5f81e5.zip |
qtnfmac: include full channels info to regulatory notifier
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>
Diffstat (limited to 'drivers/net/wireless/quantenna')
-rw-r--r-- | drivers/net/wireless/quantenna/qtnfmac/commands.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/quantenna/qtnfmac/qlink.h | 8 |
2 files changed, 27 insertions, 1 deletions
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 @@ out: 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; /** |