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

Commit dd6d2a8a authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

iwlegacy: remove reset rf infrastructure



We do not reset radio anymore, hence don't need that code too.

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ecaee0ff
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2697,7 +2697,6 @@ static struct iwl_base_params iwl3945_base_params = {
	.set_l0s = false,
	.use_bsm = true,
	.led_compensation = 64,
	.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
	.wd_timeout = IWL_DEF_WD_TIMEOUT,
	.max_event_log_size = 512,
};
+8 −71
Original line number Diff line number Diff line
@@ -694,47 +694,6 @@ void iwl4965_rx_reply_rx_phy(struct iwl_priv *priv,
	       sizeof(struct iwl_rx_phy_res));
}

static int iwl4965_get_single_channel_for_scan(struct iwl_priv *priv,
					   struct ieee80211_vif *vif,
					   enum ieee80211_band band,
					   struct iwl_scan_channel *scan_ch)
{
	const struct ieee80211_supported_band *sband;
	u16 passive_dwell = 0;
	u16 active_dwell = 0;
	int added = 0;
	u16 channel = 0;

	sband = iwl_get_hw_mode(priv, band);
	if (!sband) {
		IWL_ERR(priv, "invalid band\n");
		return added;
	}

	active_dwell = iwl_legacy_get_active_dwell_time(priv, band, 0);
	passive_dwell = iwl_legacy_get_passive_dwell_time(priv, band, vif);

	if (passive_dwell <= active_dwell)
		passive_dwell = active_dwell + 1;

	channel = iwl_legacy_get_single_channel_number(priv, band);
	if (channel) {
		scan_ch->channel = cpu_to_le16(channel);
		scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
		scan_ch->active_dwell = cpu_to_le16(active_dwell);
		scan_ch->passive_dwell = cpu_to_le16(passive_dwell);
		/* Set txpower levels to defaults */
		scan_ch->dsp_atten = 110;
		if (band == IEEE80211_BAND_5GHZ)
			scan_ch->tx_gain = ((1 << 5) | (3 << 3)) | 3;
		else
			scan_ch->tx_gain = ((1 << 5) | (5 << 3));
		added++;
	} else
		IWL_ERR(priv, "no valid channel found\n");
	return added;
}

static int iwl4965_get_channels_for_scan(struct iwl_priv *priv,
				     struct ieee80211_vif *vif,
				     enum ieee80211_band band,
@@ -858,15 +817,12 @@ int iwl4965_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
	scan->quiet_time = IWL_ACTIVE_QUIET_TIME;

	if (iwl_legacy_is_any_associated(priv)) {
		u16 interval = 0;
		u16 interval;
		u32 extra;
		u32 suspend_time = 100;
		u32 scan_suspend_time = 100;

		IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
		if (priv->is_internal_short_scan)
			interval = 0;
		else
		interval = vif->bss_conf.beacon_int;

		scan->suspend_time = 0;
@@ -882,9 +838,7 @@ int iwl4965_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
			       scan_suspend_time, interval);
	}

	if (priv->is_internal_short_scan) {
		IWL_DEBUG_SCAN(priv, "Start internal passive scan.\n");
	} else if (priv->scan_request->n_ssids) {
	if (priv->scan_request->n_ssids) {
		int i, p = 0;
		IWL_DEBUG_SCAN(priv, "Kicking off active scan\n");
		for (i = 0; i < priv->scan_request->n_ssids; i++) {
@@ -981,38 +935,21 @@ int iwl4965_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
	rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS;
	rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
	scan->rx_chain = cpu_to_le16(rx_chain);
	if (!priv->is_internal_short_scan) {

	cmd_len = iwl_legacy_fill_probe_req(priv,
					(struct ieee80211_mgmt *)scan->data,
					vif->addr,
					priv->scan_request->ie,
					priv->scan_request->ie_len,
					IWL_MAX_SCAN_SIZE - sizeof(*scan));
	} else {
		/* use bcast addr, will not be transmitted but must be valid */
		cmd_len = iwl_legacy_fill_probe_req(priv,
					(struct ieee80211_mgmt *)scan->data,
					iwlegacy_bcast_addr, NULL, 0,
					IWL_MAX_SCAN_SIZE - sizeof(*scan));

	}
	scan->tx_cmd.len = cpu_to_le16(cmd_len);

	scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK |
			       RXON_FILTER_BCON_AWARE_MSK);

	if (priv->is_internal_short_scan) {
		scan->channel_count =
			iwl4965_get_single_channel_for_scan(priv, vif, band,
				(void *)&scan->data[le16_to_cpu(
				scan->tx_cmd.len)]);
	} else {
		scan->channel_count =
			iwl4965_get_channels_for_scan(priv, vif, band,
	scan->channel_count = iwl4965_get_channels_for_scan(priv, vif, band,
						is_active, n_probes,
				(void *)&scan->data[le16_to_cpu(
				scan->tx_cmd.len)]);
	}
						(void *)&scan->data[cmd_len]);
	if (scan->channel_count == 0) {
		IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count);
		return -EIO;
+0 −1
Original line number Diff line number Diff line
@@ -2149,7 +2149,6 @@ static struct iwl_base_params iwl4965_base_params = {
	.use_bsm = true,
	.led_compensation = 61,
	.chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS,
	.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
	.wd_timeout = IWL_DEF_WD_TIMEOUT,
	.temperature_kelvin = true,
	.max_event_log_size = 512,
+30 −60
Original line number Diff line number Diff line
@@ -1707,41 +1707,14 @@ iwl_legacy_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len)
EXPORT_SYMBOL(iwl_legacy_update_stats);
#endif

static void _iwl_legacy_force_rf_reset(struct iwl_priv *priv)
{
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;

	if (!iwl_legacy_is_any_associated(priv)) {
		IWL_DEBUG_SCAN(priv, "force reset rejected: not associated\n");
		return;
	}
	/*
	 * There is no easy and better way to force reset the radio,
	 * the only known method is switching channel which will force to
	 * reset and tune the radio.
	 * Use internal short scan (single channel) operation to should
	 * achieve this objective.
	 * Driver should reset the radio when number of consecutive missed
	 * beacon, or any other uCode error condition detected.
	 */
	IWL_DEBUG_INFO(priv, "perform radio reset.\n");
	iwl_legacy_internal_short_hw_scan(priv);
}


int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external)
int iwl_legacy_force_reset(struct iwl_priv *priv, bool external)
{
	struct iwl_force_reset *force_reset;

	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return -EINVAL;

	if (mode >= IWL_MAX_FORCE_RESET) {
		IWL_DEBUG_INFO(priv, "invalid reset request.\n");
		return -EINVAL;
	}
	force_reset = &priv->force_reset[mode];
	force_reset = &priv->force_reset;
	force_reset->reset_request_count++;
	if (!external) {
		if (force_reset->last_force_reset_jiffies &&
@@ -1754,12 +1727,7 @@ int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external)
	}
	force_reset->reset_success_count++;
	force_reset->last_force_reset_jiffies = jiffies;
	IWL_DEBUG_INFO(priv, "perform force reset (%d)\n", mode);
	switch (mode) {
	case IWL_RF_RESET:
		_iwl_legacy_force_rf_reset(priv);
		break;
	case IWL_FW_RESET:

	/*
	 * if the request is from external(ex: debugfs),
	 * then always perform the request in regardless the module
@@ -1768,12 +1736,15 @@ int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external)
	 * detect failure), then fw_restart module parameter
	 * need to be check before performing firmware reload
	 */

	if (!external && !priv->cfg->mod_params->restart_fw) {
		IWL_DEBUG_INFO(priv, "Cancel firmware reload based on "
			       "module parameter setting\n");
			break;
		return 0;
	}

	IWL_ERR(priv, "On demand firmware reload\n");

	/* Set the FW error flag -- cleared on iwl_down */
	set_bit(STATUS_FW_ERROR, &priv->status);
	wake_up_interruptible(&priv->wait_command_queue);
@@ -1783,8 +1754,7 @@ int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external)
	 */
	clear_bit(STATUS_READY, &priv->status);
	queue_work(priv->workqueue, &priv->restart);
		break;
	}

	return 0;
}

@@ -1879,7 +1849,7 @@ static int iwl_legacy_check_stuck_queue(struct iwl_priv *priv, int cnt)
	if (time_after(jiffies, timeout)) {
		IWL_ERR(priv, "Queue %d stuck for %u ms.\n",
				q->id, priv->cfg->base_params->wd_timeout);
		ret = iwl_legacy_force_reset(priv, IWL_FW_RESET, false);
		ret = iwl_legacy_force_reset(priv, false);
		return (ret == -EAGAIN) ? 0 : 1;
	}

+1 −4
Original line number Diff line number Diff line
@@ -204,8 +204,6 @@ struct iwl_mod_params {
 *	to the deviation to achieve the desired led frequency.
 *	The detail algorithm is described in iwl-led.c
 * @chain_noise_num_beacons: number of beacons used to compute chain noise
 * @plcp_delta_threshold: plcp error rate threshold used to trigger
 *	radio tuning when there is a high receiving plcp error rate
 * @wd_timeout: TX queues watchdog timeout
 * @temperature_kelvin: temperature report by uCode in kelvin
 * @max_event_log_size: size of event log buffer size for ucode event logging
@@ -226,7 +224,6 @@ struct iwl_base_params {

	u16 led_compensation;
	int chain_noise_num_beacons;
	u8 plcp_delta_threshold;
	unsigned int wd_timeout;
	bool temperature_kelvin;
	u32 max_event_log_size;
@@ -438,7 +435,7 @@ int iwl_legacy_mac_hw_scan(struct ieee80211_hw *hw,
		    struct ieee80211_vif *vif,
		    struct cfg80211_scan_request *req);
void iwl_legacy_internal_short_hw_scan(struct iwl_priv *priv);
int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external);
int iwl_legacy_force_reset(struct iwl_priv *priv, bool external);
u16 iwl_legacy_fill_probe_req(struct iwl_priv *priv,
			struct ieee80211_mgmt *frame,
		       const u8 *ta, const u8 *ie, int ie_len, int left);
Loading