Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: Massive packet loss with ath9k, AR9280, hostapd in 802.11n mode
From: Rene Mayrhofer @ 2009-09-25 21:29 UTC (permalink / raw)
  To: Bob Copeland; +Cc: linux-wireless
In-Reply-To: <b6c5339f0909251352s4c30323awa588dd2f9f0d1af5@mail.gmail.com>

Am Freitag, 25. September 2009 22:52:58 schrieb Bob Copeland:
> > 4. How do I tell CRDA to load frequency definitions for my location (AT)
> > instead of the default (US)? I might be blind, stupid, or both, but using
> > the slightly conflicting documentation available on various Wikis, I was
> > unable to change this. I have read that some chipsets are hard-wired for
> > one location and can't be changed, but couldn't find out if mine is (it
> > was bought in Europe, so shouldn't be locked to US in any case). An RTFM
> > (with an up-to-date pointer, preferrably for Debian/Ubuntu) in this
> > matter would be highly appreciated.
> 
> "iw reg set XX", but read this first:
> 
> http://wireless.kernel.org/en/users/Drivers/ath
> http://wireless.kernel.org/en/developers/Regulatory
> 
> In short, it depends on what's in your EEPROM.

Thanks for the pointers. Using compat-wireless-2.6 as of today, I get

 [ 1686.542910] cfg80211: Using static regulatory domain info                                                                          
[ 1686.542931] cfg80211: Regulatory domain: US                                                                                        
[ 1686.542947]  (start_freq - end_freq @ bandwidth), (max_antenna_gain, 
max_eirp)                                                     
[ 1686.542976]  (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)                                                          
[ 1686.543004]  (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)                                                          
[ 1686.543031]  (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)                                                          
[ 1686.543058]  (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)                                                          
[ 1686.543085]  (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)                                                          
[ 1686.543113]  (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)                                                          
[ 1686.543158] cfg80211: Calling CRDA for country: US 
[ 1698.498801] ath: EEPROM regdomain: 0x0                                                                                             
[ 1698.498820] ath: EEPROM indicates default country code should be used                                                              
[ 1698.498838] ath: doing EEPROM country->regdmn map search                                                                           
[ 1698.498862] ath: country maps to regdmn code: 0x3a                                                                                 
[ 1698.498880] ath: Country alpha2 being used: US                                                                                     
[ 1698.498896] ath: Regpair used: 0x3a                                                                                                
[ 1698.513630] phy0: Selected rate control algorithm 'ath9k_rate_control'                                                             
[ 1698.533093] cfg80211: Calling CRDA for country: US                                                                                 
[ 1698.555221] Registered led device: ath9k-phy0::radio                                                                               
[ 1698.555359] Registered led device: ath9k-phy0::assoc                                                                               
[ 1698.555490] Registered led device: ath9k-phy0::tx                                                                                  
[ 1698.555624] Registered led device: ath9k-phy0::rx                                                                                  
[ 1698.555680] phy0: Atheros AR9280 MAC/BB Rev:2 AR5133 RF Rev:d0: 
mem=0xd2780000, irq=9

Does this indicate that the EEPROM is locked to country code 0x0 (whatever 
that is, probably US)? "iw reg" doesn't seem to change anything:

[root@gibraltar-500 tmp]# iw reg get                                                     
country US:                                                                              
        (2402 - 2472 @ 40), (6, 27)                                                      
        (5170 - 5190 @ 40), (6, 23)                                                      
        (5190 - 5210 @ 40), (6, 23)                                                      
        (5210 - 5230 @ 40), (6, 23)                                                      
        (5230 - 5330 @ 40), (6, 23)                                                      
        (5735 - 5835 @ 40), (6, 30)                                                      
[root@gibraltar-500 tmp]# iw reg set 0x68
not a valid ISO/IEC 3166-1 alpha2
Special non-alpha2 usable entries:
        00      World Regulatory domain
[root@gibraltar-500 tmp]# iw reg set 00
command failed: Invalid argument (-22)
[root@gibraltar-500 tmp]# iw reg set AT
[root@gibraltar-500 tmp]# iw reg get
country US:
        (2402 - 2472 @ 40), (6, 27)
        (5170 - 5190 @ 40), (6, 23)
        (5190 - 5210 @ 40), (6, 23)
        (5210 - 5230 @ 40), (6, 23)
        (5230 - 5330 @ 40), (6, 23)
        (5735 - 5835 @ 40), (6, 30)
[root@gibraltar-500 tmp]# iw reg set EU
[root@gibraltar-500 tmp]# iw reg get
country US:
        (2402 - 2472 @ 40), (6, 27)
        (5170 - 5190 @ 40), (6, 23)
        (5190 - 5210 @ 40), (6, 23)
        (5210 - 5230 @ 40), (6, 23)
        (5230 - 5330 @ 40), (6, 23)
        (5735 - 5835 @ 40), (6, 30)

What I am still unsure about (having read the regulatory Wiki page before): 
are CRDA+regdb required to be able to change the regulatory domain or are they 
only responsible for updating the regulatory database for which a default 
already exists in the kernel?

If the EEPROM states that the device belongs to a specific domain, can this be 
overridden without patching the source?

best regards,
Rene


^ permalink raw reply

* Re: Porting AR6K to use cfg80211
From: Matthew Ryan @ 2009-09-25 21:25 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <43e72e890909251417gfce4ac2x240c25e3b34f646a@mail.gmail.com>

Luis R. Rodriguez <mcgrof@...> writes:


> 
> Oh and I missed my main point: if the above is possible we can then
> share an ath_htc.
> 
>   Luis
> --



Thanks for the detailed help ;)

I'll keep you updated as I get going. 

Matt


^ permalink raw reply

* [PATCH 7/8] iwlwifi: support idle for 6000 series hw
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Johannes Berg <johannes@sipsolutions.net>

Using powersave while idle saves a lot of power, but
we've had problems with this on some cards (5150 has
been reported to be problematic). However, on the new
6000 series we're seeing no problems, so for now let
that hardware benefit from idle mode, we can look at
the problems with other hardware one by one and then
enable those once we figure out the problems.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-6000.c  |   10 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-core.c  |    3 ++-
 drivers/net/wireless/iwlwifi/iwl-core.h  |    1 +
 drivers/net/wireless/iwlwifi/iwl-power.c |    3 +++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index ad5d77c..6f4ee27 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -254,6 +254,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = {
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6000h_2abg_cfg = {
@@ -276,6 +277,7 @@ struct iwl_cfg iwl6000h_2abg_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6000h_2bg_cfg = {
@@ -298,6 +300,7 @@ struct iwl_cfg iwl6000h_2bg_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 /*
@@ -324,6 +327,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6000i_2abg_cfg = {
@@ -346,6 +350,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6000i_2bg_cfg = {
@@ -368,6 +373,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6050_2agn_cfg = {
@@ -391,6 +397,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6050_2abg_cfg = {
@@ -413,6 +420,7 @@ struct iwl_cfg iwl6050_2abg_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6000_3agn_cfg = {
@@ -436,6 +444,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 struct iwl_cfg iwl6050_3agn_cfg = {
@@ -459,6 +468,7 @@ struct iwl_cfg iwl6050_3agn_cfg = {
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+	.supports_idle = true,
 };
 
 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index e97b104..1cf2e04 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2650,7 +2650,8 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
 		iwl_set_rate(priv);
 	}
 
-	if (changed & IEEE80211_CONF_CHANGE_PS) {
+	if (changed & (IEEE80211_CONF_CHANGE_PS |
+			IEEE80211_CONF_CHANGE_IDLE)) {
 		ret = iwl_power_update_mode(priv, false);
 		if (ret)
 			IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index b66bf7b..744f0ca 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -265,6 +265,7 @@ struct iwl_cfg {
 	const bool broken_powersave;
 	bool use_rts_for_ht;
 	int chain_noise_num_beacons;
+	const bool supports_idle;
 };
 
 /***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 60be976..e50d77b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -294,6 +294,9 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
 
 	if (priv->cfg->broken_powersave)
 		iwl_power_sleep_cam_cmd(priv, &cmd);
+	else if (priv->cfg->supports_idle &&
+		 priv->hw->conf.flags & IEEE80211_CONF_IDLE)
+		iwl_static_sleep_cmd(priv, &cmd, IWL_POWER_INDEX_5, 20);
 	else if (tt->state >= IWL_TI_1)
 		iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper);
 	else if (!enabled)
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 3/8 v2.6.32 and w-t] iwlwifi: fix 3945 ucode info retrieval after failure
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Reinette Chatre <reinette.chatre@intel.com>

When hardware or uCode problem occurs driver captures significant
information from device to enable debugging. The format of this information
is different between 3945 and 4965 and later devices, yet currently the
3945 uses the 4965 and later format. Fix this by adding a new library call
that is initialized to the correct formatting routine based on device.

This moves the iwlagn event and error log handling back to iwl-agn.c to
make it part of iwlagn module.

Also remove the 3945 sysfs file that triggers dump of event log - there is
already a debugfs file that can do it for all drivers.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-1000.c     |    2 +
 drivers/net/wireless/iwlwifi/iwl-3945.c     |    2 +
 drivers/net/wireless/iwlwifi/iwl-3945.h     |    2 +
 drivers/net/wireless/iwlwifi/iwl-4965.c     |    2 +
 drivers/net/wireless/iwlwifi/iwl-5000.c     |    4 +
 drivers/net/wireless/iwlwifi/iwl-6000.c     |    2 +
 drivers/net/wireless/iwlwifi/iwl-agn.c      |  185 ++++++++++++++++++++++++++
 drivers/net/wireless/iwlwifi/iwl-core.c     |  187 +--------------------------
 drivers/net/wireless/iwlwifi/iwl-core.h     |   14 ++
 drivers/net/wireless/iwlwifi/iwl-debugfs.c  |    2 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   31 ++---
 11 files changed, 229 insertions(+), 204 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 4abfc84..3b3e6bc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -102,6 +102,8 @@ static struct iwl_lib_ops iwl1000_lib = {
 	.setup_deferred_work = iwl5000_setup_deferred_work,
 	.is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
 	.load_ucode = iwl5000_load_ucode,
+	.dump_nic_event_log = iwl_dump_nic_event_log,
+	.dump_nic_error_log = iwl_dump_nic_error_log,
 	.init_alive_start = iwl5000_init_alive_start,
 	.alive_notify = iwl5000_alive_notify,
 	.send_tx_power = iwl5000_send_tx_power,
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 63dfa57..33e40c2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2839,6 +2839,8 @@ static struct iwl_lib_ops iwl3945_lib = {
 	.txq_free_tfd = iwl3945_hw_txq_free_tfd,
 	.txq_init = iwl3945_hw_tx_queue_init,
 	.load_ucode = iwl3945_load_bsm,
+	.dump_nic_event_log = iwl3945_dump_nic_event_log,
+	.dump_nic_error_log = iwl3945_dump_nic_error_log,
 	.apm_ops = {
 		.init = iwl3945_apm_init,
 		.reset = iwl3945_apm_reset,
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index f240369..21679bf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -209,6 +209,8 @@ extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv,
 					 struct iwl_host_cmd *cmd);
 extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
 					struct ieee80211_hdr *hdr,int left);
+extern void iwl3945_dump_nic_event_log(struct iwl_priv *priv);
+extern void iwl3945_dump_nic_error_log(struct iwl_priv *priv);
 
 /*
  * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 021e855..9ad5bca 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2292,6 +2292,8 @@ static struct iwl_lib_ops iwl4965_lib = {
 	.alive_notify = iwl4965_alive_notify,
 	.init_alive_start = iwl4965_init_alive_start,
 	.load_ucode = iwl4965_load_bsm,
+	.dump_nic_event_log = iwl_dump_nic_event_log,
+	.dump_nic_error_log = iwl_dump_nic_error_log,
 	.apm_ops = {
 		.init = iwl4965_apm_init,
 		.reset = iwl4965_apm_reset,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 2bb282e..e5b0fab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1540,6 +1540,8 @@ struct iwl_lib_ops iwl5000_lib = {
 	.rx_handler_setup = iwl5000_rx_handler_setup,
 	.setup_deferred_work = iwl5000_setup_deferred_work,
 	.is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
+	.dump_nic_event_log = iwl_dump_nic_event_log,
+	.dump_nic_error_log = iwl_dump_nic_error_log,
 	.load_ucode = iwl5000_load_ucode,
 	.init_alive_start = iwl5000_init_alive_start,
 	.alive_notify = iwl5000_alive_notify,
@@ -1590,6 +1592,8 @@ static struct iwl_lib_ops iwl5150_lib = {
 	.rx_handler_setup = iwl5000_rx_handler_setup,
 	.setup_deferred_work = iwl5000_setup_deferred_work,
 	.is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
+	.dump_nic_event_log = iwl_dump_nic_event_log,
+	.dump_nic_error_log = iwl_dump_nic_error_log,
 	.load_ucode = iwl5000_load_ucode,
 	.init_alive_start = iwl5000_init_alive_start,
 	.alive_notify = iwl5000_alive_notify,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 73ca012..01a1f81 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -183,6 +183,8 @@ static struct iwl_lib_ops iwl6000_lib = {
 	.setup_deferred_work = iwl5000_setup_deferred_work,
 	.is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
 	.load_ucode = iwl5000_load_ucode,
+	.dump_nic_event_log = iwl_dump_nic_event_log,
+	.dump_nic_error_log = iwl_dump_nic_error_log,
 	.init_alive_start = iwl5000_init_alive_start,
 	.alive_notify = iwl5000_alive_notify,
 	.send_tx_power = iwl5000_send_tx_power,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index d39467f..26c66b4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1530,6 +1530,191 @@ static int iwl_read_ucode(struct iwl_priv *priv)
 	return ret;
 }
 
+#ifdef CONFIG_IWLWIFI_DEBUG
+static const char *desc_lookup_text[] = {
+	"OK",
+	"FAIL",
+	"BAD_PARAM",
+	"BAD_CHECKSUM",
+	"NMI_INTERRUPT_WDG",
+	"SYSASSERT",
+	"FATAL_ERROR",
+	"BAD_COMMAND",
+	"HW_ERROR_TUNE_LOCK",
+	"HW_ERROR_TEMPERATURE",
+	"ILLEGAL_CHAN_FREQ",
+	"VCC_NOT_STABLE",
+	"FH_ERROR",
+	"NMI_INTERRUPT_HOST",
+	"NMI_INTERRUPT_ACTION_PT",
+	"NMI_INTERRUPT_UNKNOWN",
+	"UCODE_VERSION_MISMATCH",
+	"HW_ERROR_ABS_LOCK",
+	"HW_ERROR_CAL_LOCK_FAIL",
+	"NMI_INTERRUPT_INST_ACTION_PT",
+	"NMI_INTERRUPT_DATA_ACTION_PT",
+	"NMI_TRM_HW_ER",
+	"NMI_INTERRUPT_TRM",
+	"NMI_INTERRUPT_BREAK_POINT"
+	"DEBUG_0",
+	"DEBUG_1",
+	"DEBUG_2",
+	"DEBUG_3",
+	"UNKNOWN"
+};
+
+static const char *desc_lookup(int i)
+{
+	int max = ARRAY_SIZE(desc_lookup_text) - 1;
+
+	if (i < 0 || i > max)
+		i = max;
+
+	return desc_lookup_text[i];
+}
+
+#define ERROR_START_OFFSET  (1 * sizeof(u32))
+#define ERROR_ELEM_SIZE     (7 * sizeof(u32))
+
+void iwl_dump_nic_error_log(struct iwl_priv *priv)
+{
+	u32 data2, line;
+	u32 desc, time, count, base, data1;
+	u32 blink1, blink2, ilink1, ilink2;
+
+	if (priv->ucode_type == UCODE_INIT)
+		base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
+	else
+		base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
+
+	if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
+		IWL_ERR(priv, "Not valid error log pointer 0x%08X\n", base);
+		return;
+	}
+
+	count = iwl_read_targ_mem(priv, base);
+
+	if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
+		IWL_ERR(priv, "Start IWL Error Log Dump:\n");
+		IWL_ERR(priv, "Status: 0x%08lX, count: %d\n",
+			priv->status, count);
+	}
+
+	desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
+	blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32));
+	blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32));
+	ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32));
+	ilink2 = iwl_read_targ_mem(priv, base + 6 * sizeof(u32));
+	data1 = iwl_read_targ_mem(priv, base + 7 * sizeof(u32));
+	data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32));
+	line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
+	time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
+
+	IWL_ERR(priv, "Desc                               Time       "
+		"data1      data2      line\n");
+	IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n",
+		desc_lookup(desc), desc, time, data1, data2, line);
+	IWL_ERR(priv, "blink1  blink2  ilink1  ilink2\n");
+	IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,
+		ilink1, ilink2);
+
+}
+
+#define EVENT_START_OFFSET  (4 * sizeof(u32))
+
+/**
+ * iwl_print_event_log - Dump error event log to syslog
+ *
+ */
+static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
+				u32 num_events, u32 mode)
+{
+	u32 i;
+	u32 base;       /* SRAM byte address of event log header */
+	u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
+	u32 ptr;        /* SRAM byte address of log data */
+	u32 ev, time, data; /* event log data */
+
+	if (num_events == 0)
+		return;
+	if (priv->ucode_type == UCODE_INIT)
+		base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
+	else
+		base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
+
+	if (mode == 0)
+		event_size = 2 * sizeof(u32);
+	else
+		event_size = 3 * sizeof(u32);
+
+	ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
+
+	/* "time" is actually "data" for mode 0 (no timestamp).
+	* place event id # at far right for easier visual parsing. */
+	for (i = 0; i < num_events; i++) {
+		ev = iwl_read_targ_mem(priv, ptr);
+		ptr += sizeof(u32);
+		time = iwl_read_targ_mem(priv, ptr);
+		ptr += sizeof(u32);
+		if (mode == 0) {
+			/* data, ev */
+			IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n", time, ev);
+		} else {
+			data = iwl_read_targ_mem(priv, ptr);
+			ptr += sizeof(u32);
+			IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n",
+					time, data, ev);
+		}
+	}
+}
+
+void iwl_dump_nic_event_log(struct iwl_priv *priv)
+{
+	u32 base;       /* SRAM byte address of event log header */
+	u32 capacity;   /* event log capacity in # entries */
+	u32 mode;       /* 0 - no timestamp, 1 - timestamp recorded */
+	u32 num_wraps;  /* # times uCode wrapped to top of log */
+	u32 next_entry; /* index of next entry to be written by uCode */
+	u32 size;       /* # entries that we'll print */
+
+	if (priv->ucode_type == UCODE_INIT)
+		base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
+	else
+		base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
+
+	if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
+		IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
+		return;
+	}
+
+	/* event log header */
+	capacity = iwl_read_targ_mem(priv, base);
+	mode = iwl_read_targ_mem(priv, base + (1 * sizeof(u32)));
+	num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
+	next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
+
+	size = num_wraps ? capacity : next_entry;
+
+	/* bail out if nothing in log */
+	if (size == 0) {
+		IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
+		return;
+	}
+
+	IWL_ERR(priv, "Start IWL Event Log Dump: display count %d, wraps %d\n",
+			size, num_wraps);
+
+	/* if uCode has wrapped back to top of log, start at the oldest entry,
+	 * i.e the next one that uCode would fill. */
+	if (num_wraps)
+		iwl_print_event_log(priv, next_entry,
+					capacity - next_entry, mode);
+	/* (then/else) start at top of log */
+	iwl_print_event_log(priv, 0, next_entry, mode);
+
+}
+#endif
+
 /**
  * iwl_alive_start - called after REPLY_ALIVE notification received
  *                   from protocol/runtime uCode (initialization uCode's
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index e447c1a..2908bff 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1289,189 +1289,6 @@ static void iwl_print_rx_config_cmd(struct iwl_priv *priv)
 	IWL_DEBUG_RADIO(priv, "u8[6] bssid_addr: %pM\n", rxon->bssid_addr);
 	IWL_DEBUG_RADIO(priv, "u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
 }
-
-static const char *desc_lookup_text[] = {
-	"OK",
-	"FAIL",
-	"BAD_PARAM",
-	"BAD_CHECKSUM",
-	"NMI_INTERRUPT_WDG",
-	"SYSASSERT",
-	"FATAL_ERROR",
-	"BAD_COMMAND",
-	"HW_ERROR_TUNE_LOCK",
-	"HW_ERROR_TEMPERATURE",
-	"ILLEGAL_CHAN_FREQ",
-	"VCC_NOT_STABLE",
-	"FH_ERROR",
-	"NMI_INTERRUPT_HOST",
-	"NMI_INTERRUPT_ACTION_PT",
-	"NMI_INTERRUPT_UNKNOWN",
-	"UCODE_VERSION_MISMATCH",
-	"HW_ERROR_ABS_LOCK",
-	"HW_ERROR_CAL_LOCK_FAIL",
-	"NMI_INTERRUPT_INST_ACTION_PT",
-	"NMI_INTERRUPT_DATA_ACTION_PT",
-	"NMI_TRM_HW_ER",
-	"NMI_INTERRUPT_TRM",
-	"NMI_INTERRUPT_BREAK_POINT"
-	"DEBUG_0",
-	"DEBUG_1",
-	"DEBUG_2",
-	"DEBUG_3",
-	"UNKNOWN"
-};
-
-static const char *desc_lookup(int i)
-{
-	int max = ARRAY_SIZE(desc_lookup_text) - 1;
-
-	if (i < 0 || i > max)
-		i = max;
-
-	return desc_lookup_text[i];
-}
-
-#define ERROR_START_OFFSET  (1 * sizeof(u32))
-#define ERROR_ELEM_SIZE     (7 * sizeof(u32))
-
-static void iwl_dump_nic_error_log(struct iwl_priv *priv)
-{
-	u32 data2, line;
-	u32 desc, time, count, base, data1;
-	u32 blink1, blink2, ilink1, ilink2;
-
-	if (priv->ucode_type == UCODE_INIT)
-		base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
-	else
-		base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
-
-	if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
-		IWL_ERR(priv, "Not valid error log pointer 0x%08X\n", base);
-		return;
-	}
-
-	count = iwl_read_targ_mem(priv, base);
-
-	if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
-		IWL_ERR(priv, "Start IWL Error Log Dump:\n");
-		IWL_ERR(priv, "Status: 0x%08lX, count: %d\n",
-			priv->status, count);
-	}
-
-	desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
-	blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32));
-	blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32));
-	ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32));
-	ilink2 = iwl_read_targ_mem(priv, base + 6 * sizeof(u32));
-	data1 = iwl_read_targ_mem(priv, base + 7 * sizeof(u32));
-	data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32));
-	line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
-	time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
-
-	IWL_ERR(priv, "Desc                               Time       "
-		"data1      data2      line\n");
-	IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n",
-		desc_lookup(desc), desc, time, data1, data2, line);
-	IWL_ERR(priv, "blink1  blink2  ilink1  ilink2\n");
-	IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,
-		ilink1, ilink2);
-
-}
-
-#define EVENT_START_OFFSET  (4 * sizeof(u32))
-
-/**
- * iwl_print_event_log - Dump error event log to syslog
- *
- */
-static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
-				u32 num_events, u32 mode)
-{
-	u32 i;
-	u32 base;       /* SRAM byte address of event log header */
-	u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
-	u32 ptr;        /* SRAM byte address of log data */
-	u32 ev, time, data; /* event log data */
-
-	if (num_events == 0)
-		return;
-	if (priv->ucode_type == UCODE_INIT)
-		base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
-	else
-		base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
-
-	if (mode == 0)
-		event_size = 2 * sizeof(u32);
-	else
-		event_size = 3 * sizeof(u32);
-
-	ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
-
-	/* "time" is actually "data" for mode 0 (no timestamp).
-	* place event id # at far right for easier visual parsing. */
-	for (i = 0; i < num_events; i++) {
-		ev = iwl_read_targ_mem(priv, ptr);
-		ptr += sizeof(u32);
-		time = iwl_read_targ_mem(priv, ptr);
-		ptr += sizeof(u32);
-		if (mode == 0) {
-			/* data, ev */
-			IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n", time, ev);
-		} else {
-			data = iwl_read_targ_mem(priv, ptr);
-			ptr += sizeof(u32);
-			IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n",
-					time, data, ev);
-		}
-	}
-}
-
-void iwl_dump_nic_event_log(struct iwl_priv *priv)
-{
-	u32 base;       /* SRAM byte address of event log header */
-	u32 capacity;   /* event log capacity in # entries */
-	u32 mode;       /* 0 - no timestamp, 1 - timestamp recorded */
-	u32 num_wraps;  /* # times uCode wrapped to top of log */
-	u32 next_entry; /* index of next entry to be written by uCode */
-	u32 size;       /* # entries that we'll print */
-
-	if (priv->ucode_type == UCODE_INIT)
-		base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
-	else
-		base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
-
-	if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
-		IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
-		return;
-	}
-
-	/* event log header */
-	capacity = iwl_read_targ_mem(priv, base);
-	mode = iwl_read_targ_mem(priv, base + (1 * sizeof(u32)));
-	num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
-	next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
-
-	size = num_wraps ? capacity : next_entry;
-
-	/* bail out if nothing in log */
-	if (size == 0) {
-		IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
-		return;
-	}
-
-	IWL_ERR(priv, "Start IWL Event Log Dump: display count %d, wraps %d\n",
-			size, num_wraps);
-
-	/* if uCode has wrapped back to top of log, start at the oldest entry,
-	 * i.e the next one that uCode would fill. */
-	if (num_wraps)
-		iwl_print_event_log(priv, next_entry,
-					capacity - next_entry, mode);
-	/* (then/else) start at top of log */
-	iwl_print_event_log(priv, 0, next_entry, mode);
-
-}
 #endif
 /**
  * iwl_irq_handle_error - called for HW or SW error interrupt from card
@@ -1486,8 +1303,8 @@ void iwl_irq_handle_error(struct iwl_priv *priv)
 
 #ifdef CONFIG_IWLWIFI_DEBUG
 	if (iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) {
-		iwl_dump_nic_error_log(priv);
-		iwl_dump_nic_event_log(priv);
+		priv->cfg->ops->lib->dump_nic_error_log(priv);
+		priv->cfg->ops->lib->dump_nic_event_log(priv);
 		iwl_print_rx_config_cmd(priv);
 	}
 #endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 3791c87..f094cd9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -167,6 +167,8 @@ struct iwl_lib_ops {
 	int (*is_valid_rtc_data_addr)(u32 addr);
 	/* 1st ucode load */
 	int (*load_ucode)(struct iwl_priv *priv);
+	void (*dump_nic_event_log)(struct iwl_priv *priv);
+	void (*dump_nic_error_log)(struct iwl_priv *priv);
 	/* power management */
 	struct iwl_apm_ops apm_ops;
 
@@ -547,7 +549,19 @@ int iwl_pci_resume(struct pci_dev *pdev);
 /*****************************************************
 *  Error Handling Debugging
 ******************************************************/
+#ifdef CONFIG_IWLWIFI_DEBUG
 void iwl_dump_nic_event_log(struct iwl_priv *priv);
+void iwl_dump_nic_error_log(struct iwl_priv *priv);
+#else
+static inline void iwl_dump_nic_event_log(struct iwl_priv *priv)
+{
+}
+
+static inline void iwl_dump_nic_error_log(struct iwl_priv *priv)
+{
+}
+#endif
+
 void iwl_clear_isr_stats(struct iwl_priv *priv);
 
 /*****************************************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index f2b38d9..037b75c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -439,7 +439,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
 	if (sscanf(buf, "%d", &event_log_flag) != 1)
 		return -EFAULT;
 	if (event_log_flag == 1)
-		iwl_dump_nic_event_log(priv);
+		priv->cfg->ops->lib->dump_nic_event_log(priv);
 
 	return count;
 }
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c92db01..4a4af0f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1481,6 +1481,7 @@ static inline void iwl_synchronize_irq(struct iwl_priv *priv)
 	tasklet_kill(&priv->irq_tasklet);
 }
 
+#ifdef CONFIG_IWLWIFI_DEBUG
 static const char *desc_lookup(int i)
 {
 	switch (i) {
@@ -1504,7 +1505,7 @@ static const char *desc_lookup(int i)
 #define ERROR_START_OFFSET  (1 * sizeof(u32))
 #define ERROR_ELEM_SIZE     (7 * sizeof(u32))
 
-static void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
+void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
 {
 	u32 i;
 	u32 desc, time, count, base, data1;
@@ -1598,7 +1599,7 @@ static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
 	}
 }
 
-static void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
+void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
 {
 	u32 base;       /* SRAM byte address of event log header */
 	u32 capacity;   /* event log capacity in # entries */
@@ -1640,6 +1641,16 @@ static void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
 	iwl3945_print_event_log(priv, 0, next_entry, mode);
 
 }
+#else
+void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
+{
+}
+
+void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
+{
+}
+
+#endif
 
 static void iwl3945_irq_tasklet(struct iwl_priv *priv)
 {
@@ -3683,21 +3694,6 @@ static ssize_t dump_error_log(struct device *d,
 
 static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log);
 
-static ssize_t dump_event_log(struct device *d,
-			      struct device_attribute *attr,
-			      const char *buf, size_t count)
-{
-	struct iwl_priv *priv = dev_get_drvdata(d);
-	char *p = (char *)buf;
-
-	if (p[0] == '1')
-		iwl3945_dump_nic_event_log(priv);
-
-	return strnlen(buf, count);
-}
-
-static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log);
-
 /*****************************************************************************
  *
  * driver setup and tear down
@@ -3742,7 +3738,6 @@ static struct attribute *iwl3945_sysfs_entries[] = {
 	&dev_attr_antenna.attr,
 	&dev_attr_channels.attr,
 	&dev_attr_dump_errors.attr,
-	&dev_attr_dump_events.attr,
 	&dev_attr_flags.attr,
 	&dev_attr_filter_flags.attr,
 #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 6/8] iwlwifi: Chain Noise Calibration for 6000 series
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

Adding support of Chain Noise Calibration for 6000 series NICs.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-1000.c  |    2 +
 drivers/net/wireless/iwlwifi/iwl-4965.c  |    6 ++-
 drivers/net/wireless/iwlwifi/iwl-5000.c  |   15 ++++++-
 drivers/net/wireless/iwlwifi/iwl-6000.c  |   19 +++++----
 drivers/net/wireless/iwlwifi/iwl-calib.c |   64 +++++++++++++++++++++---------
 drivers/net/wireless/iwlwifi/iwl-core.h  |    5 ++-
 drivers/net/wireless/iwlwifi/iwl-dev.h   |    3 +-
 7 files changed, 80 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 3b3e6bc..9dfd4c4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -165,6 +165,7 @@ struct iwl_cfg iwl1000_bgn_cfg = {
 	.shadow_ram_support = false,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl1000_bg_cfg = {
@@ -185,5 +186,6 @@ struct iwl_cfg iwl1000_bg_cfg = {
 	.shadow_ram_support = false,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 9ad5bca..d8c10ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -495,14 +495,15 @@ static void iwl4965_chain_noise_reset(struct iwl_priv *priv)
 static void iwl4965_gain_computation(struct iwl_priv *priv,
 		u32 *average_noise,
 		u16 min_average_noise_antenna_i,
-		u32 min_average_noise)
+		u32 min_average_noise,
+		u8 default_chain)
 {
 	int i, ret;
 	struct iwl_chain_noise_data *data = &priv->chain_noise_data;
 
 	data->delta_gain_code[min_average_noise_antenna_i] = 0;
 
-	for (i = 0; i < NUM_RX_CHAINS; i++) {
+	for (i = default_chain; i < NUM_RX_CHAINS; i++) {
 		s32 delta_g = 0;
 
 		if (!(data->disconn_array[i]) &&
@@ -2350,6 +2351,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
 	.ht_greenfield_support = false,
 	.broken_powersave = true,
 	.led_compensation = 61,
+	.chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS,
 };
 
 /* Module firmware */
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index e5b0fab..35bf56c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -301,14 +301,17 @@ u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv)
 static void iwl5000_gain_computation(struct iwl_priv *priv,
 		u32 average_noise[NUM_RX_CHAINS],
 		u16 min_average_noise_antenna_i,
-		u32 min_average_noise)
+		u32 min_average_noise,
+		u8 default_chain)
 {
 	int i;
 	s32 delta_g;
 	struct iwl_chain_noise_data *data = &priv->chain_noise_data;
 
-	/* Find Gain Code for the antennas B and C */
-	for (i = 1; i < NUM_RX_CHAINS; i++) {
+	/*
+	 * Find Gain Code for the chains based on "default chain"
+	 */
+	for (i = default_chain + 1; i < NUM_RX_CHAINS; i++) {
 		if ((data->disconn_array[i])) {
 			data->delta_gain_code[i] = 0;
 			continue;
@@ -1670,6 +1673,7 @@ struct iwl_cfg iwl5300_agn_cfg = {
 	.need_pll_cfg = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl5100_bg_cfg = {
@@ -1688,6 +1692,7 @@ struct iwl_cfg iwl5100_bg_cfg = {
 	.need_pll_cfg = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl5100_abg_cfg = {
@@ -1706,6 +1711,7 @@ struct iwl_cfg iwl5100_abg_cfg = {
 	.need_pll_cfg = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl5100_agn_cfg = {
@@ -1724,6 +1730,7 @@ struct iwl_cfg iwl5100_agn_cfg = {
 	.need_pll_cfg = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl5350_agn_cfg = {
@@ -1742,6 +1749,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
 	.need_pll_cfg = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl5150_agn_cfg = {
@@ -1760,6 +1768,7 @@ struct iwl_cfg iwl5150_agn_cfg = {
 	.need_pll_cfg = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 01a1f81..ad5d77c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -222,18 +222,11 @@ static struct iwl_lib_ops iwl6000_lib = {
 	 },
 };
 
-static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
-	.get_hcmd_size = iwl5000_get_hcmd_size,
-	.build_addsta_hcmd = iwl5000_build_addsta_hcmd,
-	.rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag,
-	.calc_rssi = iwl5000_calc_rssi,
-};
-
 static struct iwl_ops iwl6000_ops = {
 	.ucode = &iwl5000_ucode,
 	.lib = &iwl6000_lib,
 	.hcmd = &iwl5000_hcmd,
-	.utils = &iwl6000_hcmd_utils,
+	.utils = &iwl5000_hcmd_utils,
 };
 
 
@@ -260,6 +253,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6000h_2abg_cfg = {
@@ -281,6 +275,7 @@ struct iwl_cfg iwl6000h_2abg_cfg = {
 	.shadow_ram_support = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6000h_2bg_cfg = {
@@ -302,6 +297,7 @@ struct iwl_cfg iwl6000h_2bg_cfg = {
 	.shadow_ram_support = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 /*
@@ -327,6 +323,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6000i_2abg_cfg = {
@@ -348,6 +345,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
 	.shadow_ram_support = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6000i_2bg_cfg = {
@@ -369,6 +367,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
 	.shadow_ram_support = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6050_2agn_cfg = {
@@ -391,6 +390,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6050_2abg_cfg = {
@@ -412,6 +412,7 @@ struct iwl_cfg iwl6050_2abg_cfg = {
 	.shadow_ram_support = true,
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6000_3agn_cfg = {
@@ -434,6 +435,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 struct iwl_cfg iwl6050_3agn_cfg = {
@@ -456,6 +458,7 @@ struct iwl_cfg iwl6050_3agn_cfg = {
 	.ht_greenfield_support = true,
 	.led_compensation = 51,
 	.use_rts_for_ht = true, /* use rts/cts protection */
+	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index 6e73317..69a80d7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -643,6 +643,15 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
 }
 EXPORT_SYMBOL(iwl_sensitivity_calibration);
 
+static inline u8 find_first_chain(u8 mask)
+{
+	if (mask & ANT_A)
+		return CHAIN_A;
+	if (mask & ANT_B)
+		return CHAIN_B;
+	return CHAIN_C;
+}
+
 /*
  * Accumulate 20 beacons of signal and noise statistics for each of
  *   3 receivers/antennas/rx-chains, then figure out:
@@ -675,14 +684,17 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 	u8 num_tx_chains;
 	unsigned long flags;
 	struct statistics_rx_non_phy *rx_info = &(stat_resp->rx.general);
+	u8 first_chain;
 
 	if (priv->disable_chain_noise_cal)
 		return;
 
 	data = &(priv->chain_noise_data);
 
-	/* Accumulate just the first 20 beacons after the first association,
-	 *   then we're done forever. */
+	/*
+	 * Accumulate just the first "chain_noise_num_beacons" after
+	 * the first association, then we're done forever.
+	 */
 	if (data->state != IWL_CHAIN_NOISE_ACCUMULATE) {
 		if (data->state == IWL_CHAIN_NOISE_ALIVE)
 			IWL_DEBUG_CALIB(priv, "Wait for noise calib reset\n");
@@ -710,7 +722,10 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 		return;
 	}
 
-	/* Accumulate beacon statistics values across 20 beacons */
+	/*
+	 *  Accumulate beacon statistics values across
+	 * "chain_noise_num_beacons"
+	 */
 	chain_noise_a = le32_to_cpu(rx_info->beacon_silence_rssi_a) &
 				IN_BAND_FILTER;
 	chain_noise_b = le32_to_cpu(rx_info->beacon_silence_rssi_b) &
@@ -741,16 +756,19 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 	IWL_DEBUG_CALIB(priv, "chain_noise: a %d b %d c %d\n",
 			chain_noise_a, chain_noise_b, chain_noise_c);
 
-	/* If this is the 20th beacon, determine:
+	/* If this is the "chain_noise_num_beacons", determine:
 	 * 1)  Disconnected antennas (using signal strengths)
 	 * 2)  Differential gain (using silence noise) to balance receivers */
-	if (data->beacon_count != CAL_NUM_OF_BEACONS)
+	if (data->beacon_count != priv->cfg->chain_noise_num_beacons)
 		return;
 
 	/* Analyze signal for disconnected antenna */
-	average_sig[0] = (data->chain_signal_a) / CAL_NUM_OF_BEACONS;
-	average_sig[1] = (data->chain_signal_b) / CAL_NUM_OF_BEACONS;
-	average_sig[2] = (data->chain_signal_c) / CAL_NUM_OF_BEACONS;
+	average_sig[0] =
+		(data->chain_signal_a) / priv->cfg->chain_noise_num_beacons;
+	average_sig[1] =
+		(data->chain_signal_b) / priv->cfg->chain_noise_num_beacons;
+	average_sig[2] =
+		(data->chain_signal_c) / priv->cfg->chain_noise_num_beacons;
 
 	if (average_sig[0] >= average_sig[1]) {
 		max_average_sig = average_sig[0];
@@ -803,13 +821,17 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 			/* there is a Tx antenna connected */
 			break;
 		if (num_tx_chains == priv->hw_params.tx_chains_num &&
-		data->disconn_array[i]) {
-			/* This is the last TX antenna and is also
-			 * disconnected connect it anyway */
-			data->disconn_array[i] = 0;
-			active_chains |= ant_msk;
-			IWL_DEBUG_CALIB(priv, "All Tx chains are disconnected W/A - "
-				"declare %d as connected\n", i);
+		    data->disconn_array[i]) {
+			/*
+			 * If all chains are disconnected
+			 * connect the first valid tx chain
+			 */
+			first_chain =
+				find_first_chain(priv->cfg->valid_tx_ant);
+			data->disconn_array[first_chain] = 0;
+			active_chains |= BIT(first_chain);
+			IWL_DEBUG_CALIB(priv, "All Tx chains are disconnected W/A - declare %d as connected\n",
+					first_chain);
 			break;
 		}
 	}
@@ -820,9 +842,12 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 			active_chains);
 
 	/* Analyze noise for rx balance */
-	average_noise[0] = ((data->chain_noise_a)/CAL_NUM_OF_BEACONS);
-	average_noise[1] = ((data->chain_noise_b)/CAL_NUM_OF_BEACONS);
-	average_noise[2] = ((data->chain_noise_c)/CAL_NUM_OF_BEACONS);
+	average_noise[0] =
+		((data->chain_noise_a) / priv->cfg->chain_noise_num_beacons);
+	average_noise[1] =
+		((data->chain_noise_b) / priv->cfg->chain_noise_num_beacons);
+	average_noise[2] =
+		((data->chain_noise_c) / priv->cfg->chain_noise_num_beacons);
 
 	for (i = 0; i < NUM_RX_CHAINS; i++) {
 		if (!(data->disconn_array[i]) &&
@@ -843,7 +868,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 
 	if (priv->cfg->ops->utils->gain_computation)
 		priv->cfg->ops->utils->gain_computation(priv, average_noise,
-			min_average_noise_antenna_i, min_average_noise);
+				min_average_noise_antenna_i, min_average_noise,
+				find_first_chain(priv->cfg->valid_rx_ant));
 
 	/* Some power changes may have been made during the calibration.
 	 * Update and commit the RXON
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index f094cd9..b66bf7b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -98,7 +98,8 @@ struct iwl_hcmd_utils_ops {
 	void (*gain_computation)(struct iwl_priv *priv,
 			u32 *average_noise,
 			u16 min_average_noise_antennat_i,
-			u32 min_average_noise);
+			u32 min_average_noise,
+			u8 default_chain);
 	void (*chain_noise_reset)(struct iwl_priv *priv);
 	void (*rts_tx_cmd_flag)(struct ieee80211_tx_info *info,
 			__le32 *tx_flags);
@@ -218,6 +219,7 @@ struct iwl_mod_params {
  *	to the deviation to achieve the desired led frequency.
  *	The detail algorithm is described in iwl-led.c
  * @use_rts_for_ht: use rts/cts protection for HT traffic
+ * @chain_noise_num_beacons: number of beacons used to compute chain noise
  *
  * We enable the driver to be backward compatible wrt API version. The
  * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -262,6 +264,7 @@ struct iwl_cfg {
 	u16 led_compensation;
 	const bool broken_powersave;
 	bool use_rts_for_ht;
+	int chain_noise_num_beacons;
 };
 
 /***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 3ea97be..ad99ce7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -743,7 +743,8 @@ struct iwl_dma_ptr {
 
 /* Sensitivity and chain noise calibration */
 #define INITIALIZATION_VALUE		0xFFFF
-#define CAL_NUM_OF_BEACONS		20
+#define IWL4965_CAL_NUM_BEACONS		20
+#define IWL_CAL_NUM_BEACONS		16
 #define MAXIMUM_ALLOWED_PATHLOSS	15
 
 #define CHAIN_NOISE_MAX_DELTA_GAIN_CODE 3
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 8/8] iwlwifi: add module firmware info for 1000 series
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Huaxu Wan, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Huaxu Wan <huaxu.wan@linux.intel.com>

The module firmware information of 1000 series is missing from iwlagn.

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-1000.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 9dfd4c4..af91dba 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -189,3 +189,4 @@ struct iwl_cfg iwl1000_bg_cfg = {
 	.chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
 };
 
+MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 4/8] iwlwifi: fix a typo
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Johannes Berg <johannes@sipsolutions.net>

We never have four chains, but let's fix the typo
while we noticed it. You count 0, 1, 2, 3, not
0, 1, 2, 4 :)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 2908bff..5ff0f66 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -984,7 +984,7 @@ static u8 iwl_count_chain_bitmap(u32 chain_bitmap)
 	res = (chain_bitmap & BIT(0)) >> 0;
 	res += (chain_bitmap & BIT(1)) >> 1;
 	res += (chain_bitmap & BIT(2)) >> 2;
-	res += (chain_bitmap & BIT(4)) >> 4;
+	res += (chain_bitmap & BIT(3)) >> 3;
 	return res;
 }
 
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 1/8 v2.6.32 and w-t] iwlwifi: fix debugfs buffer handling
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Reinette Chatre <reinette.chatre@intel.com>

We keep track of where to write into a buffer by keeping a count of how
much has been written so far. When writing to the buffer we thus take the
buffer pointer and adding the count of what has been written so far.
Keeping track of what has been written so far is done by incrementing
this number every time something is written to the buffer with how much has
been written at that time.

Currently this number is incremented incorrectly when using the
"hex_dump_to_buffer" call to add data to the buffer. Fix this by only
adding what has been added to the buffer in that call instead of what has
been added since beginning of buffer.

Issue was discovered and discussed during testing of
https://bugzilla.redhat.com/show_bug.cgi?id=464598 .

When a user views any of these files they will see something like:

[  179.355202] ------------[ cut here ]------------
[  179.355209] WARNING: at ../lib/vsprintf.c:989 vsnprintf+0x5ec/0x5f0()
[  179.355212] Hardware name: VGN-Z540N
[  179.355213] Modules linked in: i915 drm i2c_algo_bit i2c_core ipv6 acpi_cpufreq cpufreq_userspace cpufreq_powersave cpufreq_ondemand cpufreq_conservative cpufreq_stats freq_table container sbs sbshc arc4 ecb iwlagn iwlcore joydev led_class mac80211 af_packet pcmcia psmouse sony_laptop cfg80211 iTCO_wdt iTCO_vendor_support pcspkr serio_raw rfkill intel_agp video output tpm_infineon tpm tpm_bios button battery yenta_socket rsrc_nonstatic pcmcia_core processor ac evdev ext3 jbd mbcache sr_mod sg cdrom sd_mod ahci libata scsi_mod ehci_hcd uhci_hcd usbcore thermal fan thermal_sys
[  179.355262] Pid: 5449, comm: cat Not tainted 2.6.31-wl-54419-ge881071 #62
[  179.355264] Call Trace:
[  179.355267]  [<ffffffff811ad14c>] ? vsnprintf+0x5ec/0x5f0
[  179.355271]  [<ffffffff81041348>] warn_slowpath_common+0x78/0xd0
[  179.355275]  [<ffffffff810413af>] warn_slowpath_null+0xf/0x20
[  179.355277]  [<ffffffff811ad14c>] vsnprintf+0x5ec/0x5f0
[  179.355280]  [<ffffffff811ad23d>] ? scnprintf+0x5d/0x80
[  179.355283]  [<ffffffff811ad23d>] scnprintf+0x5d/0x80
[  179.355286]  [<ffffffff811aed29>] ? hex_dump_to_buffer+0x189/0x340
[  179.355290]  [<ffffffff810e91d7>] ? __kmalloc+0x207/0x260
[  179.355303]  [<ffffffffa02a02f8>] iwl_dbgfs_nvm_read+0xe8/0x220 [iwlcore]
[  179.355306]  [<ffffffff811a9b62>] ? __up_read+0x92/0xb0
[  179.355310]  [<ffffffff810f0988>] vfs_read+0xc8/0x1a0
[  179.355313]  [<ffffffff810f0b50>] sys_read+0x50/0x90
[  179.355316]  [<ffffffff8100bd6b>] system_call_fastpath+0x16/0x1b
[  179.355319] ---[ end trace 2383d0d5e0752ca0 ]---

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-debugfs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 1a0337f..f2b38d9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -413,7 +413,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
 		pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
 		hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos,
 				   buf_size - pos, 0);
-		pos += strlen(buf);
+		pos += strlen(buf + pos);
 		if (buf_size - pos > 0)
 			buf[pos++] = '\n';
 	}
@@ -912,7 +912,7 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,
 						"0x%.4x ", ofs);
 				hex_dump_to_buffer(ptr + ofs, 16, 16, 2,
 						   buf + pos, bufsz - pos, 0);
-				pos += strlen(buf);
+				pos += strlen(buf + pos);
 				if (bufsz - pos > 0)
 					buf[pos++] = '\n';
 			}
@@ -935,7 +935,7 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,
 						"0x%.4x ", ofs);
 				hex_dump_to_buffer(ptr + ofs, 16, 16, 2,
 						   buf + pos, bufsz - pos, 0);
-				pos += strlen(buf);
+				pos += strlen(buf + pos);
 				if (bufsz - pos > 0)
 					buf[pos++] = '\n';
 			}
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 0/8] iwlwifi driver updates 09/25/2009
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Reinette Chatre

We include a few fixes targeting 2.6.32 and wireless-testing:
1/8 prevents a WARN printed due to invalid address
2/8 fixes a memory leak
3/8 fixes debug information when a ucode problem occurs in 3945. without
this patch the logs printed when such a problem occurs will be formatted
incorrectly.

The rest of the patches continue adding support for 6000 support as well as
better powersaving support.

[PATCH 1/8 v2.6.32 and w-t] iwlwifi: fix debugfs buffer handling
[PATCH 2/8 v2.6.32 and w-t] iwlwifi: fix memory leak in command queue handling
[PATCH 3/8 v2.6.32 and w-t] iwlwifi: fix 3945 ucode info retrieval after failure
[PATCH 4/8] iwlwifi: fix a typo
[PATCH 5/8] iwlwifi: default to using all chains
[PATCH 6/8] iwlwifi: Chain Noise Calibration for 6000 series
[PATCH 7/8] iwlwifi: support idle for 6000 series hw
[PATCH 8/8] iwlwifi: add module firmware info for 1000 series

Reinette

^ permalink raw reply

* [PATCH 2/8 v2.6.32 and w-t] iwlwifi: fix memory leak in command queue handling
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Reinette Chatre <reinette.chatre@intel.com>

Also free the array of command pointers and meta data of each
command buffer when command queue is freed.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-tx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index ee0e26d..ad69479 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -197,6 +197,12 @@ void iwl_cmd_queue_free(struct iwl_priv *priv)
 		pci_free_consistent(dev, priv->hw_params.tfd_size *
 				    txq->q.n_bd, txq->tfds, txq->q.dma_addr);
 
+	/* deallocate arrays */
+	kfree(txq->cmd);
+	kfree(txq->meta);
+	txq->cmd = NULL;
+	txq->meta = NULL;
+
 	/* 0-fill queue descriptor structure */
 	memset(txq, 0, sizeof(*txq));
 }
-- 
1.5.6.3


^ permalink raw reply related

* [PATCH 5/8] iwlwifi: default to using all chains
From: Reinette Chatre @ 2009-09-25 21:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1253913868-8400-1-git-send-email-reinette.chatre@intel.com>

From: Johannes Berg <johannes@sipsolutions.net>

When instructing the microcode to use just a single
chain when we have power saving enabled, we should
also tell the AP that we are doing SM powersave.
However, using a single chain doesn't actually have
any power saving advantage while idle -- measurements
show that the power consumption is no different when
using one vs. two or three chains.

Therefore, always instruct the microcode to use all
chains.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 5ff0f66..e97b104 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -948,8 +948,13 @@ EXPORT_SYMBOL(iwl_set_rxon_ht);
 #define IWL_NUM_IDLE_CHAINS_DUAL	2
 #define IWL_NUM_IDLE_CHAINS_SINGLE	1
 
-/* Determine how many receiver/antenna chains to use.
- * More provides better reception via diversity.  Fewer saves power.
+/*
+ * Determine how many receiver/antenna chains to use.
+ *
+ * More provides better reception via diversity.  Fewer saves power
+ * at the expense of throughput, but only when not in powersave to
+ * start with.
+ *
  * MIMO (dual stream) requires at least 2, but works better with 3.
  * This does not determine *which* chains to use, just how many.
  */
@@ -962,19 +967,18 @@ static int iwl_get_active_rx_chain_count(struct iwl_priv *priv)
 		return IWL_NUM_RX_CHAINS_MULTIPLE;
 }
 
+/*
+ * When we are in power saving, there's no difference between
+ * using multiple chains or just a single chain, but due to the
+ * lack of SM PS we lose a lot of throughput if we use just a
+ * single chain.
+ *
+ * Therefore, use the active count here (which will use multiple
+ * chains unless connected to a legacy AP).
+ */
 static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt)
 {
-	bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status);
-
-	/* # Rx chains when idling and maybe trying to save power */
-
-	/*
-	 * XXX: this is incorrect!!
-	 *	we always indicate to the AP that
-	 *	our SM PS mode is "disabled"
-	 */
-
-	return is_cam ? active_cnt : IWL_NUM_IDLE_CHAINS_SINGLE;
+	return active_cnt;
 }
 
 /* up to 4 chains */
-- 
1.5.6.3


^ permalink raw reply related

* Re: Porting AR6K to use cfg80211
From: Luis R. Rodriguez @ 2009-09-25 21:17 UTC (permalink / raw)
  To: Dave; +Cc: Matthew Ryan, linux-wireless
In-Reply-To: <43e72e890909251416g59a24d8as90f7a4d649c06914@mail.gmail.com>

On Fri, Sep 25, 2009 at 2:16 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Fri, Sep 25, 2009 at 2:06 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>> On Fri, Sep 25, 2009 at 1:57 PM, Dave <kilroyd@googlemail.com> wrote:
>>> Matthew Ryan wrote:
>>>> Michael Buesch <mb@...> writes:
>>>>> On Friday 25 September 2009 19:40:52 Matthew Ryan wrote:
>>>>>> I was curious if I could get a few expert opinions on if its possible to port
>>>>>> this driver to use mac80211, and how difficult/ what pitfalls there may be.
>>>>> The device is fullmac, so it does not require mac80211.
>>>>> I guess however, ar6k can be ported to use cfg80211.
>>>>>
>>>>
>>>> Do you know of any examples in the source tree which are fullmac, but utilize
>>>> cfg80211 that I could use as a base to get started?
>>>
>>> There are a few fullmac drivers in wireless-testing that use cfg80211. I
>>> don't think these are in the recently released 2.6.31, but are queued
>>> for 2.6.32.
>>>
>>> iwmc3200wifi and rndis_wlan are furthest along. orinoco is in the
>>> process of conversion (it uses cfg80211, but relies on the wext
>>> compatibility code for a large portion of functionality).
>>
>> Additionally you can poke at the HTC / HIF stuff I'm doing for ar9271:
>>
>> http://wireless.kernel.org/en/users/Drivers/ath9k_htc
>>
>> Granted I've removed all credit distribution stuff as ar9271 doesn't
>> use it, but it still may be easier to use that then what I had seen on
>> ar6k for HTC.
>
> Let me clarify a little more.
>
> ath9k_htc is a module which will use ath_htc and ath_hif_usb.
> ath9k_htc delcares hardware support for the 802.11n Atheros 9k family
> for devices which use HTC. The ar9271 usb device gets probed by
> ath_hif_usb. ath9k_htc is being designed as the mac80211 driver for
> ar9271 but it may be possible to just share the same ath9k_htc for all
> SoftMAC Atheros 11n HTC devices.
>
> Now, ar6k is FullMAC so an ath9k_htc per se is not needed but I'd
> expect you'd just need to implement a ar6k.c which uses cfg80211 and
> adds support for the ar6k hw famiy. You'd need to implement an
> ath_hif_sdio.c to handle the SDIO transport and this would be the
> module probing the ar6k devices over sdio. Now, sure, I don't expect
> any PCI/USB ar6k devices but still, this is the architectural approach
> I'd like to see.

Oh and I missed my main point: if the above is possible we can then
share an ath_htc.

  Luis

^ permalink raw reply

* Re: Porting AR6K to use cfg80211
From: Luis R. Rodriguez @ 2009-09-25 21:16 UTC (permalink / raw)
  To: Dave; +Cc: Matthew Ryan, linux-wireless
In-Reply-To: <43e72e890909251406o64417544w2fd836f820eae80e@mail.gmail.com>

On Fri, Sep 25, 2009 at 2:06 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Fri, Sep 25, 2009 at 1:57 PM, Dave <kilroyd@googlemail.com> wrote:
>> Matthew Ryan wrote:
>>> Michael Buesch <mb@...> writes:
>>>> On Friday 25 September 2009 19:40:52 Matthew Ryan wrote:
>>>>> I was curious if I could get a few expert opinions on if its possible to port
>>>>> this driver to use mac80211, and how difficult/ what pitfalls there may be.
>>>> The device is fullmac, so it does not require mac80211.
>>>> I guess however, ar6k can be ported to use cfg80211.
>>>>
>>>
>>> Do you know of any examples in the source tree which are fullmac, but utilize
>>> cfg80211 that I could use as a base to get started?
>>
>> There are a few fullmac drivers in wireless-testing that use cfg80211. I
>> don't think these are in the recently released 2.6.31, but are queued
>> for 2.6.32.
>>
>> iwmc3200wifi and rndis_wlan are furthest along. orinoco is in the
>> process of conversion (it uses cfg80211, but relies on the wext
>> compatibility code for a large portion of functionality).
>
> Additionally you can poke at the HTC / HIF stuff I'm doing for ar9271:
>
> http://wireless.kernel.org/en/users/Drivers/ath9k_htc
>
> Granted I've removed all credit distribution stuff as ar9271 doesn't
> use it, but it still may be easier to use that then what I had seen on
> ar6k for HTC.

Let me clarify a little more.

ath9k_htc is a module which will use ath_htc and ath_hif_usb.
ath9k_htc delcares hardware support for the 802.11n Atheros 9k family
for devices which use HTC. The ar9271 usb device gets probed by
ath_hif_usb. ath9k_htc is being designed as the mac80211 driver for
ar9271 but it may be possible to just share the same ath9k_htc for all
SoftMAC Atheros 11n HTC devices.

Now, ar6k is FullMAC so an ath9k_htc per se is not needed but I'd
expect you'd just need to implement a ar6k.c which uses cfg80211 and
adds support for the ar6k hw famiy. You'd need to implement an
ath_hif_sdio.c to handle the SDIO transport and this would be the
module probing the ar6k devices over sdio. Now, sure, I don't expect
any PCI/USB ar6k devices but still, this is the architectural approach
I'd like to see.

  Luis

^ permalink raw reply

* Re: Porting AR6K to use cfg80211
From: Luis R. Rodriguez @ 2009-09-25 21:06 UTC (permalink / raw)
  To: Dave; +Cc: Matthew Ryan, linux-wireless
In-Reply-To: <4ABD2ECE.50501@gmail.com>

On Fri, Sep 25, 2009 at 1:57 PM, Dave <kilroyd@googlemail.com> wrote:
> Matthew Ryan wrote:
>> Michael Buesch <mb@...> writes:
>>> On Friday 25 September 2009 19:40:52 Matthew Ryan wrote:
>>>> I was curious if I could get a few expert opinions on if its possible to port
>>>> this driver to use mac80211, and how difficult/ what pitfalls there may be.
>>> The device is fullmac, so it does not require mac80211.
>>> I guess however, ar6k can be ported to use cfg80211.
>>>
>>
>> Do you know of any examples in the source tree which are fullmac, but utilize
>> cfg80211 that I could use as a base to get started?
>
> There are a few fullmac drivers in wireless-testing that use cfg80211. I
> don't think these are in the recently released 2.6.31, but are queued
> for 2.6.32.
>
> iwmc3200wifi and rndis_wlan are furthest along. orinoco is in the
> process of conversion (it uses cfg80211, but relies on the wext
> compatibility code for a large portion of functionality).

Additionally you can poke at the HTC / HIF stuff I'm doing for ar9271:

http://wireless.kernel.org/en/users/Drivers/ath9k_htc

Granted I've removed all credit distribution stuff as ar9271 doesn't
use it, but it still may be easier to use that then what I had seen on
ar6k for HTC.

  Luis

^ permalink raw reply

* Re: Porting AR6K to use cfg80211
From: Dave @ 2009-09-25 20:57 UTC (permalink / raw)
  To: Matthew Ryan; +Cc: linux-wireless
In-Reply-To: <loom.20090925T222532-791@post.gmane.org>

Matthew Ryan wrote:
> Michael Buesch <mb@...> writes:
>> On Friday 25 September 2009 19:40:52 Matthew Ryan wrote:
>>> I was curious if I could get a few expert opinions on if its possible to port
>>> this driver to use mac80211, and how difficult/ what pitfalls there may be.
>> The device is fullmac, so it does not require mac80211.
>> I guess however, ar6k can be ported to use cfg80211.
>>
> 
> Do you know of any examples in the source tree which are fullmac, but utilize
> cfg80211 that I could use as a base to get started?

There are a few fullmac drivers in wireless-testing that use cfg80211. I
don't think these are in the recently released 2.6.31, but are queued
for 2.6.32.

iwmc3200wifi and rndis_wlan are furthest along. orinoco is in the
process of conversion (it uses cfg80211, but relies on the wext
compatibility code for a large portion of functionality).


Dave.

^ permalink raw reply

* Re: Massive packet loss with ath9k, AR9280, hostapd in 802.11n mode
From: Bob Copeland @ 2009-09-25 20:52 UTC (permalink / raw)
  To: Rene Mayrhofer; +Cc: linux-wireless
In-Reply-To: <200909252054.19762.rene.mayrhofer@gibraltar.at>

On Fri, Sep 25, 2009 at 2:54 PM, Rene Mayrhofer
<rene.mayrhofer@gibraltar.at> wrote:

I'll take a stab at this one, someone else can try the other ath9k-related
questions.

> 4. How do I tell CRDA to load frequency definitions for my location (AT)
> instead of the default (US)? I might be blind, stupid, or both, but using the
> slightly conflicting documentation available on various Wikis, I was unable to
> change this. I have read that some chipsets are hard-wired for one location
> and can't be changed, but couldn't find out if mine is (it was bought in
> Europe, so shouldn't be locked to US in any case). An RTFM (with an up-to-date
> pointer, preferrably for Debian/Ubuntu) in this matter would be highly
> appreciated.

"iw reg set XX", but read this first:

http://wireless.kernel.org/en/users/Drivers/ath
http://wireless.kernel.org/en/developers/Regulatory

In short, it depends on what's in your EEPROM.

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply

* Re: Porting AR6K to use cfg80211
From: Matthew Ryan @ 2009-09-25 20:25 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <200909252005.23746.mb@bu3sch.de>

Michael Buesch <mb@...> writes:

> 
> On Friday 25 September 2009 19:40:52 Matthew Ryan wrote:
> > I was curious if I could get a few expert opinions on if its possible to port
> > this driver to use mac80211, and how difficult/ what pitfalls there may be.
> 
> The device is fullmac, so it does not require mac80211.
> I guess however, ar6k can be ported to use cfg80211.
> 

Do you know of any examples in the source tree which are fullmac, but utilize
cfg80211 that I could use as a base to get started?

Thanks,

Matt




^ permalink raw reply

* Re: ar9170 makes machine hang when shut down
From: Joerg Albert @ 2009-09-25 20:16 UTC (permalink / raw)
  To: Malte Gell; +Cc: linux-wireless
In-Reply-To: <200909251132.18546.malte.gell@gmx.de>

On 09/25/2009 11:32 AM, Malte Gell wrote:
> My system loads ar9170:
> 
> lsmod | grep ar91*
> 
> ar9170                 32632  0
> mac80211              237208  1 ar9170
> led_class               4028  1 ar9170
> usbcore               183280  15 
> usbserial,ar9170,usbhid,uvcvideo,snd_usb_audio,snd_usb_lib,usblp,ehci_hcd,uhci_hcd,ohci_hcd,usb_storage

You are right. I had a look into the source rpm for the packets your url pointed to. The ar9170 driver inside
compat-wireless dates back to end of February 2009, at that time the driver was called ar9170, it got the "usb" prefix later.

You might try arusb_lnx (the vendor driver) from the other package (no idea how OpenSuSE handles two drivers
for the same hardware), but the best way to get support from this list would be to compile a decent
compat-wireless by your own and report bugs etc. to the list. A lot of stuff changed since February.

Regards,
Jörg.

^ permalink raw reply

* Re: Problems with WPA in mainline 2.6.31-gitX
From: Larry Finger @ 2009-09-25 19:38 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: Johannes Berg, John Linville, wireless
In-Reply-To: <200909252042.37881.chunkeey@googlemail.com>

Christian Lamparter wrote:
> 
> it made it into 2.6.31-git16:
> "cfg80211: don't overwrite privacy setting"
> 94f85853324e02c3a32bc3101f090dc9a3f512b4
> 
> but, "[PATCH] cfg80211: don't set privacy w/o key"
> is still missing.

Thanks, Christian. It turns out I do not need "don't set privacy".

With the latest pull, my system works fine.

Larry

^ permalink raw reply

* Re: [PATCH 2/2] at76c50x-usb: set firmware and hardware version in wiphy
From: Luis R. Rodriguez @ 2009-09-25 19:27 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <da94abde0909251211x347bbd30xdfe2bd05bc1e07e5@mail.gmail.com>

On Fri, Sep 25, 2009 at 12:11 PM, Kalle Valo <kalle.valo@iki.fi> wrote:
> On Thu, Sep 24, 2009 at 1:11 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>> On Thu, Sep 24, 2009 at 12:10 PM, Kalle Valo <kalle.valo@iki.fi> wrote:
>>
>>> BTW, is there an easy way to get the module name for the interface?
>>> That's also helpful information for the user.
>>
>> If you can map the interface to PCI ID then I think its possible,
>> lspci -k seems to do it.
>
> Not all drivers use PCI, we have USB, SDIO, SPI and so on.

Sure, it was just an example of a transport where this does exist, I
am hoping this doesn't use PCI specific stuff and based on a simple
strace of "strace -o foo lspci -k -s 03:00.0"  I see it actually ends
up reading a  /lib/modules/ file and am hoping this is what it uses to
do the mapping. But you still first need the bus ID for the netdevice,
not sure how to best to do that. I do see the sysfs ieee80211 class
maps the phy%d to the bus:

mcgrof@tux ~ $ ls -ld /sys/class/ieee80211/phy0/device
lrwxrwxrwx 1 root root 0 2009-09-25 12:25
/sys/class/ieee80211/phy0/device -> ../../../0000:03:00.0

If you can extract the bus from here and then the device:vendor id I
think you can read the /lib/modules/ map file for the driver.

Check these files out:

ls /lib/modules/2.6.31-wl/modules.*map

  Luis

^ permalink raw reply

* Re: [PATCH 2/2] at76c50x-usb: set firmware and hardware version in wiphy
From: Kalle Valo @ 2009-09-25 19:11 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, Felix Bitterli
In-Reply-To: <43e72e890909241311j552ee33ata80ba24c386a316b@mail.gmail.com>

On Thu, Sep 24, 2009 at 1:11 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Thu, Sep 24, 2009 at 12:10 PM, Kalle Valo <kalle.valo@iki.fi> wrote:
>
>> BTW, is there an easy way to get the module name for the interface?
>> That's also helpful information for the user.
>
> If you can map the interface to PCI ID then I think its possible,
> lspci -k seems to do it.

Not all drivers use PCI, we have USB, SDIO, SPI and so on.

> It would be a nice addition to iw output as well IMHO.

I agree. I'm not going to work on adding the driver name right now,
but maybe in the future.

Kalle

^ permalink raw reply

* Re: [PATCH 2/2] at76c50x-usb: set firmware and hardware version in wiphy
From: Kalle Valo @ 2009-09-25 19:06 UTC (permalink / raw)
  To: Joerg Albert; +Cc: linux-wireless
In-Reply-To: <4ABBE0E6.4090408@gmx.de>

On Thu, Sep 24, 2009 at 2:13 PM, Joerg Albert <jal2@gmx.de> wrote:
> On 09/24/2009 08:02 PM, Kalle Valo wrote:
>
>> +     len = sizeof(wiphy->fw_version);
>> +     snprintf(wiphy->fw_version, len, "%d.%d.%d-%d",
>> +              priv->fw_version.major, priv->fw_version.minor,
>> +              priv->fw_version.patch, priv->fw_version.build);
>> +
>> +     len = sizeof(wiphy->hw_version);
>> +     snprintf(wiphy->hw_version, len, "%d", priv->board_type);
>> +
>> +     /* null terminate the strings in case they were truncated */
>> +     wiphy->fw_version[len - 1] = '\0';
>> +     wiphy->hw_version[len - 1] = '\0';
>
> This only works as long as sizeof(wiphy->fw_version) == sizeof(wiphy->hw_version) - which is currently the case.
> For sizeof(wiphy->fw_version) < sizeof(wiphy_hw_version) it overwrites memory behind wiphy->fw_version.

Good point, thanks for catching that.

> IMHO this is more robust against changes in the lengths of the char arrays:
>
> +       wiphy->fw_version[sizeof(wiphy->fw_version) - 1] = '\0';
> +       wiphy->hw_version[sizeof(wiphy->hw_version) - 1] = '\0';

Actually Christian pointed out that snprintf() always null terminates
the string and all this unnecessary. So I'll just remove this in v2.

Kalle

^ permalink raw reply

* Massive packet loss with ath9k, AR9280, hostapd in 802.11n mode
From: Rene Mayrhofer @ 2009-09-25 18:54 UTC (permalink / raw)
  To: linux-wireless

Hi everybody,

[Please CC me in replies, I am currently not subscribed to this list.]

For quite a few weeks, I have now been trying to get an AR9280 mini-PCI card 
to run as an access point, both in 802.11g and 802.11n mode. 

In 802.11g mode, it seems to work for some time with multiple clients, but 
then generally drops most packets (estimated >90%) after a period of a few 
hours of usage. Restarting the device makes it work again.

In 802.11n mode, one client (Asus eeePC 1000 with Atheros 802.11agn chipset) 
initially gets a fairly stable connection (with massive packet loss after some 
period of usage), while another client (Dell Latitude XT with Broadcom 
802.11ag chipset) only manages to connect with an absymal transfer rate (<2 
MBit/s).

This behaviour seems to be mostly independent from WPA and encryption settings 
(with the unencrypted connection being sometimes slower than the WPA2/AES 
secured one), and does not change much with driver versions. My default driver 
is the one included in the upstream 2.6.30.5/.7 kernel, but I have also tried 
compat-wireless-2.6 in multiple versions, including 2009-09-25.

The hardware is detected as:

[   25.714849] cfg80211: Calling CRDA for country: US
[   27.233246] geode-aes: GEODE AES engine enabled.
[   27.510611] AMD Geode RNG detected
[   29.955007] phy0: Selected rate control algorithm 'ath9k_rate_control'
[   29.957464] cfg80211: Calling CRDA for country: US
[   29.965266] Registered led device: ath9k-phy0::radio
[   29.965407] Registered led device: ath9k-phy0::assoc
[   29.965540] Registered led device: ath9k-phy0::tx
[   29.965693] Registered led device: ath9k-phy0::rx
[   29.965744] phy0: Atheros AR9280 MAC/BB Rev:2 AR5133 RF Rev:d0: 
mem=0xd0b60000, irq=9

and sits in a mini-PCI slow on an Alix2d13 boards.

hostapd is version v0.6.9 from Debian testing and configured with these 
relevant options:

interface=wlan0
country_code=AT
hw_mode=g
ieee80211n=1
ht_capab=[HT40-][SHORT-GI-40]
channel=6
wpa=3
wpa_passphrase=<long string>
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
driver=nl80211
wme_enabled=1
wme_ac_bk_cwmin=4
wme_ac_bk_cwmax=10
wme_ac_bk_aifs=7
wme_ac_bk_txop_limit=0
wme_ac_bk_acm=0
wme_ac_be_aifs=3
wme_ac_be_cwmin=4
wme_ac_be_cwmax=10
wme_ac_be_txop_limit=0
wme_ac_be_acm=0
wme_ac_vi_aifs=2
wme_ac_vi_cwmin=3
wme_ac_vi_cwmax=4
wme_ac_vi_txop_limit=94
wme_ac_vi_acm=0
wme_ac_vo_aifs=2
wme_ac_vo_cwmin=2
wme_ac_vo_cwmax=3
wme_ac_vo_txop_limit=47
wme_ac_vo_acm=0

The WME settings were taken from the OpenWRT forum and indeed improved 
stability and throughput, although I can not currently quantify the 
improvement.

Unfortunately, I seem to have more questions than answers:

1. Could this be an instance of the issue with massive packet loss that has 
been documented previously with ath9k? Is this a known problem with AR9280? 
Are there any patches floating around that are not yet in compat-wireless and 
that I could try?

2. Is there anything to be done about the Broadcom client, and why is it much 
more unstable than the Atheros one?

3. Why does the ath9k driver in AP mode fail to work after a few hours and 
needs a restart?

4. How do I tell CRDA to load frequency definitions for my location (AT) 
instead of the default (US)? I might be blind, stupid, or both, but using the 
slightly conflicting documentation available on various Wikis, I was unable to 
change this. I have read that some chipsets are hard-wired for one location 
and can't be changed, but couldn't find out if mine is (it was bought in 
Europe, so shouldn't be locked to US in any case). An RTFM (with an up-to-date 
pointer, preferrably for Debian/Ubuntu) in this matter would be highly 
appreciated.

5. After having set the correct location, is hw_mode=a and channel=40 actually 
supposed to work? I have not, so far, managed to get this device into 802.11an 
mode (which might be down to locked frequencies).

Any hints, pointers, or - even better - patches are very welcome ;-)

best regards,
Rene

^ permalink raw reply

* Re: Problems with WPA in mainline 2.6.31-gitX
From: Christian Lamparter @ 2009-09-25 18:42 UTC (permalink / raw)
  To: Larry Finger; +Cc: Johannes Berg, John Linville, wireless
In-Reply-To: <4ABD0B0D.5020002@lwfinger.net>

On Friday 25 September 2009 20:25:17 Larry Finger wrote:
> Johannes and John,
> 
> I found that commit bbac31f4 "cfg80211: fix SME connect" breaks WPA2
> connections. I found the problem using bisection. I verified the
> bisection by reverting the patch above. I also found that commit
> 55a00b833 "cfg80211: don't overwrite privacy setting" from
> wireless-testing fixed the issue.
> 
> Is the latter patch on its way upstream? If so, I will not bother with
> posting a regression on LKML or a bugzilla report. If not, I will
> initiate the formalities to ensure that the second patch is included
> in mainline.
> 

it made it into 2.6.31-git16:
"cfg80211: don't overwrite privacy setting"
94f85853324e02c3a32bc3101f090dc9a3f512b4

but, "[PATCH] cfg80211: don't set privacy w/o key"
is still missing.

Regards,
	Chr

^ permalink raw reply

* Problems with WPA in mainline 2.6.31-gitX
From: Larry Finger @ 2009-09-25 18:25 UTC (permalink / raw)
  To: Johannes Berg, John Linville; +Cc: wireless

Johannes and John,

I found that commit bbac31f4 "cfg80211: fix SME connect" breaks WPA2
connections. I found the problem using bisection. I verified the
bisection by reverting the patch above. I also found that commit
55a00b833 "cfg80211: don't overwrite privacy setting" from
wireless-testing fixed the issue.

Is the latter patch on its way upstream? If so, I will not bother with
posting a regression on LKML or a bugzilla report. If not, I will
initiate the formalities to ensure that the second patch is included
in mainline.

Larry



^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox