2012-03-05 22:02:43

by John Williams

[permalink] [raw]
Subject: [PATCH] rtl8192cu driver ignores eeprom channel plan

Larry,

The various rtl8192xx drivers read the manufacturer-set channel plan
into efuse.eeprom_channelplan, but ignore this and use
efuse.channel_plan (which is never initialized) when deciding which
channels to allow. The patch below allowed my device, purchased in
Europe, to see channels 12 and 13 when configured with "iw reg set EC"

It needs more work in order to accept being configured for arbitrary countries: would you like me to work on a more comprehensive patch?

Signed-off-by John Williams <[email protected]>

--- linux-3.2/drivers/net/wireless/rtlwifi/regd.c.orig
+++ linux-3.2/drivers/net/wireless/rtlwifi/regd.c
@@ -405,7 +405,7 @@
return -EINVAL;

/* init country_code from efuse channel plan */
- rtlpriv->regd.country_code = rtlpriv->efuse.channel_plan;
+ rtlpriv->regd.country_code = rtlpriv->efuse.eeprom_channelplan;

RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE,
(KERN_DEBUG "rtl: EEPROM regdomain: 0x%0x\n",



2012-03-06 01:52:51

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] rtl8192cu driver ignores eeprom channel plan

On 03/05/2012 03:39 PM, John Williams wrote:
> Larry,
>
> The various rtl8192xx drivers read the manufacturer-set channel plan
> into efuse.eeprom_channelplan, but ignore this and use
> efuse.channel_plan (which is never initialized) when deciding which
> channels to allow. The patch below allowed my device, purchased in
> Europe, to see channels 12 and 13 when configured with "iw reg set EC"
>
> It needs more work in order to accept being configured for arbitrary countries: would you like me to work on a more comprehensive patch?

Please - I have plenty to do. I had never had any problems with the allowed
channels, as I use CRDA and it sets my domain to US, which is as restrictive as any.

I just tested, and the RTL8192CE that I have installed at the moment has 0xA
(COUNTRY_CODE_WORLD_WIDE_13) in the eeprom, which happens to be what is set in
rtlpriv->efuse.channel_plan in rtl8192ce. That is not surprising as the card
came from Realtek and I would expect something appropriate for China.

Larry