diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2008-12-18 21:37:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:56 -0500 |
commit | a3139c5956702c9ff957ac9fe2d902de355b063e (patch) | |
tree | 50df5afc7b5867b13421c6be19ff1e020c18c745 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 40b8ec0bfa2d96c9feae2bc1596e9b427c77b8da (diff) |
iwl3945: Remove DRV_NAME dependenies
As DRV_NAME is defined in 2 different header files, including both is not
possible.
This patch defines this constant from iwl3945-base.c and iwl-agn.c. It also
redefines the IWL_ERROR and IWL_WARNING macros to use dev_printk, as the
IWL_DEBUG_* macros do.
Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@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 | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index c706ccff159b..c2e0152108d3 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -46,6 +46,8 @@ | |||
46 | 46 | ||
47 | #include <asm/div64.h> | 47 | #include <asm/div64.h> |
48 | 48 | ||
49 | #define DRV_NAME "iwl3945" | ||
50 | |||
49 | #include "iwl-3945-core.h" | 51 | #include "iwl-3945-core.h" |
50 | #include "iwl-commands.h" | 52 | #include "iwl-commands.h" |
51 | #include "iwl-3945.h" | 53 | #include "iwl-3945.h" |
@@ -71,7 +73,6 @@ int iwl3945_param_queues_num = IWL39_MAX_NUM_QUEUES; /* def: 8 Tx queues */ | |||
71 | 73 | ||
72 | /* | 74 | /* |
73 | * module name, copyright, version, etc. | 75 | * module name, copyright, version, etc. |
74 | * NOTE: DRV_NAME is defined in iwlwifi.h for use by iwl-debug.h and printk | ||
75 | */ | 76 | */ |
76 | 77 | ||
77 | #define DRV_DESCRIPTION \ | 78 | #define DRV_DESCRIPTION \ |
@@ -847,10 +848,11 @@ static int iwl3945_set_rxon_channel(struct iwl3945_priv *priv, | |||
847 | * be #ifdef'd out once the driver is stable and folks aren't actively | 848 | * be #ifdef'd out once the driver is stable and folks aren't actively |
848 | * making changes | 849 | * making changes |
849 | */ | 850 | */ |
850 | static int iwl3945_check_rxon_cmd(struct iwl3945_rxon_cmd *rxon) | 851 | static int iwl3945_check_rxon_cmd(struct iwl3945_priv *priv) |
851 | { | 852 | { |
852 | int error = 0; | 853 | int error = 0; |
853 | int counter = 1; | 854 | int counter = 1; |
855 | struct iwl3945_rxon_cmd *rxon = &priv->staging_rxon; | ||
854 | 856 | ||
855 | if (rxon->flags & RXON_FLG_BAND_24G_MSK) { | 857 | if (rxon->flags & RXON_FLG_BAND_24G_MSK) { |
856 | error |= le32_to_cpu(rxon->flags & | 858 | error |= le32_to_cpu(rxon->flags & |
@@ -1031,7 +1033,7 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv) | |||
1031 | ~(RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_SEL_MSK); | 1033 | ~(RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_SEL_MSK); |
1032 | priv->staging_rxon.flags |= iwl3945_get_antenna_flags(priv); | 1034 | priv->staging_rxon.flags |= iwl3945_get_antenna_flags(priv); |
1033 | 1035 | ||
1034 | rc = iwl3945_check_rxon_cmd(&priv->staging_rxon); | 1036 | rc = iwl3945_check_rxon_cmd(priv); |
1035 | if (rc) { | 1037 | if (rc) { |
1036 | IWL_ERROR("Invalid RXON configuration. Not committing.\n"); | 1038 | IWL_ERROR("Invalid RXON configuration. Not committing.\n"); |
1037 | return -EINVAL; | 1039 | return -EINVAL; |
@@ -7803,19 +7805,11 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7803 | * 1. Allocating HW data | 7805 | * 1. Allocating HW data |
7804 | * ********************/ | 7806 | * ********************/ |
7805 | 7807 | ||
7806 | if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) || | ||
7807 | (iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) { | ||
7808 | IWL_ERROR("invalid queues_num, should be between %d and %d\n", | ||
7809 | IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES); | ||
7810 | err = -EINVAL; | ||
7811 | goto out; | ||
7812 | } | ||
7813 | |||
7814 | /* mac80211 allocates memory for this device instance, including | 7808 | /* mac80211 allocates memory for this device instance, including |
7815 | * space for this driver's private structure */ | 7809 | * space for this driver's private structure */ |
7816 | hw = ieee80211_alloc_hw(sizeof(struct iwl3945_priv), &iwl3945_hw_ops); | 7810 | hw = ieee80211_alloc_hw(sizeof(struct iwl3945_priv), &iwl3945_hw_ops); |
7817 | if (hw == NULL) { | 7811 | if (hw == NULL) { |
7818 | IWL_ERROR("Can not allocate network device\n"); | 7812 | printk(KERN_ERR DRV_NAME "Can not allocate network device\n"); |
7819 | err = -ENOMEM; | 7813 | err = -ENOMEM; |
7820 | goto out; | 7814 | goto out; |
7821 | } | 7815 | } |
@@ -7827,6 +7821,14 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7827 | priv->pci_dev = pdev; | 7821 | priv->pci_dev = pdev; |
7828 | priv->cfg = cfg; | 7822 | priv->cfg = cfg; |
7829 | 7823 | ||
7824 | if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) || | ||
7825 | (iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) { | ||
7826 | IWL_ERROR("invalid queues_num, should be between %d and %d\n", | ||
7827 | IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES); | ||
7828 | err = -EINVAL; | ||
7829 | goto out; | ||
7830 | } | ||
7831 | |||
7830 | /* Disabling hardware scan means that mac80211 will perform scans | 7832 | /* Disabling hardware scan means that mac80211 will perform scans |
7831 | * "the hard way", rather than using device's scan. */ | 7833 | * "the hard way", rather than using device's scan. */ |
7832 | if (iwl3945_param_disable_hw_scan) { | 7834 | if (iwl3945_param_disable_hw_scan) { |
@@ -8293,13 +8295,14 @@ static int __init iwl3945_init(void) | |||
8293 | 8295 | ||
8294 | ret = iwl3945_rate_control_register(); | 8296 | ret = iwl3945_rate_control_register(); |
8295 | if (ret) { | 8297 | if (ret) { |
8296 | IWL_ERROR("Unable to register rate control algorithm: %d\n", ret); | 8298 | printk(KERN_ERR DRV_NAME |
8299 | "Unable to register rate control algorithm: %d\n", ret); | ||
8297 | return ret; | 8300 | return ret; |
8298 | } | 8301 | } |
8299 | 8302 | ||
8300 | ret = pci_register_driver(&iwl3945_driver); | 8303 | ret = pci_register_driver(&iwl3945_driver); |
8301 | if (ret) { | 8304 | if (ret) { |
8302 | IWL_ERROR("Unable to initialize PCI module\n"); | 8305 | printk(KERN_ERR DRV_NAME "Unable to initialize PCI module\n"); |
8303 | goto error_register; | 8306 | goto error_register; |
8304 | } | 8307 | } |
8305 | 8308 | ||