mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
mpdu: Fix bitfield use on big endian
This commit is contained in:
parent
75ec08df73
commit
7b6d8b54cd
12
src/mpdu.h
12
src/mpdu.h
@ -80,17 +80,21 @@ struct mpdu_mgmt_header {
|
|||||||
unsigned char address_2[6];
|
unsigned char address_2[6];
|
||||||
unsigned char address_3[6];
|
unsigned char address_3[6];
|
||||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||||
__le16 fragment_number:4;
|
uint8_t fragment_number:4;
|
||||||
__le16 sequence_number:12;
|
uint8_t sequence_number_low:4;
|
||||||
#elif defined (__BIG_ENDIAN_BITFIELD)
|
#elif defined (__BIG_ENDIAN_BITFIELD)
|
||||||
__le16 sequence_number:12;
|
uint8_t sequence_number_low:4;
|
||||||
__le16 fragment_number:4;
|
uint8_t fragment_number:4;
|
||||||
#else
|
#else
|
||||||
#error "Please fix <asm/byteorder.h>"
|
#error "Please fix <asm/byteorder.h>"
|
||||||
#endif
|
#endif
|
||||||
|
uint8_t sequence_number_high;
|
||||||
__le32 ht_control; /* ToDo? */
|
__le32 ht_control; /* ToDo? */
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
#define MPDU_MGMT_SEQUENCE_NUMBER(v) \
|
||||||
|
(((v).sequence_number_high << 4) + ((v).sequence_number_low))
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.11 */
|
/* 802.11, Section 8.3.3.11 */
|
||||||
struct mpdu_authentication {
|
struct mpdu_authentication {
|
||||||
__le16 algorithm;
|
__le16 algorithm;
|
||||||
|
Loading…
Reference in New Issue
Block a user