Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134025
b: refs/heads/master
c: df878d8
h: refs/heads/master
i:
  134023: 4c79090
v: v3
  • Loading branch information
Kolekar, Abhijeet authored and John W. Linville committed Jan 29, 2009
1 parent 1abc24b commit 7907d6a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2d79b488a33a77d337092c967ce50614edc5d25
refs/heads/master: df878d8f0156ec2b41da5ae9c70af4a27cb2eb0a
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
/* Set the size of the skb to the size of the frame */
skb_put(rxb->skb, le16_to_cpu(rx_hdr->len));

if (iwl3945_param_hwcrypto)
if (iwl3945_mod_params.sw_crypto)
iwl3945_set_decrypted_flag(priv, rxb->skb,
le32_to_cpu(rx_end->status), stats);

Expand Down Expand Up @@ -2512,6 +2512,7 @@ static struct iwl_cfg iwl3945_bg_cfg = {
.ucode_api_max = IWL3945_UCODE_API_MAX,
.ucode_api_min = IWL3945_UCODE_API_MIN,
.sku = IWL_SKU_G,
.mod_params = &iwl3945_mod_params
};

static struct iwl_cfg iwl3945_abg_cfg = {
Expand All @@ -2520,6 +2521,7 @@ static struct iwl_cfg iwl3945_abg_cfg = {
.ucode_api_max = IWL3945_UCODE_API_MAX,
.ucode_api_min = IWL3945_UCODE_API_MIN,
.sku = IWL_SKU_A|IWL_SKU_G,
.mod_params = &iwl3945_mod_params
};

struct pci_device_id iwl3945_hw_card_ids[] = {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ extern struct pci_device_id iwl3945_hw_card_ids[];
#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)

/* Module parameters accessible from iwl-*.c */
extern int iwl3945_param_hwcrypto;
extern int iwl3945_param_queues_num;
extern struct iwl_mod_params iwl3945_mod_params;

struct iwl3945_sta_priv {
struct iwl3945_rs_sta *rs_sta;
Expand Down
48 changes: 20 additions & 28 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@
static int iwl3945_tx_queue_update_write_ptr(struct iwl_priv *priv,
struct iwl3945_tx_queue *txq);

/******************************************************************************
*
* module boiler plate
*
******************************************************************************/

/* module parameters */
static int iwl3945_param_disable_hw_scan; /* def: 0 = use 3945's h/w scan */
static u32 iwl3945_param_debug; /* def: 0 = minimal debug log messages */
static int iwl3945_param_disable; /* def: 0 = enable radio */
static int iwl3945_param_antenna; /* def: 0 = both antennas (use diversity) */
int iwl3945_param_hwcrypto; /* def: 0 = use software encryption */
int iwl3945_param_queues_num = IWL39_MAX_NUM_QUEUES; /* def: 8 Tx queues */

/*
* module name, copyright, version, etc.
*/
Expand Down Expand Up @@ -102,6 +88,12 @@ MODULE_VERSION(DRV_VERSION);
MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
MODULE_LICENSE("GPL");

/* module parameters */
struct iwl_mod_params iwl3945_mod_params = {
.num_of_queues = IWL39_MAX_NUM_QUEUES,
/* the rest are 0 by default */
};

static const struct ieee80211_supported_band *iwl3945_get_band(
struct iwl_priv *priv, enum ieee80211_band band)
{
Expand Down Expand Up @@ -6532,7 +6524,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
goto out;
}

if (unlikely(!iwl3945_param_disable_hw_scan &&
if (unlikely(!iwl3945_mod_params.disable_hw_scan &&
test_bit(STATUS_SCANNING, &priv->status))) {
IWL_DEBUG_MAC80211("leave - scanning\n");
set_bit(STATUS_CONF_PENDING, &priv->status);
Expand Down Expand Up @@ -6944,7 +6936,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,

IWL_DEBUG_MAC80211("enter\n");

if (!iwl3945_param_hwcrypto) {
if (iwl3945_mod_params.sw_crypto) {
IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n");
return -EOPNOTSUPP;
}
Expand Down Expand Up @@ -7747,8 +7739,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
priv->pci_dev = pdev;
priv->cfg = cfg;

if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) ||
(iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) {
if ((iwl3945_mod_params.num_of_queues > IWL39_MAX_NUM_QUEUES) ||
(iwl3945_mod_params.num_of_queues < IWL_MIN_NUM_QUEUES)) {
IWL_ERR(priv,
"invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES);
Expand All @@ -7758,7 +7750,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e

/* Disabling hardware scan means that mac80211 will perform scans
* "the hard way", rather than using device's scan. */
if (iwl3945_param_disable_hw_scan) {
if (iwl3945_mod_params.disable_hw_scan) {
IWL_DEBUG_INFO("Disabling hw_scan\n");
iwl3945_hw_ops.hw_scan = NULL;
}
Expand All @@ -7768,9 +7760,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
hw->sta_data_size = sizeof(struct iwl3945_sta_priv);

/* Select antenna (may be helpful if only one antenna is connected) */
priv->antenna = (enum iwl3945_antenna)iwl3945_param_antenna;
priv->antenna = (enum iwl3945_antenna)iwl3945_mod_params.antenna;
#ifdef CONFIG_IWL3945_DEBUG
priv->debug_level = iwl3945_param_debug;
priv->debug_level = iwl3945_mod_params.debug;
atomic_set(&priv->restrict_refcnt, 0);
#endif

Expand Down Expand Up @@ -7918,7 +7910,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e

/* Initialize module parameter values here */
/* Disable radio (SW RF KILL) via parameter when loading driver */
if (iwl3945_param_disable) {
if (iwl3945_mod_params.disable) {
set_bit(STATUS_RF_KILL_SW, &priv->status);
IWL_DEBUG_INFO("Radio disabled.\n");
}
Expand Down Expand Up @@ -8248,19 +8240,19 @@ static void __exit iwl3945_exit(void)

MODULE_FIRMWARE(IWL3945_MODULE_FIRMWARE(IWL3945_UCODE_API_MAX));

module_param_named(antenna, iwl3945_param_antenna, int, 0444);
module_param_named(antenna, iwl3945_mod_params.antenna, int, 0444);
MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
module_param_named(disable, iwl3945_param_disable, int, 0444);
module_param_named(disable, iwl3945_mod_params.disable, int, 0444);
MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
module_param_named(hwcrypto, iwl3945_param_hwcrypto, int, 0444);
module_param_named(hwcrypto, iwl3945_mod_params.sw_crypto, int, 0444);
MODULE_PARM_DESC(hwcrypto,
"using hardware crypto engine (default 0 [software])\n");
module_param_named(debug, iwl3945_param_debug, uint, 0444);
module_param_named(debug, iwl3945_mod_params.debug, uint, 0444);
MODULE_PARM_DESC(debug, "debug output mask");
module_param_named(disable_hw_scan, iwl3945_param_disable_hw_scan, int, 0444);
module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, int, 0444);
MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");

module_param_named(queues_num, iwl3945_param_queues_num, int, 0444);
module_param_named(queues_num, iwl3945_mod_params.num_of_queues, int, 0444);
MODULE_PARM_DESC(queues_num, "number of hw queues.");

module_exit(iwl3945_exit);
Expand Down

0 comments on commit 7907d6a

Please sign in to comment.