/* default is to dump the entire data segment */
        if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
+               struct iwl_trans *trans = trans(priv);
                priv->dbgfs_sram_offset = 0x800000;
-               if (priv->ucode_type == IWL_UCODE_INIT)
-                       priv->dbgfs_sram_len = trans(priv)->ucode_init.data.len;
+               if (trans->shrd->ucode_type == IWL_UCODE_INIT)
+                       priv->dbgfs_sram_len = trans->ucode_init.data.len;
                else
-                       priv->dbgfs_sram_len = trans(priv)->ucode_rt.data.len;
+                       priv->dbgfs_sram_len = trans->ucode_rt.data.len;
        }
        len = priv->dbgfs_sram_len;
 
 
        u32 ucode_ver;                  /* version of ucode, copy of
                                           iwl_ucode.ver */
 
-       enum iwl_ucode_type ucode_type;
        char firmware_name[25];
 
        struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
 
        struct iwl_ht_agg agg;
 };
 
+/**
+ * enum iwl_ucode_type
+ *
+ * The type of ucode currently loaded on the hardware.
+ *
+ * @IWL_UCODE_NONE: No ucode loaded
+ * @IWL_UCODE_REGULAR: Normal runtime ucode
+ * @IWL_UCODE_INIT: Initial ucode
+ * @IWL_UCODE_WOWLAN: Wake on Wireless enabled ucode
+ */
+enum iwl_ucode_type {
+       IWL_UCODE_NONE,
+       IWL_UCODE_REGULAR,
+       IWL_UCODE_INIT,
+       IWL_UCODE_WOWLAN,
+};
+
 /**
  * struct iwl_shared - shared fields for all the layers of the driver
  *
        struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT];
 
        wait_queue_head_t wait_command_queue;
+
+       /* ucode related variables */
+       enum iwl_ucode_type ucode_type;
 };
 
 /*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
 
                return -ENOMSG;
        }
        size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]);
-       switch (priv->ucode_type) {
+       switch (priv->shrd->ucode_type) {
        case IWL_UCODE_REGULAR:
                maxsize = trans(priv)->ucode_rt.data.len;
                break;
 
                IWL_TRANS_GET_PCIE_TRANS(trans);
 
        base = priv->device_pointers.error_event_table;
-       if (priv->ucode_type == IWL_UCODE_INIT) {
+       if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
                if (!base)
                        base = priv->init_errlog_ptr;
        } else {
                IWL_ERR(trans,
                        "Not valid error log pointer 0x%08X for %s uCode\n",
                        base,
-                       (priv->ucode_type == IWL_UCODE_INIT)
+                       (trans->shrd->ucode_type == IWL_UCODE_INIT)
                                        ? "Init" : "RT");
                return;
        }
                return pos;
 
        base = priv->device_pointers.log_event_table;
-       if (priv->ucode_type == IWL_UCODE_INIT) {
+       if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
                if (!base)
                        base = priv->init_evtlog_ptr;
        } else {
        struct iwl_priv *priv = priv(trans);
 
        base = priv->device_pointers.log_event_table;
-       if (priv->ucode_type == IWL_UCODE_INIT) {
+       if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
                logsize = priv->init_evtlog_size;
                if (!base)
                        base = priv->init_evtlog_ptr;
                IWL_ERR(trans,
                        "Invalid event log pointer 0x%08X for %s uCode\n",
                        base,
-                       (priv->ucode_type == IWL_UCODE_INIT)
+                       (trans->shrd->ucode_type == IWL_UCODE_INIT)
                                        ? "Init" : "RT");
                return -EINVAL;
        }
 
        struct fw_desc data;    /* firmware data image */
 };
 
-enum iwl_ucode_type {
-       IWL_UCODE_NONE,
-       IWL_UCODE_REGULAR,
-       IWL_UCODE_INIT,
-       IWL_UCODE_WOWLAN,
-};
-
 /**
  * struct iwl_trans - transport common data
  * @ops - pointer to iwl_trans_ops
 
 {
        struct iwl_notification_wait alive_wait;
        struct iwlagn_alive_data alive_data;
+       struct iwl_trans *trans = trans(priv);
        int ret;
        enum iwl_ucode_type old_type;
 
-       ret = iwl_trans_start_device(trans(priv));
+       ret = iwl_trans_start_device(trans);
        if (ret)
                return ret;
 
        iwlagn_init_notification_wait(priv, &alive_wait, REPLY_ALIVE,
                                      iwl_alive_fn, &alive_data);
 
-       old_type = priv->ucode_type;
-       priv->ucode_type = ucode_type;
+       old_type = trans->shrd->ucode_type;
+       trans->shrd->ucode_type = ucode_type;
 
-       ret = iwl_load_given_ucode(trans(priv), ucode_type);
+       ret = iwl_load_given_ucode(trans, ucode_type);
        if (ret) {
-               priv->ucode_type = old_type;
+               trans->shrd->ucode_type = old_type;
                iwlagn_remove_notification(priv, &alive_wait);
                return ret;
        }
 
-       iwl_trans_kick_nic(trans(priv));
+       iwl_trans_kick_nic(trans);
 
        /*
         * Some things may run in the background now, but we
         */
        ret = iwlagn_wait_notification(priv, &alive_wait, UCODE_ALIVE_TIMEOUT);
        if (ret) {
-               priv->ucode_type = old_type;
+               trans->shrd->ucode_type = old_type;
                return ret;
        }
 
        if (!alive_data.valid) {
                IWL_ERR(priv, "Loaded ucode is not valid!\n");
-               priv->ucode_type = old_type;
+               trans->shrd->ucode_type = old_type;
                return -EIO;
        }
 
         * skip it for WoWLAN.
         */
        if (ucode_type != IWL_UCODE_WOWLAN) {
-               ret = iwl_verify_ucode(trans(priv), ucode_type);
+               ret = iwl_verify_ucode(trans, ucode_type);
                if (ret) {
-                       priv->ucode_type = old_type;
+                       trans->shrd->ucode_type = old_type;
                        return ret;
                }
 
        if (ret) {
                IWL_WARN(priv,
                        "Could not complete ALIVE transition: %d\n", ret);
-               priv->ucode_type = old_type;
+               trans->shrd->ucode_type = old_type;
                return ret;
        }
 
        if (!trans(priv)->ucode_init.code.len)
                return 0;
 
-       if (priv->ucode_type != IWL_UCODE_NONE)
+       if (priv->shrd->ucode_type != IWL_UCODE_NONE)
                return 0;
 
        iwlagn_init_notification_wait(priv, &calib_wait,