aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-15 01:54:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:59 -0400
commit54dbb525e7b8580b86af352cf60b27cc889c2ae4 (patch)
treecd791dd579945e8db57de6328f8cd8933b9760d4 /drivers/net/wireless/iwlwifi/iwl-4965-rs.c
parent83d527d9e8f9aff92cbd33f208f77c055dabb499 (diff)
iwlwifi: refactor ieee80211_get_qos_ctrl
This patch refactors ieee80211_get_qos_ctrl function and its usage in iwlwifi drivers. Function is moved as inline into iwl-helpers.h. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index ce70f2b29b61..071c7b6ebef2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -282,14 +282,20 @@ static void rs_tl_rm_old_stats(struct iwl4965_traffic_load *tl, u32 curr_time)
282 * increment traffic load value for tid and also remove 282 * increment traffic load value for tid and also remove
283 * any old values if passed the certain time period 283 * any old values if passed the certain time period
284 */ 284 */
285static void rs_tl_add_packet(struct iwl4965_lq_sta *lq_data, u8 tid) 285static void rs_tl_add_packet(struct iwl4965_lq_sta *lq_data,
286 struct ieee80211_hdr *hdr)
286{ 287{
287 u32 curr_time = jiffies_to_msecs(jiffies); 288 u32 curr_time = jiffies_to_msecs(jiffies);
288 u32 time_diff; 289 u32 time_diff;
289 s32 index; 290 s32 index;
290 struct iwl4965_traffic_load *tl = NULL; 291 struct iwl4965_traffic_load *tl = NULL;
292 u16 fc = le16_to_cpu(hdr->frame_control);
293 u8 tid;
291 294
292 if (tid >= TID_MAX_LOAD_COUNT) 295 if (ieee80211_is_qos_data(fc)) {
296 u8 *qc = ieee80211_get_qos_ctrl(hdr, ieee80211_get_hdrlen(fc));
297 tid = qc[0] & 0xf;
298 } else
293 return; 299 return;
294 300
295 tl = &lq_data->load[tid]; 301 tl = &lq_data->load[tid];
@@ -1670,7 +1676,6 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1670 u16 high_low; 1676 u16 high_low;
1671#ifdef CONFIG_IWL4965_HT 1677#ifdef CONFIG_IWL4965_HT
1672 u8 tid = MAX_TID_COUNT; 1678 u8 tid = MAX_TID_COUNT;
1673 __le16 *qc;
1674#endif 1679#endif
1675 1680
1676 IWL_DEBUG_RATE("rate scale calculate new rate for skb\n"); 1681 IWL_DEBUG_RATE("rate scale calculate new rate for skb\n");
@@ -1693,11 +1698,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1693 lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; 1698 lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv;
1694 1699
1695#ifdef CONFIG_IWL4965_HT 1700#ifdef CONFIG_IWL4965_HT
1696 qc = ieee80211_get_qos_ctrl(hdr); 1701 rs_tl_add_packet(lq_sta, hdr);
1697 if (qc) {
1698 tid = (u8)(le16_to_cpu(*qc) & 0xf);
1699 rs_tl_add_packet(lq_sta, tid);
1700 }
1701#endif 1702#endif
1702 /* 1703 /*
1703 * Select rate-scale / modulation-mode table to work with in 1704 * Select rate-scale / modulation-mode table to work with in