]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-5000.c
iwlwifi: use type uint for module param debug
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-5000.c
index 4348c7db3d1f64a9ab1389586f9f58549ae65d23..7f3a921a15c6af69c6e7772e0f2ac72476396470 100644 (file)
 #include "iwl-helpers.h"
 #include "iwl-5000-hw.h"
 
-#define IWL5000_UCODE_API  "-1"
+/* Highest firmware API version supported */
+#define IWL5000_UCODE_API_MAX 1
+#define IWL5150_UCODE_API_MAX 1
 
-#define IWL5000_MODULE_FIRMWARE "iwlwifi-5000" IWL5000_UCODE_API ".ucode"
+/* Lowest firmware API version supported */
+#define IWL5000_UCODE_API_MIN 1
+#define IWL5150_UCODE_API_MIN 1
+
+#define IWL5000_FW_PRE "iwlwifi-5000-"
+#define _IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode"
+#define IWL5000_MODULE_FIRMWARE(api) _IWL5000_MODULE_FIRMWARE(api)
+
+#define IWL5150_FW_PRE "iwlwifi-5150-"
+#define _IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode"
+#define IWL5150_MODULE_FIRMWARE(api) _IWL5150_MODULE_FIRMWARE(api)
 
 static const u16 iwl5000_default_queue_to_tx_fifo[] = {
        IWL_TX_FIFO_AC3,
@@ -69,8 +81,7 @@ static int iwl5000_apm_stop_master(struct iwl_priv *priv)
        /* set stop master bit */
        iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
 
-       ret = iwl_poll_bit(priv, CSR_RESET,
-                                 CSR_RESET_REG_FLAG_MASTER_DISABLED,
+       ret = iwl_poll_direct_bit(priv, CSR_RESET,
                                  CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
        if (ret < 0)
                goto out;
@@ -108,9 +119,8 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
        iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
 
        /* wait for clock stabilization */
-       ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
-                         CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
-                         CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
+       ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
+                       CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
        if (ret < 0) {
                IWL_DEBUG_INFO("Failed to init the card\n");
                return ret;
@@ -177,9 +187,8 @@ static int iwl5000_apm_reset(struct iwl_priv *priv)
        iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
 
        /* wait for clock stabilization */
-       ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
-                         CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
-                         CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
+       ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
+                       CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
        if (ret < 0) {
                IWL_DEBUG_INFO("Failed to init the card\n");
                goto out;
@@ -338,9 +347,13 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
 
        if (!data->radio_write) {
                struct iwl_calib_chain_noise_gain_cmd cmd;
+
                memset(&cmd, 0, sizeof(cmd));
 
-               cmd.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD;
+               cmd.hdr.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD;
+               cmd.hdr.first_group = 0;
+               cmd.hdr.groups_num = 1;
+               cmd.hdr.data_valid = 1;
                cmd.delta_gain_1 = data->delta_gain_code[1];
                cmd.delta_gain_2 = data->delta_gain_code[2];
                iwl_send_cmd_pdu_async(priv, REPLY_PHY_CALIBRATION_CMD,
@@ -362,14 +375,19 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
 static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
 {
        struct iwl_chain_noise_data *data = &priv->chain_noise_data;
+       int ret;
 
        if ((data->state == IWL_CHAIN_NOISE_ALIVE) && iwl_is_associated(priv)) {
                struct iwl_calib_chain_noise_reset_cmd cmd;
-
                memset(&cmd, 0, sizeof(cmd));
-               cmd.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD;
-               if (iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
-                       sizeof(cmd), &cmd))
+
+               cmd.hdr.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD;
+               cmd.hdr.first_group = 0;
+               cmd.hdr.groups_num = 1;
+               cmd.hdr.data_valid = 1;
+               ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
+                                       sizeof(cmd), &cmd);
+               if (ret)
                        IWL_ERROR("Could not send REPLY_PHY_CALIBRATION_CMD\n");
                data->state = IWL_CHAIN_NOISE_ACCUMULATE;
                IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
@@ -415,22 +433,33 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
        return &priv->eeprom[address];
 }
 
+static s32 iwl5150_get_ct_threshold(struct iwl_priv *priv)
+{
+       const s32 volt2temp_coef = -5;
+       u16 *temp_calib = (u16 *)iwl_eeprom_query_addr(priv,
+                                               EEPROM_5000_TEMPERATURE);
+       /* offset =  temperate -  voltage / coef */
+       s32 offset = temp_calib[0] - temp_calib[1] / volt2temp_coef;
+       s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD) - offset;
+       return threshold * volt2temp_coef;
+}
+
 /*
  *  Calibration
  */
 static int iwl5000_set_Xtal_calib(struct iwl_priv *priv)
 {
-       u8 data[sizeof(struct iwl_calib_hdr) +
-               sizeof(struct iwl_cal_xtal_freq)];
-       struct iwl_calib_cmd *cmd = (struct iwl_calib_cmd *)data;
-       struct iwl_cal_xtal_freq *xtal = (struct iwl_cal_xtal_freq *)cmd->data;
+       struct iwl_calib_xtal_freq_cmd cmd;
        u16 *xtal_calib = (u16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL);
 
-       cmd->hdr.op_code = IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD;
-       xtal->cap_pin1 = (u8)xtal_calib[0];
-       xtal->cap_pin2 = (u8)xtal_calib[1];
+       cmd.hdr.op_code = IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD;
+       cmd.hdr.first_group = 0;
+       cmd.hdr.groups_num = 1;
+       cmd.hdr.data_valid = 1;
+       cmd.cap_pin1 = (u8)xtal_calib[0];
+       cmd.cap_pin2 = (u8)xtal_calib[1];
        return iwl_calib_set(&priv->calib_results[IWL_CALIB_XTAL],
-                            data, sizeof(data));
+                            (u8 *)&cmd, sizeof(cmd));
 }
 
 static int iwl5000_send_calib_cfg(struct iwl_priv *priv)
@@ -466,6 +495,9 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
         * uCode. iwl_send_calib_results sends them in a row according to their
         * index. We sort them here */
        switch (hdr->op_code) {
+       case IWL_PHY_CALIBRATE_DC_CMD:
+               index = IWL_CALIB_DC;
+               break;
        case IWL_PHY_CALIBRATE_LO_CMD:
                index = IWL_CALIB_LO;
                break;
@@ -475,6 +507,9 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
        case IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD:
                index = IWL_CALIB_TX_IQ_PERD;
                break;
+       case IWL_PHY_CALIBRATE_BASE_BAND_CMD:
+               index = IWL_CALIB_BASE_BAND;
+               break;
        default:
                IWL_ERROR("Unknown calibration notification %d\n",
                          hdr->op_code);
@@ -535,7 +570,7 @@ static int iwl5000_load_section(struct iwl_priv *priv,
        iwl_write_direct32(priv,
                FH_TCSR_CHNL_TX_CONFIG_REG(FH_SRVC_CHNL),
                FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE       |
-               FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL |
+               FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE    |
                FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD);
 
        iwl_release_nic_access(priv);
@@ -549,14 +584,13 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
 {
        int ret = 0;
 
-       ret = iwl5000_load_section(
-               priv, inst_image, RTC_INST_LOWER_BOUND);
+       ret = iwl5000_load_section(priv, inst_image, RTC_INST_LOWER_BOUND);
        if (ret)
                return ret;
 
        IWL_DEBUG_INFO("INST uCode section being loaded...\n");
        ret = wait_event_interruptible_timeout(priv->wait_command_queue,
-                               priv->ucode_write_complete, 5 * HZ);
+                                       priv->ucode_write_complete, 5 * HZ);
        if (ret == -ERESTARTSYS) {
                IWL_ERROR("Could not load the INST uCode section due "
                        "to interrupt\n");
@@ -698,9 +732,10 @@ static int iwl5000_send_wimax_coex(struct iwl_priv *priv)
 static int iwl5000_alive_notify(struct iwl_priv *priv)
 {
        u32 a;
-       int i = 0;
        unsigned long flags;
        int ret;
+       int i, chan;
+       u32 reg_val;
 
        spin_lock_irqsave(&priv->lock, flags);
 
@@ -722,11 +757,21 @@ static int iwl5000_alive_notify(struct iwl_priv *priv)
                iwl_write_targ_mem(priv, a, 0);
 
        iwl_write_prph(priv, IWL50_SCD_DRAM_BASE_ADDR,
-               (priv->shared_phys +
-                offsetof(struct iwl5000_shared, queues_bc_tbls)) >> 10);
+                      priv->scd_bc_tbls.dma >> 10);
+
+       /* Enable DMA channel */
+       for (chan = 0; chan < FH50_TCSR_CHNL_NUM ; chan++)
+               iwl_write_direct32(priv, FH_TCSR_CHNL_TX_CONFIG_REG(chan),
+                               FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE |
+                               FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE);
+
+       /* Update FH chicken bits */
+       reg_val = iwl_read_direct32(priv, FH_TX_CHICKEN_BITS_REG);
+       iwl_write_direct32(priv, FH_TX_CHICKEN_BITS_REG,
+                          reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN);
+
        iwl_write_prph(priv, IWL50_SCD_QUEUECHAIN_SEL,
-               IWL50_SCD_QUEUECHAIN_SEL_ALL(
-                       priv->hw_params.max_txq_num));
+               IWL50_SCD_QUEUECHAIN_SEL_ALL(priv->hw_params.max_txq_num));
        iwl_write_prph(priv, IWL50_SCD_AGGR_SEL, 0);
 
        /* initiate the queues */
@@ -753,6 +798,7 @@ static int iwl5000_alive_notify(struct iwl_priv *priv)
        priv->cfg->ops->lib->txq_set_sched(priv, IWL_MASK(0, 7));
 
        iwl5000_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0);
+
        /* map qos queues to fifos one-to-one */
        for (i = 0; i < ARRAY_SIZE(iwl5000_default_queue_to_tx_fifo); i++) {
                int ac = iwl5000_default_queue_to_tx_fifo[i];
@@ -788,6 +834,9 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
        }
 
        priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
+       priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
+       priv->hw_params.scd_bc_tbls_size =
+                       IWL50_NUM_QUEUES * sizeof(struct iwl5000_scd_bc_tbl);
        priv->hw_params.max_stations = IWL5000_STATION_COUNT;
        priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
        priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
@@ -829,7 +878,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
        case CSR_HW_REV_TYPE_5150:
                /* 5150 wants in Kelvin */
                priv->hw_params.ct_kill_threshold =
-                               CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD);
+                               iwl5150_get_ct_threshold(priv);
                break;
        }
 
@@ -841,11 +890,17 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
                priv->hw_params.calib_init_cfg =
                        BIT(IWL_CALIB_XTAL)             |
                        BIT(IWL_CALIB_LO)               |
-                       BIT(IWL_CALIB_TX_IQ)    |
-                       BIT(IWL_CALIB_TX_IQ_PERD);
+                       BIT(IWL_CALIB_TX_IQ)            |
+                       BIT(IWL_CALIB_TX_IQ_PERD)       |
+                       BIT(IWL_CALIB_BASE_BAND);
                break;
        case CSR_HW_REV_TYPE_5150:
-               priv->hw_params.calib_init_cfg = 0;
+               priv->hw_params.calib_init_cfg =
+                       BIT(IWL_CALIB_DC)               |
+                       BIT(IWL_CALIB_LO)               |
+                       BIT(IWL_CALIB_TX_IQ)            |
+                       BIT(IWL_CALIB_BASE_BAND);
+
                break;
        }
 
@@ -853,36 +908,6 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
        return 0;
 }
 
-static int iwl5000_alloc_shared_mem(struct iwl_priv *priv)
-{
-       priv->shared_virt = pci_alloc_consistent(priv->pci_dev,
-                                       sizeof(struct iwl5000_shared),
-                                       &priv->shared_phys);
-       if (!priv->shared_virt)
-               return -ENOMEM;
-
-       memset(priv->shared_virt, 0, sizeof(struct iwl5000_shared));
-
-       priv->rb_closed_offset = offsetof(struct iwl5000_shared, rb_closed);
-
-       return 0;
-}
-
-static void iwl5000_free_shared_mem(struct iwl_priv *priv)
-{
-       if (priv->shared_virt)
-               pci_free_consistent(priv->pci_dev,
-                                   sizeof(struct iwl5000_shared),
-                                   priv->shared_virt,
-                                   priv->shared_phys);
-}
-
-static int iwl5000_shared_mem_rx_idx(struct iwl_priv *priv)
-{
-       struct iwl5000_shared *s = priv->shared_virt;
-       return le32_to_cpu(s->rb_closed) & 0xFFF;
-}
-
 /**
  * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array
  */
@@ -890,7 +915,7 @@ static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
                                            struct iwl_tx_queue *txq,
                                            u16 byte_cnt)
 {
-       struct iwl5000_shared *shared_data = priv->shared_virt;
+       struct iwl5000_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr;
        int write_ptr = txq->q.write_ptr;
        int txq_id = txq->q.id;
        u8 sec_ctl = 0;
@@ -919,17 +944,17 @@ static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
 
        bc_ent = cpu_to_le16((len & 0xFFF) | (sta_id << 12));
 
-       shared_data->queues_bc_tbls[txq_id].tfd_offset[write_ptr] = bc_ent;
+       scd_bc_tbl[txq_id].tfd_offset[write_ptr] = bc_ent;
 
        if (txq->q.write_ptr < TFD_QUEUE_SIZE_BC_DUP)
-               shared_data->queues_bc_tbls[txq_id].
+               scd_bc_tbl[txq_id].
                        tfd_offset[TFD_QUEUE_SIZE_MAX + write_ptr] = bc_ent;
 }
 
 static void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
                                           struct iwl_tx_queue *txq)
 {
-       struct iwl5000_shared *shared_data = priv->shared_virt;
+       struct iwl5000_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr;
        int txq_id = txq->q.id;
        int read_ptr = txq->q.read_ptr;
        u8 sta_id = 0;
@@ -941,11 +966,10 @@ static void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
                sta_id = txq->cmd[read_ptr]->cmd.tx.sta_id;
 
        bc_ent =  cpu_to_le16(1 | (sta_id << 12));
-       shared_data->queues_bc_tbls[txq_id].
-                       tfd_offset[read_ptr] = bc_ent;
+       scd_bc_tbl[txq_id].tfd_offset[read_ptr] = bc_ent;
 
        if (txq->q.write_ptr < TFD_QUEUE_SIZE_BC_DUP)
-               shared_data->queues_bc_tbls[txq_id].
+               scd_bc_tbl[txq_id].
                        tfd_offset[TFD_QUEUE_SIZE_MAX + read_ptr] =  bc_ent;
 }
 
@@ -1000,7 +1024,7 @@ static int iwl5000_txq_agg_enable(struct iwl_priv *priv, int txq_id,
        ra_tid = BUILD_RAxTID(sta_id, tid);
 
        /* Modify device's station table to Tx this TID */
-       iwl_sta_modify_enable_tid_tx(priv, sta_id, tid);
+       iwl_sta_tx_modify_enable_tid(priv, sta_id, tid);
 
        spin_lock_irqsave(&priv->lock, flags);
        ret = iwl_grab_nic_access(priv);
@@ -1142,7 +1166,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
                info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
                info->status.rates[0].count = tx_resp->failure_frame + 1;
                info->flags &= ~IEEE80211_TX_CTL_AMPDU;
-               info->flags |= iwl_is_tx_success(status)?
+               info->flags |= iwl_is_tx_success(status) ?
                                        IEEE80211_TX_STAT_ACK : 0;
                iwl_hwrate_to_tx_control(priv, rate_n_flags, info);
 
@@ -1458,9 +1482,6 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = {
 
 static struct iwl_lib_ops iwl5000_lib = {
        .set_hw_params = iwl5000_hw_set_hw_params,
-       .alloc_shared_mem = iwl5000_alloc_shared_mem,
-       .free_shared_mem = iwl5000_free_shared_mem,
-       .shared_mem_rx_idx = iwl5000_shared_mem_rx_idx,
        .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,
@@ -1474,13 +1495,13 @@ static struct iwl_lib_ops iwl5000_lib = {
        .alive_notify = iwl5000_alive_notify,
        .send_tx_power = iwl5000_send_tx_power,
        .temperature = iwl5000_temperature,
-       .update_chain_flags = iwl4965_update_chain_flags,
+       .update_chain_flags = iwl_update_chain_flags,
        .apm_ops = {
                .init = iwl5000_apm_init,
                .reset = iwl5000_apm_reset,
                .stop = iwl5000_apm_stop,
                .config = iwl5000_nic_config,
-               .set_pwr_src = iwl4965_set_pwr_src,
+               .set_pwr_src = iwl_set_pwr_src,
        },
        .eeprom_ops = {
                .regulatory_bands = {
@@ -1509,7 +1530,6 @@ static struct iwl_ops iwl5000_ops = {
 static struct iwl_mod_params iwl50_mod_params = {
        .num_of_queues = IWL50_NUM_QUEUES,
        .num_of_ampdu_queues = IWL50_NUM_AMPDU_QUEUES,
-       .enable_qos = 1,
        .amsdu_size_8K = 1,
        .restart_fw = 1,
        /* the rest are 0 by default */
@@ -1518,7 +1538,9 @@ static struct iwl_mod_params iwl50_mod_params = {
 
 struct iwl_cfg iwl5300_agn_cfg = {
        .name = "5300AGN",
-       .fw_name = IWL5000_MODULE_FIRMWARE,
+       .fw_name_pre = IWL5000_FW_PRE,
+       .ucode_api_max = IWL5000_UCODE_API_MAX,
+       .ucode_api_min = IWL5000_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl5000_ops,
        .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
@@ -1529,7 +1551,9 @@ struct iwl_cfg iwl5300_agn_cfg = {
 
 struct iwl_cfg iwl5100_bg_cfg = {
        .name = "5100BG",
-       .fw_name = IWL5000_MODULE_FIRMWARE,
+       .fw_name_pre = IWL5000_FW_PRE,
+       .ucode_api_max = IWL5000_UCODE_API_MAX,
+       .ucode_api_min = IWL5000_UCODE_API_MIN,
        .sku = IWL_SKU_G,
        .ops = &iwl5000_ops,
        .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
@@ -1540,7 +1564,9 @@ struct iwl_cfg iwl5100_bg_cfg = {
 
 struct iwl_cfg iwl5100_abg_cfg = {
        .name = "5100ABG",
-       .fw_name = IWL5000_MODULE_FIRMWARE,
+       .fw_name_pre = IWL5000_FW_PRE,
+       .ucode_api_max = IWL5000_UCODE_API_MAX,
+       .ucode_api_min = IWL5000_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G,
        .ops = &iwl5000_ops,
        .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
@@ -1551,7 +1577,9 @@ struct iwl_cfg iwl5100_abg_cfg = {
 
 struct iwl_cfg iwl5100_agn_cfg = {
        .name = "5100AGN",
-       .fw_name = IWL5000_MODULE_FIRMWARE,
+       .fw_name_pre = IWL5000_FW_PRE,
+       .ucode_api_max = IWL5000_UCODE_API_MAX,
+       .ucode_api_min = IWL5000_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl5000_ops,
        .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
@@ -1562,7 +1590,22 @@ struct iwl_cfg iwl5100_agn_cfg = {
 
 struct iwl_cfg iwl5350_agn_cfg = {
        .name = "5350AGN",
-       .fw_name = IWL5000_MODULE_FIRMWARE,
+       .fw_name_pre = IWL5000_FW_PRE,
+       .ucode_api_max = IWL5000_UCODE_API_MAX,
+       .ucode_api_min = IWL5000_UCODE_API_MIN,
+       .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
+       .ops = &iwl5000_ops,
+       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
+       .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
+       .mod_params = &iwl50_mod_params,
+};
+
+struct iwl_cfg iwl5150_agn_cfg = {
+       .name = "5150AGN",
+       .fw_name_pre = IWL5150_FW_PRE,
+       .ucode_api_max = IWL5150_UCODE_API_MAX,
+       .ucode_api_min = IWL5150_UCODE_API_MIN,
        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
        .ops = &iwl5000_ops,
        .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
@@ -1571,7 +1614,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
        .mod_params = &iwl50_mod_params,
 };
 
-MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE);
+MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));
 
 module_param_named(disable50, iwl50_mod_params.disable, int, 0444);
 MODULE_PARM_DESC(disable50,
@@ -1579,12 +1623,10 @@ MODULE_PARM_DESC(disable50,
 module_param_named(swcrypto50, iwl50_mod_params.sw_crypto, bool, 0444);
 MODULE_PARM_DESC(swcrypto50,
                  "using software crypto engine (default 0 [hardware])\n");
-module_param_named(debug50, iwl50_mod_params.debug, int, 0444);
+module_param_named(debug50, iwl50_mod_params.debug, uint, 0444);
 MODULE_PARM_DESC(debug50, "50XX debug output mask");
 module_param_named(queues_num50, iwl50_mod_params.num_of_queues, int, 0444);
 MODULE_PARM_DESC(queues_num50, "number of hw queues in 50xx series");
-module_param_named(qos_enable50, iwl50_mod_params.enable_qos, int, 0444);
-MODULE_PARM_DESC(qos_enable50, "enable all 50XX QoS functionality");
 module_param_named(11n_disable50, iwl50_mod_params.disable_11n, int, 0444);
 MODULE_PARM_DESC(11n_disable50, "disable 50XX 11n functionality");
 module_param_named(amsdu_size_8K50, iwl50_mod_params.amsdu_size_8K, int, 0444);