aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel.ortiz@intel.com>2009-01-23 16:45:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:36 -0500
commit7e4bca5e5b8dffd9373470693e20f43b0aee566c (patch)
treeb2ffe397128882b6019794dcba1384eaac7b89ab /drivers/net/wireless/iwlwifi/iwl3945-base.c
parentd08853a3995cfc2985307da7400fb57bfa5773e2 (diff)
iwl3945: Getting rid of priv->antenna
The iwl_priv antenna field is useless as we can simply use the corresponding mod_params antenna field. Signed-off-by: Samuel Ortiz <samuel.ortiz@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.c44
1 files changed, 39 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index d832cb95a928..8aaa6bfd128d 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -448,6 +448,43 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
448} 448}
449 449
450/** 450/**
451 * iwl3945_get_antenna_flags - Get antenna flags for RXON command
452 * @priv: eeprom and antenna fields are used to determine antenna flags
453 *
454 * priv->eeprom39 is used to determine if antenna AUX/MAIN are reversed
455 * iwl3945_mod_params.antenna specifies the antenna diversity mode:
456 *
457 * IWL_ANTENNA_DIVERSITY - NIC selects best antenna by itself
458 * IWL_ANTENNA_MAIN - Force MAIN antenna
459 * IWL_ANTENNA_AUX - Force AUX antenna
460 */
461__le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv)
462{
463 struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom;
464
465 switch (iwl3945_mod_params.antenna) {
466 case IWL_ANTENNA_DIVERSITY:
467 return 0;
468
469 case IWL_ANTENNA_MAIN:
470 if (eeprom->antenna_switch_type)
471 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK;
472 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK;
473
474 case IWL_ANTENNA_AUX:
475 if (eeprom->antenna_switch_type)
476 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK;
477 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK;
478 }
479
480 /* bad antenna selector value */
481 IWL_ERR(priv, "Bad antenna selector value (0x%x)\n",
482 iwl3945_mod_params.antenna);
483
484 return 0; /* "diversity" is default if error */
485}
486
487/**
451 * iwl3945_commit_rxon - commit staging_rxon to hardware 488 * iwl3945_commit_rxon - commit staging_rxon to hardware
452 * 489 *
453 * The RXON command in staging_rxon is committed to the hardware and 490 * The RXON command in staging_rxon is committed to the hardware and
@@ -5804,7 +5841,7 @@ static ssize_t show_antenna(struct device *d,
5804 if (!iwl_is_alive(priv)) 5841 if (!iwl_is_alive(priv))
5805 return -EAGAIN; 5842 return -EAGAIN;
5806 5843
5807 return sprintf(buf, "%d\n", priv->antenna); 5844 return sprintf(buf, "%d\n", iwl3945_mod_params.antenna);
5808} 5845}
5809 5846
5810static ssize_t store_antenna(struct device *d, 5847static ssize_t store_antenna(struct device *d,
@@ -5824,7 +5861,7 @@ static ssize_t store_antenna(struct device *d,
5824 5861
5825 if ((ant >= 0) && (ant <= 2)) { 5862 if ((ant >= 0) && (ant <= 2)) {
5826 IWL_DEBUG_INFO("Setting antenna select to %d.\n", ant); 5863 IWL_DEBUG_INFO("Setting antenna select to %d.\n", ant);
5827 priv->antenna = (enum iwl3945_antenna)ant; 5864 iwl3945_mod_params.antenna = (enum iwl3945_antenna)ant;
5828 } else 5865 } else
5829 IWL_DEBUG_INFO("Bad antenna select value %d.\n", ant); 5866 IWL_DEBUG_INFO("Bad antenna select value %d.\n", ant);
5830 5867
@@ -6089,9 +6126,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
6089 hw->rate_control_algorithm = "iwl-3945-rs"; 6126 hw->rate_control_algorithm = "iwl-3945-rs";
6090 hw->sta_data_size = sizeof(struct iwl3945_sta_priv); 6127 hw->sta_data_size = sizeof(struct iwl3945_sta_priv);
6091 6128
6092 /* Select antenna (may be helpful if only one antenna is connected) */
6093 priv->antenna = (enum iwl3945_antenna)iwl3945_mod_params.antenna;
6094
6095 /* Tell mac80211 our characteristics */ 6129 /* Tell mac80211 our characteristics */
6096 hw->flags = IEEE80211_HW_SIGNAL_DBM | 6130 hw->flags = IEEE80211_HW_SIGNAL_DBM |
6097 IEEE80211_HW_NOISE_DBM; 6131 IEEE80211_HW_NOISE_DBM;