Search Linux Wireless

Re: [PATCH] cfg80211: Use capability info to detect mesh beacons.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2011-05-04 at 10:24 -0700, Javier Cardona wrote:
> Mesh beacons no longer use all-zeroes BSSID.  Beacon frames for MBSS,
> infrastructure BSS, or IBSS are differentiated by the Capability
> Information field in the Beacon frame.  A mesh STA sets the ESS and IBSS
> subfields to 0 in transmitted Beacon or Probe Response management
> frames.

Sorry for the late reply, yeah, I think that looks good.

johannes

> Signed-off-by: Javier Cardona <javier@xxxxxxxxxxx>
> ---
>  include/linux/ieee80211.h |    5 +++++
>  net/wireless/scan.c       |   14 +++++++-------
>  2 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
> index a26dcb8..b2eee58 100644
> --- a/include/linux/ieee80211.h
> +++ b/include/linux/ieee80211.h
> @@ -1002,6 +1002,11 @@ struct ieee80211_ht_info {
>  
>  #define WLAN_CAPABILITY_ESS		(1<<0)
>  #define WLAN_CAPABILITY_IBSS		(1<<1)
> +
> +/* A mesh STA sets the ESS and IBSS capability bits to zero */
> +#define WLAN_CAPABILITY_IS_MBSS(cap)	\
> +	(!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)))
> +
>  #define WLAN_CAPABILITY_CF_POLLABLE	(1<<2)
>  #define WLAN_CAPABILITY_CF_POLL_REQUEST	(1<<3)
>  #define WLAN_CAPABILITY_PRIVACY		(1<<4)
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index fbf6f33..62e542a 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -210,7 +210,7 @@ static bool is_mesh(struct cfg80211_bss *a,
>  {
>  	const u8 *ie;
>  
> -	if (!is_zero_ether_addr(a->bssid))
> +	if (!WLAN_CAPABILITY_IS_MBSS(a->capability))
>  		return false;
>  
>  	ie = cfg80211_find_ie(WLAN_EID_MESH_ID,
> @@ -248,11 +248,7 @@ static int cmp_bss(struct cfg80211_bss *a,
>  	if (a->channel != b->channel)
>  		return b->channel->center_freq - a->channel->center_freq;
>  
> -	r = memcmp(a->bssid, b->bssid, ETH_ALEN);
> -	if (r)
> -		return r;
> -
> -	if (is_zero_ether_addr(a->bssid)) {
> +	if (WLAN_CAPABILITY_IS_MBSS(a->capability | b->capability)) {
>  		r = cmp_ies(WLAN_EID_MESH_ID,
>  			    a->information_elements,
>  			    a->len_information_elements,
> @@ -267,6 +263,10 @@ static int cmp_bss(struct cfg80211_bss *a,
>  			       b->len_information_elements);
>  	}
>  
> +	r = memcmp(a->bssid, b->bssid, ETH_ALEN);
> +	if (r)
> +		return r;
> +
>  	return cmp_ies(WLAN_EID_SSID,
>  		       a->information_elements,
>  		       a->len_information_elements,
> @@ -407,7 +407,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
>  
>  	res->ts = jiffies;
>  
> -	if (is_zero_ether_addr(res->pub.bssid)) {
> +	if (WLAN_CAPABILITY_IS_MBSS(res->pub.capability)) {
>  		/* must be mesh, verify */
>  		meshid = cfg80211_find_ie(WLAN_EID_MESH_ID,
>  					  res->pub.information_elements,


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux