iwlwifi: fix gain computation for 5000 series and up
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 23 Oct 2009 20:42:20 +0000 (13:42 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:49:58 +0000 (16:49 -0400)
In Rx gain balancing (chain noise) computation for 5000 series and up,
the delta gain calculation should use the average noise of default
chain, not "chain 0" which do not exist for all the devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-5000.c

index 17555c7c1d6797e7c5034bc1948f6cc7b9af1e69..afa88a304158fa9a5b24724700117ed97d0afbb5 100644 (file)
@@ -236,7 +236,7 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
                        data->delta_gain_code[i] = 0;
                        continue;
                }
-               delta_g = (1000 * ((s32)average_noise[0] -
+               delta_g = (1000 * ((s32)average_noise[default_chain] -
                        (s32)average_noise[i])) / 1500;
                /* bound gain by 2 bits value max, 3rd bit is sign */
                data->delta_gain_code[i] =