27 #ifndef BL_MESSAGES_H_
28 #define BL_MESSAGES_H_
32 #define PACK(__Declaration__) __pragma(pack(push, 1)) __Declaration__ __pragma(pack(pop))
34 #define PACK(__Declaration__) __Declaration__ __attribute__((__packed__))
40 #define BL_INCLUDE_CAP_EXTENSIONS
42 #define uint8_t quint8
43 #define uint16_t quint16
44 #define uint32_t quint32
71 #define BL_MSG_FLAGS_ECHO_REQ 0x80
72 #define BL_MSG_FLAGS_ECHO_REP 0x40
73 #define BL_MSG_FLAGS_MASK 0xC0
74 #define BL_MSG_COMMAND_MASK 0x3F
78 ((((v)&0xFF000000) >> 24) | (((v)&0x00FF0000) >> 8) | (((v)&0x0000FF00) << 8) \
79 | (((v)&0x000000FF) << 24))
81 #define ntohs(v) ((((v)&0xFF00) >> 8) | (((v)&0x00FF) << 8))
83 #define htonl(v) ntohl((v))
85 #define htons(v) ntohs((v))
133 #if defined(BL_INCLUDE_CAP_EXTENSIONS)
135 #define BL_CAP_EXTENSION_MAGIC 0x3456
169 PACK(
struct msg_xfer_start {
170 uint32_t packets_in_transfer;
172 uint8_t words_in_last_packet;
173 uint32_t expected_crc;
176 #define XFER_BYTES_PER_PACKET 56
180 uint8_t
data[XFER_BYTES_PER_PACKET];
199 PACK(
union msg_contents {
208 struct msg_xfer_start xfer_start;
216 PACK(
struct bl_messages {
217 uint8_t flags_command;
219 union msg_contents v;
224 #endif // BL_MESSAGES_H
uint32_t additional_state
uint8_t data[XFER_BYTES_PER_PACKET]
uint32_t current_packet_number
uint16_t number_of_devices
PACK(struct msg_xfer_start{uint32_t packets_in_transfer;uint8_t label;uint8_t words_in_last_packet;uint32_t expected_crc;})
uint32_t partition_sizes[10]
uint16_t cap_extension_magic