3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

util: Add util_bit_field

This commit is contained in:
Denis Kenzior 2014-12-29 19:41:24 -06:00
parent c8fb0b21f1
commit 56f1ccf7f2

View File

@ -28,4 +28,9 @@
const char *util_ssid_to_utf8(size_t len, const uint8_t *ssid);
static inline uint8_t util_bit_field(const uint8_t oct, int start, int num)
{
unsigned char mask = (1 << num) - 1;
return (oct >> start) & mask;
}
#endif /* __UTIL_H */