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

Commit 3e10caeb authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlagn: remove priv dereferences from the transport layer



Another round of clean up on the transport layer.
Define a wrapper around wiphy_rfkill_set_hw_state to prevent the
transport layer from accessing priv->hw.
Also move wait_command_queue to the transport layer.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@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 65e291ac
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -114,7 +114,7 @@ static int iwlagn_load_section(struct iwl_priv *priv, const char *name,
		FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD);
		FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD);


	IWL_DEBUG_FW(priv, "%s uCode section being loaded...\n", name);
	IWL_DEBUG_FW(priv, "%s uCode section being loaded...\n", name);
	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
	ret = wait_event_interruptible_timeout(priv->shrd->wait_command_queue,
					priv->ucode_write_complete, 5 * HZ);
					priv->ucode_write_complete, 5 * HZ);
	if (ret == -ERESTARTSYS) {
	if (ret == -ERESTARTSYS) {
		IWL_ERR(priv, "Could not load the %s uCode section due "
		IWL_ERR(priv, "Could not load the %s uCode section due "
+1 −1
Original line number Original line Diff line number Diff line
@@ -3032,7 +3032,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
{
{
	priv->shrd->workqueue = create_singlethread_workqueue(DRV_NAME);
	priv->shrd->workqueue = create_singlethread_workqueue(DRV_NAME);


	init_waitqueue_head(&priv->wait_command_queue);
	init_waitqueue_head(&priv->shrd->wait_command_queue);


	INIT_WORK(&priv->restart, iwl_bg_restart);
	INIT_WORK(&priv->restart, iwl_bg_restart);
	INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
	INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
+6 −1
Original line number Original line Diff line number Diff line
@@ -868,7 +868,7 @@ void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
	 * commands by clearing the ready bit */
	 * commands by clearing the ready bit */
	clear_bit(STATUS_READY, &priv->shrd->status);
	clear_bit(STATUS_READY, &priv->shrd->status);


	wake_up_interruptible(&priv->wait_command_queue);
	wake_up_interruptible(&priv->shrd->wait_command_queue);


	if (!ondemand) {
	if (!ondemand) {
		/*
		/*
@@ -1865,3 +1865,8 @@ void iwl_stop_tx_ba_trans_ready(struct iwl_priv *priv,


	ieee80211_stop_tx_ba_cb_irqsafe(vif, addr, tid);
	ieee80211_stop_tx_ba_cb_irqsafe(vif, addr, tid);
}
}

void iwl_set_hw_rfkill_state(struct iwl_priv *priv, bool state)
{
	wiphy_rfkill_set_hw_state(priv->hw->wiphy, state);
}
+2 −4
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ struct iwl_cmd_meta {
	 * invoked for SYNC commands, if it were and its result passed
	 * invoked for SYNC commands, if it were and its result passed
	 * through it would be simpler...)
	 * through it would be simpler...)
	 */
	 */
	void (*callback)(struct iwl_priv *priv,
	void (*callback)(struct iwl_shared *shrd,
			 struct iwl_device_cmd *cmd,
			 struct iwl_device_cmd *cmd,
			 struct iwl_rx_packet *pkt);
			 struct iwl_rx_packet *pkt);


@@ -304,7 +304,7 @@ enum iwl_hcmd_dataflag {
struct iwl_host_cmd {
struct iwl_host_cmd {
	const void *data[IWL_MAX_CMD_TFDS];
	const void *data[IWL_MAX_CMD_TFDS];
	unsigned long reply_page;
	unsigned long reply_page;
	void (*callback)(struct iwl_priv *priv,
	void (*callback)(struct iwl_shared *shrd,
			 struct iwl_device_cmd *cmd,
			 struct iwl_device_cmd *cmd,
			 struct iwl_rx_packet *pkt);
			 struct iwl_rx_packet *pkt);
	u32 flags;
	u32 flags;
@@ -1142,8 +1142,6 @@ struct iwl_priv {
	/* Rate scaling data */
	/* Rate scaling data */
	u8 retry_rate;
	u8 retry_rate;


	wait_queue_head_t wait_command_queue;

	int activity_timer_active;
	int activity_timer_active;


	/* counts mgmt, ctl, and data packets */
	/* counts mgmt, ctl, and data packets */
+1 −1
Original line number Original line Diff line number Diff line
@@ -563,7 +563,7 @@ static void iwl_rx_card_state_notif(struct iwl_priv *priv,
		wiphy_rfkill_set_hw_state(priv->hw->wiphy,
		wiphy_rfkill_set_hw_state(priv->hw->wiphy,
			test_bit(STATUS_RF_KILL_HW, &priv->shrd->status));
			test_bit(STATUS_RF_KILL_HW, &priv->shrd->status));
	else
	else
		wake_up_interruptible(&priv->wait_command_queue);
		wake_up_interruptible(&priv->shrd->wait_command_queue);
}
}


static void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
static void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
Loading