diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-06-14 18:23:39 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-06-18 11:23:56 -0400 |
commit | 86cb3b4e08a106594ee79c94dec9c7ca289cf999 (patch) | |
tree | 6c83c6367f30bbc65a9ee734cf553c69907d68d4 /drivers/net/wireless/iwlwifi/iwl-eeprom.c | |
parent | 916b337310969dd5eef35be0988a6bf768c138f9 (diff) |
iwlagn: merge duplicate code into single function
Same operation needed by multiple devices, move to single function.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-eeprom.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 47a56bc1cd12..768d0ee276f7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -834,3 +834,28 @@ const struct iwl_channel_info *iwl_get_channel_info(const struct iwl_priv *priv, | |||
834 | 834 | ||
835 | return NULL; | 835 | return NULL; |
836 | } | 836 | } |
837 | |||
838 | void iwl_rf_config(struct iwl_priv *priv) | ||
839 | { | ||
840 | u16 radio_cfg; | ||
841 | |||
842 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); | ||
843 | |||
844 | /* write radio config values to register */ | ||
845 | if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) { | ||
846 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, | ||
847 | EEPROM_RF_CFG_TYPE_MSK(radio_cfg) | | ||
848 | EEPROM_RF_CFG_STEP_MSK(radio_cfg) | | ||
849 | EEPROM_RF_CFG_DASH_MSK(radio_cfg)); | ||
850 | IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n", | ||
851 | EEPROM_RF_CFG_TYPE_MSK(radio_cfg), | ||
852 | EEPROM_RF_CFG_STEP_MSK(radio_cfg), | ||
853 | EEPROM_RF_CFG_DASH_MSK(radio_cfg)); | ||
854 | } else | ||
855 | WARN_ON(1); | ||
856 | |||
857 | /* set CSR_HW_CONFIG_REG for uCode use */ | ||
858 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, | ||
859 | CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | | ||
860 | CSR_HW_IF_CONFIG_REG_BIT_MAC_SI); | ||
861 | } | ||