Search Linux Wireless

Re: [PATCHv3 06/18] mac80211: select and adjust bitrates according for channel mode

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

 



On Thu, 2013-05-16 at 13:00 +0200, Simon Wunderlich wrote:
> The various components accessing the bitrates table must use consider
> the used channel bandwidth to select only available rates or calculate
> the bitrate correctly.
> 
> There are some rates in reduced bandwidth modes which can't be
> represented as multiples of 500kbps, like 2.25 MBit/s in 5 MHz mode. The
> standard suggests to round up to the next multiple of 500kbps, just do
> that in mac80211 as well.

"suggests", heh ...

> @@ -4238,7 +4238,6 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
>  		  struct ieee80211_sta *sta)
>  {
>  	int i;
> -
>  	for (i = 0; i < sband->n_bitrates; i++)

please don't do that.

>  		for (i = 0; i < params->supported_rates_len; i++) {
>  			int rate = (params->supported_rates[i] & 0x7f) * 5;
> +			int brate;
>  			for (j = 0; j < sband->n_bitrates; j++) {
> -				if (sband->bitrates[j].bitrate == rate)
> +				brate = sband->bitrates[j].bitrate;
> +				brate = DIV_ROUND_UP(brate, divisor);
> +				if ((rate_flags & sband->bitrates[i].flags)
> +				    != rate_flags)
> +					continue;
> +
> +				if (brate == rate)
>  					rates |= BIT(j);
>  			}

some refactoring might be useful ... having != at the start of a line is
a really good sign for that ;-)

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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux