Skip to contentSkip to conversation

ath: add common function ath_is_mybeacon

PATCH Superseded Oleksij Rempel 2 participants 3 messages Jan 15, 2014 – Jan 16, 2014 Atheros ath generic utilities

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/5 ath: add common function ath_is_mybeacon

this function is used by most ath driver, so it can be moved here.

---
 drivers/net/wireless/ath/ath.h  | 2 ++
 drivers/net/wireless/ath/main.c | 8 ++++++++
 2 files changed, 10 insertions(+)
drivers/net/wireless/ath/ath.h +2 -0
index e0ba7cd..b59cfbe 100644
@@ -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);
drivers/net/wireless/ath/main.c +8 -0
index 8e99540..8b0ac14 100644
@@ -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, ...)
 {
Signature · 1 line
1.8.5.2
#1 lore raw

PATCH v2 1/5 ath: add common function ath_is_mybeacon

Quoted 2 lines · Oleksij Rempel

+bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr);

another late comment: wouldn't it be better is the function was called is_my_beacon() instead of is_mybeacon() ?

Cheers,

Signature · 9 lines
Antonio Quartulli

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140116/3db30a4d/attachment-0001.pgp 
#2 lore raw

PATCH v2 1/5 ath: add common function ath_is_mybeacon

Am 16.01.2014 13:09, schrieb Antonio Quartulli:

Quoted 6 lines · Oleksij Rempel
Quoted 2 lines

+bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr);

another late comment: wouldn't it be better is the function was called is_my_beacon() instead of is_mybeacon() ?

Right now i see that this check affect almost all wifi driver. Theoretically it can be placed to some more generic place. Where?

My actual target are these patch set:
https://github.com/olerem/linux-2.6/commits/wifi-ath-common_more

is_my_beacon() is only sight result of it.

Signature · 2 lines
Regards,
Oleksij