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

Commit 417f114b authored by Tomas Winkler's avatar Tomas Winkler Committed by John W. Linville
Browse files

iwlwifi: rs: remove fc variable and other cleanups



This patch
1. Removes use once use only fc variables, they are useless after refactoring
ieee80211 frame control handlers
2. Other trivial cleanups

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9f58671e
Loading
Loading
Loading
Loading
+19 −29
Original line number Diff line number Diff line
@@ -281,10 +281,9 @@ static u8 rs_tl_add_packet(struct iwl_lq_sta *lq_data,
	u32 time_diff;
	s32 index;
	struct iwl_traffic_load *tl = NULL;
	__le16 fc = hdr->frame_control;
	u8 tid;

	if (ieee80211_is_data_qos(fc)) {
	if (ieee80211_is_data_qos(hdr->frame_control)) {
		u8 *qc = ieee80211_get_qos_ctl(hdr);
		tid = qc[0] & 0xf;
	} else
@@ -773,7 +772,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
	int status;
	u8 retries;
	int rs_index, index = 0;
	struct iwl_lq_sta *lq_sta;
	struct iwl_lq_sta *lq_sta = priv_sta;
	struct iwl_link_quality_cmd *table;
	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
	struct iwl_priv *priv = (struct iwl_priv *)priv_r;
@@ -785,12 +784,12 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
	struct iwl_scale_tbl_info tbl_type;
	struct iwl_scale_tbl_info *curr_tbl, *search_tbl;
	u8 active_index = 0;
	__le16 fc = hdr->frame_control;
	s32 tpt = 0;

	IWL_DEBUG_RATE_LIMIT("get frame ack response, update rate scale window\n");

	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1))
	if (!ieee80211_is_data(hdr->frame_control) ||
	    is_multicast_ether_addr(hdr->addr1))
		return;

	/* This packet was aggregated but doesn't carry rate scale info */
@@ -803,8 +802,6 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
	if (retries > 15)
		retries = 15;

	lq_sta = (struct iwl_lq_sta *)priv_sta;

	if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
	    !lq_sta->ibss_sta_added)
		goto out;
@@ -1675,7 +1672,6 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
	int high_tpt = IWL_INVALID_VALUE;
	u32 fail_count;
	s8 scale_action = 0;
	__le16 fc;
	u16 rate_mask;
	u8 update_lq = 0;
	struct iwl_scale_tbl_info *tbl, *tbl1;
@@ -1690,13 +1686,12 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,

	IWL_DEBUG_RATE("rate scale calculate new rate for skb\n");

	fc = hdr->frame_control;
	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) {
	/* Send management frames and broadcast/multicast data using
	 * lowest rate. */
	/* TODO: this could probably be improved.. */
	if (!ieee80211_is_data(hdr->frame_control) ||
	    is_multicast_ether_addr(hdr->addr1))
		return;
	}

	if (!sta || !lq_sta)
		return;
@@ -2095,29 +2090,26 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
			struct ieee80211_tx_rate_control *txrc)
{

	int i;
	struct sk_buff *skb = txrc->skb;
	struct ieee80211_supported_band *sband = txrc->sband;
	struct iwl_priv *priv = (struct iwl_priv *)priv_r;
	struct ieee80211_conf *conf = &priv->hw->conf;
	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
	__le16 fc;
	struct iwl_lq_sta *lq_sta;
	struct iwl_lq_sta *lq_sta = priv_sta;
	int rate_idx;

	IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");

	/* Send management frames and broadcast/multicast data using lowest
	 * rate. */
	fc = hdr->frame_control;
	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) ||
	    !sta || !priv_sta) {
	if (!ieee80211_is_data(hdr->frame_control) ||
	    is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) {
		info->control.rates[0].idx = rate_lowest_index(sband, sta);
		return;
	}

	lq_sta = (struct iwl_lq_sta *)priv_sta;
	i = lq_sta->last_txrate_idx;
	rate_idx  = lq_sta->last_txrate_idx;

	if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
	    !lq_sta->ibss_sta_added) {
@@ -2137,14 +2129,12 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
		}
	}

	if ((i < 0) || (i > IWL_RATE_COUNT)) {
		info->control.rates[0].idx = rate_lowest_index(sband, sta);
		return;
	}
	if (rate_idx < 0 || rate_idx > IWL_RATE_COUNT)
		rate_idx = rate_lowest_index(sband, sta);
	else if (sband->band == IEEE80211_BAND_5GHZ)
		rate_idx -= IWL_FIRST_OFDM_RATE;

	if (sband->band == IEEE80211_BAND_5GHZ)
		i -= IWL_FIRST_OFDM_RATE;
	info->control.rates[0].idx = i;
	info->control.rates[0].idx = rate_idx;
}

static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,