From 065e63b00cf13919010bbeff48f7a120033be448 Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Fri, 23 Oct 2009 13:42:20 -0700 Subject: [PATCH] iwlwifi: fix gain computation for 5000 series and up 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 Signed-off-by: Reinette Chatre Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 17555c7c1d67..afa88a304158 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c @@ -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] = -- 2.34.1