Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d6acefc authored by Don Fry's avatar Don Fry Committed by Wey-Yi Guy
Browse files

iwlwifi: move ucode_type from iwl_priv to iwl_shared



Move the ucode_type variable from the iwl_priv to the iwl_shared
structure with associated code changes.

Signed-off-by: default avatarDon Fry <donald.h.fry@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 66128b14
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -234,11 +234,12 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,


	/* default is to dump the entire data segment */
	/* default is to dump the entire data segment */
	if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
	if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
		struct iwl_trans *trans = trans(priv);
		priv->dbgfs_sram_offset = 0x800000;
		priv->dbgfs_sram_offset = 0x800000;
		if (priv->ucode_type == IWL_UCODE_INIT)
		if (trans->shrd->ucode_type == IWL_UCODE_INIT)
			priv->dbgfs_sram_len = trans(priv)->ucode_init.data.len;
			priv->dbgfs_sram_len = trans->ucode_init.data.len;
		else
		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;
	len = priv->dbgfs_sram_len;


+0 −1
Original line number Original line Diff line number Diff line
@@ -889,7 +889,6 @@ struct iwl_priv {
	u32 ucode_ver;			/* version of ucode, copy of
	u32 ucode_ver;			/* version of ucode, copy of
					   iwl_ucode.ver */
					   iwl_ucode.ver */


	enum iwl_ucode_type ucode_type;
	char firmware_name[25];
	char firmware_name[25];


	struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
	struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
+20 −0
Original line number Original line Diff line number Diff line
@@ -256,6 +256,23 @@ struct iwl_tid_data {
	struct iwl_ht_agg agg;
	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_shared - shared fields for all the layers of the driver
 *
 *
@@ -300,6 +317,9 @@ struct iwl_shared {
	struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT];
	struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT];


	wait_queue_head_t wait_command_queue;
	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 */
/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
+1 −1
Original line number Original line Diff line number Diff line
@@ -710,7 +710,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
		return -ENOMSG;
		return -ENOMSG;
	}
	}
	size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]);
	size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]);
	switch (priv->ucode_type) {
	switch (priv->shrd->ucode_type) {
	case IWL_UCODE_REGULAR:
	case IWL_UCODE_REGULAR:
		maxsize = trans(priv)->ucode_rt.data.len;
		maxsize = trans(priv)->ucode_rt.data.len;
		break;
		break;
+5 −5
Original line number Original line Diff line number Diff line
@@ -595,7 +595,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
		IWL_TRANS_GET_PCIE_TRANS(trans);
		IWL_TRANS_GET_PCIE_TRANS(trans);


	base = priv->device_pointers.error_event_table;
	base = priv->device_pointers.error_event_table;
	if (priv->ucode_type == IWL_UCODE_INIT) {
	if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
		if (!base)
		if (!base)
			base = priv->init_errlog_ptr;
			base = priv->init_errlog_ptr;
	} else {
	} else {
@@ -607,7 +607,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
		IWL_ERR(trans,
		IWL_ERR(trans,
			"Not valid error log pointer 0x%08X for %s uCode\n",
			"Not valid error log pointer 0x%08X for %s uCode\n",
			base,
			base,
			(priv->ucode_type == IWL_UCODE_INIT)
			(trans->shrd->ucode_type == IWL_UCODE_INIT)
					? "Init" : "RT");
					? "Init" : "RT");
		return;
		return;
	}
	}
@@ -710,7 +710,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
		return pos;
		return pos;


	base = priv->device_pointers.log_event_table;
	base = priv->device_pointers.log_event_table;
	if (priv->ucode_type == IWL_UCODE_INIT) {
	if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
		if (!base)
		if (!base)
			base = priv->init_evtlog_ptr;
			base = priv->init_evtlog_ptr;
	} else {
	} else {
@@ -824,7 +824,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
	struct iwl_priv *priv = priv(trans);
	struct iwl_priv *priv = priv(trans);


	base = priv->device_pointers.log_event_table;
	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;
		logsize = priv->init_evtlog_size;
		if (!base)
		if (!base)
			base = priv->init_evtlog_ptr;
			base = priv->init_evtlog_ptr;
@@ -838,7 +838,7 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
		IWL_ERR(trans,
		IWL_ERR(trans,
			"Invalid event log pointer 0x%08X for %s uCode\n",
			"Invalid event log pointer 0x%08X for %s uCode\n",
			base,
			base,
			(priv->ucode_type == IWL_UCODE_INIT)
			(trans->shrd->ucode_type == IWL_UCODE_INIT)
					? "Init" : "RT");
					? "Init" : "RT");
		return -EINVAL;
		return -EINVAL;
	}
	}
Loading