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

Commit 39e88504 authored by Guy Cohen's avatar Guy Cohen Committed by John W. Linville
Browse files

iwlwifi: TLC modifications



1. Merge TLC fixes from AP support code
2. Remove struct iwl4965_rate
3. Misc code restructuring

Signed-off-by: default avatarGuy Cohen <guy.cohen@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 399f4900
Loading
Loading
Loading
Loading
+204 −230

File changed.

Preview size limit exceeded, changes collapsed.

+17 −14
Original line number Diff line number Diff line
@@ -1073,17 +1073,29 @@ unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
	return priv->ibss_beacon->len;
}

static u8 iwl4965_rate_get_lowest_plcp(int rate_mask)
static u8 iwl4965_rate_get_lowest_plcp(struct iwl_priv *priv)
{
	u8 i;
	int i;
	int rate_mask;

	/* Set rate mask*/
	if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)
		rate_mask = priv->active_rate_basic & 0xF;
	else
		rate_mask = priv->active_rate_basic & 0xFF0;

	/* Find lowest valid rate */
	for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID;
					i = iwl4965_rates[i].next_ieee) {
		if (rate_mask & (1 << i))
			return iwl4965_rates[i].plcp;
	}

	return IWL_RATE_INVALID;
	/* No valid rate was found. Assign the lowest one */
	if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)
		return IWL_RATE_1M_PLCP;
	else
		return IWL_RATE_6M_PLCP;
}

static int iwl4965_send_beacon_cmd(struct iwl_priv *priv)
@@ -1101,16 +1113,7 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv)
		return -ENOMEM;
	}

	if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) {
		rate = iwl4965_rate_get_lowest_plcp(priv->active_rate_basic &
						0xFF0);
		if (rate == IWL_INVALID_RATE)
			rate = IWL_RATE_6M_PLCP;
	} else {
		rate = iwl4965_rate_get_lowest_plcp(priv->active_rate_basic & 0xF);
		if (rate == IWL_INVALID_RATE)
			rate = IWL_RATE_1M_PLCP;
	}
	rate = iwl4965_rate_get_lowest_plcp(priv);

	frame_size = iwl4965_hw_get_beacon_cmd(priv, frame, rate);