Commit a0ddf39a authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Kalle Valo

wifi: wilc1000: simplify remain on channel support

For 'struct wilc_remain_ch', drop set but otherwise unused 'duration'
field and adjust 'expired' callback assuming that the only data passed
to it is 'struct wilc_vif *', thus making 'wilc_remain_on_channel()'
a bit simpler as well. Compile tested only.
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Acked-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231026141016.71407-1-dmantipov@yandex.ru
parent 58534b3b
...@@ -1094,9 +1094,8 @@ static void wilc_wfi_mgmt_tx_complete(void *priv, int status) ...@@ -1094,9 +1094,8 @@ static void wilc_wfi_mgmt_tx_complete(void *priv, int status)
kfree(pv_data); kfree(pv_data);
} }
static void wilc_wfi_remain_on_channel_expired(void *data, u64 cookie) static void wilc_wfi_remain_on_channel_expired(struct wilc_vif *vif, u64 cookie)
{ {
struct wilc_vif *vif = data;
struct wilc_priv *priv = &vif->priv; struct wilc_priv *priv = &vif->priv;
struct wilc_wfi_p2p_listen_params *params = &priv->remain_on_ch_params; struct wilc_wfi_p2p_listen_params *params = &priv->remain_on_ch_params;
...@@ -1128,9 +1127,8 @@ static int remain_on_channel(struct wiphy *wiphy, ...@@ -1128,9 +1127,8 @@ static int remain_on_channel(struct wiphy *wiphy,
if (id == 0) if (id == 0)
id = ++priv->inc_roc_cookie; id = ++priv->inc_roc_cookie;
ret = wilc_remain_on_channel(vif, id, duration, chan->hw_value, ret = wilc_remain_on_channel(vif, id, chan->hw_value,
wilc_wfi_remain_on_channel_expired, wilc_wfi_remain_on_channel_expired);
(void *)vif);
if (ret) if (ret)
return ret; return ret;
......
...@@ -878,7 +878,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif, ...@@ -878,7 +878,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
if (result) if (result)
return -EBUSY; return -EBUSY;
hif_drv->remain_on_ch.arg = hif_remain_ch->arg; hif_drv->remain_on_ch.vif = hif_remain_ch->vif;
hif_drv->remain_on_ch.expired = hif_remain_ch->expired; hif_drv->remain_on_ch.expired = hif_remain_ch->expired;
hif_drv->remain_on_ch.ch = hif_remain_ch->ch; hif_drv->remain_on_ch.ch = hif_remain_ch->ch;
hif_drv->remain_on_ch.cookie = hif_remain_ch->cookie; hif_drv->remain_on_ch.cookie = hif_remain_ch->cookie;
...@@ -915,7 +915,7 @@ static int wilc_handle_roc_expired(struct wilc_vif *vif, u64 cookie) ...@@ -915,7 +915,7 @@ static int wilc_handle_roc_expired(struct wilc_vif *vif, u64 cookie)
} }
if (hif_drv->remain_on_ch.expired) { if (hif_drv->remain_on_ch.expired) {
hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.arg, hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.vif,
cookie); cookie);
} }
} else { } else {
...@@ -1669,18 +1669,15 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length) ...@@ -1669,18 +1669,15 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length)
} }
} }
int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u16 chan,
u32 duration, u16 chan, void (*expired)(struct wilc_vif *, u64))
void (*expired)(void *, u64),
void *user_arg)
{ {
struct wilc_remain_ch roc; struct wilc_remain_ch roc;
int result; int result;
roc.ch = chan; roc.ch = chan;
roc.expired = expired; roc.expired = expired;
roc.arg = user_arg; roc.vif = vif;
roc.duration = duration;
roc.cookie = cookie; roc.cookie = cookie;
result = handle_remain_on_chan(vif, &roc); result = handle_remain_on_chan(vif, &roc);
if (result) if (result)
......
...@@ -118,11 +118,11 @@ struct wilc_conn_info { ...@@ -118,11 +118,11 @@ struct wilc_conn_info {
void *param; void *param;
}; };
struct wilc_vif;
struct wilc_remain_ch { struct wilc_remain_ch {
u16 ch; u16 ch;
u32 duration; void (*expired)(struct wilc_vif *vif, u64 cookie);
void (*expired)(void *priv, u64 cookie); struct wilc_vif *vif;
void *arg;
u64 cookie; u64 cookie;
}; };
...@@ -150,7 +150,6 @@ struct host_if_drv { ...@@ -150,7 +150,6 @@ struct host_if_drv {
u8 assoc_resp[WILC_MAX_ASSOC_RESP_FRAME_SIZE]; u8 assoc_resp[WILC_MAX_ASSOC_RESP_FRAME_SIZE];
}; };
struct wilc_vif;
int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len,
const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic, const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic,
u8 mode, u8 cipher_mode, u8 index); u8 mode, u8 cipher_mode, u8 index);
...@@ -192,10 +191,8 @@ int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, ...@@ -192,10 +191,8 @@ int wilc_edit_station(struct wilc_vif *vif, const u8 *mac,
int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout); int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count, int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count,
u8 *mc_list); u8 *mc_list);
int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u16 chan,
u32 duration, u16 chan, void (*expired)(struct wilc_vif *, u64));
void (*expired)(void *, u64),
void *user_arg);
int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie); int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie);
void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg); void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg);
int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode, int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode,
......
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