diff options
author | Kolekar, Abhijeet <abhijeet.kolekar@intel.com> | 2008-12-18 21:37:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:18 -0500 |
commit | df878d8f0156ec2b41da5ae9c70af4a27cb2eb0a (patch) | |
tree | 69b08115e2e0a930792153efacb7a6a8a1f1ea77 /drivers/net/wireless | |
parent | c2d79b488a33a77d337092c967ce50614edc5d25 (diff) |
iwl3945: use iwl_mod_params for 3945
Use iwl_mod_params for 3945.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 48 |
3 files changed, 24 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 422de88f128e..d5509d589382 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -599,7 +599,7 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
599 | /* Set the size of the skb to the size of the frame */ | 599 | /* Set the size of the skb to the size of the frame */ |
600 | skb_put(rxb->skb, le16_to_cpu(rx_hdr->len)); | 600 | skb_put(rxb->skb, le16_to_cpu(rx_hdr->len)); |
601 | 601 | ||
602 | if (iwl3945_param_hwcrypto) | 602 | if (iwl3945_mod_params.sw_crypto) |
603 | iwl3945_set_decrypted_flag(priv, rxb->skb, | 603 | iwl3945_set_decrypted_flag(priv, rxb->skb, |
604 | le32_to_cpu(rx_end->status), stats); | 604 | le32_to_cpu(rx_end->status), stats); |
605 | 605 | ||
@@ -2512,6 +2512,7 @@ static struct iwl_cfg iwl3945_bg_cfg = { | |||
2512 | .ucode_api_max = IWL3945_UCODE_API_MAX, | 2512 | .ucode_api_max = IWL3945_UCODE_API_MAX, |
2513 | .ucode_api_min = IWL3945_UCODE_API_MIN, | 2513 | .ucode_api_min = IWL3945_UCODE_API_MIN, |
2514 | .sku = IWL_SKU_G, | 2514 | .sku = IWL_SKU_G, |
2515 | .mod_params = &iwl3945_mod_params | ||
2515 | }; | 2516 | }; |
2516 | 2517 | ||
2517 | static struct iwl_cfg iwl3945_abg_cfg = { | 2518 | static struct iwl_cfg iwl3945_abg_cfg = { |
@@ -2520,6 +2521,7 @@ static struct iwl_cfg iwl3945_abg_cfg = { | |||
2520 | .ucode_api_max = IWL3945_UCODE_API_MAX, | 2521 | .ucode_api_max = IWL3945_UCODE_API_MAX, |
2521 | .ucode_api_min = IWL3945_UCODE_API_MIN, | 2522 | .ucode_api_min = IWL3945_UCODE_API_MIN, |
2522 | .sku = IWL_SKU_A|IWL_SKU_G, | 2523 | .sku = IWL_SKU_A|IWL_SKU_G, |
2524 | .mod_params = &iwl3945_mod_params | ||
2523 | }; | 2525 | }; |
2524 | 2526 | ||
2525 | struct pci_device_id iwl3945_hw_card_ids[] = { | 2527 | struct pci_device_id iwl3945_hw_card_ids[] = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 18424a308d12..9c520c455a4b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -75,8 +75,7 @@ extern struct pci_device_id iwl3945_hw_card_ids[]; | |||
75 | #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) | 75 | #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) |
76 | 76 | ||
77 | /* Module parameters accessible from iwl-*.c */ | 77 | /* Module parameters accessible from iwl-*.c */ |
78 | extern int iwl3945_param_hwcrypto; | 78 | extern struct iwl_mod_params iwl3945_mod_params; |
79 | extern int iwl3945_param_queues_num; | ||
80 | 79 | ||
81 | struct iwl3945_sta_priv { | 80 | struct iwl3945_sta_priv { |
82 | struct iwl3945_rs_sta *rs_sta; | 81 | struct iwl3945_rs_sta *rs_sta; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 0af710b8fb78..d057ab3022aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -58,20 +58,6 @@ | |||
58 | static int iwl3945_tx_queue_update_write_ptr(struct iwl_priv *priv, | 58 | static int iwl3945_tx_queue_update_write_ptr(struct iwl_priv *priv, |
59 | struct iwl3945_tx_queue *txq); | 59 | struct iwl3945_tx_queue *txq); |
60 | 60 | ||
61 | /****************************************************************************** | ||
62 | * | ||
63 | * module boiler plate | ||
64 | * | ||
65 | ******************************************************************************/ | ||
66 | |||
67 | /* module parameters */ | ||
68 | static int iwl3945_param_disable_hw_scan; /* def: 0 = use 3945's h/w scan */ | ||
69 | static u32 iwl3945_param_debug; /* def: 0 = minimal debug log messages */ | ||
70 | static int iwl3945_param_disable; /* def: 0 = enable radio */ | ||
71 | static int iwl3945_param_antenna; /* def: 0 = both antennas (use diversity) */ | ||
72 | int iwl3945_param_hwcrypto; /* def: 0 = use software encryption */ | ||
73 | int iwl3945_param_queues_num = IWL39_MAX_NUM_QUEUES; /* def: 8 Tx queues */ | ||
74 | |||
75 | /* | 61 | /* |
76 | * module name, copyright, version, etc. | 62 | * module name, copyright, version, etc. |
77 | */ | 63 | */ |
@@ -102,6 +88,12 @@ MODULE_VERSION(DRV_VERSION); | |||
102 | MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); | 88 | MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); |
103 | MODULE_LICENSE("GPL"); | 89 | MODULE_LICENSE("GPL"); |
104 | 90 | ||
91 | /* module parameters */ | ||
92 | struct iwl_mod_params iwl3945_mod_params = { | ||
93 | .num_of_queues = IWL39_MAX_NUM_QUEUES, | ||
94 | /* the rest are 0 by default */ | ||
95 | }; | ||
96 | |||
105 | static const struct ieee80211_supported_band *iwl3945_get_band( | 97 | static const struct ieee80211_supported_band *iwl3945_get_band( |
106 | struct iwl_priv *priv, enum ieee80211_band band) | 98 | struct iwl_priv *priv, enum ieee80211_band band) |
107 | { | 99 | { |
@@ -6532,7 +6524,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
6532 | goto out; | 6524 | goto out; |
6533 | } | 6525 | } |
6534 | 6526 | ||
6535 | if (unlikely(!iwl3945_param_disable_hw_scan && | 6527 | if (unlikely(!iwl3945_mod_params.disable_hw_scan && |
6536 | test_bit(STATUS_SCANNING, &priv->status))) { | 6528 | test_bit(STATUS_SCANNING, &priv->status))) { |
6537 | IWL_DEBUG_MAC80211("leave - scanning\n"); | 6529 | IWL_DEBUG_MAC80211("leave - scanning\n"); |
6538 | set_bit(STATUS_CONF_PENDING, &priv->status); | 6530 | set_bit(STATUS_CONF_PENDING, &priv->status); |
@@ -6944,7 +6936,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6944 | 6936 | ||
6945 | IWL_DEBUG_MAC80211("enter\n"); | 6937 | IWL_DEBUG_MAC80211("enter\n"); |
6946 | 6938 | ||
6947 | if (!iwl3945_param_hwcrypto) { | 6939 | if (iwl3945_mod_params.sw_crypto) { |
6948 | IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); | 6940 | IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); |
6949 | return -EOPNOTSUPP; | 6941 | return -EOPNOTSUPP; |
6950 | } | 6942 | } |
@@ -7747,8 +7739,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7747 | priv->pci_dev = pdev; | 7739 | priv->pci_dev = pdev; |
7748 | priv->cfg = cfg; | 7740 | priv->cfg = cfg; |
7749 | 7741 | ||
7750 | if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) || | 7742 | if ((iwl3945_mod_params.num_of_queues > IWL39_MAX_NUM_QUEUES) || |
7751 | (iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) { | 7743 | (iwl3945_mod_params.num_of_queues < IWL_MIN_NUM_QUEUES)) { |
7752 | IWL_ERR(priv, | 7744 | IWL_ERR(priv, |
7753 | "invalid queues_num, should be between %d and %d\n", | 7745 | "invalid queues_num, should be between %d and %d\n", |
7754 | IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES); | 7746 | IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES); |
@@ -7758,7 +7750,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7758 | 7750 | ||
7759 | /* Disabling hardware scan means that mac80211 will perform scans | 7751 | /* Disabling hardware scan means that mac80211 will perform scans |
7760 | * "the hard way", rather than using device's scan. */ | 7752 | * "the hard way", rather than using device's scan. */ |
7761 | if (iwl3945_param_disable_hw_scan) { | 7753 | if (iwl3945_mod_params.disable_hw_scan) { |
7762 | IWL_DEBUG_INFO("Disabling hw_scan\n"); | 7754 | IWL_DEBUG_INFO("Disabling hw_scan\n"); |
7763 | iwl3945_hw_ops.hw_scan = NULL; | 7755 | iwl3945_hw_ops.hw_scan = NULL; |
7764 | } | 7756 | } |
@@ -7768,9 +7760,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7768 | hw->sta_data_size = sizeof(struct iwl3945_sta_priv); | 7760 | hw->sta_data_size = sizeof(struct iwl3945_sta_priv); |
7769 | 7761 | ||
7770 | /* Select antenna (may be helpful if only one antenna is connected) */ | 7762 | /* Select antenna (may be helpful if only one antenna is connected) */ |
7771 | priv->antenna = (enum iwl3945_antenna)iwl3945_param_antenna; | 7763 | priv->antenna = (enum iwl3945_antenna)iwl3945_mod_params.antenna; |
7772 | #ifdef CONFIG_IWL3945_DEBUG | 7764 | #ifdef CONFIG_IWL3945_DEBUG |
7773 | priv->debug_level = iwl3945_param_debug; | 7765 | priv->debug_level = iwl3945_mod_params.debug; |
7774 | atomic_set(&priv->restrict_refcnt, 0); | 7766 | atomic_set(&priv->restrict_refcnt, 0); |
7775 | #endif | 7767 | #endif |
7776 | 7768 | ||
@@ -7918,7 +7910,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7918 | 7910 | ||
7919 | /* Initialize module parameter values here */ | 7911 | /* Initialize module parameter values here */ |
7920 | /* Disable radio (SW RF KILL) via parameter when loading driver */ | 7912 | /* Disable radio (SW RF KILL) via parameter when loading driver */ |
7921 | if (iwl3945_param_disable) { | 7913 | if (iwl3945_mod_params.disable) { |
7922 | set_bit(STATUS_RF_KILL_SW, &priv->status); | 7914 | set_bit(STATUS_RF_KILL_SW, &priv->status); |
7923 | IWL_DEBUG_INFO("Radio disabled.\n"); | 7915 | IWL_DEBUG_INFO("Radio disabled.\n"); |
7924 | } | 7916 | } |
@@ -8248,19 +8240,19 @@ static void __exit iwl3945_exit(void) | |||
8248 | 8240 | ||
8249 | MODULE_FIRMWARE(IWL3945_MODULE_FIRMWARE(IWL3945_UCODE_API_MAX)); | 8241 | MODULE_FIRMWARE(IWL3945_MODULE_FIRMWARE(IWL3945_UCODE_API_MAX)); |
8250 | 8242 | ||
8251 | module_param_named(antenna, iwl3945_param_antenna, int, 0444); | 8243 | module_param_named(antenna, iwl3945_mod_params.antenna, int, 0444); |
8252 | MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); | 8244 | MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); |
8253 | module_param_named(disable, iwl3945_param_disable, int, 0444); | 8245 | module_param_named(disable, iwl3945_mod_params.disable, int, 0444); |
8254 | MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); | 8246 | MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); |
8255 | module_param_named(hwcrypto, iwl3945_param_hwcrypto, int, 0444); | 8247 | module_param_named(hwcrypto, iwl3945_mod_params.sw_crypto, int, 0444); |
8256 | MODULE_PARM_DESC(hwcrypto, | 8248 | MODULE_PARM_DESC(hwcrypto, |
8257 | "using hardware crypto engine (default 0 [software])\n"); | 8249 | "using hardware crypto engine (default 0 [software])\n"); |
8258 | module_param_named(debug, iwl3945_param_debug, uint, 0444); | 8250 | module_param_named(debug, iwl3945_mod_params.debug, uint, 0444); |
8259 | MODULE_PARM_DESC(debug, "debug output mask"); | 8251 | MODULE_PARM_DESC(debug, "debug output mask"); |
8260 | module_param_named(disable_hw_scan, iwl3945_param_disable_hw_scan, int, 0444); | 8252 | module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, int, 0444); |
8261 | MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); | 8253 | MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); |
8262 | 8254 | ||
8263 | module_param_named(queues_num, iwl3945_param_queues_num, int, 0444); | 8255 | module_param_named(queues_num, iwl3945_mod_params.num_of_queues, int, 0444); |
8264 | MODULE_PARM_DESC(queues_num, "number of hw queues."); | 8256 | MODULE_PARM_DESC(queues_num, "number of hw queues."); |
8265 | 8257 | ||
8266 | module_exit(iwl3945_exit); | 8258 | module_exit(iwl3945_exit); |