Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fed9017e authored by Ron Rindjunsky's avatar Ron Rindjunsky Committed by John W. Linville
Browse files

iwlwifi: move HW device registration



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: default avatarRon Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 66c73db7
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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.
+15 −7
Original line number Diff line number Diff line
@@ -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 @@ static int __init iwl4965_init(void)
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();
}