aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-05-29 10:30:43 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-06 07:22:11 -0400
commit7b6a2be9e40c9ff7909fdf39d20ad78ba7822040 (patch)
tree48409dcaa1ddc5580dfa608fe02ab61e9b28abdf
parent2baa2e57a9add3f6e5add31f28404ca7b8efecb4 (diff)
iwlwifi: fix rf configuration
Johannes noticed this was completely messed up. We got confused between masks and bit position. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/eeprom.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-csr.h16
2 files changed, 27 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/eeprom.c b/drivers/net/wireless/iwlwifi/dvm/eeprom.c
index b4da76d5d97e..b382b16b89d7 100644
--- a/drivers/net/wireless/iwlwifi/dvm/eeprom.c
+++ b/drivers/net/wireless/iwlwifi/dvm/eeprom.c
@@ -1136,10 +1136,19 @@ void iwl_rf_config(struct iwl_priv *priv)
1136 1136
1137 /* write radio config values to register */ 1137 /* write radio config values to register */
1138 if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) { 1138 if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) {
1139 iwl_set_bit(priv->trans, CSR_HW_IF_CONFIG_REG, 1139 u32 reg_val =
1140 EEPROM_RF_CFG_TYPE_MSK(radio_cfg) | 1140 EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <<
1141 EEPROM_RF_CFG_STEP_MSK(radio_cfg) | 1141 CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE |
1142 EEPROM_RF_CFG_DASH_MSK(radio_cfg)); 1142 EEPROM_RF_CFG_STEP_MSK(radio_cfg) <<
1143 CSR_HW_IF_CONFIG_REG_POS_PHY_STEP |
1144 EEPROM_RF_CFG_DASH_MSK(radio_cfg) <<
1145 CSR_HW_IF_CONFIG_REG_POS_PHY_DASH;
1146
1147 iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG,
1148 CSR_HW_IF_CONFIG_REG_MSK_PHY_TYPE |
1149 CSR_HW_IF_CONFIG_REG_MSK_PHY_STEP |
1150 CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH, reg_val);
1151
1143 IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n", 1152 IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n",
1144 EEPROM_RF_CFG_TYPE_MSK(radio_cfg), 1153 EEPROM_RF_CFG_TYPE_MSK(radio_cfg),
1145 EEPROM_RF_CFG_STEP_MSK(radio_cfg), 1154 EEPROM_RF_CFG_STEP_MSK(radio_cfg),
diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h
index 59750543fce7..41dc6911b164 100644
--- a/drivers/net/wireless/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/iwlwifi/iwl-csr.h
@@ -155,9 +155,21 @@
155#define CSR_DBG_LINK_PWR_MGMT_REG (CSR_BASE+0x250) 155#define CSR_DBG_LINK_PWR_MGMT_REG (CSR_BASE+0x250)
156 156
157/* Bits for CSR_HW_IF_CONFIG_REG */ 157/* Bits for CSR_HW_IF_CONFIG_REG */
158#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x00000C00) 158#define CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH (0x00000003)
159#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100) 159#define CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP (0x0000000C)
160#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x000000C0)
161#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100)
160#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200) 162#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200)
163#define CSR_HW_IF_CONFIG_REG_MSK_PHY_TYPE (0x00000C00)
164#define CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH (0x00003000)
165#define CSR_HW_IF_CONFIG_REG_MSK_PHY_STEP (0x0000C000)
166
167#define CSR_HW_IF_CONFIG_REG_POS_MAC_DASH (0)
168#define CSR_HW_IF_CONFIG_REG_POS_MAC_STEP (2)
169#define CSR_HW_IF_CONFIG_REG_POS_BOARD_VER (6)
170#define CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE (10)
171#define CSR_HW_IF_CONFIG_REG_POS_PHY_DASH (12)
172#define CSR_HW_IF_CONFIG_REG_POS_PHY_STEP (14)
161 173
162#define CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A (0x00080000) 174#define CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A (0x00080000)
163#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000) 175#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)