diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-15 05:54:06 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-22 01:47:59 (GMT) |
commit | 54dbb525e7b8580b86af352cf60b27cc889c2ae4 (patch) | |
tree | cd791dd579945e8db57de6328f8cd8933b9760d4 /drivers/net/wireless/iwlwifi/iwl-helpers.h | |
parent | 83d527d9e8f9aff92cbd33f208f77c055dabb499 (diff) | |
download | linux-fsl-qoriq-54dbb525e7b8580b86af352cf60b27cc889c2ae4.tar.xz |
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.h | 19 |
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 a443472..e4c3f84 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) ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_RESP); } +static inline int ieee80211_is_qos_data(u16 fc) +{ + return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && + ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA); +} +/** + * ieee80211_get_qos_ctrl - get pointer to the QoS control field + * + * This function returns the pointer to 802.11 header QoS field (2 bytes) + * This function doesn't check whether hdr is a QoS hdr, use with care + * @hdr: struct ieee80211_hdr *hdr + * @hdr_len: header length + */ + +static inline u8 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr, int hdr_len) +{ + return ((u8 *) hdr + hdr_len - QOS_CONTROL_LEN); +} + static inline int iwl_check_bits(unsigned long field, unsigned long mask) { return ((field & mask) == mask) ? 1 : 0; |