radiotap: Silence sparse warnings about byte order swapping

These little endian fields were not marked properly and the type case in
the get_unaligned_* helper macros were causing warnings from sparse.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-06-23 18:06:37 +03:00 committed by Jouni Malinen
parent 94c4d78ef1
commit fad6485c56
5 changed files with 7 additions and 7 deletions

View file

@ -136,7 +136,7 @@ static void handle_monitor_read(int sock, void *eloop_ctx, void *sock_ctx)
break; break;
case IEEE80211_RADIOTAP_TX_FLAGS: case IEEE80211_RADIOTAP_TX_FLAGS:
injected = 1; injected = 1;
failed = le_to_host16((*(uint16_t *) iter.this_arg)) & failed = le_to_host16((*(le16 *) iter.this_arg)) &
IEEE80211_RADIOTAP_F_TX_FAIL; IEEE80211_RADIOTAP_F_TX_FAIL;
break; break;
case IEEE80211_RADIOTAP_DATA_RETRIES: case IEEE80211_RADIOTAP_DATA_RETRIES:

View file

@ -15,7 +15,7 @@
\ \
__ptr->__val; \ __ptr->__val; \
}) })
#define get_unaligned_le16(p) le16_to_cpu(get_unaligned((uint16_t *)(p))) #define get_unaligned_le16(p) le16_to_cpu(get_unaligned((le16 *)(p)))
#define get_unaligned_le32(p) le32_to_cpu(get_unaligned((uint32_t *)(p))) #define get_unaligned_le32(p) le32_to_cpu(get_unaligned((le32 *)(p)))
#endif /* PLATFORM_H */ #endif /* PLATFORM_H */

View file

@ -13,8 +13,8 @@
* *
* See COPYING for more details. * See COPYING for more details.
*/ */
#include "radiotap_iter.h"
#include "platform.h" #include "platform.h"
#include "radiotap_iter.h"
/* function prototypes and related defs are in radiotap_iter.h */ /* function prototypes and related defs are in radiotap_iter.h */

View file

@ -65,12 +65,12 @@ struct ieee80211_radiotap_header {
* new fields does not count. * new fields does not count.
*/ */
uint8_t it_pad; uint8_t it_pad;
uint16_t it_len; /* length of the whole le16 it_len; /* length of the whole
* header in bytes, including * header in bytes, including
* it_version, it_pad, * it_version, it_pad,
* it_len, and data fields. * it_len, and data fields.
*/ */
uint32_t it_present; /* A bitmap telling which le32 it_present; /* A bitmap telling which
* fields are present. Set bit 31 * fields are present. Set bit 31
* (0x80000000) to extend the * (0x80000000) to extend the
* bitmap by another 32 bits. * bitmap by another 32 bits.

View file

@ -67,7 +67,7 @@ struct ieee80211_radiotap_iterator {
const struct ieee80211_radiotap_namespace *current_namespace; const struct ieee80211_radiotap_namespace *current_namespace;
unsigned char *_arg, *_next_ns_data; unsigned char *_arg, *_next_ns_data;
uint32_t *_next_bitmap; le32 *_next_bitmap;
unsigned char *this_arg; unsigned char *this_arg;
#ifdef RADIOTAP_SUPPORT_OVERRIDES #ifdef RADIOTAP_SUPPORT_OVERRIDES