Go back –> iwl3945 kerneldoc

iwl_get_bits - Extract a hardware bit-field value

u32 iwl_get_bits (__le32 src, u8 pos, u8 len)

Arguments

src
source hardware value (__le32)
pos
bit-position (0-based) of first bit of value
len
length of bit-field

Description

iwl_get_bits will return the bit-field in cpu endian ordering.

NOTE

If used from IWL_GET_BITS then pos and len are compile-constants and will collapse to minimal code by the compiler.

iwl_set_bits - Set a hardware bit-field value

void iwl_set_bits (__le32 * dst, u8 pos, u8 len, int val)

Arguments

dst
Address of __le32 hardware value
pos
bit-position (0-based) of first bit of value
len
length of bit-field
val
cpu endian value to encode into the bit-field

Description

iwl_set_bits will encode val into dst, masked to be len bits long at bit position pos.

NOTE

If used IWL_SET_BITS pos and len will be compile-constants and will collapse to minimal code by the compiler.

iwl_queue_inc_wrap - increment queue index, wrap back to beginning

int iwl_queue_inc_wrap (int index, int n_bd)

Arguments

Description

index -- current index n_bd -- total number of entries in queue (must be power of 2)

iwl_queue_dec_wrap - decrement queue index, wrap back to end

int iwl_queue_dec_wrap (int index, int n_bd)

Arguments

Description

index -- current index n_bd -- total number of entries in queue (must be power of 2)