wlcore: update channel_switch/stop_channel_switch commands
Some fields were added to the channel_switch and stop_channel_switch commands. Unfortunately, the new 18xx channel_switch struct is not backward compatible with the 12xx channel switch struct. Add a new channel_switch op to wlcore, and update the driver accordingly. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Esse commit está contido em:
@@ -284,3 +284,40 @@ int wl128x_cmd_radio_parms(struct wl1271 *wl)
|
||||
kfree(radio_parms);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int wl12xx_cmd_channel_switch(struct wl1271 *wl,
|
||||
struct wl12xx_vif *wlvif,
|
||||
struct ieee80211_channel_switch *ch_switch)
|
||||
{
|
||||
struct wl12xx_cmd_channel_switch *cmd;
|
||||
int ret;
|
||||
|
||||
wl1271_debug(DEBUG_ACX, "cmd channel switch");
|
||||
|
||||
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
|
||||
if (!cmd) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
cmd->role_id = wlvif->role_id;
|
||||
cmd->channel = ch_switch->channel->hw_value;
|
||||
cmd->switch_time = ch_switch->count;
|
||||
cmd->stop_tx = ch_switch->block_tx;
|
||||
|
||||
/* FIXME: control from mac80211 in the future */
|
||||
/* Enable TX on the target channel */
|
||||
cmd->post_switch_tx_disable = 0;
|
||||
|
||||
ret = wl1271_cmd_send(wl, CMD_CHANNEL_SWITCH, cmd, sizeof(*cmd), 0);
|
||||
if (ret < 0) {
|
||||
wl1271_error("failed to send channel switch command");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
out_free:
|
||||
kfree(cmd);
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
@@ -103,10 +103,30 @@ struct wl1271_ext_radio_parms_cmd {
|
||||
u8 padding[3];
|
||||
} __packed;
|
||||
|
||||
struct wl12xx_cmd_channel_switch {
|
||||
struct wl1271_cmd_header header;
|
||||
|
||||
u8 role_id;
|
||||
|
||||
/* The new serving channel */
|
||||
u8 channel;
|
||||
/* Relative time of the serving channel switch in TBTT units */
|
||||
u8 switch_time;
|
||||
/* Stop the role TX, should expect it after radar detection */
|
||||
u8 stop_tx;
|
||||
/* The target channel tx status 1-stopped 0-open*/
|
||||
u8 post_switch_tx_disable;
|
||||
|
||||
u8 padding[3];
|
||||
} __packed;
|
||||
|
||||
int wl1271_cmd_general_parms(struct wl1271 *wl);
|
||||
int wl128x_cmd_general_parms(struct wl1271 *wl);
|
||||
int wl1271_cmd_radio_parms(struct wl1271 *wl);
|
||||
int wl128x_cmd_radio_parms(struct wl1271 *wl);
|
||||
int wl1271_cmd_ext_radio_parms(struct wl1271 *wl);
|
||||
int wl12xx_cmd_channel_switch(struct wl1271 *wl,
|
||||
struct wl12xx_vif *wlvif,
|
||||
struct ieee80211_channel_switch *ch_switch);
|
||||
|
||||
#endif /* __WL12XX_CMD_H__ */
|
||||
|
@@ -1632,6 +1632,7 @@ static struct wlcore_ops wl12xx_ops = {
|
||||
.sched_scan_stop = wl12xx_scan_sched_scan_stop,
|
||||
.get_spare_blocks = wl12xx_get_spare_blocks,
|
||||
.set_key = wl12xx_set_key,
|
||||
.channel_switch = wl12xx_cmd_channel_switch,
|
||||
.pre_pkt_send = NULL,
|
||||
};
|
||||
|
||||
|
Referência em uma nova issue
Block a user