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

Commit 47107e84 authored by Don Fry's avatar Don Fry Committed by John W. Linville
Browse files

iwlwifi: split POWER_PMI status bit



Move the POWER_PMI to the op_mode where it is changed.  The trans needs
to check it frequently, so shadow the status in the trans and update it
in trans when it infrequently 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>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 17acd0b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -856,7 +856,7 @@ static u8 iwl_count_chain_bitmap(u32 chain_bitmap)
void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
{
	bool is_single = is_single_rx_stream(priv);
	bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->shrd->status);
	bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status);
	u8 idle_rx_cnt, active_rx_cnt, valid_rx_cnt;
	u32 active_chains;
	u16 rx_chain;
+9 −0
Original line number Diff line number Diff line
@@ -392,6 +392,15 @@ static inline int iwl_is_ready_rf(struct iwl_priv *priv)
	return iwl_is_ready(priv);
}

static inline void iwl_dvm_set_pmi(struct iwl_priv *priv, bool state)
{
	if (state)
		set_bit(STATUS_POWER_PMI, &priv->status);
	else
		clear_bit(STATUS_POWER_PMI, &priv->status);
	iwl_trans_set_pmi(trans(priv), state);
}

#ifdef CONFIG_IWLWIFI_DEBUG
#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...)	\
do {									\
+1 −1
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ static ssize_t iwl_dbgfs_status_read(struct file *file,
	pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_HW:\t\t %d\n",
		test_bit(STATUS_SCAN_HW, &priv->status));
	pos += scnprintf(buf + pos, bufsz - pos, "STATUS_POWER_PMI:\t %d\n",
		test_bit(STATUS_POWER_PMI, &priv->shrd->status));
		test_bit(STATUS_POWER_PMI, &priv->status));
	pos += scnprintf(buf + pos, bufsz - pos, "STATUS_FW_ERROR:\t %d\n",
		test_bit(STATUS_FW_ERROR, &priv->status));
	return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+2 −2
Original line number Diff line number Diff line
@@ -403,12 +403,12 @@ int iwl_power_set_mode(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd,
	}

	if (cmd->flags & IWL_POWER_DRIVER_ALLOW_SLEEP_MSK)
		set_bit(STATUS_POWER_PMI, &priv->shrd->status);
		iwl_dvm_set_pmi(priv, true);

	ret = iwl_set_power(priv, cmd);
	if (!ret) {
		if (!(cmd->flags & IWL_POWER_DRIVER_ALLOW_SLEEP_MSK))
			clear_bit(STATUS_POWER_PMI, &priv->shrd->status);
			iwl_dvm_set_pmi(priv, false);

		if (update_chains)
			iwl_update_chain_flags(priv);
+1 −1
Original line number Diff line number Diff line
@@ -850,7 +850,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
	 * In power save mode while associated use one chain,
	 * otherwise use all chains
	 */
	if (test_bit(STATUS_POWER_PMI, &priv->shrd->status) &&
	if (test_bit(STATUS_POWER_PMI, &priv->status) &&
	    !(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) {
		/* rx_ant has been set to all valid chains previously */
		active_chains = rx_ant &
Loading