iwlagn: all function iwl-io.c receive iwl_bus
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-agn.c
index ca6bb7b1c96d01339ad6f7ec9b02028c406515fc..37d2043fb7e9cfcf1df323a5cf2eb401bdc12f0d 100644 (file)
@@ -251,7 +251,7 @@ static void iwl_bg_bt_runtime_config(struct work_struct *work)
                return;
 
        /* dont send host command if rf-kill is on */
-       if (!iwl_is_ready_rf(priv))
+       if (!iwl_is_ready_rf(priv->shrd))
                return;
        iwlagn_send_advance_bt_config(priv);
 }
@@ -268,7 +268,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)
                goto out;
 
        /* dont send host command if rf-kill is on */
-       if (!iwl_is_ready_rf(priv))
+       if (!iwl_is_ready_rf(priv->shrd))
                goto out;
 
        IWL_DEBUG_INFO(priv, "BT coex in %s mode\n",
@@ -307,7 +307,7 @@ static void iwl_bg_statistics_periodic(unsigned long data)
                return;
 
        /* dont send host command if rf-kill is on */
-       if (!iwl_is_ready_rf(priv))
+       if (!iwl_is_ready_rf(priv->shrd))
                return;
 
        iwl_send_statistics_request(priv, CMD_ASYNC, false);
@@ -329,14 +329,14 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
                ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32));
 
        /* Make sure device is powered up for SRAM reads */
-       spin_lock_irqsave(&priv->reg_lock, reg_flags);
-       if (iwl_grab_nic_access(priv)) {
-               spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
+       spin_lock_irqsave(&bus(priv)->reg_lock, reg_flags);
+       if (iwl_grab_nic_access(bus(priv))) {
+               spin_unlock_irqrestore(&bus(priv)->reg_lock, reg_flags);
                return;
        }
 
        /* Set starting address; reads will auto-increment */
-       iwl_write32(priv, HBUS_TARG_MEM_RADDR, ptr);
+       iwl_write32(bus(priv), HBUS_TARG_MEM_RADDR, ptr);
        rmb();
 
        /*
@@ -344,20 +344,20 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
         * place event id # at far right for easier visual parsing.
         */
        for (i = 0; i < num_events; i++) {
-               ev = iwl_read32(priv, HBUS_TARG_MEM_RDAT);
-               time = iwl_read32(priv, HBUS_TARG_MEM_RDAT);
+               ev = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT);
+               time = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT);
                if (mode == 0) {
                        trace_iwlwifi_dev_ucode_cont_event(priv,
                                                        0, time, ev);
                } else {
-                       data = iwl_read32(priv, HBUS_TARG_MEM_RDAT);
+                       data = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT);
                        trace_iwlwifi_dev_ucode_cont_event(priv,
                                                time, data, ev);
                }
        }
        /* Allow device to power down */
-       iwl_release_nic_access(priv);
-       spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
+       iwl_release_nic_access(bus(priv));
+       spin_unlock_irqrestore(&bus(priv)->reg_lock, reg_flags);
 }
 
 static void iwl_continuous_event_trace(struct iwl_priv *priv)
@@ -370,10 +370,12 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
 
        base = priv->device_pointers.error_event_table;
        if (iwlagn_hw_valid_rtc_data_addr(base)) {
-               capacity = iwl_read_targ_mem(priv, base);
-               num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
-               mode = iwl_read_targ_mem(priv, base + (1 * sizeof(u32)));
-               next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
+               capacity = iwl_read_targ_mem(bus(priv), base);
+               num_wraps = iwl_read_targ_mem(bus(priv),
+                                               base + (2 * sizeof(u32)));
+               mode = iwl_read_targ_mem(bus(priv), base + (1 * sizeof(u32)));
+               next_entry = iwl_read_targ_mem(bus(priv),
+                                               base + (3 * sizeof(u32)));
        } else
                return;
 
@@ -444,7 +446,7 @@ static void iwl_bg_tx_flush(struct work_struct *work)
                return;
 
        /* do nothing if rf-kill is on */
-       if (!iwl_is_ready_rf(priv))
+       if (!iwl_is_ready_rf(priv->shrd))
                return;
 
        IWL_DEBUG_INFO(priv, "device request: flush all tx frames\n");
@@ -510,7 +512,7 @@ static ssize_t show_temperature(struct device *d,
        struct iwl_shared *shrd = dev_get_drvdata(d);
        struct iwl_priv *priv = shrd->priv;
 
-       if (!iwl_is_alive(priv))
+       if (!iwl_is_alive(priv->shrd))
                return -EAGAIN;
 
        return sprintf(buf, "%d\n", priv->temperature);
@@ -523,7 +525,7 @@ static ssize_t show_tx_power(struct device *d,
 {
        struct iwl_priv *priv = dev_get_drvdata(d);
 
-       if (!iwl_is_ready_rf(priv))
+       if (!iwl_is_ready_rf(priv->shrd))
                return sprintf(buf, "off\n");
        else
                return sprintf(buf, "%d\n", priv->tx_power_user_lmt);
@@ -1308,364 +1310,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
        release_firmware(ucode_raw);
 }
 
-static const char * const desc_lookup_text[] = {
-       "OK",
-       "FAIL",
-       "BAD_PARAM",
-       "BAD_CHECKSUM",
-       "NMI_INTERRUPT_WDG",
-       "SYSASSERT",
-       "FATAL_ERROR",
-       "BAD_COMMAND",
-       "HW_ERROR_TUNE_LOCK",
-       "HW_ERROR_TEMPERATURE",
-       "ILLEGAL_CHAN_FREQ",
-       "VCC_NOT_STABLE",
-       "FH_ERROR",
-       "NMI_INTERRUPT_HOST",
-       "NMI_INTERRUPT_ACTION_PT",
-       "NMI_INTERRUPT_UNKNOWN",
-       "UCODE_VERSION_MISMATCH",
-       "HW_ERROR_ABS_LOCK",
-       "HW_ERROR_CAL_LOCK_FAIL",
-       "NMI_INTERRUPT_INST_ACTION_PT",
-       "NMI_INTERRUPT_DATA_ACTION_PT",
-       "NMI_TRM_HW_ER",
-       "NMI_INTERRUPT_TRM",
-       "NMI_INTERRUPT_BREAK_POINT",
-       "DEBUG_0",
-       "DEBUG_1",
-       "DEBUG_2",
-       "DEBUG_3",
-};
-
-static struct { char *name; u8 num; } advanced_lookup[] = {
-       { "NMI_INTERRUPT_WDG", 0x34 },
-       { "SYSASSERT", 0x35 },
-       { "UCODE_VERSION_MISMATCH", 0x37 },
-       { "BAD_COMMAND", 0x38 },
-       { "NMI_INTERRUPT_DATA_ACTION_PT", 0x3C },
-       { "FATAL_ERROR", 0x3D },
-       { "NMI_TRM_HW_ERR", 0x46 },
-       { "NMI_INTERRUPT_TRM", 0x4C },
-       { "NMI_INTERRUPT_BREAK_POINT", 0x54 },
-       { "NMI_INTERRUPT_WDG_RXF_FULL", 0x5C },
-       { "NMI_INTERRUPT_WDG_NO_RBD_RXF_FULL", 0x64 },
-       { "NMI_INTERRUPT_HOST", 0x66 },
-       { "NMI_INTERRUPT_ACTION_PT", 0x7C },
-       { "NMI_INTERRUPT_UNKNOWN", 0x84 },
-       { "NMI_INTERRUPT_INST_ACTION_PT", 0x86 },
-       { "ADVANCED_SYSASSERT", 0 },
-};
-
-static const char *desc_lookup(u32 num)
-{
-       int i;
-       int max = ARRAY_SIZE(desc_lookup_text);
-
-       if (num < max)
-               return desc_lookup_text[num];
-
-       max = ARRAY_SIZE(advanced_lookup) - 1;
-       for (i = 0; i < max; i++) {
-               if (advanced_lookup[i].num == num)
-                       break;
-       }
-       return advanced_lookup[i].name;
-}
-
-#define ERROR_START_OFFSET  (1 * sizeof(u32))
-#define ERROR_ELEM_SIZE     (7 * sizeof(u32))
-
-void iwl_dump_nic_error_log(struct iwl_priv *priv)
-{
-       u32 base;
-       struct iwl_error_event_table table;
-
-       base = priv->device_pointers.error_event_table;
-       if (priv->ucode_type == IWL_UCODE_INIT) {
-               if (!base)
-                       base = priv->init_errlog_ptr;
-       } else {
-               if (!base)
-                       base = priv->inst_errlog_ptr;
-       }
-
-       if (!iwlagn_hw_valid_rtc_data_addr(base)) {
-               IWL_ERR(priv,
-                       "Not valid error log pointer 0x%08X for %s uCode\n",
-                       base,
-                       (priv->ucode_type == IWL_UCODE_INIT)
-                                       ? "Init" : "RT");
-               return;
-       }
-
-       iwl_read_targ_mem_words(priv, base, &table, sizeof(table));
-
-       if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) {
-               IWL_ERR(priv, "Start IWL Error Log Dump:\n");
-               IWL_ERR(priv, "Status: 0x%08lX, count: %d\n",
-                       priv->shrd->status, table.valid);
-       }
-
-       priv->isr_stats.err_code = table.error_id;
-
-       trace_iwlwifi_dev_ucode_error(priv, table.error_id, table.tsf_low,
-                                     table.data1, table.data2, table.line,
-                                     table.blink1, table.blink2, table.ilink1,
-                                     table.ilink2, table.bcon_time, table.gp1,
-                                     table.gp2, table.gp3, table.ucode_ver,
-                                     table.hw_ver, table.brd_ver);
-       IWL_ERR(priv, "0x%08X | %-28s\n", table.error_id,
-               desc_lookup(table.error_id));
-       IWL_ERR(priv, "0x%08X | uPc\n", table.pc);
-       IWL_ERR(priv, "0x%08X | branchlink1\n", table.blink1);
-       IWL_ERR(priv, "0x%08X | branchlink2\n", table.blink2);
-       IWL_ERR(priv, "0x%08X | interruptlink1\n", table.ilink1);
-       IWL_ERR(priv, "0x%08X | interruptlink2\n", table.ilink2);
-       IWL_ERR(priv, "0x%08X | data1\n", table.data1);
-       IWL_ERR(priv, "0x%08X | data2\n", table.data2);
-       IWL_ERR(priv, "0x%08X | line\n", table.line);
-       IWL_ERR(priv, "0x%08X | beacon time\n", table.bcon_time);
-       IWL_ERR(priv, "0x%08X | tsf low\n", table.tsf_low);
-       IWL_ERR(priv, "0x%08X | tsf hi\n", table.tsf_hi);
-       IWL_ERR(priv, "0x%08X | time gp1\n", table.gp1);
-       IWL_ERR(priv, "0x%08X | time gp2\n", table.gp2);
-       IWL_ERR(priv, "0x%08X | time gp3\n", table.gp3);
-       IWL_ERR(priv, "0x%08X | uCode version\n", table.ucode_ver);
-       IWL_ERR(priv, "0x%08X | hw version\n", table.hw_ver);
-       IWL_ERR(priv, "0x%08X | board version\n", table.brd_ver);
-       IWL_ERR(priv, "0x%08X | hcmd\n", table.hcmd);
-}
-
-#define EVENT_START_OFFSET  (4 * sizeof(u32))
-
-/**
- * iwl_print_event_log - Dump error event log to syslog
- *
- */
-static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
-                              u32 num_events, u32 mode,
-                              int pos, char **buf, size_t bufsz)
-{
-       u32 i;
-       u32 base;       /* SRAM byte address of event log header */
-       u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
-       u32 ptr;        /* SRAM byte address of log data */
-       u32 ev, time, data; /* event log data */
-       unsigned long reg_flags;
-
-       if (num_events == 0)
-               return pos;
-
-       base = priv->device_pointers.log_event_table;
-       if (priv->ucode_type == IWL_UCODE_INIT) {
-               if (!base)
-                       base = priv->init_evtlog_ptr;
-       } else {
-               if (!base)
-                       base = priv->inst_evtlog_ptr;
-       }
-
-       if (mode == 0)
-               event_size = 2 * sizeof(u32);
-       else
-               event_size = 3 * sizeof(u32);
-
-       ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
-
-       /* Make sure device is powered up for SRAM reads */
-       spin_lock_irqsave(&priv->reg_lock, reg_flags);
-       iwl_grab_nic_access(priv);
-
-       /* Set starting address; reads will auto-increment */
-       iwl_write32(priv, HBUS_TARG_MEM_RADDR, ptr);
-       rmb();
-
-       /* "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_read32(priv, HBUS_TARG_MEM_RDAT);
-               time = iwl_read32(priv, HBUS_TARG_MEM_RDAT);
-               if (mode == 0) {
-                       /* data, ev */
-                       if (bufsz) {
-                               pos += scnprintf(*buf + pos, bufsz - pos,
-                                               "EVT_LOG:0x%08x:%04u\n",
-                                               time, ev);
-                       } else {
-                               trace_iwlwifi_dev_ucode_event(priv, 0,
-                                       time, ev);
-                               IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n",
-                                       time, ev);
-                       }
-               } else {
-                       data = iwl_read32(priv, HBUS_TARG_MEM_RDAT);
-                       if (bufsz) {
-                               pos += scnprintf(*buf + pos, bufsz - pos,
-                                               "EVT_LOGT:%010u:0x%08x:%04u\n",
-                                                time, data, ev);
-                       } else {
-                               IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n",
-                                       time, data, ev);
-                               trace_iwlwifi_dev_ucode_event(priv, time,
-                                       data, ev);
-                       }
-               }
-       }
-
-       /* Allow device to power down */
-       iwl_release_nic_access(priv);
-       spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
-       return pos;
-}
-
-/**
- * iwl_print_last_event_logs - Dump the newest # of event log to syslog
- */
-static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
-                                   u32 num_wraps, u32 next_entry,
-                                   u32 size, u32 mode,
-                                   int pos, char **buf, size_t bufsz)
-{
-       /*
-        * display the newest DEFAULT_LOG_ENTRIES entries
-        * i.e the entries just before the next ont that uCode would fill.
-        */
-       if (num_wraps) {
-               if (next_entry < size) {
-                       pos = iwl_print_event_log(priv,
-                                               capacity - (size - next_entry),
-                                               size - next_entry, mode,
-                                               pos, buf, bufsz);
-                       pos = iwl_print_event_log(priv, 0,
-                                                 next_entry, mode,
-                                                 pos, buf, bufsz);
-               } else
-                       pos = iwl_print_event_log(priv, next_entry - size,
-                                                 size, mode, pos, buf, bufsz);
-       } else {
-               if (next_entry < size) {
-                       pos = iwl_print_event_log(priv, 0, next_entry,
-                                                 mode, pos, buf, bufsz);
-               } else {
-                       pos = iwl_print_event_log(priv, next_entry - size,
-                                                 size, mode, pos, buf, bufsz);
-               }
-       }
-       return pos;
-}
-
-#define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20)
-
-int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
-                           char **buf, bool display)
-{
-       u32 base;       /* SRAM byte address of event log header */
-       u32 capacity;   /* event log capacity in # entries */
-       u32 mode;       /* 0 - no timestamp, 1 - timestamp recorded */
-       u32 num_wraps;  /* # times uCode wrapped to top of log */
-       u32 next_entry; /* index of next entry to be written by uCode */
-       u32 size;       /* # entries that we'll print */
-       u32 logsize;
-       int pos = 0;
-       size_t bufsz = 0;
-
-       base = priv->device_pointers.log_event_table;
-       if (priv->ucode_type == IWL_UCODE_INIT) {
-               logsize = priv->init_evtlog_size;
-               if (!base)
-                       base = priv->init_evtlog_ptr;
-       } else {
-               logsize = priv->inst_evtlog_size;
-               if (!base)
-                       base = priv->inst_evtlog_ptr;
-       }
-
-       if (!iwlagn_hw_valid_rtc_data_addr(base)) {
-               IWL_ERR(priv,
-                       "Invalid event log pointer 0x%08X for %s uCode\n",
-                       base,
-                       (priv->ucode_type == IWL_UCODE_INIT)
-                                       ? "Init" : "RT");
-               return -EINVAL;
-       }
-
-       /* event log header */
-       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)));
-
-       if (capacity > logsize) {
-               IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
-                       capacity, logsize);
-               capacity = logsize;
-       }
-
-       if (next_entry > logsize) {
-               IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
-                       next_entry, logsize);
-               next_entry = logsize;
-       }
-
-       size = num_wraps ? capacity : next_entry;
-
-       /* bail out if nothing in log */
-       if (size == 0) {
-               IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
-               return pos;
-       }
-
-       /* enable/disable bt channel inhibition */
-       priv->bt_ch_announce = iwlagn_mod_params.bt_ch_announce;
-
-#ifdef CONFIG_IWLWIFI_DEBUG
-       if (!(iwl_get_debug_level(priv->shrd) & IWL_DL_FW_ERRORS) && !full_log)
-               size = (size > DEFAULT_DUMP_EVENT_LOG_ENTRIES)
-                       ? DEFAULT_DUMP_EVENT_LOG_ENTRIES : size;
-#else
-       size = (size > DEFAULT_DUMP_EVENT_LOG_ENTRIES)
-               ? DEFAULT_DUMP_EVENT_LOG_ENTRIES : size;
-#endif
-       IWL_ERR(priv, "Start IWL Event Log Dump: display last %u entries\n",
-               size);
-
-#ifdef CONFIG_IWLWIFI_DEBUG
-       if (display) {
-               if (full_log)
-                       bufsz = capacity * 48;
-               else
-                       bufsz = size * 48;
-               *buf = kmalloc(bufsz, GFP_KERNEL);
-               if (!*buf)
-                       return -ENOMEM;
-       }
-       if ((iwl_get_debug_level(priv->shrd) & IWL_DL_FW_ERRORS) || full_log) {
-               /*
-                * if uCode has wrapped back to top of log,
-                * start at the oldest entry,
-                * i.e the next one that uCode would fill.
-                */
-               if (num_wraps)
-                       pos = iwl_print_event_log(priv, next_entry,
-                                               capacity - next_entry, mode,
-                                               pos, buf, bufsz);
-               /* (then/else) start at top of log */
-               pos = iwl_print_event_log(priv, 0,
-                                         next_entry, mode, pos, buf, bufsz);
-       } else
-               pos = iwl_print_last_event_logs(priv, capacity, num_wraps,
-                                               next_entry, size, mode,
-                                               pos, buf, bufsz);
-#else
-       pos = iwl_print_last_event_logs(priv, capacity, num_wraps,
-                                       next_entry, size, mode,
-                                       pos, buf, bufsz);
-#endif
-       return pos;
-}
-
 static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
 {
        struct iwl_ct_kill_config cmd;
@@ -1674,7 +1318,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
        int ret = 0;
 
        spin_lock_irqsave(&priv->shrd->lock, flags);
-       iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
+       iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_CLR,
                    CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
        spin_unlock_irqrestore(&priv->shrd->lock, flags);
        priv->thermal_throttle.ct_kill_toggle = false;
@@ -1760,7 +1404,7 @@ int iwl_alive_start(struct iwl_priv *priv)
        struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
 
        /*TODO: this should go to the transport layer */
-       iwl_reset_ict(priv);
+       iwl_reset_ict(trans(priv));
 
        IWL_DEBUG_INFO(priv, "Runtime Alive received.\n");
 
@@ -1770,7 +1414,7 @@ int iwl_alive_start(struct iwl_priv *priv)
        /* Enable watchdog to monitor the driver tx queues */
        iwl_setup_watchdog(priv);
 
-       if (iwl_is_rfkill(priv))
+       if (iwl_is_rfkill(priv->shrd))
                return -ERFKILL;
 
        /* download priority table before any calibration request */
@@ -2292,7 +1936,7 @@ static void iwlagn_mac_stop(struct ieee80211_hw *hw)
 
        /* User space software may expect getting rfkill changes
         * even if interface is down */
-       iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
+       iwl_write32(bus(priv), CSR_INT, 0xFFFFFFFF);
        iwl_enable_rfkill_int(priv);
 
        IWL_DEBUG_MAC80211(priv, "leave\n");
@@ -2687,7 +2331,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
        device_set_wakeup_enable(priv->bus->dev, true);
 
        /* Now let the ucode operate on its own */
-       iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
+       iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_SET,
                          CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE);
 
        goto out;
@@ -2713,19 +2357,19 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
 
        mutex_lock(&priv->shrd->mutex);
 
-       iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
+       iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_CLR,
                          CSR_UCODE_DRV_GP1_BIT_D3_CFG_COMPLETE);
 
        base = priv->device_pointers.error_event_table;
        if (iwlagn_hw_valid_rtc_data_addr(base)) {
-               spin_lock_irqsave(&priv->reg_lock, flags);
-               ret = iwl_grab_nic_access_silent(priv);
+               spin_lock_irqsave(&bus(priv)->reg_lock, flags);
+               ret = iwl_grab_nic_access_silent(bus(priv));
                if (ret == 0) {
-                       iwl_write32(priv, HBUS_TARG_MEM_RADDR, base);
-                       status = iwl_read32(priv, HBUS_TARG_MEM_RDAT);
-                       iwl_release_nic_access(priv);
+                       iwl_write32(bus(priv), HBUS_TARG_MEM_RADDR, base);
+                       status = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT);
+                       iwl_release_nic_access(bus(priv));
                }
-               spin_unlock_irqrestore(&priv->reg_lock, flags);
+               spin_unlock_irqrestore(&bus(priv)->reg_lock, flags);
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
                if (ret == 0) {
@@ -2736,7 +2380,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
 
                        if (priv->wowlan_sram)
                                _iwl_read_targ_mem_words(
-                                       priv, 0x800000, priv->wowlan_sram,
+                                       bus(priv), 0x800000, priv->wowlan_sram,
                                        priv->ucode_wowlan.data.len / 4);
                }
 #endif
@@ -3059,7 +2703,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
 
        mutex_lock(&priv->shrd->mutex);
 
-       if (iwl_is_rfkill(priv))
+       if (iwl_is_rfkill(priv->shrd))
                goto out;
 
        if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) ||
@@ -3194,7 +2838,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
                IWL_DEBUG_TX(priv, "Aborting flush due to device shutdown\n");
                goto done;
        }
-       if (iwl_is_rfkill(priv)) {
+       if (iwl_is_rfkill(priv->shrd)) {
                IWL_DEBUG_TX(priv, "Aborting flush due to RF Kill\n");
                goto done;
        }
@@ -3417,7 +3061,6 @@ static int iwl_init_drv(struct iwl_priv *priv)
        int ret;
 
        spin_lock_init(&priv->shrd->sta_lock);
-       spin_lock_init(&priv->hcmd_lock);
 
        mutex_init(&priv->shrd->mutex);
 
@@ -3545,13 +3188,15 @@ struct ieee80211_ops iwlagn_hw_ops = {
 
 static u32 iwl_hw_detect(struct iwl_priv *priv)
 {
-       return iwl_read32(priv, CSR_HW_REV);
+       return iwl_read32(bus(priv), CSR_HW_REV);
 }
 
+/* Size of one Rx buffer in host DRAM */
+#define IWL_RX_BUF_SIZE_4K (4 * 1024)
+#define IWL_RX_BUF_SIZE_8K (8 * 1024)
+
 static int iwl_set_hw_params(struct iwl_priv *priv)
 {
-       hw_params(priv).max_rxq_size = RX_QUEUE_SIZE;
-       hw_params(priv).max_rxq_log = RX_QUEUE_SIZE_LOG;
        if (iwlagn_mod_params.amsdu_size_8K)
                hw_params(priv).rx_page_order =
                        get_order(IWL_RX_BUF_SIZE_8K);
@@ -3559,8 +3204,6 @@ static int iwl_set_hw_params(struct iwl_priv *priv)
                hw_params(priv).rx_page_order =
                        get_order(IWL_RX_BUF_SIZE_4K);
 
-       hw_params(priv).max_beacon_itrvl = IWL_MAX_UCODE_BEACON_INTERVAL;
-
        if (iwlagn_mod_params.disable_11n)
                priv->cfg->sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
 
@@ -3645,7 +3288,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
        /* these spin locks will be used in apm_ops.init and EEPROM access
         * we should init now
         */
-       spin_lock_init(&priv->reg_lock);
+       spin_lock_init(&bus(priv)->reg_lock);
        spin_lock_init(&priv->shrd->lock);
 
        /*
@@ -3653,7 +3296,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
         * strange state ... like being left stranded by a primary kernel
         * and this is now the kdump kernel trying to start up
         */
-       iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
+       iwl_write32(bus(priv), CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
 
        /***********************
         * 3. Read REV register
@@ -3734,7 +3377,8 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
        iwl_enable_rfkill_int(priv);
 
        /* If platform's RF_KILL switch is NOT set to KILL */
-       if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
+       if (iwl_read32(bus(priv),
+                       CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
                clear_bit(STATUS_RF_KILL_HW, &priv->shrd->status);
        else
                set_bit(STATUS_RF_KILL_HW, &priv->shrd->status);
@@ -3900,7 +3544,7 @@ MODULE_PARM_DESC(antenna_coupling,
 module_param_named(bt_ch_inhibition, iwlagn_mod_params.bt_ch_announce,
                   bool, S_IRUGO);
 MODULE_PARM_DESC(bt_ch_inhibition,
-                "Disable BT channel inhibition (default: enable)");
+                "Enable BT channel inhibition (default: enable)");
 
 module_param_named(plcp_check, iwlagn_mod_params.plcp_check, bool, S_IRUGO);
 MODULE_PARM_DESC(plcp_check, "Check plcp health (default: 1 [enabled])");
@@ -3946,6 +3590,11 @@ module_param_named(power_level, iwlagn_mod_params.power_level,
 MODULE_PARM_DESC(power_level,
                 "default power save level (range from 1 - 5, default: 1)");
 
+module_param_named(auto_agg, iwlagn_mod_params.auto_agg,
+               bool, S_IRUGO);
+MODULE_PARM_DESC(auto_agg,
+                "enable agg w/o check traffic load (default: enable)");
+
 /*
  * For now, keep using power level 1 instead of automatically
  * adjusting ...
This page took 0.048615 seconds and 5 git commands to generate.