Re: Help required in understandingMadWifiinitialization and card setup

Aditya Bhave <[email protected]> Thu, 03 Jun 2010 00:34:22 -0400
Newsgroups gmane.linux.drivers.madwifi.devel,gmane.linux.drivers.madwifi.user
Message-ID <[email protected]>
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?

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?

Thanks


On 06/01/2010 11:45 PM, Tom Sharples wrote:
> You might also want to take a look here:
>
> http://madwifi-project.org/ticket/2316
>
> Using hal-testing  r4068 we were able to get 1/2 and 1/4 channel 
> capability on 900Mhz and 4.9Ghz by setting the countrycodes to 843 and 
> 842 respectively. This did NOT work on trunk, however, as of about 9 
> months ago. I don't know whether whatever made it work on hal-testing 
> has been ported to trunk in the meanwhile.
>
> Tom S.
>
> ----- Original Message ----- From: "Brett Wright" 
> <[email protected]>
> To: "Aditya Bhave" <[email protected]>; 
> <[email protected]>; 
> <[email protected]>
> Sent: Tuesday, June 01, 2010 7:29 PM
> Subject: Re: [Madwifi-devel] Help required in 
> understandingMadWifiinitialization and card setup
>
>
>> Hi,
>>
>> You need to set a reg domain that supports half and quarter channels
>> (you may have to add/modify to get the functionality you want).
>> Have a look at struct regDomain in ah_regdomain.c
>> In particular the parameters chan11g_quarter, chanllg_half, etc.
>> The reg domain you are using will have to assign an appropriate
>> REG_DMN_FREQ_BAND to these parameters with corresponding channelBW set.
>>
>> Once these half/quarter channels exist for your regdomain, they are
>> differentiated by appropriate bits of the channelFlags parameter of an
>> ieee80211_channel structure - take a look at ath_getchannels() in
>> if_ath.c to get a good idea where the channel structures are set and
>> what they contain. Ultimately, these are the channels/bandwidths that
>> you can then specify.
>>
>> Brett
>>
>>> -----Original Message-----
>>> From: Aditya Bhave [mailto:[email protected]]
>>> Sent: Wednesday, 2 June 2010 12:07 PM
>>> To: [email protected]; madwifi-
>>> [email protected]
>>> Subject: [Madwifi-devel] Help required in understanding
>>> MadWifiinitialization and card setup
>>>
>>> Hi,
>>>
>>> I needed some help in understanding what happens during MadWifi
>>> initialization? What functions get called and in what order? Which
>>> function initializes the card through the HAL and so on. Specifically,
>>> Im looking to implement 5/10 MHz channel widths on Madwifi and I know
>>> that this requires modifying parts of the ath_reset() and ath_init()
>>> methods as well as adding regulatory support in ah_regdomain.c. Can
>>> someone please guide me on this? Specifically,
>>>
>>> 1. How does the driver know which channels are supported by the card?
>>> Which HAL functions does it call and what data structures represent
>>> channels?
>>> 2. How and where does the driver tell the card to use a specific
>> channel
>>> center frequency and width?
>>>
>>> Many thanks for your help
>>> --Aditya Bhave
>>>
>>>
>> ------------------------------------------------------------------------
>> -- 
>>> ----
>>>
>>> _______________________________________________
>>> Madwifi-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/madwifi-devel
>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------ 
>>
>>
>> _______________________________________________
>> Madwifi-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/madwifi-devel
>
>
> -------------------------------------------------------------------------------- 
>
>
>
>
> Internal Virus Database is out of date.
> Checked by AVG - www.avg.com
> Version: 8.5.435 / Virus Database: 271.1.1/2675 - Release Date: 
> 02/08/10 07:35:00
>
>



------------------------------------------------------------------------------
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