iwlagn: add IQ inversion support for 2000 series devices
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Tue, 18 Jan 2011 16:58:48 +0000 (08:58 -0800)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 31 Jan 2011 21:17:53 +0000 (13:17 -0800)
The I/Q swapping is extremely important and should be dealt with extra care.
It will affects OFDM and CCK differently.

For 6000/6005/6030 series devices, the I/Q were swapped, and for 2000 series
devices, it is in non-swapped status (but its swapped with respected to 6000/6005/6030).
so the CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER register need to be set to support
the correct behavior.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-2000.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-csr.h

index 3c9e1b5724c789e5a0a5c09c62940a99d03d7df6..ac5996f40e78b705f08d77149ae03cf9c31fee25 100644 (file)
@@ -97,6 +97,10 @@ static void iwl2000_nic_config(struct iwl_priv *priv)
                    CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
                    CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
 
+       if (priv->cfg->iq_invert)
+               iwl_set_bit(priv, CSR_GP_DRIVER_REG,
+                           CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER);
+
 }
 
 static struct iwl_sensitivity_ranges iwl2000_sensitivity = {
@@ -428,7 +432,8 @@ static struct iwl_bt_params iwl2030_bt_params = {
        .base_params = &iwl2000_base_params,                    \
        .need_dc_calib = true,                                  \
        .need_temp_offset_calib = true,                         \
-       .led_mode = IWL_LED_RF_STATE                            \
+       .led_mode = IWL_LED_RF_STATE,                           \
+       .iq_invert = true                                       \
 
 struct iwl_cfg iwl2000_2bgn_cfg = {
        .name = "2000 Series 2x2 BGN",
@@ -454,7 +459,8 @@ struct iwl_cfg iwl2000_2bg_cfg = {
        .need_dc_calib = true,                                  \
        .need_temp_offset_calib = true,                         \
        .led_mode = IWL_LED_RF_STATE,                           \
-       .adv_pm = true                                          \
+       .adv_pm = true,                                         \
+       .iq_invert = true                                       \
 
 struct iwl_cfg iwl2030_2bgn_cfg = {
        .name = "2000 Series 2x2 BGN/BT",
index c83fcc60ccc58a1cb7925e74debb2c10123ec1e3..b57e739e5bbb8d229467090959e34da7c7d1ee54 100644 (file)
@@ -364,6 +364,7 @@ struct iwl_ht_params {
  * @adv_pm: advance power management
  * @rx_with_siso_diversity: 1x1 device with rx antenna diversity
  * @internal_wimax_coex: internal wifi/wimax combo device
+ * @iq_invert: I/Q inversion
  *
  * We enable the driver to be backward compatible wrt API version. The
  * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -413,6 +414,7 @@ struct iwl_cfg {
        const bool adv_pm;
        const bool rx_with_siso_diversity;
        const bool internal_wimax_coex;
+       const bool iq_invert;
 };
 
 /***************************
index 6c2b2df7ee7e68ede8fba3bcbe8d92c7c1382324..f52bc040bcbf96fb5d059c279f8acc8a8f19140f 100644 (file)
 #define CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6       (0x00000004)
 #define CSR_GP_DRIVER_REG_BIT_6050_1x2             (0x00000008)
 
+#define CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER       (0x00000080)
+
 /* GIO Chicken Bits (PCI Express bus link power management) */
 #define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX  (0x00800000)
 #define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER  (0x20000000)