aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
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-helpers.h
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-helpers.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index a443472bea62..e4c3f84f530a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -235,6 +235,25 @@ static inline int ieee80211_is_reassoc_response(u16 fc)
235 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_RESP); 235 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_RESP);
236} 236}
237 237
238static inline int ieee80211_is_qos_data(u16 fc)
239{
240 return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) &&
241 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA);
242}
243/**
244 * ieee80211_get_qos_ctrl - get pointer to the QoS control field
245 *
246 * This function returns the pointer to 802.11 header QoS field (2 bytes)
247 * This function doesn't check whether hdr is a QoS hdr, use with care
248 * @hdr: struct ieee80211_hdr *hdr
249 * @hdr_len: header length
250 */
251
252static inline u8 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr, int hdr_len)
253{
254 return ((u8 *) hdr + hdr_len - QOS_CONTROL_LEN);
255}
256
238static inline int iwl_check_bits(unsigned long field, unsigned long mask) 257static inline int iwl_check_bits(unsigned long field, unsigned long mask)
239{ 258{
240 return ((field & mask) == mask) ? 1 : 0; 259 return ((field & mask) == mask) ? 1 : 0;