Commit 8986f0a9 authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Kalle Valo

wifi: rtw88: simplify vif iterators

Since all iterators called by 'rtw_iterate_vifs()' never uses
'mac' argument, it may be omitted, and 'struct rtw_vifs_entry'
may be simplified accordingly.
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230628072327.167196-4-dmantipov@yandex.ru
parent e88c9558
...@@ -140,7 +140,7 @@ struct rtw_beacon_filter_iter_data { ...@@ -140,7 +140,7 @@ struct rtw_beacon_filter_iter_data {
u8 *payload; u8 *payload;
}; };
static void rtw_fw_bcn_filter_notify_vif_iter(void *data, u8 *mac, static void rtw_fw_bcn_filter_notify_vif_iter(void *data,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct rtw_beacon_filter_iter_data *iter_data = data; struct rtw_beacon_filter_iter_data *iter_data = data;
......
...@@ -185,8 +185,7 @@ static void rtw_dynamic_csi_rate(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif) ...@@ -185,8 +185,7 @@ static void rtw_dynamic_csi_rate(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif)
bf_info->cur_csi_rpt_rate = new_csi_rate_idx; bf_info->cur_csi_rpt_rate = new_csi_rate_idx;
} }
static void rtw_vif_watch_dog_iter(void *data, u8 *mac, static void rtw_vif_watch_dog_iter(void *data, struct ieee80211_vif *vif)
struct ieee80211_vif *vif)
{ {
struct rtw_watch_dog_iter_data *iter_data = data; struct rtw_watch_dog_iter_data *iter_data = data;
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
...@@ -2330,7 +2329,7 @@ struct rtw_iter_port_switch_data { ...@@ -2330,7 +2329,7 @@ struct rtw_iter_port_switch_data {
struct rtw_vif *rtwvif_ap; struct rtw_vif *rtwvif_ap;
}; };
static void rtw_port_switch_iter(void *data, u8 *mac, struct ieee80211_vif *vif) static void rtw_port_switch_iter(void *data, struct ieee80211_vif *vif)
{ {
struct rtw_iter_port_switch_data *iter_data = data; struct rtw_iter_port_switch_data *iter_data = data;
struct rtw_dev *rtwdev = iter_data->rtwdev; struct rtw_dev *rtwdev = iter_data->rtwdev;
...@@ -2382,8 +2381,7 @@ void rtw_core_port_switch(struct rtw_dev *rtwdev, struct ieee80211_vif *vif) ...@@ -2382,8 +2381,7 @@ void rtw_core_port_switch(struct rtw_dev *rtwdev, struct ieee80211_vif *vif)
rtw_iterate_vifs(rtwdev, rtw_port_switch_iter, &iter_data); rtw_iterate_vifs(rtwdev, rtw_port_switch_iter, &iter_data);
} }
static void rtw_check_sta_active_iter(void *data, u8 *mac, static void rtw_check_sta_active_iter(void *data, struct ieee80211_vif *vif)
struct ieee80211_vif *vif)
{ {
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
bool *active = data; bool *active = data;
......
...@@ -37,8 +37,7 @@ int rtw_enter_ips(struct rtw_dev *rtwdev) ...@@ -37,8 +37,7 @@ int rtw_enter_ips(struct rtw_dev *rtwdev)
return 0; return 0;
} }
static void rtw_restore_port_cfg_iter(void *data, u8 *mac, static void rtw_restore_port_cfg_iter(void *data, struct ieee80211_vif *vif)
struct ieee80211_vif *vif)
{ {
struct rtw_dev *rtwdev = data; struct rtw_dev *rtwdev = data;
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
...@@ -320,8 +319,7 @@ static void __rtw_vif_recalc_lps(struct rtw_vif_recalc_lps_iter_data *data, ...@@ -320,8 +319,7 @@ static void __rtw_vif_recalc_lps(struct rtw_vif_recalc_lps_iter_data *data,
data->found_vif = vif; data->found_vif = vif;
} }
static void rtw_vif_recalc_lps_iter(void *data, u8 *mac, static void rtw_vif_recalc_lps_iter(void *data, struct ieee80211_vif *vif)
struct ieee80211_vif *vif)
{ {
__rtw_vif_recalc_lps(data, vif); __rtw_vif_recalc_lps(data, vif);
} }
......
...@@ -159,7 +159,6 @@ void rtw_iterate_stas(struct rtw_dev *rtwdev, ...@@ -159,7 +159,6 @@ void rtw_iterate_stas(struct rtw_dev *rtwdev,
struct rtw_vifs_entry { struct rtw_vifs_entry {
struct list_head list; struct list_head list;
struct ieee80211_vif *vif; struct ieee80211_vif *vif;
u8 mac[ETH_ALEN];
}; };
struct rtw_iter_vifs_data { struct rtw_iter_vifs_data {
...@@ -177,13 +176,11 @@ static void rtw_collect_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) ...@@ -177,13 +176,11 @@ static void rtw_collect_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
return; return;
vifs_entry->vif = vif; vifs_entry->vif = vif;
ether_addr_copy(vifs_entry->mac, mac);
list_add_tail(&vifs_entry->list, &iter_stas->list); list_add_tail(&vifs_entry->list, &iter_stas->list);
} }
void rtw_iterate_vifs(struct rtw_dev *rtwdev, void rtw_iterate_vifs(struct rtw_dev *rtwdev,
void (*iterator)(void *data, u8 *mac, void (*iterator)(void *data, struct ieee80211_vif *vif),
struct ieee80211_vif *vif),
void *data) void *data)
{ {
struct rtw_iter_vifs_data iter_data; struct rtw_iter_vifs_data iter_data;
...@@ -204,7 +201,7 @@ void rtw_iterate_vifs(struct rtw_dev *rtwdev, ...@@ -204,7 +201,7 @@ void rtw_iterate_vifs(struct rtw_dev *rtwdev,
list_for_each_entry_safe(vif_entry, tmp, &iter_data.list, list_for_each_entry_safe(vif_entry, tmp, &iter_data.list,
list) { list) {
list_del_init(&vif_entry->list); list_del_init(&vif_entry->list);
iterator(data, vif_entry->mac, vif_entry->vif); iterator(data, vif_entry->vif);
kfree(vif_entry); kfree(vif_entry);
} }
} }
...@@ -18,8 +18,7 @@ struct rtw_dev; ...@@ -18,8 +18,7 @@ struct rtw_dev;
ieee80211_iter_keys_rcu((rtwdev)->hw, vif, iterator, data) ieee80211_iter_keys_rcu((rtwdev)->hw, vif, iterator, data)
void rtw_iterate_vifs(struct rtw_dev *rtwdev, void rtw_iterate_vifs(struct rtw_dev *rtwdev,
void (*iterator)(void *data, u8 *mac, void (*iterator)(void *data, struct ieee80211_vif *vif),
struct ieee80211_vif *vif),
void *data); void *data);
void rtw_iterate_stas(struct rtw_dev *rtwdev, void rtw_iterate_stas(struct rtw_dev *rtwdev,
void (*iterator)(void *data, void (*iterator)(void *data,
......
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