From: Luis R. Rodriguez Date: Fri, 17 Jul 2009 10:59:13 -0700 Subject: [ath9k-devel] Zyxel NWD-170n badly slow In-Reply-To: <4A60B561.30205@podzimek.org> References: <4A60A0EF.5050601@podzimek.org> <43e72e890907170930u5205c1c0g50ee27cd119349c5@mail.gmail.com> <4A60B561.30205@podzimek.org> Message-ID: <43e72e890907171059kfec2366qf7d8d8b50f67d575@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Fri, Jul 17, 2009 at 10:31 AM, Andrej Podzimek wrote: > Hello, > >>> I have a question regarding the 802.11n transfer rates. My 802.11n WiFi >>> card associated with a 802.11n router is badly slow. The maximum data rates >>> are only about 3 MB/s (24 Mb/s), exactly the same as when a 802.11g client >>> is used. What could this be caused by? >> >> This could be an interoperability issue with a specific Access Point. > > Yes, but these are two Zyxel devices, both recommended by the manufacturer > as a good combination for 802.11n networking... Heh yeah point taken, still my point being that maybe the firmware for the AP is a bit old and we haven't tested against it. >> Do you have CONFIG_WIRELESS_OLD_REGULATORY set? > > It was on when I started testing this card. Then I recompiled the kernel > with this option set to off. It didn't really change anything. Was just checking. >> Are you using an ieee80211_regdom module parameter? > > The ath9k module I use does not accept such a parameter. The same applies to > the mac80211 module. Maybe it's not in the vanilla kernel yet? Will try > something bleeding-edge ASAP (compat-wireless). Was just asking to see if you used it to understand better how your cfg80211 is coming up and with what parameters. I do not want you to use it but it is available through the cfg80211 module. Just ignore this then. >> Anyway -- >> you should not need to set your regulatory domain manually at all for >> ath9k devicesl, the card already has regulatory domain information >> embedded on the EEPROM and this is used by the card to get regulatory >> domain information for the card. > > I used the ath_info utility with an old ath5k card to change the regdomain. Just so you know, if you do such a thing don't be surprised if you loose support. The device EEPROM should be left as-is. > I usually buy WiFi hardware on eBay from USA or Hong Kong, so it's necessary > to switch to the ETSI regdomain. (Some people say it's 0x30, others say it's > 0x37. Both of them seem to work.) This is not something you should be mucking with because of the lack of documentation of implications of such action, you are disregarding calibration information, I'd advise to just set it back. If you want to change regulatory domains use the upstream Linux wireless drivers as-is and then do use the properly supported methods to change regulatory domains. That is: use iw. > However, ath_info says "MAC revision 0x3fb7 is not supported!" when used > with my Zyxel PCMCIA card, so there's probably no way to change the value in > the EEPROM. EEPROM changes every few revisions... ath_info is for legacy (802.11bg) devices. Writing to your device EEPROM can screw things up, only manufacturers should be doing that as they then calibrate the devices and ensure properly compliance. > The problem is that iw reg set only takes effect once per system lifetime. You mean upon bootup, yes. That can be fixed in cfg80211, but I haven't had a chance to do that. But you should only need to set that once unless you are pm-suspend'ing and then going to another country. Anyway, as I said before for ath9k devices have regulatory information on the EEPROM, you should not need to set anything when using ath9k devices unless you want to help compliance further. > It's obviously not designed for USB, PCMCIA or other removable WiFi > adapters. Driver regulatory hints are always trusted. If you have a card with no regulatory information and you set your regulatory domain to "US" then you obviously meant it. Plugging another device will get you the same information. What there is no support yet for is suspending, flying to another country and then setting the regulatory domain again to something different. > Consequently, when you need to reset the device (plug/unplug, > reload the module), there is no way to restore the regdomain settings > without rebooting. No, if you try to set the regulatory domain twice for the same country nothing will be done as there is no need to do anything as everything was already done. > Any subsequent re-initializations of the device use the > original value from EEPROM (which is correct) and the kernel does not switch > the device to the new regdomain configured using iw (which is wrong). > (Anyway, this doesn't seem to be an ath9k problem.) Driver regulatory hints are always trusted in cfg80211, but cfg80211 trusts the first device that is plugged in. We could do an intersection for two devices, we have support for that, but we had decided to go with the first plugged in device first. Either way your device always gets its own driver regulatory hint, which is what counts. >> For ath9k, since it has EEPROM >> regulatory information we trust it and keep that information. Further >> user input for ath9k devices will only restrict the device further, >> never add more capabilities. So you should be OK with the default >> values the card has unless you want to help compliance further. > > If I am not mistaken, it seems that changing the regulatory domain *did* add > some capabilities: > > Before: > ? ? ? ?cfg80211: Calling CRDA for country: AM > ? ? ? ?cfg80211: Regulatory domain changed to country: AM > ? ? ? ? ? ? ? ?(start_freq - end_freq @ bandwidth), (max_antenna_gain, > max_eirp) > ? ? ? ? ? ? ? ?(2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm) > ? ? ? ? ? ? ? ?(5170000 KHz - 5250000 KHz @ 20000 KHz), (N/A, 1800 mBm) > ? ? ? ? ? ? ? ?(5250000 KHz - 5330000 KHz @ 20000 KHz), (N/A, 1800 mBm) > > After: > ? ? ? ?cfg80211: Calling CRDA for country: CZ > ? ? ? ?cfg80211: Regulatory domain changed to country: CZ > ? ? ? ? ? ? ? ?(start_freq - end_freq @ bandwidth), (max_antenna_gain, > max_eirp) > ? ? ? ? ? ? ? ?(2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm) > ? ? ? ? ? ? ? ?(5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2301 mBm) > ? ? ? ? ? ? ? ?(5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2301 mBm) > ? ? ? ? ? ? ? ?(5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 3000 mBm) > > There are more channels and higher output power is allowed. No, that is the regulatory domain information. To see the actual channel information that gets stuck to a device use 'iw list'. Drivers that have their own EEPROM and regulatory information always trust that information first. User input is only used for those devices to help compliance further, not to override it. > Anyway, maybe I'm wrong and the card's capabilities are limited by an > intersection of some built-in country-specific hardware limitations and the > regulatory domain. You are wrong, please read carefully. You have no need to set the regulatory domain with ath9k devices unless you want to enhance compliance. >> The new >> wireless API is through cfg80211, the userspace interface for this >> nl80211. nl80211 based applications should be used now. iw is such >> application [1], and it seems you already have it. Please read its >> documentation and learn to use that over iwconfig, the documentation >> has replacement commands. > > Yes, I know it has 802.11n channel "width" settings, mesh network settings > and other new features. However, I just hoped there would be something like > "switch 802.11n ON" somewhere... ;-) However, this problem is probably much > more complicated. (It seems that 802.11n support cannot be explicitly > switched on and off, so the solution is not that simple.) The real reason for not supporting 11n with Wireless-extensions is we came up with a better framework for wireless. Wireless-extensions was designed with old wireless hardware in mind and is simply a developer pain to work with. For more information please read: http://wireless.kernel.org/en/developers/Documentation/Wireless-Extensions >> I recommend to check if your AP has any firmware upgrades available, >> and to also try out the latest ath9k driver updates. > > OK, will try the latest ath9k. The AP has the latest firmware, of course. > That's the first thing I checked. Great thanks. Luis