diff options
author | Johannes Berg <johannes.berg@intel.com> | 2022-06-10 11:21:21 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-06-20 12:56:14 +0200 |
commit | 0d8c4a3c8688bd0bbc67b8a24b4e7a7344272c93 (patch) | |
tree | 8035056d48beeacdc78aa39050410b250ae814b1 /net | |
parent | f2a0290b2df2b0e65ab78b71c4a15e732afd4458 (diff) |
wifi: mac80211: implement add/del interface link callbacks
When a link is added or removed via nl80211, these are
called. Implement them so we don't have to check in all
the different per-link commands whether we've already
created the necessary datastructures.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/cfg.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index abc3fa5a8d7e..6790fb78c068 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4549,6 +4549,24 @@ ieee80211_set_radar_background(struct wiphy *wiphy, return local->ops->set_radar_background(&local->hw, chandef); } +static int ieee80211_add_intf_link(struct wiphy *wiphy, + struct wireless_dev *wdev, + unsigned int link_id) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + + return ieee80211_vif_set_links(sdata, wdev->valid_links); +} + +static void ieee80211_del_intf_link(struct wiphy *wiphy, + struct wireless_dev *wdev, + unsigned int link_id) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + + ieee80211_vif_set_links(sdata, wdev->valid_links); +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -4654,4 +4672,6 @@ const struct cfg80211_ops mac80211_config_ops = { .set_sar_specs = ieee80211_set_sar_specs, .color_change = ieee80211_color_change, .set_radar_background = ieee80211_set_radar_background, + .add_intf_link = ieee80211_add_intf_link, + .del_intf_link = ieee80211_del_intf_link, }; |