iwlwifi: separate nic_config for different NIC
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 11 Sep 2009 17:38:10 +0000 (10:38 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:31 +0000 (16:39 -0400)
Different NIC has different requirements for configuration. Currently all
5000 series hardware and later share the same configuration function even
though they do not need the same configurations. Fix this by separating the
needed configuration actions for each hardware model.

.5000 series: L1-ASPM H/W bug work-around
              configure radio
              write CSR_HW_IF_CONFIG_REG for uCode use
              work-around for NIC get stuck after early PCIe power off

.1000 series: write CSR_HW_IF_CONFIG_REG for uCode use
              setting digital SVR for 1000 card to 1.32V

.6000 series: configure radio
              write CSR_HW_IF_CONFIG_REG for uCode use
              write CSR_GP_DRIVER_REG to indicate radio sku

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-eeprom.h

index 2716b91ba9fa753b879c80e0de57ae430356a575..89f360befc30f0105a9da2bf65659263b3722d60 100644 (file)
@@ -76,7 +76,10 @@ static void iwl1000_set_ct_threshold(struct iwl_priv *priv)
 /* NIC configuration for 1000 series */
 static void iwl1000_nic_config(struct iwl_priv *priv)
 {
-       iwl5000_nic_config(priv);
+       /* set CSR_HW_CONFIG_REG for uCode use */
+       iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+                   CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
+                   CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
 
        /* Setting digital SVR for 1000 card to 1.32V */
        /* locking is acquired in iwl_set_bits_mask_prph() function */
index eb08f4411000cdd8f430de8b0342f97dd8627521..d312ef03245fee7fb26312070f8fb4fb97d65cd9 100644 (file)
@@ -198,7 +198,7 @@ out:
 }
 
 
-/* NIC configuration for 5000 series and up */
+/* NIC configuration for 5000 series */
 void iwl5000_nic_config(struct iwl_priv *priv)
 {
        unsigned long flags;
@@ -221,7 +221,7 @@ void iwl5000_nic_config(struct iwl_priv *priv)
        radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
 
        /* write radio config values to register */
-       if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) < EEPROM_5000_RF_CFG_TYPE_MAX)
+       if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) < EEPROM_RF_CONFIG_TYPE_MAX)
                iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
                            EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
                            EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
index c295b8ee922896ab16be8812bef15b0641b7cf2f..37b3e2086633d43e1d57c605386a2975740344ba 100644 (file)
@@ -71,7 +71,21 @@ static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
 /* NIC configuration for 6000 series */
 static void iwl6000_nic_config(struct iwl_priv *priv)
 {
-       iwl5000_nic_config(priv);
+       u16 radio_cfg;
+
+       radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
+
+       /* write radio config values to register */
+       if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
+               iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+                           EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
+                           EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
+                           EEPROM_RF_CFG_DASH_MSK(radio_cfg));
+
+       /* set CSR_HW_CONFIG_REG for uCode use */
+       iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+                   CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
+                   CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
 
        /* no locking required for register write */
        if (priv->cfg->pa_type == IWL_PA_HYBRID) {
index 90e2b4ea2606c4a1f609d139007447bfb635c952..61794eb3d6898de67cc926a4a30e9cbe76890ea2 100644 (file)
@@ -385,7 +385,12 @@ struct iwl_eeprom_calib_info {
 
 #define EEPROM_3945_RF_CFG_TYPE_MAX  0x0
 #define EEPROM_4965_RF_CFG_TYPE_MAX  0x1
-#define EEPROM_5000_RF_CFG_TYPE_MAX  0x3
+
+/* Radio Config for 5000 and up */
+#define EEPROM_RF_CONFIG_TYPE_R3x3     0x0
+#define EEPROM_RF_CONFIG_TYPE_R2x2     0x1
+#define EEPROM_RF_CONFIG_TYPE_R1x2     0x2
+#define EEPROM_RF_CONFIG_TYPE_MAX      0x3
 
 /*
  * Per-channel regulatory data.