diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2008-03-28 19:21:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-01 17:13:19 -0400 |
commit | 897e1cf29e05e3373bf380a417d085cd3389a3c0 (patch) | |
tree | 8e60c677284c649ebcfaabf727da1ec607adba7c /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 0359facc7b7a37fd1223ac60649c80cd8daeaf73 (diff) |
iwlwifi: move rate registration to module load
Having rate registration during module load enables the use of
error checking as well as reliable registration/unregistration
pairing. Previously this was not possible as rate registration
was done during _probe where _probe could be run for more than
one device on the system.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 2a5245b63e32..8c2036850c89 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -8156,7 +8156,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
8156 | goto out_free_channel_map; | 8156 | goto out_free_channel_map; |
8157 | } | 8157 | } |
8158 | 8158 | ||
8159 | iwl3945_rate_control_register(priv->hw); | ||
8160 | err = ieee80211_register_hw(priv->hw); | 8159 | err = ieee80211_register_hw(priv->hw); |
8161 | if (err) { | 8160 | if (err) { |
8162 | IWL_ERROR("Failed to register network device (error %d)\n", err); | 8161 | IWL_ERROR("Failed to register network device (error %d)\n", err); |
@@ -8241,7 +8240,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) | |||
8241 | 8240 | ||
8242 | if (priv->mac80211_registered) { | 8241 | if (priv->mac80211_registered) { |
8243 | ieee80211_unregister_hw(priv->hw); | 8242 | ieee80211_unregister_hw(priv->hw); |
8244 | iwl3945_rate_control_unregister(priv->hw); | ||
8245 | } | 8243 | } |
8246 | 8244 | ||
8247 | /*netif_stop_queue(dev); */ | 8245 | /*netif_stop_queue(dev); */ |
@@ -8322,21 +8320,35 @@ static int __init iwl3945_init(void) | |||
8322 | int ret; | 8320 | int ret; |
8323 | printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); | 8321 | printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); |
8324 | printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); | 8322 | printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); |
8323 | |||
8324 | ret = iwl3945_rate_control_register(); | ||
8325 | if (ret) { | ||
8326 | IWL_ERROR("Unable to register rate control algorithm: %d\n", ret); | ||
8327 | return ret; | ||
8328 | } | ||
8329 | |||
8325 | ret = pci_register_driver(&iwl3945_driver); | 8330 | ret = pci_register_driver(&iwl3945_driver); |
8326 | if (ret) { | 8331 | if (ret) { |
8327 | IWL_ERROR("Unable to initialize PCI module\n"); | 8332 | IWL_ERROR("Unable to initialize PCI module\n"); |
8328 | return ret; | 8333 | goto error_register; |
8329 | } | 8334 | } |
8330 | #ifdef CONFIG_IWL3945_DEBUG | 8335 | #ifdef CONFIG_IWL3945_DEBUG |
8331 | ret = driver_create_file(&iwl3945_driver.driver, &driver_attr_debug_level); | 8336 | ret = driver_create_file(&iwl3945_driver.driver, &driver_attr_debug_level); |
8332 | if (ret) { | 8337 | if (ret) { |
8333 | IWL_ERROR("Unable to create driver sysfs file\n"); | 8338 | IWL_ERROR("Unable to create driver sysfs file\n"); |
8334 | pci_unregister_driver(&iwl3945_driver); | 8339 | goto error_debug; |
8335 | return ret; | ||
8336 | } | 8340 | } |
8337 | #endif | 8341 | #endif |
8338 | 8342 | ||
8339 | return ret; | 8343 | return ret; |
8344 | |||
8345 | #ifdef CONFIG_IWL3945_DEBUG | ||
8346 | error_debug: | ||
8347 | pci_unregister_driver(&iwl3945_driver); | ||
8348 | #endif | ||
8349 | error_register: | ||
8350 | iwl3945_rate_control_unregister(); | ||
8351 | return ret; | ||
8340 | } | 8352 | } |
8341 | 8353 | ||
8342 | static void __exit iwl3945_exit(void) | 8354 | static void __exit iwl3945_exit(void) |
@@ -8345,6 +8357,7 @@ static void __exit iwl3945_exit(void) | |||
8345 | driver_remove_file(&iwl3945_driver.driver, &driver_attr_debug_level); | 8357 | driver_remove_file(&iwl3945_driver.driver, &driver_attr_debug_level); |
8346 | #endif | 8358 | #endif |
8347 | pci_unregister_driver(&iwl3945_driver); | 8359 | pci_unregister_driver(&iwl3945_driver); |
8360 | iwl3945_rate_control_unregister(); | ||
8348 | } | 8361 | } |
8349 | 8362 | ||
8350 | module_param_named(antenna, iwl3945_param_antenna, int, 0444); | 8363 | module_param_named(antenna, iwl3945_param_antenna, int, 0444); |