cfg80211: disconnect on suspend
Subsystems (2)
PATCH v2 1/8 cfg80211: disconnect on suspend
If possible that after suspend, cfg80211 will receive request to disconnect what require action on interface that was removed during suspend.
Problem can manifest itself by various warnings similar to below one:
WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]() wlan0: Failed check-sdata-in-driver check, flags: 0x4 Call Trace: [<c043e0b3>] warn_slowpath_fmt+0x33/0x40 [<f83707c9>] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211] [<f83a660a>] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211] [<f83a6706>] ieee80211_set_disassoc+0xf6/0x500 [mac80211] [<f83a9441>] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211] [<f8381b36>] ieee80211_deauth+0x16/0x20 [mac80211] [<f8261e70>] cfg80211_mlme_down+0x70/0xc0 [cfg80211] [<f8264de1>] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211]
To fix the problem disconnect from any associated network before suspend. User space is responsible to establish connection again after resume. This basically need to be done by user space anyway, because associated stations can go away during suspend (for example NetworkManager disconnects on suspend and connect on resume by default).
--- net/wireless/core.c | 73 +++++++++++++++++++++++++++++----------------------- net/wireless/core.h | 3 +++ net/wireless/sysfs.c | 14 +++++++--- 3 files changed, 54 insertions(+), 36 deletions(-)
net/wireless/core.c +41 -32
@@ -815,6 +815,46 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, rdev->num_running_monitor_ifaces += num; } +void cfg80211_leave (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev) +{ +struct net_device *dev = wdev->netdev; + +switch (wdev->iftype) { +case NL80211_IFTYPE_ADHOC : +cfg80211_leave_ibss (rdev, dev, true); +break ; +case NL80211_IFTYPE_P2P_CLIENT : +case NL80211_IFTYPE_STATION : +mutex_lock (&rdev->sched_scan_mtx); +__cfg80211_stop_sched_scan (rdev, false); +mutex_unlock (&rdev->sched_scan_mtx); + +wdev_lock (wdev); +#ifdef CONFIG_CFG80211_WEXT +kfree (wdev->wext.ie); + wdev->wext.ie =NULL ; + wdev->wext.ie_len =0 ; + wdev->wext.connect.auth_type =NL80211_AUTHTYPE_AUTOMATIC ; +#endif +__cfg80211_disconnect (rdev, dev, +WLAN_REASON_DEAUTH_LEAVING , true); +cfg80211_mlme_down (rdev, dev); +wdev_unlock (wdev); +break ; +case NL80211_IFTYPE_MESH_POINT : +cfg80211_leave_mesh (rdev, dev); +break ; +case NL80211_IFTYPE_AP : +cfg80211_stop_ap (rdev, dev); +break ; +default : +break ; + } + + wdev->beacon_interval =0 ; +} +static int cfg80211_netdev_notifier_call (struct notifier_block *nb,unsigned long state,void *ndev)
@@ -883,38 +923,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, dev->priv_flags |=IFF_DONT_BRIDGE ;break ;case NETDEV_GOING_DOWN : -switch (wdev->iftype) { -case NL80211_IFTYPE_ADHOC : -cfg80211_leave_ibss (rdev, dev, true); -break ; -case NL80211_IFTYPE_P2P_CLIENT : -case NL80211_IFTYPE_STATION : -mutex_lock (&rdev->sched_scan_mtx); -__cfg80211_stop_sched_scan (rdev, false); -mutex_unlock (&rdev->sched_scan_mtx); - -wdev_lock (wdev); -#ifdef CONFIG_CFG80211_WEXT -kfree (wdev->wext.ie); - wdev->wext.ie =NULL ; - wdev->wext.ie_len =0 ; - wdev->wext.connect.auth_type =NL80211_AUTHTYPE_AUTOMATIC ; -#endif -__cfg80211_disconnect (rdev, dev, -WLAN_REASON_DEAUTH_LEAVING , true); -cfg80211_mlme_down (rdev, dev); -wdev_unlock (wdev); -break ; -case NL80211_IFTYPE_MESH_POINT : -cfg80211_leave_mesh (rdev, dev); -break ; -case NL80211_IFTYPE_AP : -cfg80211_stop_ap (rdev, dev); -break ; -default : -break ; - } - wdev->beacon_interval =0 ; +cfg80211_leave (rdev, wdev);break ;case NETDEV_DOWN :cfg80211_update_iface_num (rdev, wdev->iftype,-1 );
net/wireless/core.h +3 -0
@@ -503,6 +503,9 @@ int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,void cfg80211_update_iface_num (struct cfg80211_registered_device *rdev,enum nl80211_iftype iftype,int num); +void cfg80211_leave (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev); +#define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10#ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
net/wireless/sysfs.c +10 -4
@@ -86,16 +86,22 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env)static int wiphy_suspend (struct device *dev,pm_message_t state) {struct cfg80211_registered_device *rdev =dev_to_rdev (dev); +struct wireless_dev *wdev;int ret =0 ; rdev->suspend_at =get_seconds (); -if (rdev->ops->suspend) { -rtnl_lock (); -if (rdev->wiphy.registered) +rtnl_lock (); +if (rdev->wiphy.registered) { +if (!rdev->wowlan) { +list_for_each_entry_rcu (wdev, &rdev->wdev_list, list) +cfg80211_leave (rdev, wdev); + } + +if (rdev->ops->suspend) ret =rdev_suspend (rdev); -rtnl_unlock (); } +rtnl_unlock ();return ret; }
Signature · 1 line
1.7.11.7
PATCH v2 2/8 cfg80211/mac80211: handle wowlan failure during suspend
Drivers can refuse to configure wowlan, handle that situation in cfg80211.
--- net/mac80211/pm.c | 2 +- net/wireless/rdev-ops.h | 7 ++++--- net/wireless/sysfs.c | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 11 deletions(-)
net/mac80211/pm.c +1 -1
@@ -93,7 +93,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)return err; }else if (err >0 ) {WARN_ON (err !=1 ); - local->wowlan = false; +return err; }else {list_for_each_entry (sdata, &local->interfaces, list)if (ieee80211_sdata_running (sdata))
net/wireless/rdev-ops.h +4 -3
@@ -6,11 +6,12 @@#include "core.h" #include "trace.h" -static inline int rdev_suspend (struct cfg80211_registered_device *rdev) +static inline int rdev_suspend (struct cfg80211_registered_device *rdev, +struct cfg80211_wowlan *wowlan) {int ret; -trace_rdev_suspend (&rdev->wiphy, rdev->wowlan); - ret = rdev->ops->suspend (&rdev->wiphy, rdev->wowlan); +trace_rdev_suspend (&rdev->wiphy, wowlan); + ret = rdev->ops->suspend (&rdev->wiphy, wowlan);trace_rdev_return_int (&rdev->wiphy, ret);return ret; }
net/wireless/sysfs.c +16 -7
@@ -83,23 +83,32 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env)return 0 ; } +static void cfg80211_leave_all (struct cfg80211_registered_device *rdev) +{ +struct wireless_dev *wdev; + +list_for_each_entry_rcu (wdev, &rdev->wdev_list, list) +cfg80211_leave (rdev, wdev); +} +static int wiphy_suspend (struct device *dev,pm_message_t state) {struct cfg80211_registered_device *rdev =dev_to_rdev (dev); -struct wireless_dev *wdev;int ret =0 ; rdev->suspend_at =get_seconds ();rtnl_lock ();if (rdev->wiphy.registered) { -if (!rdev->wowlan) { -list_for_each_entry_rcu (wdev, &rdev->wdev_list, list) -cfg80211_leave (rdev, wdev); - } - +if (!rdev->wowlan) +cfg80211_leave_all (rdev);if (rdev->ops->suspend) - ret =rdev_suspend (rdev); + ret =rdev_suspend (rdev, rdev->wowlan); +if (ret ==1 ) { +/* Driver refuse to configure wowlan */ +cfg80211_leave_all (rdev); + ret =rdev_suspend (rdev,NULL ); + } }rtnl_unlock ();
Signature · 1 line
1.7.11.7
PATCH v2 3/8 mac80211: cleanup generic suspend/resume procedures
In reply to Stanislaw GruszkaSince now we disconnect before suspend, various code which save connection state can now be removed from suspend and resume procedure. Cleanup on resume side is smaller as ieee80211_reconfig() is also used for H/W restart.
--- net/mac80211/ieee80211_i.h | 4 --- net/mac80211/key.c | 14 ---------- net/mac80211/key.h | 1 - net/mac80211/pm.c | 68 ---------------------------------------------- net/mac80211/util.c | 26 ------------------ 5 files changed, 113 deletions(-)
net/mac80211/ieee80211_i.h +0 -4
@@ -765,10 +765,6 @@ struct ieee80211_sub_if_data { } debugfs;#endif -#ifdef CONFIG_PM -struct ieee80211_bss_conf suspend_bss_conf; -#endif -/* must be last, dynamically sized area in this! */ struct ieee80211_vif vif; };
net/mac80211/key.c +0 -14
@@ -566,20 +566,6 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw, }EXPORT_SYMBOL (ieee80211_iter_keys); -void ieee80211_disable_keys (struct ieee80211_sub_if_data *sdata) -{ -struct ieee80211_key *key; - -ASSERT_RTNL (); - -mutex_lock (&sdata->local->key_mtx); - -list_for_each_entry (key, &sdata->key_list, list) -ieee80211_key_disable_hw_accel (key); - -mutex_unlock (&sdata->local->key_mtx); -} -void ieee80211_free_keys (struct ieee80211_sub_if_data *sdata) {struct ieee80211_key *key, *tmp;
net/mac80211/key.h +0 -1
@@ -143,7 +143,6 @@ void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, int idx);void ieee80211_free_keys (struct ieee80211_sub_if_data *sdata);void ieee80211_enable_keys (struct ieee80211_sub_if_data *sdata); -void ieee80211_disable_keys (struct ieee80211_sub_if_data *sdata);#define key_mtx_dereference (local, ref) \ rcu_dereference_protected(ref, lockdep_is_held(&((local)->key_mtx)))
net/mac80211/pm.c +0 -68
98 lines not on this page · raw message
net/mac80211/util.c +0 -26
@@ -1534,11 +1534,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)BSS_CHANGED_IDLE |BSS_CHANGED_TXPOWER ; -#ifdef CONFIG_PM -if (local->resuming && !reconfig_due_to_wowlan) - sdata->vif.bss_conf = sdata->suspend_bss_conf; -#endif -switch (sdata->vif.type) {case NL80211_IFTYPE_STATION : changed |= BSS_CHANGED_ASSOC |
@@ -1678,28 +1673,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)mb (); local->resuming = false; -list_for_each_entry (sdata, &local->interfaces, list) { -switch (sdata->vif.type) { -case NL80211_IFTYPE_STATION : -ieee80211_sta_restart (sdata); -break ; -case NL80211_IFTYPE_ADHOC : -ieee80211_ibss_restart (sdata); -break ; -case NL80211_IFTYPE_MESH_POINT : -ieee80211_mesh_restart (sdata); -break ; -default : -break ; - } - } -mod_timer (&local->sta_cleanup, jiffies +1 ); - -mutex_lock (&local->sta_mtx); -list_for_each_entry (sta, &local->sta_list, list) -mesh_plink_restart (sta); -mutex_unlock (&local->sta_mtx);#else WARN_ON (1 );#endif
Signature · 1 line
1.7.11.7
PATCH v2 4/8 mac80211: cleanup suspend/resume on managed mode
In reply to Stanislaw GruszkaRemove not used any longer suspend/resume code.
--- net/mac80211/ieee80211_i.h | 3 -- net/mac80211/mlme.c | 84 ++-------------------------------------------- 2 files changed, 2 insertions(+), 85 deletions(-)
net/mac80211/ieee80211_i.h +0 -3
@@ -400,7 +400,6 @@ struct ieee80211_if_managed {u16 aid; -unsigned long timers_running;/* used for quiesce/restart */ bool powersave;/* powersave requested for this iface */ bool broken_ap;/* AP is broken -- turn off powersave */ u8 dtim_period;
@@ -1279,8 +1278,6 @@ void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, const struct ieee80211_channel_sw_ie *sw_elem, struct ieee80211_bss *bss, u64 timestamp); -void ieee80211_sta_quiesce (struct ieee80211_sub_if_data *sdata); -void ieee80211_sta_restart (struct ieee80211_sub_if_data *sdata);void ieee80211_sta_work (struct ieee80211_sub_if_data *sdata);void ieee80211_sta_rx_queued_mgmt (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb);
net/mac80211/mlme.c +2 -82
116 lines not on this page · raw message
Signature · 1 line
1.7.11.7
PATCH v2 5/8 mac80211: cleanup suspend/resume on ibss mode
In reply to Stanislaw GruszkaRemove not used any longer suspend/resume code.
--- net/mac80211/ibss.c | 29 +---------------------------- net/mac80211/ieee80211_i.h | 4 ---- 2 files changed, 1 insertion(+), 32 deletions(-)
net/mac80211/ibss.c +1 -28
@@ -985,36 +985,9 @@ static void ieee80211_ibss_timer(unsigned long data) {struct ieee80211_sub_if_data *sdata = (struct ieee80211_sub_if_data *) data; -struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; -struct ieee80211_local *local = sdata->local; - -if (local->quiescing) { - ifibss->timer_running = true; -return ; - } - -ieee80211_queue_work (&local->hw, &sdata->work); -} - -#ifdef CONFIG_PM -void ieee80211_ibss_quiesce (struct ieee80211_sub_if_data *sdata) -{ -struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; -if (del_timer_sync (&ifibss->timer)) - ifibss->timer_running = true; -} - -void ieee80211_ibss_restart (struct ieee80211_sub_if_data *sdata) -{ -struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; - -if (ifibss->timer_running) { -add_timer (&ifibss->timer); - ifibss->timer_running = false; - } +ieee80211_queue_work (&sdata->local->hw, &sdata->work); } -#endif void ieee80211_ibss_setup_sdata (struct ieee80211_sub_if_data *sdata) {
net/mac80211/ieee80211_i.h +0 -4
@@ -489,8 +489,6 @@ struct ieee80211_if_ibss {u32 basic_rates; -bool timer_running; -bool fixed_bssid;bool fixed_channel;bool privacy;
@@ -1295,8 +1293,6 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,int ieee80211_ibss_join (struct ieee80211_sub_if_data *sdata,struct cfg80211_ibss_params *params);int ieee80211_ibss_leave (struct ieee80211_sub_if_data *sdata); -void ieee80211_ibss_quiesce (struct ieee80211_sub_if_data *sdata); -void ieee80211_ibss_restart (struct ieee80211_sub_if_data *sdata);void ieee80211_ibss_work (struct ieee80211_sub_if_data *sdata);void ieee80211_ibss_rx_queued_mgmt (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb);
Signature · 1 line
1.7.11.7
PATCH v2 6/8 mac80211: cleanup suspend/resume on mesh mode
In reply to Stanislaw GruszkaRemove not used any longer suspend/resume code.
--- net/mac80211/ieee80211_i.h | 2 -- net/mac80211/mesh.c | 57 ++-------------------------------------------- net/mac80211/mesh.h | 12 ---------- net/mac80211/mesh_plink.c | 27 +--------------------- net/mac80211/sta_info.h | 2 -- 5 files changed, 3 insertions(+), 97 deletions(-)
net/mac80211/ieee80211_i.h +0 -2
@@ -540,8 +540,6 @@ struct ieee80211_if_mesh {struct timer_list mesh_path_timer;struct timer_list mesh_path_root_timer; -unsigned long timers_running; -unsigned long wrkq_flags;u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN ];
net/mac80211/mesh.c +2 -55
97 lines not on this page · raw message
net/mac80211/mesh.h +0 -12
@@ -313,8 +313,6 @@ void mesh_path_timer(unsigned long data);void mesh_path_flush_by_nexthop (struct sta_info *sta);void mesh_path_discard_frame (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); -void mesh_path_quiesce (struct ieee80211_sub_if_data *sdata); -void mesh_path_restart (struct ieee80211_sub_if_data *sdata);void mesh_path_tx_root_frame (struct ieee80211_sub_if_data *sdata);bool mesh_action_is_path_sel (struct ieee80211_mgmt *mgmt);
@@ -359,22 +357,12 @@ static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)void ieee80211_mesh_notify_scan_completed (struct ieee80211_local *local); -void ieee80211_mesh_quiesce (struct ieee80211_sub_if_data *sdata); -void ieee80211_mesh_restart (struct ieee80211_sub_if_data *sdata); -void mesh_plink_quiesce (struct sta_info *sta); -void mesh_plink_restart (struct sta_info *sta);void mesh_path_flush_by_iface (struct ieee80211_sub_if_data *sdata);void mesh_sync_adjust_tbtt (struct ieee80211_sub_if_data *sdata);void ieee80211s_stop (void );#else static inline void ieee80211_mesh_notify_scan_completed (struct ieee80211_local *local) {} -static inline void ieee80211_mesh_quiesce (struct ieee80211_sub_if_data *sdata) -{} -static inline void ieee80211_mesh_restart (struct ieee80211_sub_if_data *sdata) -{} -static inline void mesh_plink_quiesce (struct sta_info *sta) {} -static inline void mesh_plink_restart (struct sta_info *sta) {}static inline bool mesh_path_sel_is_hwmp (struct ieee80211_sub_if_data *sdata) {return false; }static inline void mesh_path_flush_by_iface (struct ieee80211_sub_if_data *sdata)
net/mac80211/mesh_plink.c +1 -26
@@ -534,10 +534,8 @@ static void mesh_plink_timer(unsigned long data)*/ sta = (struct sta_info *) data; -if (sta->sdata->local->quiescing) { - sta->plink_timer_was_running = true; +if (sta->sdata->local->quiescing)return ; - }spin_lock_bh (&sta->lock);if (sta->ignore_plink_timer) {
@@ -598,29 +596,6 @@ static void mesh_plink_timer(unsigned long data) } } -#ifdef CONFIG_PM -void mesh_plink_quiesce (struct sta_info *sta) -{ -if (!ieee80211_vif_is_mesh (&sta->sdata->vif)) -return ; - -/* no kernel mesh sta timers have been initialized */ -if (sta->sdata->u.mesh.security !=IEEE80211_MESH_SEC_NONE ) -return ; - -if (del_timer_sync (&sta->plink_timer)) - sta->plink_timer_was_running = true; -} - -void mesh_plink_restart (struct sta_info *sta) -{ -if (sta->plink_timer_was_running) { -add_timer (&sta->plink_timer); - sta->plink_timer_was_running = false; - } -} -#endif -static inline void mesh_plink_timer_set (struct sta_info *sta,int timeout) { sta->plink_timer.expires = jiffies + (HZ * timeout /1000 );
net/mac80211/sta_info.h +0 -2
@@ -281,7 +281,6 @@ struct sta_ampdu_mlme {* @plink_state: peer link state * @plink_timeout: timeout of peer link * @plink_timer: peer link watch timer -* @plink_timer_was_running: used by suspend/resume to restore timers * @t_offset: timing offset relative to this host * @t_offset_setpoint: reference timing offset of this sta to be used when * calculating clockdrift
@@ -379,7 +378,6 @@ struct sta_info {__le16 reason;u8 plink_retries;bool ignore_plink_timer; -bool plink_timer_was_running;enum nl80211_plink_state plink_state;u32 plink_timeout;struct timer_list plink_timer;
Signature · 1 line
1.7.11.7
PATCH v2 7/8 mac80211: merge suspend unassign chanctx code
In reply to Stanislaw Gruszka--- net/mac80211/pm.c | 56 ++++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 34 deletions(-)
net/mac80211/pm.c +22 -34
@@ -6,6 +6,26 @@#include "driver-ops.h" #include "led.h" +static void ieee80211_unassign_chanctx (struct ieee80211_local *local, +struct ieee80211_sub_if_data *sdata) + +{ +struct ieee80211_chanctx_conf *conf; +struct ieee80211_chanctx *ctx; + +if (!local->use_chanctx) +return ; + +mutex_lock (&local->chanctx_mtx); + conf =rcu_dereference_protected (sdata->vif.chanctx_conf, +lockdep_is_held (&local->chanctx_mtx)); +if (conf) { + ctx = container_of(conf, struct ieee80211_chanctx, conf); +drv_unassign_vif_chanctx (local, sdata, ctx); + } +mutex_unlock (&local->chanctx_mtx); +} +int __ieee80211_suspend (struct ieee80211_hw *hw,struct cfg80211_wowlan *wowlan) {struct ieee80211_local *local =hw_to_local (hw);
@@ -97,45 +117,13 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)list_for_each_entry (sdata, &local->interfaces, list) {if (!ieee80211_sdata_running (sdata))continue ; - -if (local->use_chanctx) { -struct ieee80211_chanctx_conf *conf; - -mutex_lock (&local->chanctx_mtx); - conf =rcu_dereference_protected ( - sdata->vif.chanctx_conf, -lockdep_is_held (&local->chanctx_mtx)); -if (conf) { - ctx =container_of (conf, - struct ieee80211_chanctx, - conf); -drv_unassign_vif_chanctx (local, sdata, ctx); - } - -mutex_unlock (&local->chanctx_mtx); - } +ieee80211_unassign_chanctx (local, sdata);drv_remove_interface (local, sdata); } sdata =rtnl_dereference (local->monitor_sdata);if (sdata) { -if (local->use_chanctx) { -struct ieee80211_chanctx_conf *conf; - -mutex_lock (&local->chanctx_mtx); - conf =rcu_dereference_protected ( - sdata->vif.chanctx_conf, -lockdep_is_held (&local->chanctx_mtx)); -if (conf) { - ctx =container_of (conf, - struct ieee80211_chanctx, - conf); -drv_unassign_vif_chanctx (local, sdata, ctx); - } - -mutex_unlock (&local->chanctx_mtx); - } - +ieee80211_unassign_chanctx (local, sdata);drv_remove_interface (local, sdata); }
Signature · 1 line
1.7.11.7
PATCH v2 8/8 mac80211: merge reconfig assign chanctx code
In reply to Stanislaw Gruszka--- net/mac80211/util.c | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-)
net/mac80211/util.c +22 -25
@@ -1357,6 +1357,25 @@ void ieee80211_stop_device(struct ieee80211_local *local)drv_stop (local); } +static void ieee80211_assign_chanctx (struct ieee80211_local *local, +struct ieee80211_sub_if_data *sdata) +{ +struct ieee80211_chanctx_conf *conf; +struct ieee80211_chanctx *ctx; + +if (!local->use_chanctx) +return ; + +mutex_lock (&local->chanctx_mtx); + conf =rcu_dereference_protected (sdata->vif.chanctx_conf, +lockdep_is_held (&local->chanctx_mtx)); +if (conf) { + ctx = container_of(conf, struct ieee80211_chanctx, conf); +drv_assign_vif_chanctx (local, sdata, ctx); + } +mutex_unlock (&local->chanctx_mtx); +} +int ieee80211_reconfig (struct ieee80211_local *local) {struct ieee80211_hw *hw = &local->hw;
@@ -1445,36 +1464,14 @@ int ieee80211_reconfig(struct ieee80211_local *local) }list_for_each_entry (sdata, &local->interfaces, list) { -struct ieee80211_chanctx_conf *ctx_conf; -if (!ieee80211_sdata_running (sdata))continue ; - -mutex_lock (&local->chanctx_mtx); - ctx_conf =rcu_dereference_protected (sdata->vif.chanctx_conf, -lockdep_is_held (&local->chanctx_mtx)); -if (ctx_conf) { - ctx = container_of(ctx_conf, struct ieee80211_chanctx, - conf); -drv_assign_vif_chanctx (local, sdata, ctx); - } -mutex_unlock (&local->chanctx_mtx); +ieee80211_assign_chanctx (local, sdata); } sdata =rtnl_dereference (local->monitor_sdata); -if (sdata && local->use_chanctx &&ieee80211_sdata_running (sdata)) { -struct ieee80211_chanctx_conf *ctx_conf; - -mutex_lock (&local->chanctx_mtx); - ctx_conf =rcu_dereference_protected (sdata->vif.chanctx_conf, -lockdep_is_held (&local->chanctx_mtx)); -if (ctx_conf) { - ctx = container_of(ctx_conf, struct ieee80211_chanctx, - conf); -drv_assign_vif_chanctx (local, sdata, ctx); - } -mutex_unlock (&local->chanctx_mtx); - } +if (sdata &&ieee80211_sdata_running (sdata)) +ieee80211_assign_chanctx (local, sdata);/* add STAs back */ mutex_lock (&local->sta_mtx);
Signature · 1 line
1.7.11.7