aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/iface.c27
-rw-r--r--net/mac80211/mlme.c24
2 files changed, 39 insertions, 12 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 58150f877ec3..9ed49ad0380f 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -78,7 +78,7 @@ void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
78 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER); 78 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER);
79} 79}
80 80
81u32 ieee80211_idle_off(struct ieee80211_local *local) 81static u32 __ieee80211_idle_off(struct ieee80211_local *local)
82{ 82{
83 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE)) 83 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE))
84 return 0; 84 return 0;
@@ -87,7 +87,7 @@ u32 ieee80211_idle_off(struct ieee80211_local *local)
87 return IEEE80211_CONF_CHANGE_IDLE; 87 return IEEE80211_CONF_CHANGE_IDLE;
88} 88}
89 89
90static u32 ieee80211_idle_on(struct ieee80211_local *local) 90static u32 __ieee80211_idle_on(struct ieee80211_local *local)
91{ 91{
92 if (local->hw.conf.flags & IEEE80211_CONF_IDLE) 92 if (local->hw.conf.flags & IEEE80211_CONF_IDLE)
93 return 0; 93 return 0;
@@ -98,16 +98,18 @@ static u32 ieee80211_idle_on(struct ieee80211_local *local)
98 return IEEE80211_CONF_CHANGE_IDLE; 98 return IEEE80211_CONF_CHANGE_IDLE;
99} 99}
100 100
101void ieee80211_recalc_idle(struct ieee80211_local *local) 101static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
102 bool force_active)
102{ 103{
103 bool working = false, scanning, active; 104 bool working = false, scanning, active;
104 unsigned int led_trig_start = 0, led_trig_stop = 0; 105 unsigned int led_trig_start = 0, led_trig_stop = 0;
105 struct ieee80211_roc_work *roc; 106 struct ieee80211_roc_work *roc;
106 u32 change;
107 107
108 lockdep_assert_held(&local->mtx); 108 lockdep_assert_held(&local->mtx);
109 109
110 active = !list_empty(&local->chanctx_list) || local->monitors; 110 active = force_active ||
111 !list_empty(&local->chanctx_list) ||
112 local->monitors;
111 113
112 if (!local->ops->remain_on_channel) { 114 if (!local->ops->remain_on_channel) {
113 list_for_each_entry(roc, &local->roc_list, list) { 115 list_for_each_entry(roc, &local->roc_list, list) {
@@ -132,9 +134,18 @@ void ieee80211_recalc_idle(struct ieee80211_local *local)
132 ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop); 134 ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop);
133 135
134 if (working || scanning || active) 136 if (working || scanning || active)
135 change = ieee80211_idle_off(local); 137 return __ieee80211_idle_off(local);
136 else 138 return __ieee80211_idle_on(local);
137 change = ieee80211_idle_on(local); 139}
140
141u32 ieee80211_idle_off(struct ieee80211_local *local)
142{
143 return __ieee80211_recalc_idle(local, true);
144}
145
146void ieee80211_recalc_idle(struct ieee80211_local *local)
147{
148 u32 change = __ieee80211_recalc_idle(local, false);
138 if (change) 149 if (change)
139 ieee80211_hw_config(local, change); 150 ieee80211_hw_config(local, change);
140} 151}
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 82cc30318a86..346ad4cfb013 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3964,8 +3964,16 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
3964 /* prep auth_data so we don't go into idle on disassoc */ 3964 /* prep auth_data so we don't go into idle on disassoc */
3965 ifmgd->auth_data = auth_data; 3965 ifmgd->auth_data = auth_data;
3966 3966
3967 if (ifmgd->associated) 3967 if (ifmgd->associated) {
3968 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 3968 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
3969
3970 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
3971 WLAN_REASON_UNSPECIFIED,
3972 false, frame_buf);
3973
3974 __cfg80211_send_deauth(sdata->dev, frame_buf,
3975 sizeof(frame_buf));
3976 }
3969 3977
3970 sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid); 3978 sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid);
3971 3979
@@ -4025,8 +4033,16 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
4025 4033
4026 mutex_lock(&ifmgd->mtx); 4034 mutex_lock(&ifmgd->mtx);
4027 4035
4028 if (ifmgd->associated) 4036 if (ifmgd->associated) {
4029 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 4037 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
4038
4039 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
4040 WLAN_REASON_UNSPECIFIED,
4041 false, frame_buf);
4042
4043 __cfg80211_send_deauth(sdata->dev, frame_buf,
4044 sizeof(frame_buf));
4045 }
4030 4046
4031 if (ifmgd->auth_data && !ifmgd->auth_data->done) { 4047 if (ifmgd->auth_data && !ifmgd->auth_data->done) {
4032 err = -EBUSY; 4048 err = -EBUSY;