net: rmnet_data: Use standard endianness macros in structs

Replace all instances of RMNET_USE_BIG_ENDIAN_STRUCTS in header
definitions with #if defined(__LITTLE_ENDIAN_BITFIELD). The replacement
macro is well known and used in the core network stack.

Change-Id: I9a174ca40e186024ee9535e1b6c458bec60d09dc
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
This commit is contained in:
Harout Hedeshian 2014-06-17 10:04:37 -06:00
parent 8e67f56edb
commit 1bc3627bdd
2 changed files with 19 additions and 13 deletions

View File

@ -2,15 +2,17 @@
#define _NET_MAP_H_
struct rmnet_map_header_s {
#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
#if defined(__LITTLE_ENDIAN_BITFIELD)
uint8_t pad_len:6;
uint8_t reserved_bit:1;
uint8_t cd_bit:1;
#elif defined(__BIG_ENDIAN_BITFIELD)
uint8_t cd_bit:1;
uint8_t reserved_bit:1;
uint8_t pad_len:6;
#else
uint8_t cd_bit:1;
uint8_t reserved_bit:1;
uint8_t pad_len:6;
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
#error "Please fix <asm/byteorder.h>"
#endif
uint8_t mux_id;
uint16_t pkt_len;
} __aligned(1);

View File

@ -19,25 +19,29 @@
struct rmnet_map_control_command_s {
uint8_t command_name;
#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
#if defined(__LITTLE_ENDIAN_BITFIELD)
uint8_t cmd_type:2;
uint8_t reserved:6;
#elif defined(__BIG_ENDIAN_BITFIELD)
uint8_t reserved:6;
uint8_t cmd_type:2;
#else
uint8_t reserved:6;
uint8_t cmd_type:2;
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
#error "Please fix <asm/byteorder.h>"
#endif
uint16_t reserved2;
uint32_t transaction_id;
union {
uint8_t data[65528];
struct {
#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
#if defined(__LITTLE_ENDIAN_BITFIELD)
uint16_t ip_family:2;
uint16_t reserved:14;
#elif defined(__BIG_ENDIAN_BITFIELD)
uint16_t reserved:14;
uint16_t ip_family:2;
#else
uint16_t reserved:14;
uint16_t ip_family:2;
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
#error "Please fix <asm/byteorder.h>"
#endif
uint16_t flow_control_seq_num;
uint32_t qos_id;
} flow_control;