iwlwifi: don't pass iwl_rx_mem_buffer to upper layers
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-ucode.c
index ea757098654d8d49d2c9a3333b770f69b80eb7ed..12e79d04374f5760c455ea28327e0a23bf151e01 100644 (file)
@@ -44,6 +44,7 @@
 #include "iwl-agn-calib.h"
 #include "iwl-trans.h"
 #include "iwl-fh.h"
+#include "iwl-op-mode.h"
 
 static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = {
        {COEX_CU_UNASSOC_IDLE_RP, COEX_CU_UNASSOC_IDLE_WP,
@@ -227,7 +228,7 @@ static int iwl_send_calib_cfg(struct iwl_trans *trans)
 }
 
 int iwlagn_rx_calib_result(struct iwl_priv *priv,
-                           struct iwl_rx_mem_buffer *rxb,
+                           struct iwl_rx_cmd_buffer *rxb,
                            struct iwl_device_cmd *cmd)
 {
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
@@ -687,12 +688,11 @@ int iwl_run_init_ucode(struct iwl_trans *trans)
 
 static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context);
 
-#define UCODE_EXPERIMENTAL_INDEX       100
 #define UCODE_EXPERIMENTAL_TAG         "exp"
 
 int __must_check iwl_request_firmware(struct iwl_nic *nic, bool first)
 {
-       struct iwl_cfg *cfg = cfg(nic);
+       const struct iwl_cfg *cfg = cfg(nic);
        const char *name_pre = cfg->fw_name_pre;
        char tag[8];
 
@@ -1045,9 +1045,8 @@ static int iwl_parse_tlv_firmware(struct iwl_nic *nic,
 static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
 {
        struct iwl_nic *nic = context;
-       struct iwl_cfg *cfg = cfg(nic);
+       const struct iwl_cfg *cfg = cfg(nic);
        struct iwl_fw *fw = &nic->fw;
-       struct iwl_priv *priv = priv(nic); /* temporary */
        struct iwl_ucode_header *ucode;
        int err;
        struct iwlagn_firmware_pieces pieces;
@@ -1127,10 +1126,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
 
        IWL_INFO(nic, "loaded firmware version %s", nic->fw.fw_version);
 
-       snprintf(priv->hw->wiphy->fw_version,
-                sizeof(priv->hw->wiphy->fw_version),
-                "%s", nic->fw.fw_version);
-
        /*
         * For any of the failures below (before allocating pci memory)
         * we will try to load a version with a smaller API -- maybe the
@@ -1232,30 +1227,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                nic->inst_evtlog_size =
                        cfg->base_params->max_event_log_size;
        nic->inst_errlog_ptr = pieces.inst_errlog_ptr;
-#ifndef CONFIG_IWLWIFI_P2P
-       fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
-#endif
-
-       priv->new_scan_threshold_behaviour =
-               !!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN);
-
-       if (!(cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE))
-               fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
-
-       /*
-        * if not PAN, then don't support P2P -- might be a uCode
-        * packaging bug or due to the eeprom check above
-        */
-       if (!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN))
-               fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_P2P;
 
-       if (fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) {
-               priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
-               nic->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
-       } else {
-               priv->sta_key_max_num = STA_KEY_MAX_NUM;
-               nic->shrd->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
-       }
        /*
         * figure out the offset of chain noise reset and gain commands
         * base on the size of standard phy calibration commands table size
@@ -1265,47 +1237,30 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                fw->ucode_capa.standard_phy_calibration_size =
                        IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE;
 
-       priv->phy_calib_chain_noise_reset_cmd =
-               fw->ucode_capa.standard_phy_calibration_size;
-       priv->phy_calib_chain_noise_gain_cmd =
-               fw->ucode_capa.standard_phy_calibration_size + 1;
+       /* We have our copies now, allow OS release its copies */
+       release_firmware(ucode_raw);
+       complete(&nic->request_firmware_complete);
 
-       /* initialize all valid contexts */
-       iwl_init_context(priv, fw->ucode_capa.flags);
+       nic->op_mode = iwl_dvm_ops.start(nic->shrd->trans);
 
-       /**************************************************
-        * This is still part of probe() in a sense...
-        *
-        * 9. Setup and register with mac80211 and debugfs
-        **************************************************/
-       err = iwlagn_mac_setup_register(priv, &fw->ucode_capa);
-       if (err)
+       if (!nic->op_mode)
                goto out_unbind;
 
-       err = iwl_dbgfs_register(priv, DRV_NAME);
-       if (err)
-               IWL_ERR(nic,
-                       "failed to create debugfs files. Ignoring error: %d\n",
-                       err);
-
-       /* We have our copies now, allow OS release its copies */
-       release_firmware(ucode_raw);
-       complete(&nic->request_firmware_complete);
        return;
 
  try_again:
        /* try next, if any */
+       release_firmware(ucode_raw);
        if (iwl_request_firmware(nic, false))
                goto out_unbind;
-       release_firmware(ucode_raw);
        return;
 
  err_pci_alloc:
        IWL_ERR(nic, "failed to allocate pci memory\n");
        iwl_dealloc_ucode(nic);
+       release_firmware(ucode_raw);
  out_unbind:
        complete(&nic->request_firmware_complete);
        device_release_driver(trans(nic)->dev);
-       release_firmware(ucode_raw);
 }
 
This page took 0.028903 seconds and 5 git commands to generate.