Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1bc3627b authored by Harout Hedeshian's avatar Harout Hedeshian
Browse files

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: default avatarHarout Hedeshian <harouth@codeaurora.org>
parent 8e67f56e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
#else
#elif defined(__BIG_ENDIAN_BITFIELD)
	uint8_t  cd_bit:1;
	uint8_t  reserved_bit:1;
	uint8_t  pad_len:6;
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
#else
#error "Please fix <asm/byteorder.h>"
#endif
	uint8_t  mux_id;
	uint16_t pkt_len;
}  __aligned(1);
+10 −6
Original line number Diff line number Diff line
@@ -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;
#else
#elif defined(__BIG_ENDIAN_BITFIELD)
	uint8_t  reserved:6;
	uint8_t  cmd_type:2;
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
#else
#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;
#else
#elif defined(__BIG_ENDIAN_BITFIELD)
			uint16_t  reserved:14;
			uint16_t  ip_family:2;
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
#else
#error "Please fix <asm/byteorder.h>"
#endif
			uint16_t  flow_control_seq_num;
			uint32_t  qos_id;
		} flow_control;