diff options
author | Ben Collins <bcollins@ubuntu.com> | 2006-06-12 18:14:47 -0400 |
---|---|---|
committer | Ben Collins <bcollins@ubuntu.com> | 2006-06-12 18:14:47 -0400 |
commit | 05db5055b1844bf39d1429a0c43078959198cd1d (patch) | |
tree | c0848d2d8fa638987479b4146a90976e27f1964c /drivers/ieee1394/sbp2.h | |
parent | bccbccdbf8f866a8e01967a48241db548e12adf2 (diff) |
sbp2: use __attribute__((packed)) for on-the-wire structures
It seems to have worked without the attribute during all the years
just because sizes of all struct members are multiples of 32 bits.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Diffstat (limited to 'drivers/ieee1394/sbp2.h')
-rw-r--r-- | drivers/ieee1394/sbp2.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index 2f53b16afc51..b22ce1aa8fe4 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
@@ -52,7 +52,7 @@ struct sbp2_command_orb { | |||
52 | u32 data_descriptor_lo; | 52 | u32 data_descriptor_lo; |
53 | u32 misc; | 53 | u32 misc; |
54 | u8 cdb[12]; | 54 | u8 cdb[12]; |
55 | }; | 55 | } __attribute__((packed)); |
56 | 56 | ||
57 | #define SBP2_LOGIN_REQUEST 0x0 | 57 | #define SBP2_LOGIN_REQUEST 0x0 |
58 | #define SBP2_QUERY_LOGINS_REQUEST 0x1 | 58 | #define SBP2_QUERY_LOGINS_REQUEST 0x1 |
@@ -80,7 +80,7 @@ struct sbp2_login_orb { | |||
80 | u32 passwd_resp_lengths; | 80 | u32 passwd_resp_lengths; |
81 | u32 status_fifo_hi; | 81 | u32 status_fifo_hi; |
82 | u32 status_fifo_lo; | 82 | u32 status_fifo_lo; |
83 | }; | 83 | } __attribute__((packed)); |
84 | 84 | ||
85 | #define RESPONSE_GET_LOGIN_ID(value) (value & 0xffff) | 85 | #define RESPONSE_GET_LOGIN_ID(value) (value & 0xffff) |
86 | #define RESPONSE_GET_LENGTH(value) ((value >> 16) & 0xffff) | 86 | #define RESPONSE_GET_LENGTH(value) ((value >> 16) & 0xffff) |
@@ -91,7 +91,7 @@ struct sbp2_login_response { | |||
91 | u32 command_block_agent_hi; | 91 | u32 command_block_agent_hi; |
92 | u32 command_block_agent_lo; | 92 | u32 command_block_agent_lo; |
93 | u32 reconnect_hold; | 93 | u32 reconnect_hold; |
94 | }; | 94 | } __attribute__((packed)); |
95 | 95 | ||
96 | #define ORB_SET_LOGIN_ID(value) (value & 0xffff) | 96 | #define ORB_SET_LOGIN_ID(value) (value & 0xffff) |
97 | 97 | ||
@@ -106,7 +106,7 @@ struct sbp2_query_logins_orb { | |||
106 | u32 reserved_resp_length; | 106 | u32 reserved_resp_length; |
107 | u32 status_fifo_hi; | 107 | u32 status_fifo_hi; |
108 | u32 status_fifo_lo; | 108 | u32 status_fifo_lo; |
109 | }; | 109 | } __attribute__((packed)); |
110 | 110 | ||
111 | #define RESPONSE_GET_MAX_LOGINS(value) (value & 0xffff) | 111 | #define RESPONSE_GET_MAX_LOGINS(value) (value & 0xffff) |
112 | #define RESPONSE_GET_ACTIVE_LOGINS(value) ((RESPONSE_GET_LENGTH(value) - 4) / 12) | 112 | #define RESPONSE_GET_ACTIVE_LOGINS(value) ((RESPONSE_GET_LENGTH(value) - 4) / 12) |
@@ -116,7 +116,7 @@ struct sbp2_query_logins_response { | |||
116 | u32 misc_IDs; | 116 | u32 misc_IDs; |
117 | u32 initiator_misc_hi; | 117 | u32 initiator_misc_hi; |
118 | u32 initiator_misc_lo; | 118 | u32 initiator_misc_lo; |
119 | }; | 119 | } __attribute__((packed)); |
120 | 120 | ||
121 | struct sbp2_reconnect_orb { | 121 | struct sbp2_reconnect_orb { |
122 | u32 reserved1; | 122 | u32 reserved1; |
@@ -127,7 +127,7 @@ struct sbp2_reconnect_orb { | |||
127 | u32 reserved5; | 127 | u32 reserved5; |
128 | u32 status_fifo_hi; | 128 | u32 status_fifo_hi; |
129 | u32 status_fifo_lo; | 129 | u32 status_fifo_lo; |
130 | }; | 130 | } __attribute__((packed)); |
131 | 131 | ||
132 | struct sbp2_logout_orb { | 132 | struct sbp2_logout_orb { |
133 | u32 reserved1; | 133 | u32 reserved1; |
@@ -138,7 +138,7 @@ struct sbp2_logout_orb { | |||
138 | u32 reserved5; | 138 | u32 reserved5; |
139 | u32 status_fifo_hi; | 139 | u32 status_fifo_hi; |
140 | u32 status_fifo_lo; | 140 | u32 status_fifo_lo; |
141 | }; | 141 | } __attribute__((packed)); |
142 | 142 | ||
143 | #define PAGE_TABLE_SET_SEGMENT_BASE_HI(value) (value & 0xffff) | 143 | #define PAGE_TABLE_SET_SEGMENT_BASE_HI(value) (value & 0xffff) |
144 | #define PAGE_TABLE_SET_SEGMENT_LENGTH(value) ((value & 0xffff) << 16) | 144 | #define PAGE_TABLE_SET_SEGMENT_LENGTH(value) ((value & 0xffff) << 16) |
@@ -146,7 +146,7 @@ struct sbp2_logout_orb { | |||
146 | struct sbp2_unrestricted_page_table { | 146 | struct sbp2_unrestricted_page_table { |
147 | u32 length_segment_base_hi; | 147 | u32 length_segment_base_hi; |
148 | u32 segment_base_lo; | 148 | u32 segment_base_lo; |
149 | }; | 149 | } __attribute__((packed)); |
150 | 150 | ||
151 | #define RESP_STATUS_REQUEST_COMPLETE 0x0 | 151 | #define RESP_STATUS_REQUEST_COMPLETE 0x0 |
152 | #define RESP_STATUS_TRANSPORT_FAILURE 0x1 | 152 | #define RESP_STATUS_TRANSPORT_FAILURE 0x1 |
@@ -191,7 +191,7 @@ struct sbp2_status_block { | |||
191 | u32 ORB_offset_hi_misc; | 191 | u32 ORB_offset_hi_misc; |
192 | u32 ORB_offset_lo; | 192 | u32 ORB_offset_lo; |
193 | u8 command_set_dependent[24]; | 193 | u8 command_set_dependent[24]; |
194 | }; | 194 | } __attribute__((packed)); |
195 | 195 | ||
196 | /* | 196 | /* |
197 | * Miscellaneous SBP2 related config rom defines | 197 | * Miscellaneous SBP2 related config rom defines |