Commit 5edadc5a authored by Igor Mitsyanko's avatar Igor Mitsyanko Committed by Kalle Valo

qtnfmac: update channel switch command to support 6GHz band

With an addition of 6GHz band support, channel number can no longer be
used to uniquely identify a specific channel. Modify channel switch
command to use chandef data.
Signed-off-by: default avatarIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 8b0b5f1b
...@@ -2519,6 +2519,7 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif, ...@@ -2519,6 +2519,7 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif,
struct qlink_cmd_chan_switch *cmd; struct qlink_cmd_chan_switch *cmd;
struct sk_buff *cmd_skb; struct sk_buff *cmd_skb;
int ret; int ret;
u64 flags = 0;
cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, vif->vifid, cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, vif->vifid,
QLINK_CMD_CHAN_SWITCH, QLINK_CMD_CHAN_SWITCH,
...@@ -2526,19 +2527,19 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif, ...@@ -2526,19 +2527,19 @@ int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif,
if (!cmd_skb) if (!cmd_skb)
return -ENOMEM; return -ENOMEM;
qtnf_bus_lock(mac->bus); if (params->radar_required)
flags |= QLINK_CHAN_SW_RADAR_REQUIRED;
if (params->block_tx)
flags |= QLINK_CHAN_SW_BLOCK_TX;
cmd = (struct qlink_cmd_chan_switch *)cmd_skb->data; cmd = (struct qlink_cmd_chan_switch *)cmd_skb->data;
cmd->channel = cpu_to_le16(params->chandef.chan->hw_value); qlink_chandef_cfg2q(&params->chandef, &cmd->channel);
cmd->radar_required = params->radar_required; cmd->flags = cpu_to_le64(flags);
cmd->block_tx = params->block_tx;
cmd->beacon_count = params->count; cmd->beacon_count = params->count;
qtnf_bus_lock(mac->bus);
ret = qtnf_cmd_send(mac->bus, cmd_skb); ret = qtnf_cmd_send(mac->bus, cmd_skb);
if (ret)
goto out;
out:
qtnf_bus_unlock(mac->bus); qtnf_bus_unlock(mac->bus);
return ret; return ret;
......
...@@ -700,19 +700,32 @@ struct qlink_cmd_reg_notify { ...@@ -700,19 +700,32 @@ struct qlink_cmd_reg_notify {
u8 info[0]; u8 info[0];
} __packed; } __packed;
/**
* enum qlink_chan_sw_flags - channel switch control flags
*
* @QLINK_CHAN_SW_RADAR_REQUIRED: whether radar detection is required on a new
* channel.
* @QLINK_CHAN_SW_BLOCK_TX: whether transmissions should be blocked while
* changing a channel.
*/
enum qlink_chan_sw_flags {
QLINK_CHAN_SW_RADAR_REQUIRED = BIT(0),
QLINK_CHAN_SW_BLOCK_TX = BIT(1),
};
/** /**
* struct qlink_cmd_chan_switch - data for QLINK_CMD_CHAN_SWITCH command * 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 * @channel: channel to switch to.
* @radar_required: whether radar detection is required on the new channel * @flags: flags to control channel switch, bitmap of &enum qlink_chan_sw_flags.
* @block_tx: whether transmissions should be blocked while changing
* @beacon_count: number of beacons until switch * @beacon_count: number of beacons until switch
*/ */
struct qlink_cmd_chan_switch { struct qlink_cmd_chan_switch {
struct qlink_cmd chdr; struct qlink_cmd chdr;
__le16 channel; struct qlink_chandef channel;
u8 radar_required; __le64 flags;
u8 block_tx; __le32 n_counter_offsets_beacon;
__le32 n_counter_offsets_presp;
u8 beacon_count; u8 beacon_count;
u8 rsvd[3]; u8 rsvd[3];
} __packed; } __packed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment