Optimized math functions and other computations. More...
|
Defines | |
| #define | CO_ALIGN4_HI(val) (((val)+3)&~3) |
| Align val on the multiple of 4 equal or nearest higher. | |
| #define | CO_ALIGNx_HI(val, x) (((val)+((x)-1))&~((x)-1)) |
| Align val on the multiple of a given number equal or nearest higher. | |
| #define | CO_ALIGN4_LO(val) ((val)&~3) |
| Align val on the multiple of 4 equal or nearest lower. | |
| #define | CO_ALIGN2_HI(val) (((val)+1)&~1) |
| Align val on the multiple of 2 equal or nearest higher. | |
| #define | CO_ALIGN2_LO(val) ((val)&~1) |
| Align val on the multiple of 2 equal or nearest lower. | |
Functions | |
| uint32_t | co_crc32 (uint32_t addr, uint32_t len, uint32_t crc) |
| Compute a CRC32 on the buffer passed as parameter. | |
| __INLINE uint32_t | co_clz (uint32_t val) |
| Count leading zeros. | |
| __INLINE void | co_random_init (uint32_t seed) |
| Function to initialize the random seed. | |
| __INLINE uint8_t | co_rand_byte (void) |
| Function to get an 8 bit random number. | |
| __INLINE uint16_t | co_rand_hword (void) |
| Function to get an 16 bit random number. | |
| __INLINE uint32_t | co_rand_word (void) |
| Function to get an 32 bit random number. | |
| __INLINE uint32_t | co_min (uint32_t a, uint32_t b) |
| Function to return the smallest of 2 unsigned 32 bits words. | |
| __INLINE uint32_t | co_max (uint32_t a, uint32_t b) |
| Function to return the greatest of 2 unsigned 32 bits words. | |
| __INLINE int | co_abs (int val) |
| Function to return the absolute value of a signed integer. | |
Variables | |
| static const uint32_t | crc_tab [256] |
| CRC lookup table. | |
Optimized math functions and other computations.
| #define CO_ALIGN2_HI | ( | val | ) | (((val)+1)&~1) |
| #define CO_ALIGN2_LO | ( | val | ) | ((val)&~1) |
| #define CO_ALIGN4_HI | ( | val | ) | (((val)+3)&~3) |
Align val on the multiple of 4 equal or nearest higher.
| [in] | val | Value to align. |
Definition at line 47 of file co_math.h.
Referenced by co_copy32(), txl_buffer_get_params(), and txl_mpdu_subframe_len().
| #define CO_ALIGN4_LO | ( | val | ) | ((val)&~3) |
Align val on the multiple of 4 equal or nearest lower.
| [in] | val | Value to align. |
Definition at line 69 of file co_math.h.
Referenced by rxl_go_to_last_rbd(), and rxl_rxcntrl_frame().
| #define CO_ALIGNx_HI | ( | val, | |||
| x | ) | (((val)+((x)-1))&~((x)-1)) |
| __INLINE int co_abs | ( | int | val | ) |
Function to return the absolute value of a signed integer.
| [in] | val | Value |
Definition at line 236 of file co_math.h.
Referenced by chan_p2p_noa_resync_check().
| __INLINE uint32_t co_clz | ( | uint32_t | val | ) |
Count leading zeros.
| [in] | val | Value to count the number of leading zeros on. |
Definition at line 102 of file co_math.h.
Referenced by apm_start_req_handler(), rc_get_initial_rate_config(), and scanu_join_frame_handler().
| uint32_t co_crc32 | ( | uint32_t | addr, | |
| uint32_t | len, | |||
| uint32_t | crc | |||
| ) |
Compute a CRC32 on the buffer passed as parameter.
The initial value of the computation is taken from crc parameter, allowing for incremental computation.
| [in] | addr | Pointer to the buffer on which the CRC has to be computed |
| [in] | len | Length of the buffer |
| [in] | crc | The initial value of the CRC computation |
Referenced by mm_compute_beacon_crc().
| __INLINE uint32_t co_max | ( | uint32_t | a, | |
| uint32_t | b | |||
| ) |
Function to return the greatest of 2 unsigned 32 bits words.
| [in] | a | First value |
| [in] | b | Second value |
Definition at line 224 of file co_math.h.
Referenced by rc_set_previous_mcs_index().
| __INLINE uint32_t co_min | ( | uint32_t | a, | |
| uint32_t | b | |||
| ) |
Function to return the smallest of 2 unsigned 32 bits words.
| [in] | a | First value |
| [in] | b | Second value |
Definition at line 211 of file co_math.h.
Referenced by bfr_check_next_nodes(), chan_start_p2pgo_noa(), dbg_vsnprintf_offset(), me_add_ie_supp_rates(), me_get_sta_bw(), me_pol_tbl_bw_upd(), me_rate_bitfield_vht_build(), me_set_sta_ht_vht_param(), me_sta_bw_nss_max_upd(), p2p_cli_noa_get_abs_time(), rc_set_max_amsdu_len(), rc_set_next_mcs_index(), rxu_mgt_ind_handler(), and txl_ampdu_constraints_get().
| __INLINE uint8_t co_rand_byte | ( | void | ) |
Function to get an 8 bit random number.
Definition at line 176 of file co_math.h.
Referenced by bam_create_ba_agg().
| __INLINE uint16_t co_rand_hword | ( | void | ) |
Function to get an 16 bit random number.
Definition at line 187 of file co_math.h.
Referenced by rc_new_random_rate(), and rc_set_trial_tx().
| __INLINE uint32_t co_rand_word | ( | void | ) |
1.6.1