[rt2x00-users] [PATCH 2/5] rt2x00: Fix channel configuration for RF3052

Ivo Van Doorn ivdoorn at gmail.com
Mon Aug 23 14:17:57 UTC 2010


On Mon, Aug 23, 2010 at 4:11 PM, Helmut Schaa
<helmut.schaa at googlemail.com> wrote:
> Am Monday 23 August 2010 schrieb Ivo van Doorn:
>> We missed a check for RF3052 in the config_channel
>> configuration function. As a result the channel is not
>> properly configured for RF3052 devices. This also
>> requires rt2800_config_channel_rf3xxx to support 5GHz
>> channels, so we must apply the TXPOWER_A_TO_DEV and
>> TXPOWER_G_TO_DEV conversions during rt2800_config_channel()
>>
>> Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
>> ---
>
> [...]
>
>>
>> +     if (rf->channel <= 14) {
>> +             info->tx_power1 = TXPOWER_G_TO_DEV(info->tx_power1);
>> +             info->tx_power2 = TXPOWER_G_TO_DEV(info->tx_power2);
>> +     } else {
>> +             info->tx_power1 = TXPOWER_A_TO_DEV(info->tx_power1);
>> +             info->tx_power2 = TXPOWER_A_TO_DEV(info->tx_power2);
>> +     }
>> +
>
> This looks a bit strange? This will overwrite tx_powerX with the converted
> value and during the next invocation it will convert the converted value
> again.
>
> Can't we use a local tx_powerX variable to hold the value and pass it to the
> rt2800_config_channel_rf* functions as arguments?

That can be done, but the info object already is a local variable. See
rt2x00config.c:

void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
                      struct ieee80211_conf *conf,
                      unsigned int ieee80211_flags)
{
        struct rt2x00lib_conf libconf;

<...snip...>

                memcpy(&libconf.channel,
                       &rt2x00dev->spec.channels_info[hw_value],
                       sizeof(libconf.channel));
<...snip...>

Ivo



More information about the users mailing list