diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c
index 46f1241..8629d4a 100644
--- a/tools/parser/rfcomm.c
+++ b/tools/parser/rfcomm.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <asm/byteorder.h>
#include <bluetooth/bluetooth.h>
diff --git a/tools/parser/rfcomm.h b/tools/parser/rfcomm.h
index e5535e9..ac309fd 100644
--- a/tools/parser/rfcomm.h
+++ b/tools/parser/rfcomm.h
#ifndef __RFCOMM_H
#define __RFCOMM_H
+#include <endian.h>
+
#define RFCOMM_PSM 3
#define TRUE 1
#define MCC_CMD 1 /* Multiplexer command */
#define MCC_RSP 0 /* Multiplexer response */
-#ifdef __LITTLE_ENDIAN_BITFIELD
+#if __BYTE_ORDER == __LITTLE_ENDIAN
typedef struct parameter_mask{
uint8_t bit_rate:1;
parameter_mask pm;
} __attribute__ ((packed)) rpn_values;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#elif __BYTE_ORDER == __BIG_ENDIAN
typedef struct parameter_mask{
uint8_t res1:1;
parameter_mask pm;
} __attribute__ ((packed)) rpn_values;
-#else /* __XXX_BITFIELD */
-#error Processor endianness unknown!
+#else
+#error "Unknown byte order"
#endif
/* Typedefinitions of stuctures used for creating and parsing packets, for a
* further description of the structures please se the bluetooth core
* specification part F:1 and the ETSI TS 07.10 specification */
-#ifdef __LITTLE_ENDIAN_BITFIELD
+#if __BYTE_ORDER == __LITTLE_ENDIAN
typedef struct address_field {
uint8_t ea:1;
uint8_t fcs;
} __attribute__ ((packed)) nsc_msg;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#elif __BYTE_ORDER == __BIG_ENDIAN
typedef struct address_field {
uint8_t server_chn:5;
uint8_t fcs;
} __attribute__ ((packed)) nsc_msg;
-#else /* __XXX_ENDIAN */
+#else
+#error "Unknown byte order"
#error Processor endianness unknown!
-#endif /* __XXX_ENDIAN */
+#endif
#endif /* __RFCOMM_H */