diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2013-08-27 05:36:35 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-09-26 07:27:11 -0400 |
commit | 392b9ffb05b62fe38aa813b924d160ab663cec8d (patch) | |
tree | 99e841bbfa3a32368cdaceb9fd7bc40a576a0205 /net | |
parent | a6ececf4ee24495ecf74672152e28c31cc208df3 (diff) |
mac80211: change beacon/connection polling
Since when we detect beacon lost we do active AP probing (using nullfunc
frame or probe request) there is no need to have beacon polling. Flags
IEEE80211_STA_BEACON_POLL seems to be used just for historical reasons.
Change also make that after we start connection poll due to beacon loss,
next received beacon will abort the poll.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 38 | ||||
-rw-r--r-- | net/mac80211/scan.c | 3 |
3 files changed, 10 insertions, 32 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index b6186517ec56..d353c6462d0f 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -322,7 +322,6 @@ struct ieee80211_roc_work { | |||
322 | 322 | ||
323 | /* flags used in struct ieee80211_if_managed.flags */ | 323 | /* flags used in struct ieee80211_if_managed.flags */ |
324 | enum ieee80211_sta_flags { | 324 | enum ieee80211_sta_flags { |
325 | IEEE80211_STA_BEACON_POLL = BIT(0), | ||
326 | IEEE80211_STA_CONNECTION_POLL = BIT(1), | 325 | IEEE80211_STA_CONNECTION_POLL = BIT(1), |
327 | IEEE80211_STA_CONTROL_PORT = BIT(2), | 326 | IEEE80211_STA_CONTROL_PORT = BIT(2), |
328 | IEEE80211_STA_DISABLE_HT = BIT(4), | 327 | IEEE80211_STA_DISABLE_HT = BIT(4), |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 86e4ad56b573..e396a2a97319 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -893,8 +893,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
893 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | 893 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) |
894 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; | 894 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; |
895 | 895 | ||
896 | if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL | | 896 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) |
897 | IEEE80211_STA_CONNECTION_POLL)) | ||
898 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_USE_MINRATE; | 897 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_USE_MINRATE; |
899 | 898 | ||
900 | ieee80211_tx_skb(sdata, skb); | 899 | ieee80211_tx_skb(sdata, skb); |
@@ -1374,8 +1373,7 @@ static bool ieee80211_powersave_allowed(struct ieee80211_sub_if_data *sdata) | |||
1374 | if (!mgd->associated) | 1373 | if (!mgd->associated) |
1375 | return false; | 1374 | return false; |
1376 | 1375 | ||
1377 | if (mgd->flags & (IEEE80211_STA_BEACON_POLL | | 1376 | if (mgd->flags & IEEE80211_STA_CONNECTION_POLL) |
1378 | IEEE80211_STA_CONNECTION_POLL)) | ||
1379 | return false; | 1377 | return false; |
1380 | 1378 | ||
1381 | if (!mgd->have_beacon) | 1379 | if (!mgd->have_beacon) |
@@ -1691,8 +1689,7 @@ static void __ieee80211_stop_poll(struct ieee80211_sub_if_data *sdata) | |||
1691 | { | 1689 | { |
1692 | lockdep_assert_held(&sdata->local->mtx); | 1690 | lockdep_assert_held(&sdata->local->mtx); |
1693 | 1691 | ||
1694 | sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL | | 1692 | sdata->u.mgd.flags &= ~IEEE80211_STA_CONNECTION_POLL; |
1695 | IEEE80211_STA_BEACON_POLL); | ||
1696 | ieee80211_run_deferred_scan(sdata->local); | 1693 | ieee80211_run_deferred_scan(sdata->local); |
1697 | } | 1694 | } |
1698 | 1695 | ||
@@ -1954,11 +1951,8 @@ static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata) | |||
1954 | struct ieee80211_local *local = sdata->local; | 1951 | struct ieee80211_local *local = sdata->local; |
1955 | 1952 | ||
1956 | mutex_lock(&local->mtx); | 1953 | mutex_lock(&local->mtx); |
1957 | if (!(ifmgd->flags & (IEEE80211_STA_BEACON_POLL | | 1954 | if (!(ifmgd->flags & IEEE80211_STA_CONNECTION_POLL)) |
1958 | IEEE80211_STA_CONNECTION_POLL))) { | 1955 | goto out; |
1959 | mutex_unlock(&local->mtx); | ||
1960 | return; | ||
1961 | } | ||
1962 | 1956 | ||
1963 | __ieee80211_stop_poll(sdata); | 1957 | __ieee80211_stop_poll(sdata); |
1964 | 1958 | ||
@@ -2094,15 +2088,9 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata, | |||
2094 | * because otherwise we would reset the timer every time and | 2088 | * because otherwise we would reset the timer every time and |
2095 | * never check whether we received a probe response! | 2089 | * never check whether we received a probe response! |
2096 | */ | 2090 | */ |
2097 | if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL | | 2091 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) |
2098 | IEEE80211_STA_CONNECTION_POLL)) | ||
2099 | already = true; | 2092 | already = true; |
2100 | 2093 | ||
2101 | if (beacon) | ||
2102 | ifmgd->flags |= IEEE80211_STA_BEACON_POLL; | ||
2103 | else | ||
2104 | ifmgd->flags |= IEEE80211_STA_CONNECTION_POLL; | ||
2105 | |||
2106 | mutex_unlock(&sdata->local->mtx); | 2094 | mutex_unlock(&sdata->local->mtx); |
2107 | 2095 | ||
2108 | if (already) | 2096 | if (already) |
@@ -3061,17 +3049,10 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, | |||
3061 | } | 3049 | } |
3062 | } | 3050 | } |
3063 | 3051 | ||
3064 | if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) { | 3052 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) { |
3065 | mlme_dbg_ratelimited(sdata, | 3053 | mlme_dbg_ratelimited(sdata, |
3066 | "cancelling AP probe due to a received beacon\n"); | 3054 | "cancelling AP probe due to a received beacon\n"); |
3067 | mutex_lock(&local->mtx); | 3055 | ieee80211_reset_ap_probe(sdata); |
3068 | ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; | ||
3069 | ieee80211_run_deferred_scan(local); | ||
3070 | mutex_unlock(&local->mtx); | ||
3071 | |||
3072 | mutex_lock(&local->iflist_mtx); | ||
3073 | ieee80211_recalc_ps(local, -1); | ||
3074 | mutex_unlock(&local->iflist_mtx); | ||
3075 | } | 3056 | } |
3076 | 3057 | ||
3077 | /* | 3058 | /* |
@@ -3543,8 +3524,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3543 | } else if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started) | 3524 | } else if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started) |
3544 | run_again(sdata, ifmgd->assoc_data->timeout); | 3525 | run_again(sdata, ifmgd->assoc_data->timeout); |
3545 | 3526 | ||
3546 | if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL | | 3527 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL && |
3547 | IEEE80211_STA_CONNECTION_POLL) && | ||
3548 | ifmgd->associated) { | 3528 | ifmgd->associated) { |
3549 | u8 bssid[ETH_ALEN]; | 3529 | u8 bssid[ETH_ALEN]; |
3550 | int max_tries; | 3530 | int max_tries; |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 08afe74b98f4..ecb57b0bf74a 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -391,8 +391,7 @@ static bool ieee80211_can_scan(struct ieee80211_local *local, | |||
391 | return false; | 391 | return false; |
392 | 392 | ||
393 | if (sdata->vif.type == NL80211_IFTYPE_STATION && | 393 | if (sdata->vif.type == NL80211_IFTYPE_STATION && |
394 | sdata->u.mgd.flags & (IEEE80211_STA_BEACON_POLL | | 394 | sdata->u.mgd.flags & IEEE80211_STA_CONNECTION_POLL) |
395 | IEEE80211_STA_CONNECTION_POLL)) | ||
396 | return false; | 395 | return false; |
397 | 396 | ||
398 | return true; | 397 | return true; |