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: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
9f58671e8d
commit
417f114bf2
@@ -281,10 +281,9 @@ static u8 rs_tl_add_packet(struct iwl_lq_sta *lq_data,
|
|||||||
u32 time_diff;
|
u32 time_diff;
|
||||||
s32 index;
|
s32 index;
|
||||||
struct iwl_traffic_load *tl = NULL;
|
struct iwl_traffic_load *tl = NULL;
|
||||||
__le16 fc = hdr->frame_control;
|
|
||||||
u8 tid;
|
u8 tid;
|
||||||
|
|
||||||
if (ieee80211_is_data_qos(fc)) {
|
if (ieee80211_is_data_qos(hdr->frame_control)) {
|
||||||
u8 *qc = ieee80211_get_qos_ctl(hdr);
|
u8 *qc = ieee80211_get_qos_ctl(hdr);
|
||||||
tid = qc[0] & 0xf;
|
tid = qc[0] & 0xf;
|
||||||
} else
|
} else
|
||||||
@@ -773,7 +772,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
|
|||||||
int status;
|
int status;
|
||||||
u8 retries;
|
u8 retries;
|
||||||
int rs_index, index = 0;
|
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 iwl_link_quality_cmd *table;
|
||||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
struct iwl_priv *priv = (struct iwl_priv *)priv_r;
|
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 tbl_type;
|
||||||
struct iwl_scale_tbl_info *curr_tbl, *search_tbl;
|
struct iwl_scale_tbl_info *curr_tbl, *search_tbl;
|
||||||
u8 active_index = 0;
|
u8 active_index = 0;
|
||||||
__le16 fc = hdr->frame_control;
|
|
||||||
s32 tpt = 0;
|
s32 tpt = 0;
|
||||||
|
|
||||||
IWL_DEBUG_RATE_LIMIT("get frame ack response, update rate scale window\n");
|
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;
|
return;
|
||||||
|
|
||||||
/* This packet was aggregated but doesn't carry rate scale info */
|
/* 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)
|
if (retries > 15)
|
||||||
retries = 15;
|
retries = 15;
|
||||||
|
|
||||||
lq_sta = (struct iwl_lq_sta *)priv_sta;
|
|
||||||
|
|
||||||
if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
|
if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
|
||||||
!lq_sta->ibss_sta_added)
|
!lq_sta->ibss_sta_added)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1675,7 +1672,6 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
|
|||||||
int high_tpt = IWL_INVALID_VALUE;
|
int high_tpt = IWL_INVALID_VALUE;
|
||||||
u32 fail_count;
|
u32 fail_count;
|
||||||
s8 scale_action = 0;
|
s8 scale_action = 0;
|
||||||
__le16 fc;
|
|
||||||
u16 rate_mask;
|
u16 rate_mask;
|
||||||
u8 update_lq = 0;
|
u8 update_lq = 0;
|
||||||
struct iwl_scale_tbl_info *tbl, *tbl1;
|
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");
|
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
|
/* Send management frames and broadcast/multicast data using
|
||||||
* lowest rate. */
|
* lowest rate. */
|
||||||
/* TODO: this could probably be improved.. */
|
/* TODO: this could probably be improved.. */
|
||||||
|
if (!ieee80211_is_data(hdr->frame_control) ||
|
||||||
|
is_multicast_ether_addr(hdr->addr1))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (!sta || !lq_sta)
|
if (!sta || !lq_sta)
|
||||||
return;
|
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)
|
struct ieee80211_tx_rate_control *txrc)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
|
||||||
struct sk_buff *skb = txrc->skb;
|
struct sk_buff *skb = txrc->skb;
|
||||||
struct ieee80211_supported_band *sband = txrc->sband;
|
struct ieee80211_supported_band *sband = txrc->sband;
|
||||||
struct iwl_priv *priv = (struct iwl_priv *)priv_r;
|
struct iwl_priv *priv = (struct iwl_priv *)priv_r;
|
||||||
struct ieee80211_conf *conf = &priv->hw->conf;
|
struct ieee80211_conf *conf = &priv->hw->conf;
|
||||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||||
__le16 fc;
|
struct iwl_lq_sta *lq_sta = priv_sta;
|
||||||
struct iwl_lq_sta *lq_sta;
|
int rate_idx;
|
||||||
|
|
||||||
IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
|
IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
|
||||||
|
|
||||||
/* Send management frames and broadcast/multicast data using lowest
|
/* Send management frames and broadcast/multicast data using lowest
|
||||||
* rate. */
|
* rate. */
|
||||||
fc = hdr->frame_control;
|
if (!ieee80211_is_data(hdr->frame_control) ||
|
||||||
if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) ||
|
is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) {
|
||||||
!sta || !priv_sta) {
|
|
||||||
info->control.rates[0].idx = rate_lowest_index(sband, sta);
|
info->control.rates[0].idx = rate_lowest_index(sband, sta);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lq_sta = (struct iwl_lq_sta *)priv_sta;
|
rate_idx = lq_sta->last_txrate_idx;
|
||||||
i = lq_sta->last_txrate_idx;
|
|
||||||
|
|
||||||
if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
|
if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
|
||||||
!lq_sta->ibss_sta_added) {
|
!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)) {
|
if (rate_idx < 0 || rate_idx > IWL_RATE_COUNT)
|
||||||
info->control.rates[0].idx = rate_lowest_index(sband, sta);
|
rate_idx = rate_lowest_index(sband, sta);
|
||||||
return;
|
else if (sband->band == IEEE80211_BAND_5GHZ)
|
||||||
}
|
rate_idx -= IWL_FIRST_OFDM_RATE;
|
||||||
|
|
||||||
if (sband->band == IEEE80211_BAND_5GHZ)
|
info->control.rates[0].idx = rate_idx;
|
||||||
i -= IWL_FIRST_OFDM_RATE;
|
|
||||||
info->control.rates[0].idx = i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,
|
static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,
|
||||||
|
Reference in New Issue
Block a user