aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-05 11:02:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-16 15:26:40 -0400
commit7da7cc1d42d8ce02cca16df8c021e6d657f1f8fd (patch)
tree3d18e0b36edfcc015d27f66890cf4a8d60c45bda /net/mac80211/mlme.c
parent1fdaa46e9f26ccbab5e0eb8c4d4f8e1fbf32c7df (diff)
mac80211: per interface idle notification
Sometimes we don't just need to know whether or not the device is idle, but also per interface. This adds that reporting capability to mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 17e9257a61d8..82e7cec5179c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1103,8 +1103,11 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata)
1103 printk(KERN_DEBUG "Connection to AP %pM lost.\n", bssid); 1103 printk(KERN_DEBUG "Connection to AP %pM lost.\n", bssid);
1104 1104
1105 ieee80211_set_disassoc(sdata, true); 1105 ieee80211_set_disassoc(sdata, true);
1106 ieee80211_recalc_idle(local);
1107 mutex_unlock(&ifmgd->mtx); 1106 mutex_unlock(&ifmgd->mtx);
1107
1108 mutex_lock(&local->mtx);
1109 ieee80211_recalc_idle(local);
1110 mutex_unlock(&local->mtx);
1108 /* 1111 /*
1109 * must be outside lock due to cfg80211, 1112 * must be outside lock due to cfg80211,
1110 * but that's not a problem. 1113 * but that's not a problem.
@@ -1173,7 +1176,9 @@ ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
1173 sdata->name, bssid, reason_code); 1176 sdata->name, bssid, reason_code);
1174 1177
1175 ieee80211_set_disassoc(sdata, true); 1178 ieee80211_set_disassoc(sdata, true);
1179 mutex_lock(&sdata->local->mtx);
1176 ieee80211_recalc_idle(sdata->local); 1180 ieee80211_recalc_idle(sdata->local);
1181 mutex_unlock(&sdata->local->mtx);
1177 1182
1178 return RX_MGMT_CFG80211_DEAUTH; 1183 return RX_MGMT_CFG80211_DEAUTH;
1179} 1184}
@@ -1203,7 +1208,9 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
1203 sdata->name, mgmt->sa, reason_code); 1208 sdata->name, mgmt->sa, reason_code);
1204 1209
1205 ieee80211_set_disassoc(sdata, true); 1210 ieee80211_set_disassoc(sdata, true);
1211 mutex_lock(&sdata->local->mtx);
1206 ieee80211_recalc_idle(sdata->local); 1212 ieee80211_recalc_idle(sdata->local);
1213 mutex_unlock(&sdata->local->mtx);
1207 return RX_MGMT_CFG80211_DISASSOC; 1214 return RX_MGMT_CFG80211_DISASSOC;
1208} 1215}
1209 1216
@@ -1840,8 +1847,10 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
1840 " after %dms, disconnecting.\n", 1847 " after %dms, disconnecting.\n",
1841 bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); 1848 bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ);
1842 ieee80211_set_disassoc(sdata, true); 1849 ieee80211_set_disassoc(sdata, true);
1843 ieee80211_recalc_idle(local);
1844 mutex_unlock(&ifmgd->mtx); 1850 mutex_unlock(&ifmgd->mtx);
1851 mutex_lock(&local->mtx);
1852 ieee80211_recalc_idle(local);
1853 mutex_unlock(&local->mtx);
1845 /* 1854 /*
1846 * must be outside lock due to cfg80211, 1855 * must be outside lock due to cfg80211,
1847 * but that's not a problem. 1856 * but that's not a problem.
@@ -2319,7 +2328,9 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2319 if (assoc_bss) 2328 if (assoc_bss)
2320 sta_info_destroy_addr(sdata, bssid); 2329 sta_info_destroy_addr(sdata, bssid);
2321 2330
2331 mutex_lock(&sdata->local->mtx);
2322 ieee80211_recalc_idle(sdata->local); 2332 ieee80211_recalc_idle(sdata->local);
2333 mutex_unlock(&sdata->local->mtx);
2323 2334
2324 return 0; 2335 return 0;
2325} 2336}
@@ -2357,7 +2368,9 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
2357 cookie, !req->local_state_change); 2368 cookie, !req->local_state_change);
2358 sta_info_destroy_addr(sdata, bssid); 2369 sta_info_destroy_addr(sdata, bssid);
2359 2370
2371 mutex_lock(&sdata->local->mtx);
2360 ieee80211_recalc_idle(sdata->local); 2372 ieee80211_recalc_idle(sdata->local);
2373 mutex_unlock(&sdata->local->mtx);
2361 2374
2362 return 0; 2375 return 0;
2363} 2376}