summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShaul Triebitz <shaul.triebitz@intel.com>2022-06-06 15:51:45 +0300
committerJohannes Berg <johannes.berg@intel.com>2022-06-20 12:55:52 +0200
commit7a52107e441effadd850a7bf155c4719205ad6d7 (patch)
tree376a3947357181b450764e82b15c71b8001dbc7f /drivers
parent325839da9581ee3e881e9c318cbebbdd680cb101 (diff)
wifi: mac80211_hwsim: split bss_info_changed to vif/link info_changed
Replace the bss_info_changed callback with vif_cfg_changed and link_info_changed callbacks (for vif changes and link changes). Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index f9392bec85d9..be83904c642b 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2097,31 +2097,44 @@ static void mac80211_hwsim_bcn_en_iter(void *data, u8 *mac,
(*count)++;
}
-static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
+static void mac80211_hwsim_vif_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- struct ieee80211_bss_conf *info,
u64 changed)
{
struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
- struct mac80211_hwsim_data *data = hw->priv;
hwsim_check_magic(vif);
wiphy_dbg(hw->wiphy, "%s(changed=0x%llx vif->addr=%pM)\n",
__func__, changed, vif->addr);
- if (changed & BSS_CHANGED_BSSID) {
- wiphy_dbg(hw->wiphy, "%s: BSSID changed: %pM\n",
- __func__, info->bssid);
- memcpy(vp->bssid, info->bssid, ETH_ALEN);
- }
-
if (changed & BSS_CHANGED_ASSOC) {
wiphy_dbg(hw->wiphy, " ASSOC: assoc=%d aid=%d\n",
vif->cfg.assoc, vif->cfg.aid);
vp->assoc = vif->cfg.assoc;
vp->aid = vif->cfg.aid;
}
+}
+
+static void mac80211_hwsim_link_info_changed(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ u32 link_id,
+ u64 changed)
+{
+ struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
+ struct mac80211_hwsim_data *data = hw->priv;
+ struct ieee80211_bss_conf *info = vif->link_conf[link_id];
+
+ hwsim_check_magic(vif);
+
+ wiphy_dbg(hw->wiphy, "%s(changed=0x%llx vif->addr=%pM)\n",
+ __func__, (unsigned long long)changed, vif->addr);
+
+ if (changed & BSS_CHANGED_BSSID) {
+ wiphy_dbg(hw->wiphy, "%s: BSSID changed: %pM\n",
+ __func__, info->bssid);
+ memcpy(vp->bssid, info->bssid, ETH_ALEN);
+ }
if (changed & BSS_CHANGED_BEACON_ENABLED) {
wiphy_dbg(hw->wiphy, " BCN EN: %d (BI=%u)\n",
@@ -2803,7 +2816,8 @@ static int mac80211_hwsim_tx_last_beacon(struct ieee80211_hw *hw)
.remove_interface = mac80211_hwsim_remove_interface, \
.config = mac80211_hwsim_config, \
.configure_filter = mac80211_hwsim_configure_filter, \
- .bss_info_changed = mac80211_hwsim_bss_info_changed, \
+ .vif_cfg_changed = mac80211_hwsim_vif_info_changed, \
+ .link_info_changed = mac80211_hwsim_link_info_changed, \
.tx_last_beacon = mac80211_hwsim_tx_last_beacon, \
.sta_add = mac80211_hwsim_sta_add, \
.sta_remove = mac80211_hwsim_sta_remove, \