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>
This commit is contained in:
Igor Mitsyanko 2019-03-20 10:03:51 +00:00 committed by Kalle Valo
parent 642f15a5ce
commit a2fbaaf757
2 changed files with 27 additions and 1 deletions

View 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);

View 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;
/**