Search Linux Wireless

Re: [PATCH v3 1/3] nl80211: Parse channel type attribute in an ibss join request

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

 



On Sun, 2011-09-18 at 00:14 +0200, Alexander Simon wrote:

> +/**
> + * cfg80211_can_use_ext_chan - test if ht40 on extension channel can be used
> + * @wiphy: the wiphy
> + * @chan: main channel
> + * @channel_type: HT mode
> + */
> +bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,

That doesn't match the documentation now ...

> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -4537,13 +4537,34 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
>  		ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
>  	}
>  
> -	ibss.channel = ieee80211_get_channel(wiphy,
> -		nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
> +	if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
> +		enum nl80211_channel_type channel_type;
> +
> +		channel_type = nla_get_u32(
> +				info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
> +		if (channel_type > NL80211_CHAN_HT40PLUS)
> +			return -EINVAL;
> +		ibss.channel_type = channel_type;
> +	} else {
> +		ibss.channel_type = NL80211_CHAN_NO_HT;
> +	}
> +
> +	ibss.channel = rdev_freq_to_chan(rdev,
> +		nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
> +		ibss.channel_type);
>  	if (!ibss.channel ||
> +	    ibss.channel->flags & IEEE80211_CHAN_RADAR ||
>  	    ibss.channel->flags & IEEE80211_CHAN_NO_IBSS ||
>  	    ibss.channel->flags & IEEE80211_CHAN_DISABLED)
>  		return -EINVAL;
>  
> +	/* Both channels should be able to initiate communication */
> +	if ((ibss.channel_type == NL80211_CHAN_HT40PLUS ||
> +	     ibss.channel_type == NL80211_CHAN_HT40MINUS) &&
> +	    !cfg80211_can_beacon_sec_chan(&rdev->wiphy, ibss.channel,
> +					  ibss.channel_type))
> +		return -EINVAL;
> +
>  	ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
>  	ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY];
>  

With just this patch, you can set HT IBSS but mac80211 won't be able to
do it so there probably should be some form of feature check for this so
other (non-mac80211) drivers would be able to do this correctly -- I
don't expect all of them to implement HT IBSS.

johannes


--
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