Re: Help required in understandingMadWifiinitialization and card setup
"Brett Wright" <[email protected]> Fri, 4 Jun 2010 12:22:18 +1000
| Newsgroups | gmane.linux.drivers.madwifi.devel,gmane.linux.drivers.madwifi.user |
|---|---|
| Message-ID | <[email protected]> |
> -----Original Message----- > From: Aditya Bhave [mailto:[email protected]] > Sent: Thursday, 3 June 2010 2:34 PM > To: Tom Sharples > Cc: Brett Wright; [email protected]; madwifi- > [email protected] > Subject: Re: [Madwifi-devel] Help required in > understandingMadWifiinitialization and card setup > > Thanks very much for both your replies. I had a few comments > > 1. I looked in ah_regdomain.c There I see the following code fragments > /* FCC1 w/ 1/2 and 1/4 width channels */ > {.regDmnEnum = FCC5, > .conformanceTestLimit = FCC, > .chan11a = BM3(F2_5180_5240, F4_5260_5320, F5_5745_5825), > .chan11a_turbo = BM3(T1_5210_5210, T2_5250_5290, > T2_5760_5800), > .chan11a_dyn_turbo = BM3(T1_5200_5240, T1_5280_5280, > T1_5765_5805), > .chan11a_half = BM3(F7_5180_5240, F7_5260_5320, > F9_5745_5825), > .chan11a_quarter = BM3(F8_5180_5240, F8_5260_5320,F10_5745_5825), > }, > > and > FCC5 = 0x0166, /* US w/ 1/2 and 1/4 width channels */ > > so it seems what Brett suggested has already been added to the code. > Only thing missing is the relationship with REG_DMN_FREQ_BAND. How do I > associate that data structure with the two above? Looking at .chan11a_quarter above, if you look at the definition of F8_5180_5240 you will see that the channelBW = 5, which is what we want for quarter channel. So that is taken care of for this case. > > 2. I looked into ath_getchannels(). It seems that this function calls > ath_hal_init_channels() with an empty array of channels 'chans' and the > ath_hal_init_channels() fills it up. I added some printk's inside this > function to see what the default country code was and what channels were > being assigned to the array. But for some reason, those printk's never > print out in /var/log/kern.log (Other printks I inserted into other > parts of code show up here though). > > For example in ah_regdomain.c, I added a simple printk as below > HAL_BOOL > ath_hal_init_channels(struct ath_hal *ah, > HAL_CHANNEL *chans, u_int maxchans, u_int *nchans, > uint8_t *regclassids, u_int maxregids, u_int *nregids, > HAL_CTRY_CODE cc, u_int modeSelect, > HAL_BOOL enableOutdoor, HAL_BOOL enableExtendedChannels) > { > #define CHANNEL_HALF_BW 10 > #define CHANNEL_QUARTER_BW 5 > u_int modesAvail; > uint16_t maxChan; > COUNTRY_CODE_TO_ENUM_RD *country = AH_NULL; > REG_DOMAIN rd5GHz, rd2GHz; > const struct cmode *cm; > HAL_CHANNEL_INTERNAL *ichans = &AH_PRIVATE(ah)->ah_channels[0]; > int next, b; > uint8_t ctl; > > // AYB > printk(KERN_ALERT "Here\n"); > // AYB > > but it never shows up. > > Can someone please tell me what the default country code is and how I > can change it to allow 5/10 MHz channels? Try change the country code and that should force call to ath_getchannels(). Something like: echo country_code > /proc/sys/dev/wifi0/countrycode where country_code is of course the numerical country code you want. > > Thanks > > ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo