c - how to disable fast frames in ath5k wireless driver -
by default, fast frames enabled in ath5k. (http://wireless.kernel.org/en/users/drivers/ath5k) have found macro disables it
#define ar5k_eeprom_ff_dis(_v) (((_v) >> 2) & 0x1
the question do it? replace above line
#define ar5k_eeprom_ff_dis(_v) 1
?
do compile passing parameter?
the bit-shift expression confuses me. _v
variable?
the question more general how deal such macros in drivers. i've seen them in other codes , got confused.
ok, try explain simplified example
#include <stdio.h> /* print in binary mode */ char *chartobin(unsigned char c) { static char a[9]; int i; (i = 0; < 8; i++) a[7 - i] = (c & (1 << i)) == (1 << i) ? '1' : '0'; a[8] = '\0'; return a; } int main(void) { unsigned char u = 0xf; printf("%s\n", chartobin(u)); u >>= 2; // shift bits 2 positions (to right) printf("%s\n", chartobin(u)); printf("%s\n", chartobin(u & 0x1)); // check if last bit on return 0; }
output:
00001111 00000011 00000001
do replace above line #define ar5k_eeprom_ff_dis(_v) 1
?
nooooo!!
if initialize u
0xb
instead of 0xf
get:
00001011 00000010 00000000
as can see (((_v) >> 2) & 0x1 != 1
Comments
Post a Comment