1 #ifndef __SPC2_STRUCT_H__6R1KTJP0NJ__
2 #define __SPC2_STRUCT_H__6R1KTJP0NJ__
4 typedef uint8_t uint40_bytes[5];
5 typedef uint8_t uint32_bytes[4];
6 typedef uint8_t uint16_bytes[2];
8 #ifndef CC_BYTE_ALIGNED
10 #define CC_BYTE_ALIGNED __attribute__ ((packed))
14 #ifndef CC_BYTE_ALIGNED
15 #define CC_BYTE_ALIGNED
18 #define HOST16_TO_BE_BYTES(x) {(((x) >> 8) & 0xff), ((x) & 0xff)}
19 #define HOST32_TO_BE_BYTES(x) {(((x) >> 24) & 0xff), (((x) >> 16) & 0xff), \
20 (((x) >> 8) & 0xff), ((x) & 0xff)}
21 #define HOST40_TO_BE_BYTES(x) {(((x) >> 32) & 0xff), (((x) >> 24) & 0xff), (((x) >> 16) & 0xff), \
22 (((x) >> 8) & 0xff), ((x) & 0xff)}
25 be16_to_host(uint16_bytes bytes)
27 return bytes[0] << 8 | bytes[1];
31 be32_to_host(uint32_bytes bytes)
33 return (be16_to_host(bytes) << 16) | be16_to_host(bytes + 2);
37 #define BE16_TO_HOST(bytes) ((bytes)[0] << 8 | (bytes)[1])
38 #define BE32_TO_HOST(bytes) \
39 ((BE16_TO_HOST(bytes) << 16) | BE16_TO_HOST((bytes)+2))
40 struct spc2_inquiry_cmd
46 uint8_t allocation_length;
50 struct spc2_std_inquiry_data
56 uint8_t additional_length;
65 struct spc2_vital_product_data_head
73 struct spc2_identification_descriptor
76 uint8_t identifier_type;
78 uint8_t identifier_length;
81 struct spc2_request_sense_cmd
87 uint8_t allocation_length;
91 struct spc2_sense_data
93 uint8_t response_code;
96 uint8_t information[4];
97 uint8_t additional_length;
98 uint8_t command_specific[4];
102 uint8_t sense_key_specific[3];
105 struct spc2_mode_sence_6_cmd
111 uint8_t allocation_length;
115 struct spc2_mode_select_6_cmd
121 uint8_t parameter_list_length;
125 struct spc2_mode_parameter_header_6
127 uint8_t mode_data_length;
129 uint8_t device_specific_parameter;
130 uint8_t block_descriptor_length;
133 struct spc2_mode_page