iwlwifi: Adjust blink rate to compensate Clock difference
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 11 Sep 2009 17:38:14 +0000 (10:38 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:32 +0000 (16:39 -0400)
commitf2d0d0e2bab7a325071dbaba3bef51c90868e1e6
treea61e9e036b0172483105834d064aa7f1a1a252b9
parentc812ee24855e20f43cf211e51e3eb53fe6dc6f1d
iwlwifi: Adjust blink rate to compensate Clock difference

Adjust led blink rate to compensate on a MAC Clock difference on every
HW. Led blink rate analysis showed an average deviation of 0% on 3945,
5% on 4965 HW and 20% on 5000 series and up.
Need to compensate on the led on/off time per HW according to the
deviation to achieve the desired led frequency
The calculation is: (100-averageDeviation)/100 * blinkTime
For code efficiency the calculation will be:
    compensation = (100 - averageDeviation) * 64 / 100
    NewBlinkTime = (compensation * BlinkTime) / 64

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-1000.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-led.c