diff options
author | Samuel Ortiz <samuel.ortiz@intel.com> | 2009-01-23 16:45:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:36 -0500 |
commit | 7e4bca5e5b8dffd9373470693e20f43b0aee566c (patch) | |
tree | b2ffe397128882b6019794dcba1384eaac7b89ab | |
parent | d08853a3995cfc2985307da7400fb57bfa5773e2 (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>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 44 |
3 files changed, 39 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index b9c5cf9a6715..7f1e04205f30 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -197,41 +197,6 @@ static int iwl3945_hwrate_to_plcp_idx(u8 plcp) | |||
197 | return -1; | 197 | return -1; |
198 | } | 198 | } |
199 | 199 | ||
200 | /** | ||
201 | * iwl3945_get_antenna_flags - Get antenna flags for RXON command | ||
202 | * @priv: eeprom and antenna fields are used to determine antenna flags | ||
203 | * | ||
204 | * priv->eeprom39 is used to determine if antenna AUX/MAIN are reversed | ||
205 | * priv->antenna specifies the antenna diversity mode: | ||
206 | * | ||
207 | * IWL_ANTENNA_DIVERSITY - NIC selects best antenna by itself | ||
208 | * IWL_ANTENNA_MAIN - Force MAIN antenna | ||
209 | * IWL_ANTENNA_AUX - Force AUX antenna | ||
210 | */ | ||
211 | __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv) | ||
212 | { | ||
213 | struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom; | ||
214 | |||
215 | switch (priv->antenna) { | ||
216 | case IWL_ANTENNA_DIVERSITY: | ||
217 | return 0; | ||
218 | |||
219 | case IWL_ANTENNA_MAIN: | ||
220 | if (eeprom->antenna_switch_type) | ||
221 | return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK; | ||
222 | return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK; | ||
223 | |||
224 | case IWL_ANTENNA_AUX: | ||
225 | if (eeprom->antenna_switch_type) | ||
226 | return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK; | ||
227 | return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK; | ||
228 | } | ||
229 | |||
230 | /* bad antenna selector value */ | ||
231 | IWL_ERR(priv, "Bad antenna selector value (0x%x)\n", priv->antenna); | ||
232 | return 0; /* "diversity" is default if error */ | ||
233 | } | ||
234 | |||
235 | #ifdef CONFIG_IWLWIFI_DEBUG | 200 | #ifdef CONFIG_IWLWIFI_DEBUG |
236 | #define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x | 201 | #define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x |
237 | 202 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 5dbab7662b8e..437c05b9a335 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -978,7 +978,6 @@ struct iwl_priv { | |||
978 | u16 rates_mask; | 978 | u16 rates_mask; |
979 | 979 | ||
980 | u32 power_mode; | 980 | u32 power_mode; |
981 | u32 antenna; | ||
982 | u8 bssid[ETH_ALEN]; | 981 | u8 bssid[ETH_ALEN]; |
983 | u16 rts_threshold; | 982 | u16 rts_threshold; |
984 | u8 mac_addr[ETH_ALEN]; | 983 | u8 mac_addr[ETH_ALEN]; |
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 | ||
5810 | static ssize_t store_antenna(struct device *d, | 5847 | static 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; |