]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
iwlwifi: move HW device registration
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Tue, 15 Apr 2008 23:01:41 +0000 (16:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 Apr 2008 20:00:00 +0000 (16:00 -0400)
This patch moves the HW device registration from the iwl-4965.c file, which
implies a HW specific support, to a more general location.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-4965.h
drivers/net/wireless/iwlwifi/iwl4965-base.c

index 8c8d7cffccfb391017a569a9e692dbf17ce4e839..4a40109d4aa07279e345ef951858d46a3a52eca7 100644 (file)
@@ -4930,7 +4930,7 @@ static struct iwl_ops iwl4965_ops = {
        .utils = &iwl4965_hcmd_utils,
 };
 
-static struct iwl_cfg iwl4965_agn_cfg = {
+struct iwl_cfg iwl4965_agn_cfg = {
        .name = "4965AGN",
        .fw_name = "iwlwifi-4965" IWL4965_UCODE_API ".ucode",
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
@@ -4938,14 +4938,6 @@ static struct iwl_cfg iwl4965_agn_cfg = {
        .mod_params = &iwl4965_mod_params,
 };
 
-struct pci_device_id iwl4965_hw_card_ids[] = {
-       {IWL_PCI_DEVICE(0x4229, PCI_ANY_ID, iwl4965_agn_cfg)},
-       {IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
-       {0}
-};
-
-MODULE_DEVICE_TABLE(pci, iwl4965_hw_card_ids);
-
 module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444);
 MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
 module_param_named(disable, iwl4965_mod_params.disable, int, 0444);
index cf909e86ed29894b3b9e6975df2c79357b5be457..ddcbad59092b0d38bc377e90b67676e607604f0f 100644 (file)
@@ -36,9 +36,6 @@
 #include <linux/kernel.h>
 #include <net/ieee80211_radiotap.h>
 
-/* Hardware specific file defines the PCI IDs table for that hardware module */
-extern struct pci_device_id iwl4965_hw_card_ids[];
-
 #define DRV_NAME        "iwl4965"
 #include "iwl-rfkill.h"
 #include "iwl-eeprom.h"
@@ -48,6 +45,9 @@ extern struct pci_device_id iwl4965_hw_card_ids[];
 #include "iwl-debug.h"
 #include "iwl-led.h"
 
+/* configuration for the iwl4965 */
+extern struct iwl_cfg iwl4965_agn_cfg;
+
 /* Change firmware file name, using "-" and incrementing number,
  *   *only* when uCode interface or architecture changes so that it
  *   is not compatible with earlier drivers.
index c71910df62aaeaab31d87b292593c7feefbe458a..249af4156c1321a3de51715dcdcfaa4e22d438b6 100644 (file)
@@ -8020,9 +8020,17 @@ static int iwl4965_pci_resume(struct pci_dev *pdev)
  *
  *****************************************************************************/
 
-static struct pci_driver iwl4965_driver = {
+/* Hardware specific file defines the PCI IDs table for that hardware module */
+static struct pci_device_id iwl_hw_card_ids[] = {
+       {IWL_PCI_DEVICE(0x4229, PCI_ANY_ID, iwl4965_agn_cfg)},
+       {IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
+       {0}
+};
+MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
+
+static struct pci_driver iwl_driver = {
        .name = DRV_NAME,
-       .id_table = iwl4965_hw_card_ids,
+       .id_table = iwl_hw_card_ids,
        .probe = iwl4965_pci_probe,
        .remove = __devexit_p(iwl4965_pci_remove),
 #ifdef CONFIG_PM
@@ -8044,13 +8052,13 @@ static int __init iwl4965_init(void)
                return ret;
        }
 
-       ret = pci_register_driver(&iwl4965_driver);
+       ret = pci_register_driver(&iwl_driver);
        if (ret) {
                IWL_ERROR("Unable to initialize PCI module\n");
                goto error_register;
        }
 #ifdef CONFIG_IWLWIFI_DEBUG
-       ret = driver_create_file(&iwl4965_driver.driver, &driver_attr_debug_level);
+       ret = driver_create_file(&iwl_driver.driver, &driver_attr_debug_level);
        if (ret) {
                IWL_ERROR("Unable to create driver sysfs file\n");
                goto error_debug;
@@ -8061,7 +8069,7 @@ static int __init iwl4965_init(void)
 
 #ifdef CONFIG_IWLWIFI_DEBUG
 error_debug:
-       pci_unregister_driver(&iwl4965_driver);
+       pci_unregister_driver(&iwl_driver);
 #endif
 error_register:
        iwl4965_rate_control_unregister();
@@ -8071,9 +8079,9 @@ error_register:
 static void __exit iwl4965_exit(void)
 {
 #ifdef CONFIG_IWLWIFI_DEBUG
-       driver_remove_file(&iwl4965_driver.driver, &driver_attr_debug_level);
+       driver_remove_file(&iwl_driver.driver, &driver_attr_debug_level);
 #endif
-       pci_unregister_driver(&iwl4965_driver);
+       pci_unregister_driver(&iwl_driver);
        iwl4965_rate_control_unregister();
 }