aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-05-06 11:54:10 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-06-06 02:15:49 -0400
commita0ee74cf080389aee4fbf198ffa7e85b3480b661 (patch)
tree8b7d1d442d7d5a82a6bfe92e6123650b7751c9ff /drivers/net/wireless/iwlwifi/iwl-helpers.h
parentae0bce029e3b96d3ba2cc868bc6a65a125666ab8 (diff)
iwlwifi: beacon format related helper function
Move the ucode beacon formation related helper function from 3945 to iwlcore, so both _3945 and _agn devices can utilize those functions. When driver pass the beacon related timing information to uCode in both spectrum measurement and channel switch commands, the beacon timing parameter require in uCode beacon format; those helper functions will do the conversation from uSec to the correct uCode format Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index 69846395763..621abe3c5af 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -175,4 +175,26 @@ static inline void iwl_enable_interrupts(struct iwl_priv *priv)
175 iwl_write32(priv, CSR_INT_MASK, priv->inta_mask); 175 iwl_write32(priv, CSR_INT_MASK, priv->inta_mask);
176} 176}
177 177
178/**
179 * iwl_beacon_time_mask_low - mask of lower 32 bit of beacon time
180 * @priv -- pointer to iwl_priv data structure
181 * @tsf_bits -- number of bits need to shift for masking)
182 */
183static inline u32 iwl_beacon_time_mask_low(struct iwl_priv *priv,
184 u16 tsf_bits)
185{
186 return (1 << tsf_bits) - 1;
187}
188
189/**
190 * iwl_beacon_time_mask_high - mask of higher 32 bit of beacon time
191 * @priv -- pointer to iwl_priv data structure
192 * @tsf_bits -- number of bits need to shift for masking)
193 */
194static inline u32 iwl_beacon_time_mask_high(struct iwl_priv *priv,
195 u16 tsf_bits)
196{
197 return ((1 << (32 - tsf_bits)) - 1) << tsf_bits;
198}
199
178#endif /* __iwl_helpers_h__ */ 200#endif /* __iwl_helpers_h__ */