qtnfmac: implement cfg80211 channel_switch handler

This patch implements cfg80211 channel_switch handler enabling CSA
channel-switch procedure.

Driver performs only basic validation of the requested new channel
and then sends command to firmware. Beacon IEs are not sent since
beacon update is handled by firmware.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Avinash Patil <avinashp@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Sergey Matyukevich
2017-07-28 02:06:50 +03:00
committed by Kalle Valo
parent 34f1145b2c
commit 97883695d5
6 changed files with 210 additions and 2 deletions

View File

@@ -153,6 +153,7 @@ enum qlink_cmd_type {
QLINK_CMD_UPDOWN_INTF = 0x0018,
QLINK_CMD_REG_NOTIFY = 0x0019,
QLINK_CMD_CHANS_INFO_GET = 0x001A,
QLINK_CMD_CHAN_SWITCH = 0x001B,
QLINK_CMD_CONFIG_AP = 0x0020,
QLINK_CMD_START_AP = 0x0021,
QLINK_CMD_STOP_AP = 0x0022,
@@ -482,6 +483,22 @@ struct qlink_cmd_reg_notify {
u8 user_reg_hint_type;
} __packed;
/**
* struct qlink_cmd_chan_switch - data for QLINK_CMD_CHAN_SWITCH command
*
* @channel: channel number according to 802.11 17.3.8.3.2 and Annex J
* @radar_required: whether radar detection is required on the new channel
* @block_tx: whether transmissions should be blocked while changing
* @beacon_count: number of beacons until switch
*/
struct qlink_cmd_chan_switch {
struct qlink_cmd chdr;
__le16 channel;
u8 radar_required;
u8 block_tx;
u8 beacon_count;
} __packed;
/* QLINK Command Responses messages related definitions
*/
@@ -667,6 +684,7 @@ enum qlink_event_type {
QLINK_EVENT_SCAN_COMPLETE = 0x0025,
QLINK_EVENT_BSS_JOIN = 0x0026,
QLINK_EVENT_BSS_LEAVE = 0x0027,
QLINK_EVENT_FREQ_CHANGE = 0x0028,
};
/**
@@ -736,6 +754,16 @@ struct qlink_event_bss_leave {
__le16 reason;
} __packed;
/**
* struct qlink_event_freq_change - data for QLINK_EVENT_FREQ_CHANGE event
*
* @freq: new operating frequency in MHz
*/
struct qlink_event_freq_change {
struct qlink_event ehdr;
__le32 freq;
} __packed;
enum qlink_rxmgmt_flags {
QLINK_RXMGMT_FLAG_ANSWERED = 1 << 0,
};