aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAssaf Krauss <assaf.krauss@intel.com>2008-03-14 13:38:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:51 -0400
commit00acbc91354f7c548ce12a9ebb7fd25c4c3861ae (patch)
treea1ed43f204a1a3ab4a05187ffa36d8f720d0b190 /drivers/net
parent316c30d9dddc1bd5b586a6cf9808018746372cc9 (diff)
iwlwifi: Packing all 4965 parameters
This patch defines a package struct for iwlwifi parameters, and uses a single instance of this struct to group all iwl4965 module parameters together. Signed-off-by: Assaf Krauss <assaf.krauss@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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c45
4 files changed, 42 insertions, 33 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 3d30cba0ad45..2e54dae95751 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -320,7 +320,7 @@ static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl4965_rx_queue *rxq)
320 return rc; 320 return rc;
321 } 321 }
322 322
323 if (iwl4965_param_amsdu_size_8K) 323 if (iwl4965_mod_params.amsdu_size_8K)
324 rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K; 324 rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K;
325 else 325 else
326 rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K; 326 rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K;
@@ -1845,8 +1845,8 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv)
1845{ 1845{
1846 int ret = 0; 1846 int ret = 0;
1847 1847
1848 if ((iwl4965_param_queues_num > IWL_MAX_NUM_QUEUES) || 1848 if ((iwl4965_mod_params.num_of_queues > IWL_MAX_NUM_QUEUES) ||
1849 (iwl4965_param_queues_num < IWL_MIN_NUM_QUEUES)) { 1849 (iwl4965_mod_params.num_of_queues < IWL_MIN_NUM_QUEUES)) {
1850 IWL_ERROR("invalid queues_num, should be between %d and %d\n", 1850 IWL_ERROR("invalid queues_num, should be between %d and %d\n",
1851 IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES); 1851 IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES);
1852 ret = -EINVAL; 1852 ret = -EINVAL;
@@ -1866,11 +1866,11 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv)
1866 1866
1867 memset(priv->hw_setting.shared_virt, 0, sizeof(struct iwl4965_shared)); 1867 memset(priv->hw_setting.shared_virt, 0, sizeof(struct iwl4965_shared));
1868 1868
1869 priv->hw_setting.max_txq_num = iwl4965_param_queues_num; 1869 priv->hw_setting.max_txq_num = iwl4965_mod_params.num_of_queues;
1870 priv->hw_setting.tx_cmd_len = sizeof(struct iwl4965_tx_cmd); 1870 priv->hw_setting.tx_cmd_len = sizeof(struct iwl4965_tx_cmd);
1871 priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE; 1871 priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE;
1872 priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG; 1872 priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG;
1873 if (iwl4965_param_amsdu_size_8K) 1873 if (iwl4965_mod_params.amsdu_size_8K)
1874 priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_8K; 1874 priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_8K;
1875 else 1875 else
1876 priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_4K; 1876 priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_4K;
@@ -3421,7 +3421,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
3421 stats->flag = 0; 3421 stats->flag = 0;
3422 hdr = (struct ieee80211_hdr *)rxb->skb->data; 3422 hdr = (struct ieee80211_hdr *)rxb->skb->data;
3423 3423
3424 if (iwl4965_param_hwcrypto) 3424 if (iwl4965_mod_params.hw_crypto)
3425 iwl4965_set_decrypted_flag(priv, rxb->skb, ampdu_status, stats); 3425 iwl4965_set_decrypted_flag(priv, rxb->skb, ampdu_status, stats);
3426 3426
3427 if (priv->add_radiotap) 3427 if (priv->add_radiotap)
@@ -3561,7 +3561,7 @@ void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info,
3561 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20; 3561 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20;
3562 ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS & 3562 ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS &
3563 (IWL_MIMO_PS_NONE << 2)); 3563 (IWL_MIMO_PS_NONE << 2));
3564 if (iwl4965_param_amsdu_size_8K) { 3564 if (iwl4965_mod_params.amsdu_size_8K) {
3565 printk(KERN_DEBUG "iwl4965 in A-MSDU 8K support mode\n"); 3565 printk(KERN_DEBUG "iwl4965 in A-MSDU 8K support mode\n");
3566 ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU; 3566 ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU;
3567 } 3567 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h
index cec62ba803b5..1480e1b698a4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -67,9 +67,7 @@ extern struct pci_device_id iwl4965_hw_card_ids[];
67#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) 67#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
68 68
69/* Module parameters accessible from iwl-*.c */ 69/* Module parameters accessible from iwl-*.c */
70extern int iwl4965_param_hwcrypto; 70extern struct iwl_mod_params iwl4965_mod_params;
71extern int iwl4965_param_queues_num;
72extern int iwl4965_param_amsdu_size_8K;
73 71
74enum iwl4965_antenna { 72enum iwl4965_antenna {
75 IWL_ANTENNA_DIVERSITY, 73 IWL_ANTENNA_DIVERSITY,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 88fd49abdabd..fb4ce081807b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -84,11 +84,23 @@ struct iwl_ops {
84 const struct iwl_lib_ops *lib; 84 const struct iwl_lib_ops *lib;
85}; 85};
86 86
87struct iwl_mod_params {
88 int disable; /* def: 0 = enable radio */
89 int hw_crypto; /* def: 0 = using software encryption */
90 int debug; /* def: 0 = minimal debug log messages */
91 int disable_hw_scan; /* def: 0 = use h/w scan */
92 int num_of_queues; /* def: HW dependent */
93 int enable_qos; /* def: 1 = use quality of service */
94 int amsdu_size_8K; /* def: 1 = enable 8K amsdu size */
95 int antenna; /* def: 0 = both antennas (use diversity) */
96};
97
87struct iwl_cfg { 98struct iwl_cfg {
88 const char *name; 99 const char *name;
89 const char *fw_name; 100 const char *fw_name;
90 unsigned int sku; 101 unsigned int sku;
91 const struct iwl_ops *ops; 102 const struct iwl_ops *ops;
103 const struct iwl_mod_params *mod_params;
92}; 104};
93 105
94#endif /* __iwl_core_h__ */ 106#endif /* __iwl_core_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index a2ee34e40b20..465918cf77f1 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -60,14 +60,12 @@ static int iwl4965_tx_queue_update_write_ptr(struct iwl_priv *priv,
60 ******************************************************************************/ 60 ******************************************************************************/
61 61
62/* module parameters */ 62/* module parameters */
63static int iwl4965_param_disable_hw_scan; /* def: 0 = use 4965's h/w scan */ 63struct iwl_mod_params iwl4965_mod_params = {
64static int iwl4965_param_debug; /* def: 0 = minimal debug log messages */ 64 .num_of_queues = IWL_MAX_NUM_QUEUES,
65static int iwl4965_param_disable; /* def: enable radio */ 65 .enable_qos = 1,
66static int iwl4965_param_antenna; /* def: 0 = both antennas (use diversity) */ 66 .amsdu_size_8K = 1,
67int iwl4965_param_hwcrypto; /* def: using software encryption */ 67 /* the rest are 0 by default */
68static int iwl4965_param_qos_enable = 1; /* def: 1 = use quality of service */ 68};
69int iwl4965_param_queues_num = IWL_MAX_NUM_QUEUES; /* def: 16 Tx queues */
70int iwl4965_param_amsdu_size_8K; /* def: enable 8K amsdu size */
71 69
72/* 70/*
73 * module name, copyright, version, etc. 71 * module name, copyright, version, etc.
@@ -7186,7 +7184,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
7186 goto out; 7184 goto out;
7187 } 7185 }
7188 7186
7189 if (unlikely(!iwl4965_param_disable_hw_scan && 7187 if (unlikely(!iwl4965_mod_params.disable_hw_scan &&
7190 test_bit(STATUS_SCANNING, &priv->status))) { 7188 test_bit(STATUS_SCANNING, &priv->status))) {
7191 IWL_DEBUG_MAC80211("leave - scanning\n"); 7189 IWL_DEBUG_MAC80211("leave - scanning\n");
7192 set_bit(STATUS_CONF_PENDING, &priv->status); 7190 set_bit(STATUS_CONF_PENDING, &priv->status);
@@ -7571,7 +7569,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
7571 7569
7572 IWL_DEBUG_MAC80211("enter\n"); 7570 IWL_DEBUG_MAC80211("enter\n");
7573 7571
7574 if (!iwl4965_param_hwcrypto) { 7572 if (!iwl4965_mod_params.hw_crypto) {
7575 IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); 7573 IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n");
7576 return -EOPNOTSUPP; 7574 return -EOPNOTSUPP;
7577 } 7575 }
@@ -8528,7 +8526,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
8528 8526
8529 /* Disabling hardware scan means that mac80211 will perform scans 8527 /* Disabling hardware scan means that mac80211 will perform scans
8530 * "the hard way", rather than using device's scan. */ 8528 * "the hard way", rather than using device's scan. */
8531 if (iwl4965_param_disable_hw_scan) { 8529 if (iwl4965_mod_params.disable_hw_scan) {
8532 IWL_DEBUG_INFO("Disabling hw_scan\n"); 8530 IWL_DEBUG_INFO("Disabling hw_scan\n");
8533 iwl4965_hw_ops.hw_scan = NULL; 8531 iwl4965_hw_ops.hw_scan = NULL;
8534 } 8532 }
@@ -8551,7 +8549,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
8551 priv->pci_dev = pdev; 8549 priv->pci_dev = pdev;
8552 8550
8553#ifdef CONFIG_IWLWIFI_DEBUG 8551#ifdef CONFIG_IWLWIFI_DEBUG
8554 iwl_debug_level = iwl4965_param_debug; 8552 iwl_debug_level = iwl4965_mod_params.debug;
8555 atomic_set(&priv->restrict_refcnt, 0); 8553 atomic_set(&priv->restrict_refcnt, 0);
8556#endif 8554#endif
8557 8555
@@ -8659,7 +8657,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
8659#endif /* CONFIG_IWL4965_HT */ 8657#endif /* CONFIG_IWL4965_HT */
8660 8658
8661 hw->rate_control_algorithm = "iwl-4965-rs"; 8659 hw->rate_control_algorithm = "iwl-4965-rs";
8662 priv->antenna = (enum iwl4965_antenna)iwl4965_param_antenna; 8660 priv->antenna = (enum iwl4965_antenna)iwl4965_mod_params.antenna;
8663 priv->retry_rate = 1; 8661 priv->retry_rate = 1;
8664 priv->ibss_beacon = NULL; 8662 priv->ibss_beacon = NULL;
8665 8663
@@ -8732,12 +8730,12 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
8732 **********************************/ 8730 **********************************/
8733 8731
8734 /* Disable radio (SW RF KILL) via parameter when loading driver */ 8732 /* Disable radio (SW RF KILL) via parameter when loading driver */
8735 if (iwl4965_param_disable) { 8733 if (iwl4965_mod_params.disable) {
8736 set_bit(STATUS_RF_KILL_SW, &priv->status); 8734 set_bit(STATUS_RF_KILL_SW, &priv->status);
8737 IWL_DEBUG_INFO("Radio disabled.\n"); 8735 IWL_DEBUG_INFO("Radio disabled.\n");
8738 } 8736 }
8739 8737
8740 if (iwl4965_param_qos_enable) 8738 if (iwl4965_mod_params.enable_qos)
8741 priv->qos_data.qos_enable = 1; 8739 priv->qos_data.qos_enable = 1;
8742 8740
8743 /******************** 8741 /********************
@@ -8932,25 +8930,26 @@ static void __exit iwl4965_exit(void)
8932 pci_unregister_driver(&iwl4965_driver); 8930 pci_unregister_driver(&iwl4965_driver);
8933} 8931}
8934 8932
8935module_param_named(antenna, iwl4965_param_antenna, int, 0444); 8933module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444);
8936MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); 8934MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
8937module_param_named(disable, iwl4965_param_disable, int, 0444); 8935module_param_named(disable, iwl4965_mod_params.disable, int, 0444);
8938MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); 8936MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
8939module_param_named(hwcrypto, iwl4965_param_hwcrypto, int, 0444); 8937module_param_named(hwcrypto, iwl4965_mod_params.hw_crypto, int, 0444);
8940MODULE_PARM_DESC(hwcrypto, 8938MODULE_PARM_DESC(hwcrypto,
8941 "using hardware crypto engine (default 0 [software])\n"); 8939 "using hardware crypto engine (default 0 [software])\n");
8942module_param_named(debug, iwl4965_param_debug, int, 0444); 8940module_param_named(debug, iwl4965_mod_params.debug, int, 0444);
8943MODULE_PARM_DESC(debug, "debug output mask"); 8941MODULE_PARM_DESC(debug, "debug output mask");
8944module_param_named(disable_hw_scan, iwl4965_param_disable_hw_scan, int, 0444); 8942module_param_named(
8943 disable_hw_scan, iwl4965_mod_params.disable_hw_scan, int, 0444);
8945MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); 8944MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
8946 8945
8947module_param_named(queues_num, iwl4965_param_queues_num, int, 0444); 8946module_param_named(queues_num, iwl4965_mod_params.num_of_queues, int, 0444);
8948MODULE_PARM_DESC(queues_num, "number of hw queues."); 8947MODULE_PARM_DESC(queues_num, "number of hw queues.");
8949 8948
8950/* QoS */ 8949/* QoS */
8951module_param_named(qos_enable, iwl4965_param_qos_enable, int, 0444); 8950module_param_named(qos_enable, iwl4965_mod_params.enable_qos, int, 0444);
8952MODULE_PARM_DESC(qos_enable, "enable all QoS functionality"); 8951MODULE_PARM_DESC(qos_enable, "enable all QoS functionality");
8953module_param_named(amsdu_size_8K, iwl4965_param_amsdu_size_8K, int, 0444); 8952module_param_named(amsdu_size_8K, iwl4965_mod_params.amsdu_size_8K, int, 0444);
8954MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size"); 8953MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size");
8955 8954
8956module_exit(iwl4965_exit); 8955module_exit(iwl4965_exit);