Commit 66c853cc authored by Gustavo F. Padovan's avatar Gustavo F. Padovan Committed by Marcel Holtmann

Bluetooth: Use __packed annotation

To make net/ and include/net/ code consistent use __packed instead of
__attribute__ ((packed)). Bluetooth subsystem was one of the last net
subsys still using __attribute__ ((packed)).
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent d1c4a17d
...@@ -84,7 +84,7 @@ enum { ...@@ -84,7 +84,7 @@ enum {
/* BD Address */ /* BD Address */
typedef struct { typedef struct {
__u8 b[6]; __u8 b[6];
} __attribute__((packed)) bdaddr_t; } __packed bdaddr_t;
#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
......
This diff is collapsed.
...@@ -131,31 +131,31 @@ struct l2cap_conninfo { ...@@ -131,31 +131,31 @@ struct l2cap_conninfo {
struct l2cap_hdr { struct l2cap_hdr {
__le16 len; __le16 len;
__le16 cid; __le16 cid;
} __attribute__ ((packed)); } __packed;
#define L2CAP_HDR_SIZE 4 #define L2CAP_HDR_SIZE 4
struct l2cap_cmd_hdr { struct l2cap_cmd_hdr {
__u8 code; __u8 code;
__u8 ident; __u8 ident;
__le16 len; __le16 len;
} __attribute__ ((packed)); } __packed;
#define L2CAP_CMD_HDR_SIZE 4 #define L2CAP_CMD_HDR_SIZE 4
struct l2cap_cmd_rej { struct l2cap_cmd_rej {
__le16 reason; __le16 reason;
} __attribute__ ((packed)); } __packed;
struct l2cap_conn_req { struct l2cap_conn_req {
__le16 psm; __le16 psm;
__le16 scid; __le16 scid;
} __attribute__ ((packed)); } __packed;
struct l2cap_conn_rsp { struct l2cap_conn_rsp {
__le16 dcid; __le16 dcid;
__le16 scid; __le16 scid;
__le16 result; __le16 result;
__le16 status; __le16 status;
} __attribute__ ((packed)); } __packed;
/* channel indentifier */ /* channel indentifier */
#define L2CAP_CID_SIGNALING 0x0001 #define L2CAP_CID_SIGNALING 0x0001
...@@ -179,14 +179,14 @@ struct l2cap_conf_req { ...@@ -179,14 +179,14 @@ struct l2cap_conf_req {
__le16 dcid; __le16 dcid;
__le16 flags; __le16 flags;
__u8 data[0]; __u8 data[0];
} __attribute__ ((packed)); } __packed;
struct l2cap_conf_rsp { struct l2cap_conf_rsp {
__le16 scid; __le16 scid;
__le16 flags; __le16 flags;
__le16 result; __le16 result;
__u8 data[0]; __u8 data[0];
} __attribute__ ((packed)); } __packed;
#define L2CAP_CONF_SUCCESS 0x0000 #define L2CAP_CONF_SUCCESS 0x0000
#define L2CAP_CONF_UNACCEPT 0x0001 #define L2CAP_CONF_UNACCEPT 0x0001
...@@ -197,7 +197,7 @@ struct l2cap_conf_opt { ...@@ -197,7 +197,7 @@ struct l2cap_conf_opt {
__u8 type; __u8 type;
__u8 len; __u8 len;
__u8 val[0]; __u8 val[0];
} __attribute__ ((packed)); } __packed;
#define L2CAP_CONF_OPT_SIZE 2 #define L2CAP_CONF_OPT_SIZE 2
#define L2CAP_CONF_HINT 0x80 #define L2CAP_CONF_HINT 0x80
...@@ -218,7 +218,7 @@ struct l2cap_conf_rfc { ...@@ -218,7 +218,7 @@ struct l2cap_conf_rfc {
__le16 retrans_timeout; __le16 retrans_timeout;
__le16 monitor_timeout; __le16 monitor_timeout;
__le16 max_pdu_size; __le16 max_pdu_size;
} __attribute__ ((packed)); } __packed;
#define L2CAP_MODE_BASIC 0x00 #define L2CAP_MODE_BASIC 0x00
#define L2CAP_MODE_RETRANS 0x01 #define L2CAP_MODE_RETRANS 0x01
...@@ -229,22 +229,22 @@ struct l2cap_conf_rfc { ...@@ -229,22 +229,22 @@ struct l2cap_conf_rfc {
struct l2cap_disconn_req { struct l2cap_disconn_req {
__le16 dcid; __le16 dcid;
__le16 scid; __le16 scid;
} __attribute__ ((packed)); } __packed;
struct l2cap_disconn_rsp { struct l2cap_disconn_rsp {
__le16 dcid; __le16 dcid;
__le16 scid; __le16 scid;
} __attribute__ ((packed)); } __packed;
struct l2cap_info_req { struct l2cap_info_req {
__le16 type; __le16 type;
} __attribute__ ((packed)); } __packed;
struct l2cap_info_rsp { struct l2cap_info_rsp {
__le16 type; __le16 type;
__le16 result; __le16 result;
__u8 data[0]; __u8 data[0];
} __attribute__ ((packed)); } __packed;
/* info type */ /* info type */
#define L2CAP_IT_CL_MTU 0x0001 #define L2CAP_IT_CL_MTU 0x0001
......
...@@ -106,19 +106,19 @@ struct rfcomm_hdr { ...@@ -106,19 +106,19 @@ struct rfcomm_hdr {
u8 addr; u8 addr;
u8 ctrl; u8 ctrl;
u8 len; // Actual size can be 2 bytes u8 len; // Actual size can be 2 bytes
} __attribute__ ((packed)); } __packed;
struct rfcomm_cmd { struct rfcomm_cmd {
u8 addr; u8 addr;
u8 ctrl; u8 ctrl;
u8 len; u8 len;
u8 fcs; u8 fcs;
} __attribute__ ((packed)); } __packed;
struct rfcomm_mcc { struct rfcomm_mcc {
u8 type; u8 type;
u8 len; u8 len;
} __attribute__ ((packed)); } __packed;
struct rfcomm_pn { struct rfcomm_pn {
u8 dlci; u8 dlci;
...@@ -128,7 +128,7 @@ struct rfcomm_pn { ...@@ -128,7 +128,7 @@ struct rfcomm_pn {
__le16 mtu; __le16 mtu;
u8 max_retrans; u8 max_retrans;
u8 credits; u8 credits;
} __attribute__ ((packed)); } __packed;
struct rfcomm_rpn { struct rfcomm_rpn {
u8 dlci; u8 dlci;
...@@ -138,17 +138,17 @@ struct rfcomm_rpn { ...@@ -138,17 +138,17 @@ struct rfcomm_rpn {
u8 xon_char; u8 xon_char;
u8 xoff_char; u8 xoff_char;
__le16 param_mask; __le16 param_mask;
} __attribute__ ((packed)); } __packed;
struct rfcomm_rls { struct rfcomm_rls {
u8 dlci; u8 dlci;
u8 status; u8 status;
} __attribute__ ((packed)); } __packed;
struct rfcomm_msc { struct rfcomm_msc {
u8 dlci; u8 dlci;
u8 v24_sig; u8 v24_sig;
} __attribute__ ((packed)); } __packed;
/* ---- Core structures, flags etc ---- */ /* ---- Core structures, flags etc ---- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment