aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index a443472bea62..dedefa06ad8f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -136,6 +136,8 @@ static inline void iwl_set_bits16(__le16 *dst, u8 pos, u8 len, int val)
136 136
137#define KELVIN_TO_CELSIUS(x) ((x)-273) 137#define KELVIN_TO_CELSIUS(x) ((x)-273)
138#define CELSIUS_TO_KELVIN(x) ((x)+273) 138#define CELSIUS_TO_KELVIN(x) ((x)+273)
139#define IWL_MASK(lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
140
139 141
140#define IEEE80211_CHAN_W_RADAR_DETECT 0x00000010 142#define IEEE80211_CHAN_W_RADAR_DETECT 0x00000010
141 143
@@ -235,6 +237,25 @@ static inline int ieee80211_is_reassoc_response(u16 fc)
235 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_RESP); 237 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_RESP);
236} 238}
237 239
240static inline int ieee80211_is_qos_data(u16 fc)
241{
242 return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) &&
243 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA);
244}
245/**
246 * ieee80211_get_qos_ctrl - get pointer to the QoS control field
247 *
248 * This function returns the pointer to 802.11 header QoS field (2 bytes)
249 * This function doesn't check whether hdr is a QoS hdr, use with care
250 * @hdr: struct ieee80211_hdr *hdr
251 * @hdr_len: header length
252 */
253
254static inline u8 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr, int hdr_len)
255{
256 return ((u8 *) hdr + hdr_len - QOS_CONTROL_LEN);
257}
258
238static inline int iwl_check_bits(unsigned long field, unsigned long mask) 259static inline int iwl_check_bits(unsigned long field, unsigned long mask)
239{ 260{
240 return ((field & mask) == mask) ? 1 : 0; 261 return ((field & mask) == mask) ? 1 : 0;