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

Commit 947a9407 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

iwlwifi: move ucode_owner to priv



The transport doesn't really need to know as
we can enforce it in the command wrapper.
Move the ucode_owner variable into priv and
do all enforcing there.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4bd14dd5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1306,6 +1306,12 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
	if (cmd->flags & CMD_SYNC)
		lockdep_assert_held(&priv->mutex);

	if (priv->ucode_owner == IWL_OWNERSHIP_TM &&
	    !(cmd->flags & CMD_ON_DEMAND)) {
		IWL_DEBUG_HC(priv, "tm own the uCode, no regular hcmd send\n");
		return -EIO;
	}

	return iwl_trans_send_cmd(trans(priv), cmd);
}

+1 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,7 @@ int iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,
	iwl_notification_wait_notify(&priv->notif_wait, pkt);

	if (priv->pre_rx_handler &&
	    priv->shrd->ucode_owner == IWL_OWNERSHIP_TM)
	    priv->ucode_owner == IWL_OWNERSHIP_TM)
		priv->pre_rx_handler(priv, rxb);
	else {
		/* Based on type of command response or notification,
+2 −0
Original line number Diff line number Diff line
@@ -1053,6 +1053,8 @@ static int iwl_init_drv(struct iwl_priv *priv)
	priv->missed_beacon_threshold = IWL_MISSED_BEACON_THRESHOLD_DEF;
	priv->agg_tids_count = 0;

	priv->ucode_owner = IWL_OWNERSHIP_DRIVER;

	/* initialize force reset */
	priv->force_reset[IWL_RF_RESET].reset_duration =
		IWL_DELAY_NEXT_FORCE_RF_RESET;
+4 −0
Original line number Diff line number Diff line
@@ -748,6 +748,10 @@ struct iwl_priv {
	struct iwl_spectrum_notification measure_report;
	u8 measurement_status;

#define IWL_OWNERSHIP_DRIVER	0
#define IWL_OWNERSHIP_TM	1
	u8 ucode_owner;

	/* ucode beacon time */
	u32 ucode_beacon_time;
	int missed_beacon_threshold;
+0 −4
Original line number Diff line number Diff line
@@ -356,7 +356,6 @@ struct iwl_cfg {
/**
 * struct iwl_shared - shared fields for all the layers of the driver
 *
 * @ucode_owner: IWL_OWNERSHIP_*
 * @cmd_queue: command queue number
 * @status: STATUS_*
 * @wowlan: are we running wowlan uCode
@@ -374,9 +373,6 @@ struct iwl_cfg {
 * @device_pointers: pointers to ucode event tables
 */
struct iwl_shared {
#define IWL_OWNERSHIP_DRIVER	0
#define IWL_OWNERSHIP_TM	1
	u8 ucode_owner;
	u8 cmd_queue;
	unsigned long status;
	u8 valid_contexts;
Loading