Search Linux Wireless

Re: [PATCH] cfg80211: module_param to disable HT40 in 2.4GHz band

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

 



On Wed, 2011-04-20 at 17:00 -0700, Bing Zhao wrote:

> @@ -651,16 +660,28 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
>  			goto nla_put_failure;
>  
>  		/* add HT info */
> -		if (dev->wiphy.bands[band]->ht_cap.ht_supported) {
> +		if (sband->ht_cap.ht_supported) {
>  			NLA_PUT(msg, NL80211_BAND_ATTR_HT_MCS_SET,
> -				sizeof(dev->wiphy.bands[band]->ht_cap.mcs),
> -				&dev->wiphy.bands[band]->ht_cap.mcs);
> +				sizeof(sband->ht_cap.mcs), &sband->ht_cap.mcs);
> +
> +			/*
> +			 * Since cfg80211_disable_40mhz_24ghz is global, we can
> +			 * modify the sband's ht data even if the driver uses a
> +			 * global structure for that.
> +			 */
> +			if (cfg80211_disable_40mhz_24ghz &&
> +					band == IEEE80211_BAND_2GHZ) {
> +				sband->ht_cap.cap &=
> +					~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
> +				sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
> +			}
> +
>  			NLA_PUT_U16(msg, NL80211_BAND_ATTR_HT_CAPA,
> -				dev->wiphy.bands[band]->ht_cap.cap);
> +				sband->ht_cap.cap);
>  			NLA_PUT_U8(msg, NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
> -				dev->wiphy.bands[band]->ht_cap.ampdu_factor);
> +				sband->ht_cap.ampdu_factor);
>  			NLA_PUT_U8(msg, NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
> -				dev->wiphy.bands[band]->ht_cap.ampdu_density);
> +				sband->ht_cap.ampdu_density);
>  		}
>  
>  		/* add frequencies */

In send_wiphy? You're kidding, right? NACK. Please try to understand how
the code in mac80211 worked.

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