aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2008-01-14 20:46:18 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:57 -0500
commit5a66926aa9230810704fd5a127966215fd58881e (patch)
tree347aa0458a71130357afcd89bb17a264cf728302 /drivers/net/wireless/iwlwifi/iwl-3945.c
parent3058f02137359efb412975cf94a9fa7c25413387 (diff)
iwlwifi: delay firmware loading from pci_probe to network interface open
This patch moves the firmware loading (read firmware from disk and load it into the device SRAM) from pci_probe time to the first network interface open time. There are two reasons for doing this: 1. To support kernel buildin iwlwifi drivers. Because kernel initializes network devices subsystem before hard disk and SATA subsystem, it is impossible to get the firmware image from hard disk in the PCI probe handler. Thus delaying the firmware loading into the network interface open time is the way to go. Note, we only read the firmware image from hard disk the first time the interface is open. After this is succeeded, we cache the firmware image into the host memory. This is a performance gain when user open and close the interface multiple times and is necessary for device suspend and resume. 2. For better power saving. When the iwlwifi modules are loaded (or buildin the kernel) but the wireless network interface is not being used, it is a good practice the wireless device consumes as less power as possible. Unloading the firmware from the wireless device and unregister the driver's interrupt handler in the network interface close handler provides users a way to achieve this. User space network configuration tools (i.e NetworkManager) can also contribute here when it detects a wired cable is connected and close the wireless interface automatically. This patch also includes the pci_save/restore_state() fixed by Ian Schram upon the first version. Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Ian Schram <ischram@telenet.be> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 77e7202c026b..0779a23729e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -1004,14 +1004,6 @@ int iwl3945_hw_nic_init(struct iwl3945_priv *priv)
1004 CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM); 1004 CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM);
1005 } 1005 }
1006 1006
1007 spin_unlock_irqrestore(&priv->lock, flags);
1008
1009 /* Initialize the EEPROM */
1010 rc = iwl3945_eeprom_init(priv);
1011 if (rc)
1012 return rc;
1013
1014 spin_lock_irqsave(&priv->lock, flags);
1015 if (EEPROM_SKU_CAP_OP_MODE_MRC == priv->eeprom.sku_cap) { 1007 if (EEPROM_SKU_CAP_OP_MODE_MRC == priv->eeprom.sku_cap) {
1016 IWL_DEBUG_INFO("SKU OP mode is mrc\n"); 1008 IWL_DEBUG_INFO("SKU OP mode is mrc\n");
1017 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1009 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,