]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/iwlwifi/iwl3945-base.c
iwlwifi: Update iwlwifi version stamp to 1.1.19
[linux-2.6] / drivers / net / wireless / iwlwifi / iwl3945-base.c
index 5041368a9a20aad0ae264cd97e6dd6548be2cbbe..68f6b8bc4dd9145f4562cf250b23b15545230e62 100644 (file)
@@ -101,7 +101,7 @@ int iwl_param_queues_num = IWL_MAX_NUM_QUEUES;
 #define VS
 #endif
 
-#define IWLWIFI_VERSION "1.1.17k" VD VS
+#define IWLWIFI_VERSION "1.1.19k" VD VS
 #define DRV_COPYRIGHT  "Copyright(c) 2003-2007 Intel Corporation"
 #define DRV_VERSION     IWLWIFI_VERSION
 
@@ -808,10 +808,6 @@ out:
 
 int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 {
-       /* A command can not be asynchronous AND expect an SKB to be set. */
-       BUG_ON((cmd->meta.flags & CMD_ASYNC) &&
-              (cmd->meta.flags & CMD_WANT_SKB));
-
        if (cmd->meta.flags & CMD_ASYNC)
                return iwl_send_cmd_async(priv, cmd);
 
@@ -1567,7 +1563,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
 
                for (i = 0; i < IWL_EEPROM_ACCESS_TIMEOUT;
                                        i += IWL_EEPROM_ACCESS_DELAY) {
-                       r = _iwl_read_restricted(priv, CSR_EEPROM_REG);
+                       r = _iwl_read_direct32(priv, CSR_EEPROM_REG);
                        if (r & CSR_EEPROM_REG_READ_VALID_MSK)
                                break;
                        udelay(IWL_EEPROM_ACCESS_DELAY);
@@ -1968,9 +1964,6 @@ static void iwl_activate_qos(struct iwl_priv *priv, u8 force)
 {
        unsigned long flags;
 
-       if (priv == NULL)
-               return;
-
        if (test_bit(STATUS_EXIT_PENDING, &priv->status))
                return;
 
@@ -3003,8 +2996,8 @@ static void iwl_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
 
        spin_lock_irqsave(&priv->lock, flags);
        iwl_read32(priv, CSR_UCODE_DRV_GP1);
-       if (!iwl_grab_restricted_access(priv))
-               iwl_release_restricted_access(priv);
+       if (!iwl_grab_nic_access(priv))
+               iwl_release_nic_access(priv);
        spin_unlock_irqrestore(&priv->lock, flags);
 
        if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
@@ -3961,13 +3954,13 @@ int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
                        goto exit_unlock;
                }
 
-               rc = iwl_grab_restricted_access(priv);
+               rc = iwl_grab_nic_access(priv);
                if (rc)
                        goto exit_unlock;
 
-               iwl_write_restricted(priv, FH_RSCSR_CHNL0_WPTR,
+               iwl_write_direct32(priv, FH_RSCSR_CHNL0_WPTR,
                                     q->write & ~0x7);
-               iwl_release_restricted_access(priv);
+               iwl_release_nic_access(priv);
        } else
                iwl_write32(priv, FH_RSCSR_CHNL0_WPTR, q->write & ~0x7);
 
@@ -4359,12 +4352,12 @@ int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
                }
 
                /* restore this queue's parameters in nic hardware. */
-               rc = iwl_grab_restricted_access(priv);
+               rc = iwl_grab_nic_access(priv);
                if (rc)
                        return rc;
-               iwl_write_restricted(priv, HBUS_TARG_WRPTR,
+               iwl_write_direct32(priv, HBUS_TARG_WRPTR,
                                     txq->q.write_ptr | (txq_id << 8));
-               iwl_release_restricted_access(priv);
+               iwl_release_nic_access(priv);
 
        /* else not in power-save mode, uCode will never sleep when we're
         * trying to tx (during RFKILL, we're not trying to tx). */
@@ -4458,13 +4451,13 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv)
                return;
        }
 
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc) {
                IWL_WARNING("Can not read from adapter at this time.\n");
                return;
        }
 
-       count = iwl_read_restricted_mem(priv, base);
+       count = iwl_read_targ_mem(priv, base);
 
        if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
                IWL_ERROR("Start IWL Error Log Dump:\n");
@@ -4477,19 +4470,19 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv)
        for (i = ERROR_START_OFFSET;
             i < (count * ERROR_ELEM_SIZE) + ERROR_START_OFFSET;
             i += ERROR_ELEM_SIZE) {
-               desc = iwl_read_restricted_mem(priv, base + i);
+               desc = iwl_read_targ_mem(priv, base + i);
                time =
-                   iwl_read_restricted_mem(priv, base + i + 1 * sizeof(u32));
+                   iwl_read_targ_mem(priv, base + i + 1 * sizeof(u32));
                blink1 =
-                   iwl_read_restricted_mem(priv, base + i + 2 * sizeof(u32));
+                   iwl_read_targ_mem(priv, base + i + 2 * sizeof(u32));
                blink2 =
-                   iwl_read_restricted_mem(priv, base + i + 3 * sizeof(u32));
+                   iwl_read_targ_mem(priv, base + i + 3 * sizeof(u32));
                ilink1 =
-                   iwl_read_restricted_mem(priv, base + i + 4 * sizeof(u32));
+                   iwl_read_targ_mem(priv, base + i + 4 * sizeof(u32));
                ilink2 =
-                   iwl_read_restricted_mem(priv, base + i + 5 * sizeof(u32));
+                   iwl_read_targ_mem(priv, base + i + 5 * sizeof(u32));
                data1 =
-                   iwl_read_restricted_mem(priv, base + i + 6 * sizeof(u32));
+                   iwl_read_targ_mem(priv, base + i + 6 * sizeof(u32));
 
                IWL_ERROR
                    ("%-13s (#%d) %010u 0x%05X 0x%05X 0x%05X 0x%05X %u\n\n",
@@ -4497,7 +4490,7 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv)
                     ilink1, ilink2, data1);
        }
 
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 
 }
 
@@ -4506,7 +4499,7 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv)
 /**
  * iwl_print_event_log - Dump error event log to syslog
  *
- * NOTE: Must be called with iwl_grab_restricted_access() already obtained!
+ * NOTE: Must be called with iwl_grab_nic_access() already obtained!
  */
 static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
                                u32 num_events, u32 mode)
@@ -4532,14 +4525,14 @@ static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
        /* "time" is actually "data" for mode 0 (no timestamp).
         * place event id # at far right for easier visual parsing. */
        for (i = 0; i < num_events; i++) {
-               ev = iwl_read_restricted_mem(priv, ptr);
+               ev = iwl_read_targ_mem(priv, ptr);
                ptr += sizeof(u32);
-               time = iwl_read_restricted_mem(priv, ptr);
+               time = iwl_read_targ_mem(priv, ptr);
                ptr += sizeof(u32);
                if (mode == 0)
                        IWL_ERROR("0x%08x\t%04u\n", time, ev); /* data, ev */
                else {
-                       data = iwl_read_restricted_mem(priv, ptr);
+                       data = iwl_read_targ_mem(priv, ptr);
                        ptr += sizeof(u32);
                        IWL_ERROR("%010u\t0x%08x\t%04u\n", time, data, ev);
                }
@@ -4562,24 +4555,24 @@ static void iwl_dump_nic_event_log(struct iwl_priv *priv)
                return;
        }
 
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc) {
                IWL_WARNING("Can not read from adapter at this time.\n");
                return;
        }
 
        /* event log header */
-       capacity = iwl_read_restricted_mem(priv, base);
-       mode = iwl_read_restricted_mem(priv, base + (1 * sizeof(u32)));
-       num_wraps = iwl_read_restricted_mem(priv, base + (2 * sizeof(u32)));
-       next_entry = iwl_read_restricted_mem(priv, base + (3 * sizeof(u32)));
+       capacity = iwl_read_targ_mem(priv, base);
+       mode = iwl_read_targ_mem(priv, base + (1 * sizeof(u32)));
+       num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
+       next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
 
        size = num_wraps ? capacity : next_entry;
 
        /* bail out if nothing in log */
        if (size == 0) {
                IWL_ERROR("Start IWL Event Log Dump: nothing in log\n");
-               iwl_release_restricted_access(priv);
+               iwl_release_nic_access(priv);
                return;
        }
 
@@ -4595,7 +4588,7 @@ static void iwl_dump_nic_event_log(struct iwl_priv *priv)
        /* (then/else) start at top of log */
        iwl_print_event_log(priv, 0, next_entry, mode);
 
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 }
 
 /**
@@ -4786,11 +4779,11 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
                IWL_DEBUG_ISR("Tx interrupt\n");
 
                iwl_write32(priv, CSR_FH_INT_STATUS, (1 << 6));
-               if (!iwl_grab_restricted_access(priv)) {
-                       iwl_write_restricted(priv,
+               if (!iwl_grab_nic_access(priv)) {
+                       iwl_write_direct32(priv,
                                             FH_TCSR_CREDIT
                                             (ALM_FH_SRVC_CHNL), 0x0);
-                       iwl_release_restricted_access(priv);
+                       iwl_release_nic_access(priv);
                }
                handled |= CSR_INT_BIT_FH_TX;
        }
@@ -5494,18 +5487,18 @@ static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 * image, u32 len)
 
        IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
 
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc)
                return rc;
 
-       iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR, RTC_INST_LOWER_BOUND);
+       iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, RTC_INST_LOWER_BOUND);
 
        errcnt = 0;
        for (; len > 0; len -= sizeof(u32), image++) {
                /* read data comes through single port, auto-incr addr */
                /* NOTE: Use the debugless read so we don't flood kernel log
                 * if IWL_DL_IO is set */
-               val = _iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
+               val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
                if (val != le32_to_cpu(*image)) {
                        IWL_ERROR("uCode INST section is invalid at "
                                  "offset 0x%x, is 0x%x, s/b 0x%x\n",
@@ -5517,7 +5510,7 @@ static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 * image, u32 len)
                }
        }
 
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 
        if (!errcnt)
                IWL_DEBUG_INFO("ucode image in INSTRUCTION memory is good\n");
@@ -5540,7 +5533,7 @@ static int iwl_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
 
        IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
 
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc)
                return rc;
 
@@ -5548,9 +5541,9 @@ static int iwl_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
                /* read data comes through single port, auto-incr addr */
                /* NOTE: Use the debugless read so we don't flood kernel log
                 * if IWL_DL_IO is set */
-               iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR,
+               iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR,
                        i + RTC_INST_LOWER_BOUND);
-               val = _iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
+               val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
                if (val != le32_to_cpu(*image)) {
 #if 0 /* Enable this if you want to see details */
                        IWL_ERROR("uCode INST section is invalid at "
@@ -5564,7 +5557,7 @@ static int iwl_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
                }
        }
 
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 
        return rc;
 }
@@ -5630,11 +5623,11 @@ static int iwl_verify_bsm(struct iwl_priv *priv)
        IWL_DEBUG_INFO("Begin verify bsm\n");
 
        /* verify BSM SRAM contents */
-       val = iwl_read_restricted_reg(priv, BSM_WR_DWCOUNT_REG);
+       val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG);
        for (reg = BSM_SRAM_LOWER_BOUND;
             reg < BSM_SRAM_LOWER_BOUND + len;
             reg += sizeof(u32), image ++) {
-               val = iwl_read_restricted_reg(priv, reg);
+               val = iwl_read_prph(priv, reg);
                if (val != le32_to_cpu(*image)) {
                        IWL_ERROR("BSM uCode verification failed at "
                                  "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
@@ -5711,42 +5704,42 @@ static int iwl_load_bsm(struct iwl_priv *priv)
        inst_len = priv->ucode_init.len;
        data_len = priv->ucode_init_data.len;
 
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc)
                return rc;
 
-       iwl_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, pinst);
-       iwl_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, pdata);
-       iwl_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG, inst_len);
-       iwl_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG, data_len);
+       iwl_write_prph(priv, BSM_DRAM_INST_PTR_REG, pinst);
+       iwl_write_prph(priv, BSM_DRAM_DATA_PTR_REG, pdata);
+       iwl_write_prph(priv, BSM_DRAM_INST_BYTECOUNT_REG, inst_len);
+       iwl_write_prph(priv, BSM_DRAM_DATA_BYTECOUNT_REG, data_len);
 
        /* Fill BSM memory with bootstrap instructions */
        for (reg_offset = BSM_SRAM_LOWER_BOUND;
             reg_offset < BSM_SRAM_LOWER_BOUND + len;
             reg_offset += sizeof(u32), image++)
-               _iwl_write_restricted_reg(priv, reg_offset,
+               _iwl_write_prph(priv, reg_offset,
                                          le32_to_cpu(*image));
 
        rc = iwl_verify_bsm(priv);
        if (rc) {
-               iwl_release_restricted_access(priv);
+               iwl_release_nic_access(priv);
                return rc;
        }
 
        /* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */
-       iwl_write_restricted_reg(priv, BSM_WR_MEM_SRC_REG, 0x0);
-       iwl_write_restricted_reg(priv, BSM_WR_MEM_DST_REG,
+       iwl_write_prph(priv, BSM_WR_MEM_SRC_REG, 0x0);
+       iwl_write_prph(priv, BSM_WR_MEM_DST_REG,
                                 RTC_INST_LOWER_BOUND);
-       iwl_write_restricted_reg(priv, BSM_WR_DWCOUNT_REG, len / sizeof(u32));
+       iwl_write_prph(priv, BSM_WR_DWCOUNT_REG, len / sizeof(u32));
 
        /* Load bootstrap code into instruction SRAM now,
         *   to prepare to load "initialize" uCode */
-       iwl_write_restricted_reg(priv, BSM_WR_CTRL_REG,
+       iwl_write_prph(priv, BSM_WR_CTRL_REG,
                BSM_WR_CTRL_REG_BIT_START);
 
        /* Wait for load of bootstrap uCode to finish */
        for (i = 0; i < 100; i++) {
-               done = iwl_read_restricted_reg(priv, BSM_WR_CTRL_REG);
+               done = iwl_read_prph(priv, BSM_WR_CTRL_REG);
                if (!(done & BSM_WR_CTRL_REG_BIT_START))
                        break;
                udelay(10);
@@ -5760,10 +5753,10 @@ static int iwl_load_bsm(struct iwl_priv *priv)
 
        /* Enable future boot loads whenever power management unit triggers it
         *   (e.g. when powering back up after power-save shutdown) */
-       iwl_write_restricted_reg(priv, BSM_WR_CTRL_REG,
+       iwl_write_prph(priv, BSM_WR_CTRL_REG,
                BSM_WR_CTRL_REG_BIT_START_EN);
 
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 
        return 0;
 }
@@ -6004,24 +5997,24 @@ static int iwl_set_ucode_ptrs(struct iwl_priv *priv)
        pdata = priv->ucode_data_backup.p_addr;
 
        spin_lock_irqsave(&priv->lock, flags);
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc) {
                spin_unlock_irqrestore(&priv->lock, flags);
                return rc;
        }
 
        /* Tell bootstrap uCode where to find image to load */
-       iwl_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, pinst);
-       iwl_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, pdata);
-       iwl_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG,
+       iwl_write_prph(priv, BSM_DRAM_INST_PTR_REG, pinst);
+       iwl_write_prph(priv, BSM_DRAM_DATA_PTR_REG, pdata);
+       iwl_write_prph(priv, BSM_DRAM_DATA_BYTECOUNT_REG,
                                 priv->ucode_data.len);
 
        /* Inst bytecount must be last to set up, bit 31 signals uCode
         *   that all new ptr/size info is in place */
-       iwl_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG,
+       iwl_write_prph(priv, BSM_DRAM_INST_BYTECOUNT_REG,
                                 priv->ucode_code.len | BSM_DRAM_INST_LOAD);
 
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 
        spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -6110,15 +6103,15 @@ static void iwl_alive_start(struct iwl_priv *priv)
 
        iwl_clear_stations_table(priv);
 
-       rc = iwl_grab_restricted_access(priv);
+       rc = iwl_grab_nic_access(priv);
        if (rc) {
                IWL_WARNING("Can not read rfkill status from adapter\n");
                return;
        }
 
-       rfkill = iwl_read_restricted_reg(priv, APMG_RFKILL_REG);
+       rfkill = iwl_read_prph(priv, APMG_RFKILL_REG);
        IWL_DEBUG_INFO("RFKILL status: 0x%x\n", rfkill);
-       iwl_release_restricted_access(priv);
+       iwl_release_nic_access(priv);
 
        if (rfkill & 0x1) {
                clear_bit(STATUS_RF_KILL_HW, &priv->status);
@@ -6280,10 +6273,10 @@ static void __iwl_down(struct iwl_priv *priv)
        iwl_hw_rxq_stop(priv);
 
        spin_lock_irqsave(&priv->lock, flags);
-       if (!iwl_grab_restricted_access(priv)) {
-               iwl_write_restricted_reg(priv, APMG_CLK_DIS_REG,
+       if (!iwl_grab_nic_access(priv)) {
+               iwl_write_prph(priv, APMG_CLK_DIS_REG,
                                         APMG_CLK_VAL_DMA_CLK_RQT);
-               iwl_release_restricted_access(priv);
+               iwl_release_nic_access(priv);
        }
        spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -8680,10 +8673,10 @@ static void iwl_resume(struct iwl_priv *priv)
        spin_lock_irqsave(&priv->lock, flags);
        iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
 
-       if (!iwl_grab_restricted_access(priv)) {
-               iwl_write_restricted_reg(priv, APMG_CLK_DIS_REG,
+       if (!iwl_grab_nic_access(priv)) {
+               iwl_write_prph(priv, APMG_CLK_DIS_REG,
                                         APMG_CLK_VAL_DMA_CLK_RQT);
-               iwl_release_restricted_access(priv);
+               iwl_release_nic_access(priv);
        }
        spin_unlock_irqrestore(&priv->lock, flags);