diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-01-15 11:11:15 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-01-16 14:55:45 -0500 |
commit | d44efe21859777784aea9afef934ad67bbb16935 (patch) | |
tree | 186c188b9ef871ef1977c9e56e76d87e3bc7fa83 /drivers/net | |
parent | aeb0e356ec6e0d11b8369bbbb32ae81b92a1a46b (diff) |
ath5k: use ath_is_mybeacon
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index d85c312170bc..ef35da84f63b 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -1238,14 +1238,11 @@ static void | |||
1238 | ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb, | 1238 | ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb, |
1239 | struct ieee80211_rx_status *rxs) | 1239 | struct ieee80211_rx_status *rxs) |
1240 | { | 1240 | { |
1241 | struct ath_common *common = ath5k_hw_common(ah); | ||
1242 | u64 tsf, bc_tstamp; | 1241 | u64 tsf, bc_tstamp; |
1243 | u32 hw_tu; | 1242 | u32 hw_tu; |
1244 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; | 1243 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; |
1245 | 1244 | ||
1246 | if (ieee80211_is_beacon(mgmt->frame_control) && | 1245 | if (le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS) { |
1247 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && | ||
1248 | ether_addr_equal_64bits(mgmt->bssid, common->curbssid)) { | ||
1249 | /* | 1246 | /* |
1250 | * Received an IBSS beacon with the same BSSID. Hardware *must* | 1247 | * Received an IBSS beacon with the same BSSID. Hardware *must* |
1251 | * have updated the local TSF. We have to work around various | 1248 | * have updated the local TSF. We have to work around various |
@@ -1301,23 +1298,6 @@ ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb, | |||
1301 | } | 1298 | } |
1302 | } | 1299 | } |
1303 | 1300 | ||
1304 | static void | ||
1305 | ath5k_update_beacon_rssi(struct ath5k_hw *ah, struct sk_buff *skb, int rssi) | ||
1306 | { | ||
1307 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; | ||
1308 | struct ath_common *common = ath5k_hw_common(ah); | ||
1309 | |||
1310 | /* only beacons from our BSSID */ | ||
1311 | if (!ieee80211_is_beacon(mgmt->frame_control) || | ||
1312 | !ether_addr_equal_64bits(mgmt->bssid, common->curbssid)) | ||
1313 | return; | ||
1314 | |||
1315 | ewma_add(&ah->ah_beacon_rssi_avg, rssi); | ||
1316 | |||
1317 | /* in IBSS mode we should keep RSSI statistics per neighbour */ | ||
1318 | /* le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS */ | ||
1319 | } | ||
1320 | |||
1321 | /* | 1301 | /* |
1322 | * Compute padding position. skb must contain an IEEE 802.11 frame | 1302 | * Compute padding position. skb must contain an IEEE 802.11 frame |
1323 | */ | 1303 | */ |
@@ -1390,6 +1370,7 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb, | |||
1390 | struct ath5k_rx_status *rs) | 1370 | struct ath5k_rx_status *rs) |
1391 | { | 1371 | { |
1392 | struct ieee80211_rx_status *rxs; | 1372 | struct ieee80211_rx_status *rxs; |
1373 | struct ath_common *common = ath5k_hw_common(ah); | ||
1393 | 1374 | ||
1394 | ath5k_remove_padding(skb); | 1375 | ath5k_remove_padding(skb); |
1395 | 1376 | ||
@@ -1442,11 +1423,13 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb, | |||
1442 | 1423 | ||
1443 | trace_ath5k_rx(ah, skb); | 1424 | trace_ath5k_rx(ah, skb); |
1444 | 1425 | ||
1445 | ath5k_update_beacon_rssi(ah, skb, rs->rs_rssi); | 1426 | if (ath_is_mybeacon(common, (struct ieee80211_hdr *)skb->data)) { |
1427 | ewma_add(&ah->ah_beacon_rssi_avg, rs->rs_rssi); | ||
1446 | 1428 | ||
1447 | /* check beacons in IBSS mode */ | 1429 | /* check beacons in IBSS mode */ |
1448 | if (ah->opmode == NL80211_IFTYPE_ADHOC) | 1430 | if (ah->opmode == NL80211_IFTYPE_ADHOC) |
1449 | ath5k_check_ibss_tsf(ah, skb, rxs); | 1431 | ath5k_check_ibss_tsf(ah, skb, rxs); |
1432 | } | ||
1450 | 1433 | ||
1451 | ieee80211_rx(ah->hw, skb); | 1434 | ieee80211_rx(ah->hw, skb); |
1452 | } | 1435 | } |