]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-2000.c
Merge branch 'master' of git://git.infradead.org/users/linville/wireless
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-2000.c
index 54d931d614fb15b4e3d2b3a36fa77c60dd4b6e27..db889581c0e5dabe3d47e2f3d9a54bd234b93b82 100644 (file)
@@ -44,6 +44,8 @@
 #include "iwl-helpers.h"
 #include "iwl-agn-hw.h"
 #include "iwl-6000-hw.h"
+#include "iwl-shared.h"
+#include "iwl-cfg.h"
 
 /* Highest firmware API version supported */
 #define IWL2030_UCODE_API_MAX 6
 #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
 
 #define IWL135_FW_PRE "iwlwifi-135-"
-#define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE #api ".ucode"
+#define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
 
 static void iwl2000_set_ct_threshold(struct iwl_priv *priv)
 {
        /* want Celsius */
-       priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
-       priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
+       hw_params(priv).ct_kill_threshold = CT_KILL_THRESHOLD;
+       hw_params(priv).ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
 }
 
 /* NIC configuration for 2000 series */
@@ -88,7 +90,7 @@ static void iwl2000_nic_config(struct iwl_priv *priv)
        iwl_rf_config(priv);
 
        if (priv->cfg->iq_invert)
-               iwl_set_bit(priv, CSR_GP_DRIVER_REG,
+               iwl_set_bit(bus(priv), CSR_GP_DRIVER_REG,
                            CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER);
 }
 
@@ -124,44 +126,38 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv)
                priv->cfg->base_params->num_of_queues =
                        iwlagn_mod_params.num_of_queues;
 
-       priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
-       priv->hw_params.scd_bc_tbls_size =
-               priv->cfg->base_params->num_of_queues *
-               sizeof(struct iwlagn_scd_bc_tbl);
-       priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
-       priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
+       hw_params(priv).max_txq_num = priv->cfg->base_params->num_of_queues;
+       hw_params(priv).max_stations = IWLAGN_STATION_COUNT;
        priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
 
-       priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
-       priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
+       hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE;
+       hw_params(priv).max_inst_size = IWL60_RTC_INST_SIZE;
 
-       priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ);
+       hw_params(priv).ht40_channel =  BIT(IEEE80211_BAND_2GHZ);
 
-       priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
+       hw_params(priv).tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
        if (priv->cfg->rx_with_siso_diversity)
-               priv->hw_params.rx_chains_num = 1;
+               hw_params(priv).rx_chains_num = 1;
        else
-               priv->hw_params.rx_chains_num =
+               hw_params(priv).rx_chains_num =
                        num_of_ant(priv->cfg->valid_rx_ant);
-       priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
-       priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
+       hw_params(priv).valid_tx_ant = priv->cfg->valid_tx_ant;
+       hw_params(priv).valid_rx_ant = priv->cfg->valid_rx_ant;
 
        iwl2000_set_ct_threshold(priv);
 
        /* Set initial sensitivity parameters */
        /* Set initial calibration set */
-       priv->hw_params.sens = &iwl2000_sensitivity;
-       priv->hw_params.calib_init_cfg =
+       hw_params(priv).sens = &iwl2000_sensitivity;
+       hw_params(priv).calib_init_cfg =
                BIT(IWL_CALIB_XTAL)             |
                BIT(IWL_CALIB_LO)               |
                BIT(IWL_CALIB_TX_IQ)            |
                BIT(IWL_CALIB_BASE_BAND);
        if (priv->cfg->need_dc_calib)
-               priv->hw_params.calib_rt_cfg |= IWL_CALIB_CFG_DC_IDX;
+               hw_params(priv).calib_rt_cfg |= IWL_CALIB_CFG_DC_IDX;
        if (priv->cfg->need_temp_offset_calib)
-               priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);
-
-       priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
+               hw_params(priv).calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);
 
        return 0;
 }
@@ -179,7 +175,7 @@ static struct iwl_lib_ops iwl2000_lib = {
                        EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
                        EEPROM_REGULATORY_BAND_NO_HT40,
                },
-               .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
+               .update_enhanced_txpower = iwl_eeprom_enhanced_txpower,
        },
        .temperature = iwlagn_temperature,
 };
@@ -200,7 +196,7 @@ static struct iwl_lib_ops iwl2030_lib = {
                        EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
                        EEPROM_REGULATORY_BAND_NO_HT40,
                },
-               .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
+               .update_enhanced_txpower = iwl_eeprom_enhanced_txpower,
        },
        .temperature = iwlagn_temperature,
 };
@@ -213,7 +209,6 @@ static struct iwl_base_params iwl2000_base_params = {
        .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
        .shadow_ram_support = true,
        .led_compensation = 51,
-       .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .adv_thermal_throttle = true,
        .support_ct_kill_exit = true,
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
@@ -233,7 +228,6 @@ static struct iwl_base_params iwl2030_base_params = {
        .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
        .shadow_ram_support = true,
        .led_compensation = 57,
-       .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .adv_thermal_throttle = true,
        .support_ct_kill_exit = true,
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
@@ -270,6 +264,7 @@ static struct iwl_bt_params iwl2030_bt_params = {
        .base_params = &iwl2000_base_params,                    \
        .need_dc_calib = true,                                  \
        .need_temp_offset_calib = true,                         \
+       .temp_offset_v2 = true,                                 \
        .led_mode = IWL_LED_RF_STATE,                           \
        .iq_invert = true                                       \
 
@@ -284,6 +279,12 @@ struct iwl_cfg iwl2000_2bg_cfg = {
        IWL_DEVICE_2000,
 };
 
+struct iwl_cfg iwl2000_2bgn_d_cfg = {
+       .name = "2000D Series 2x2 BGN",
+       IWL_DEVICE_2000,
+       .ht_params = &iwl2000_ht_params,
+};
+
 #define IWL_DEVICE_2030                                                \
        .fw_name_pre = IWL2030_FW_PRE,                          \
        .ucode_api_max = IWL2030_UCODE_API_MAX,                 \
@@ -296,6 +297,7 @@ struct iwl_cfg iwl2000_2bg_cfg = {
        .bt_params = &iwl2030_bt_params,                        \
        .need_dc_calib = true,                                  \
        .need_temp_offset_calib = true,                         \
+       .temp_offset_v2 = true,                                 \
        .led_mode = IWL_LED_RF_STATE,                           \
        .adv_pm = true,                                         \
        .iq_invert = true                                       \
@@ -322,6 +324,7 @@ struct iwl_cfg iwl2030_2bg_cfg = {
        .base_params = &iwl2000_base_params,                    \
        .need_dc_calib = true,                                  \
        .need_temp_offset_calib = true,                         \
+       .temp_offset_v2 = true,                                 \
        .led_mode = IWL_LED_RF_STATE,                           \
        .adv_pm = true,                                         \
        .rx_with_siso_diversity = true,                         \
@@ -350,6 +353,7 @@ struct iwl_cfg iwl105_bgn_cfg = {
        .bt_params = &iwl2030_bt_params,                        \
        .need_dc_calib = true,                                  \
        .need_temp_offset_calib = true,                         \
+       .temp_offset_v2 = true,                                 \
        .led_mode = IWL_LED_RF_STATE,                           \
        .adv_pm = true,                                         \
        .rx_with_siso_diversity = true,                         \