ath: add common function ath_is_mybeacon
authorOleksij Rempel <linux@rempel-privat.de>
Wed, 15 Jan 2014 16:37:42 +0000 (17:37 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 16 Jan 2014 19:55:44 +0000 (14:55 -0500)
this function is used by most ath driver, so it can be moved here.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/main.c

index e0ba7cd14252bda97d47eca7ac40620a25239169..b59cfbe0276b830680bcc172b4393836333618d8 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef ATH_H
 #define ATH_H
 
+#include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/if_ether.h>
 #include <linux/spinlock.h>
@@ -165,6 +166,7 @@ struct ath_common {
 struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
                                u32 len,
                                gfp_t gfp_mask);
+bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr);
 
 void ath_hw_setbssidmask(struct ath_common *common);
 void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key);
index 8e99540cd90e59fdbbf38d48e6f618ad898ec4e0..8b0ac14d5c32dc2030515f4b103e3e4b1bcb0fb2 100644 (file)
@@ -59,6 +59,14 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
 }
 EXPORT_SYMBOL(ath_rxbuf_alloc);
 
+bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr)
+{
+       return ieee80211_is_beacon(hdr->frame_control) &&
+               !is_zero_ether_addr(common->curbssid) &&
+               ether_addr_equal_64bits(hdr->addr3, common->curbssid);
+}
+EXPORT_SYMBOL(ath_is_mybeacon);
+
 void ath_printk(const char *level, const struct ath_common* common,
                const char *fmt, ...)
 {