b43: LP-PHY: Two small spec updates
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-6000.c
index bd438d8..383177d 100644 (file)
@@ -46,8 +46,8 @@
 #include "iwl-5000-hw.h"
 
 /* Highest firmware API version supported */
-#define IWL6000_UCODE_API_MAX 2
-#define IWL6050_UCODE_API_MAX 2
+#define IWL6000_UCODE_API_MAX 3
+#define IWL6050_UCODE_API_MAX 3
 
 /* Lowest firmware API version supported */
 #define IWL6000_UCODE_API_MIN 1
 #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
 #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
 
+static void iwl6000_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;
+}
+
+/* NIC configuration for 6000 series */
+static void iwl6000_nic_config(struct iwl_priv *priv)
+{
+       iwl5000_nic_config(priv);
+
+       /* no locking required for register write */
+       if (priv->cfg->pa_type == IWL_PA_HYBRID) {
+               /* 2x2 hybrid phy type */
+               iwl_write32(priv, CSR_GP_DRIVER_REG,
+                            CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_HYB);
+       } else if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
+               /* 2x2 IPA phy type */
+               iwl_write32(priv, CSR_GP_DRIVER_REG,
+                            CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
+       }
+       /* else do nothing, uCode configured */
+}
+
+static struct iwl_lib_ops iwl6000_lib = {
+       .set_hw_params = iwl5000_hw_set_hw_params,
+       .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
+       .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl,
+       .txq_set_sched = iwl5000_txq_set_sched,
+       .txq_agg_enable = iwl5000_txq_agg_enable,
+       .txq_agg_disable = iwl5000_txq_agg_disable,
+       .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
+       .txq_free_tfd = iwl_hw_txq_free_tfd,
+       .txq_init = iwl_hw_tx_queue_init,
+       .rx_handler_setup = iwl5000_rx_handler_setup,
+       .setup_deferred_work = iwl5000_setup_deferred_work,
+       .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
+       .load_ucode = iwl5000_load_ucode,
+       .init_alive_start = iwl5000_init_alive_start,
+       .alive_notify = iwl5000_alive_notify,
+       .send_tx_power = iwl5000_send_tx_power,
+       .update_chain_flags = iwl_update_chain_flags,
+       .apm_ops = {
+               .init = iwl5000_apm_init,
+               .reset = iwl5000_apm_reset,
+               .stop = iwl5000_apm_stop,
+               .config = iwl6000_nic_config,
+               .set_pwr_src = iwl_set_pwr_src,
+       },
+       .eeprom_ops = {
+               .regulatory_bands = {
+                       EEPROM_5000_REG_BAND_1_CHANNELS,
+                       EEPROM_5000_REG_BAND_2_CHANNELS,
+                       EEPROM_5000_REG_BAND_3_CHANNELS,
+                       EEPROM_5000_REG_BAND_4_CHANNELS,
+                       EEPROM_5000_REG_BAND_5_CHANNELS,
+                       EEPROM_5000_REG_BAND_24_HT40_CHANNELS,
+                       EEPROM_5000_REG_BAND_52_HT40_CHANNELS
+               },
+               .verify_signature  = iwlcore_eeprom_verify_signature,
+               .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
+               .release_semaphore = iwlcore_eeprom_release_semaphore,
+               .calib_version  = iwl5000_eeprom_calib_version,
+               .query_addr = iwl5000_eeprom_query_addr,
+       },
+       .post_associate = iwl_post_associate,
+       .isr = iwl_isr_ict,
+       .config_ap = iwl_config_ap,
+       .temp_ops = {
+               .temperature = iwl5000_temperature,
+               .set_ct_kill = iwl6000_set_ct_threshold,
+        },
+};
+
 static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
        .get_hcmd_size = iwl5000_get_hcmd_size,
        .build_addsta_hcmd = iwl5000_build_addsta_hcmd,
@@ -69,41 +144,57 @@ static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
 };
 
 static struct iwl_ops iwl6000_ops = {
-       .lib = &iwl5000_lib,
+       .ucode = &iwl5000_ucode,
+       .lib = &iwl6000_lib,
        .hcmd = &iwl5000_hcmd,
        .utils = &iwl6000_hcmd_utils,
 };
 
-struct iwl_cfg iwl6000_2ag_cfg = {
-       .name = "6000 Series 2x2 AG",
+
+/*
+ * "h": Hybrid configuration, use both internal and external Power Amplifier
+ */
+struct iwl_cfg iwl6000h_2agn_cfg = {
+       .name = "6000 Series 2x2 AGN",
        .fw_name_pre = IWL6000_FW_PRE,
        .ucode_api_max = IWL6000_UCODE_API_MAX,
        .ucode_api_min = IWL6000_UCODE_API_MIN,
-       .sku = IWL_SKU_A|IWL_SKU_G,
+       .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl6000_ops,
-       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE,
        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
        .mod_params = &iwl50_mod_params,
-       .valid_tx_ant = ANT_BC,
-       .valid_rx_ant = ANT_BC,
+       .valid_tx_ant = ANT_AB,
+       .valid_rx_ant = ANT_AB,
        .need_pll_cfg = false,
+       .pa_type = IWL_PA_HYBRID,
+       .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
+       .shadow_ram_support = true,
+       .ht_greenfield_support = true,
 };
 
-struct iwl_cfg iwl6000_2agn_cfg = {
+/*
+ * "i": Internal configuration, use internal Power Amplifier
+ */
+struct iwl_cfg iwl6000i_2agn_cfg = {
        .name = "6000 Series 2x2 AGN",
        .fw_name_pre = IWL6000_FW_PRE,
        .ucode_api_max = IWL6000_UCODE_API_MAX,
        .ucode_api_min = IWL6000_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl6000_ops,
-       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE,
        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
        .mod_params = &iwl50_mod_params,
-       .valid_tx_ant = ANT_AB,
-       .valid_rx_ant = ANT_AB,
+       .valid_tx_ant = ANT_BC,
+       .valid_rx_ant = ANT_BC,
        .need_pll_cfg = false,
+       .pa_type = IWL_PA_INTERNAL,
+       .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
+       .shadow_ram_support = true,
+       .ht_greenfield_support = true,
 };
 
 struct iwl_cfg iwl6050_2agn_cfg = {
@@ -113,13 +204,17 @@ struct iwl_cfg iwl6050_2agn_cfg = {
        .ucode_api_min = IWL6050_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl6000_ops,
-       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE,
        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
        .mod_params = &iwl50_mod_params,
        .valid_tx_ant = ANT_AB,
        .valid_rx_ant = ANT_AB,
        .need_pll_cfg = false,
+       .pa_type = IWL_PA_SYSTEM,
+       .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
+       .shadow_ram_support = true,
+       .ht_greenfield_support = true,
 };
 
 struct iwl_cfg iwl6000_3agn_cfg = {
@@ -129,13 +224,17 @@ struct iwl_cfg iwl6000_3agn_cfg = {
        .ucode_api_min = IWL6000_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl6000_ops,
-       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE,
        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
        .mod_params = &iwl50_mod_params,
        .valid_tx_ant = ANT_ABC,
        .valid_rx_ant = ANT_ABC,
        .need_pll_cfg = false,
+       .pa_type = IWL_PA_SYSTEM,
+       .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
+       .shadow_ram_support = true,
+       .ht_greenfield_support = true,
 };
 
 struct iwl_cfg iwl6050_3agn_cfg = {
@@ -145,13 +244,17 @@ struct iwl_cfg iwl6050_3agn_cfg = {
        .ucode_api_min = IWL6050_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl6000_ops,
-       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .eeprom_size = OTP_LOW_IMAGE_SIZE,
        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
        .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
        .mod_params = &iwl50_mod_params,
        .valid_tx_ant = ANT_ABC,
        .valid_rx_ant = ANT_ABC,
        .need_pll_cfg = false,
+       .pa_type = IWL_PA_SYSTEM,
+       .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
+       .shadow_ram_support = true,
+       .ht_greenfield_support = true,
 };
 
 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));