Search Linux Wireless

Re: [PATCH] iw: Add more VHT capabilities reporting

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

 



On Fri, 2023-02-17 at 00:40 -0800, Anthony Refuerzo wrote:
> 
>  	/* RX STBC */
> +	switch ((capa & 0x700) >> 8) {
> +	case 1: printf("\t\t\tRX STBC 1-stream\n"); break;
> +	case 2: printf("\t\t\tRX STBC 2-streams\n"); break;

wait, isn't that wrong, this should be +1 (and can also just use the
value+1 instead of having all those switch cases) no?

Also generally, I'm not a huge fan of those compressed case statements
yeah it seems denser at first, but then at least I had to look twice if
the break was there, etc.

> +	printf("\t\t\tMax A-MPDU Length: %d (exponent: %d)\n",
> +		(1 << (((capa & 0x3800000) >> 23) + 13)) - 1,
> +		((capa & 0x3800000) >> 23));

this kind of thing really makes me want to have bitfield.h from the
kernel, but I guess we can't just copy that due to the license ... oh
well.

but at least it could use a variable for the exponent, so it doesn't
have to be done twice? :)

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux