Commit 00acbc91 authored by Assaf Krauss's avatar Assaf Krauss Committed by John W. Linville

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: default avatarAssaf Krauss <assaf.krauss@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 316c30d9
...@@ -320,7 +320,7 @@ static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl4965_rx_queue *rxq) ...@@ -320,7 +320,7 @@ static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl4965_rx_queue *rxq)
return rc; return rc;
} }
if (iwl4965_param_amsdu_size_8K) if (iwl4965_mod_params.amsdu_size_8K)
rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K; rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K;
else else
rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K; 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,8 +1845,8 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv)
{ {
int ret = 0; int ret = 0;
if ((iwl4965_param_queues_num > IWL_MAX_NUM_QUEUES) || if ((iwl4965_mod_params.num_of_queues > IWL_MAX_NUM_QUEUES) ||
(iwl4965_param_queues_num < IWL_MIN_NUM_QUEUES)) { (iwl4965_mod_params.num_of_queues < IWL_MIN_NUM_QUEUES)) {
IWL_ERROR("invalid queues_num, should be between %d and %d\n", IWL_ERROR("invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES); IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES);
ret = -EINVAL; ret = -EINVAL;
...@@ -1866,11 +1866,11 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv) ...@@ -1866,11 +1866,11 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv)
memset(priv->hw_setting.shared_virt, 0, sizeof(struct iwl4965_shared)); memset(priv->hw_setting.shared_virt, 0, sizeof(struct iwl4965_shared));
priv->hw_setting.max_txq_num = iwl4965_param_queues_num; priv->hw_setting.max_txq_num = iwl4965_mod_params.num_of_queues;
priv->hw_setting.tx_cmd_len = sizeof(struct iwl4965_tx_cmd); priv->hw_setting.tx_cmd_len = sizeof(struct iwl4965_tx_cmd);
priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE; priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE;
priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG; priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG;
if (iwl4965_param_amsdu_size_8K) if (iwl4965_mod_params.amsdu_size_8K)
priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_8K; priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_8K;
else else
priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_4K; 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,7 +3421,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
stats->flag = 0; stats->flag = 0;
hdr = (struct ieee80211_hdr *)rxb->skb->data; hdr = (struct ieee80211_hdr *)rxb->skb->data;
if (iwl4965_param_hwcrypto) if (iwl4965_mod_params.hw_crypto)
iwl4965_set_decrypted_flag(priv, rxb->skb, ampdu_status, stats); iwl4965_set_decrypted_flag(priv, rxb->skb, ampdu_status, stats);
if (priv->add_radiotap) if (priv->add_radiotap)
...@@ -3561,7 +3561,7 @@ void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, ...@@ -3561,7 +3561,7 @@ void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info,
ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20; ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20;
ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS & ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS &
(IWL_MIMO_PS_NONE << 2)); (IWL_MIMO_PS_NONE << 2));
if (iwl4965_param_amsdu_size_8K) { if (iwl4965_mod_params.amsdu_size_8K) {
printk(KERN_DEBUG "iwl4965 in A-MSDU 8K support mode\n"); printk(KERN_DEBUG "iwl4965 in A-MSDU 8K support mode\n");
ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU; ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU;
} }
......
...@@ -67,9 +67,7 @@ extern struct pci_device_id iwl4965_hw_card_ids[]; ...@@ -67,9 +67,7 @@ extern struct pci_device_id iwl4965_hw_card_ids[];
#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
/* Module parameters accessible from iwl-*.c */ /* Module parameters accessible from iwl-*.c */
extern int iwl4965_param_hwcrypto; extern struct iwl_mod_params iwl4965_mod_params;
extern int iwl4965_param_queues_num;
extern int iwl4965_param_amsdu_size_8K;
enum iwl4965_antenna { enum iwl4965_antenna {
IWL_ANTENNA_DIVERSITY, IWL_ANTENNA_DIVERSITY,
......
...@@ -84,11 +84,23 @@ struct iwl_ops { ...@@ -84,11 +84,23 @@ struct iwl_ops {
const struct iwl_lib_ops *lib; const struct iwl_lib_ops *lib;
}; };
struct iwl_mod_params {
int disable; /* def: 0 = enable radio */
int hw_crypto; /* def: 0 = using software encryption */
int debug; /* def: 0 = minimal debug log messages */
int disable_hw_scan; /* def: 0 = use h/w scan */
int num_of_queues; /* def: HW dependent */
int enable_qos; /* def: 1 = use quality of service */
int amsdu_size_8K; /* def: 1 = enable 8K amsdu size */
int antenna; /* def: 0 = both antennas (use diversity) */
};
struct iwl_cfg { struct iwl_cfg {
const char *name; const char *name;
const char *fw_name; const char *fw_name;
unsigned int sku; unsigned int sku;
const struct iwl_ops *ops; const struct iwl_ops *ops;
const struct iwl_mod_params *mod_params;
}; };
#endif /* __iwl_core_h__ */ #endif /* __iwl_core_h__ */
...@@ -60,14 +60,12 @@ static int iwl4965_tx_queue_update_write_ptr(struct iwl_priv *priv, ...@@ -60,14 +60,12 @@ static int iwl4965_tx_queue_update_write_ptr(struct iwl_priv *priv,
******************************************************************************/ ******************************************************************************/
/* module parameters */ /* module parameters */
static int iwl4965_param_disable_hw_scan; /* def: 0 = use 4965's h/w scan */ struct iwl_mod_params iwl4965_mod_params = {
static int iwl4965_param_debug; /* def: 0 = minimal debug log messages */ .num_of_queues = IWL_MAX_NUM_QUEUES,
static int iwl4965_param_disable; /* def: enable radio */ .enable_qos = 1,
static int iwl4965_param_antenna; /* def: 0 = both antennas (use diversity) */ .amsdu_size_8K = 1,
int iwl4965_param_hwcrypto; /* def: using software encryption */ /* the rest are 0 by default */
static int iwl4965_param_qos_enable = 1; /* def: 1 = use quality of service */ };
int iwl4965_param_queues_num = IWL_MAX_NUM_QUEUES; /* def: 16 Tx queues */
int iwl4965_param_amsdu_size_8K; /* def: enable 8K amsdu size */
/* /*
* module name, copyright, version, etc. * module name, copyright, version, etc.
...@@ -7186,7 +7184,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co ...@@ -7186,7 +7184,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
goto out; goto out;
} }
if (unlikely(!iwl4965_param_disable_hw_scan && if (unlikely(!iwl4965_mod_params.disable_hw_scan &&
test_bit(STATUS_SCANNING, &priv->status))) { test_bit(STATUS_SCANNING, &priv->status))) {
IWL_DEBUG_MAC80211("leave - scanning\n"); IWL_DEBUG_MAC80211("leave - scanning\n");
set_bit(STATUS_CONF_PENDING, &priv->status); 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,7 +7569,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
IWL_DEBUG_MAC80211("enter\n"); IWL_DEBUG_MAC80211("enter\n");
if (!iwl4965_param_hwcrypto) { if (!iwl4965_mod_params.hw_crypto) {
IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -8528,7 +8526,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e ...@@ -8528,7 +8526,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
/* Disabling hardware scan means that mac80211 will perform scans /* Disabling hardware scan means that mac80211 will perform scans
* "the hard way", rather than using device's scan. */ * "the hard way", rather than using device's scan. */
if (iwl4965_param_disable_hw_scan) { if (iwl4965_mod_params.disable_hw_scan) {
IWL_DEBUG_INFO("Disabling hw_scan\n"); IWL_DEBUG_INFO("Disabling hw_scan\n");
iwl4965_hw_ops.hw_scan = NULL; iwl4965_hw_ops.hw_scan = NULL;
} }
...@@ -8551,7 +8549,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e ...@@ -8551,7 +8549,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
priv->pci_dev = pdev; priv->pci_dev = pdev;
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
iwl_debug_level = iwl4965_param_debug; iwl_debug_level = iwl4965_mod_params.debug;
atomic_set(&priv->restrict_refcnt, 0); atomic_set(&priv->restrict_refcnt, 0);
#endif #endif
...@@ -8659,7 +8657,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e ...@@ -8659,7 +8657,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
#endif /* CONFIG_IWL4965_HT */ #endif /* CONFIG_IWL4965_HT */
hw->rate_control_algorithm = "iwl-4965-rs"; hw->rate_control_algorithm = "iwl-4965-rs";
priv->antenna = (enum iwl4965_antenna)iwl4965_param_antenna; priv->antenna = (enum iwl4965_antenna)iwl4965_mod_params.antenna;
priv->retry_rate = 1; priv->retry_rate = 1;
priv->ibss_beacon = NULL; priv->ibss_beacon = NULL;
...@@ -8732,12 +8730,12 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e ...@@ -8732,12 +8730,12 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
**********************************/ **********************************/
/* Disable radio (SW RF KILL) via parameter when loading driver */ /* Disable radio (SW RF KILL) via parameter when loading driver */
if (iwl4965_param_disable) { if (iwl4965_mod_params.disable) {
set_bit(STATUS_RF_KILL_SW, &priv->status); set_bit(STATUS_RF_KILL_SW, &priv->status);
IWL_DEBUG_INFO("Radio disabled.\n"); IWL_DEBUG_INFO("Radio disabled.\n");
} }
if (iwl4965_param_qos_enable) if (iwl4965_mod_params.enable_qos)
priv->qos_data.qos_enable = 1; priv->qos_data.qos_enable = 1;
/******************** /********************
...@@ -8932,25 +8930,26 @@ static void __exit iwl4965_exit(void) ...@@ -8932,25 +8930,26 @@ static void __exit iwl4965_exit(void)
pci_unregister_driver(&iwl4965_driver); pci_unregister_driver(&iwl4965_driver);
} }
module_param_named(antenna, iwl4965_param_antenna, int, 0444); module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444);
MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
module_param_named(disable, iwl4965_param_disable, int, 0444); module_param_named(disable, iwl4965_mod_params.disable, int, 0444);
MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
module_param_named(hwcrypto, iwl4965_param_hwcrypto, int, 0444); module_param_named(hwcrypto, iwl4965_mod_params.hw_crypto, int, 0444);
MODULE_PARM_DESC(hwcrypto, MODULE_PARM_DESC(hwcrypto,
"using hardware crypto engine (default 0 [software])\n"); "using hardware crypto engine (default 0 [software])\n");
module_param_named(debug, iwl4965_param_debug, int, 0444); module_param_named(debug, iwl4965_mod_params.debug, int, 0444);
MODULE_PARM_DESC(debug, "debug output mask"); MODULE_PARM_DESC(debug, "debug output mask");
module_param_named(disable_hw_scan, iwl4965_param_disable_hw_scan, int, 0444); module_param_named(
disable_hw_scan, iwl4965_mod_params.disable_hw_scan, int, 0444);
MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)"); MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
module_param_named(queues_num, iwl4965_param_queues_num, int, 0444); module_param_named(queues_num, iwl4965_mod_params.num_of_queues, int, 0444);
MODULE_PARM_DESC(queues_num, "number of hw queues."); MODULE_PARM_DESC(queues_num, "number of hw queues.");
/* QoS */ /* QoS */
module_param_named(qos_enable, iwl4965_param_qos_enable, int, 0444); module_param_named(qos_enable, iwl4965_mod_params.enable_qos, int, 0444);
MODULE_PARM_DESC(qos_enable, "enable all QoS functionality"); MODULE_PARM_DESC(qos_enable, "enable all QoS functionality");
module_param_named(amsdu_size_8K, iwl4965_param_amsdu_size_8K, int, 0444); module_param_named(amsdu_size_8K, iwl4965_mod_params.amsdu_size_8K, int, 0444);
MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size"); MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size");
module_exit(iwl4965_exit); module_exit(iwl4965_exit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment