BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / drivers / disk / usb / usb_floppy / usb_disk_scsi.h
blobe46bd0e05677bbc640a0d08de10e51bab63a32bb
1 /*
2 * Copyright 2008, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Michael Lotz <mmlr@mlotz.ch>
7 */
9 #ifndef _USB_DISK_SCSI_H_
10 #define _USB_DISK_SCSI_H_
12 typedef enum {
13 SCSI_TEST_UNIT_READY_6 = 0x00,
14 SCSI_REQUEST_SENSE_6 = 0x03,
15 SCSI_INQUIRY_6 = 0x12,
16 SCSI_MODE_SENSE_6 = 0x1a,
17 SCSI_START_STOP_UNIT_6 = 0x1b,
18 SCSI_SEND_DIAGNOSTIC = 0x1d,
19 SCSI_READ_CAPACITY_10 = 0x25,
20 SCSI_READ_12 = 0xA8,
21 SCSI_WRITE_12 = 0xAA,
22 SCSI_SYNCHRONIZE_CACHE_10 = 0x35,
23 } scsi_operations;
25 // parameters = returned data
26 typedef struct scsi_request_sense_6_parameter_s {
27 uint8 error_code : 7;
28 uint8 valid : 1;
29 uint8 segment_number;
30 uint8 sense_key : 4;
31 uint8 unused_1 : 4;
32 uint32 information;
33 uint8 additional_sense_length;
34 uint32 command_specific_information;
35 uint8 additional_sense_code;
36 uint8 additional_sense_code_qualifier;
37 uint8 field_replacable_unit_code;
38 uint8 sense_key_specific[3];
39 } _PACKED scsi_request_sense_6_parameter;
41 typedef struct scsi_inquiry_6_parameter_s {
42 uint8 peripherial_device_type : 5;
43 uint8 peripherial_qualifier : 3;
44 uint8 reserved_1 : 7;
45 uint8 removable_medium : 1;
46 uint8 version;
47 uint8 response_data_format : 4;
48 uint8 unused_1 : 4;
49 uint8 additional_length;
50 uint8 unused_2[3];
51 char vendor_identification[8];
52 char product_identification[16];
53 char product_revision_level[4];
54 } _PACKED scsi_inquiry_6_parameter;
56 typedef struct scsi_mode_sense_6_parameter_s {
57 uint8 data_length;
58 uint8 medium_type;
59 uint8 device_specific;
60 uint8 block_descriptor_length;
61 uint8 densitiy;
62 uint8 num_blocks[3];
63 uint8 reserved;
64 uint8 block_length[3];
65 } _PACKED scsi_mode_sense_6_parameter;
67 typedef struct scsi_read_capacity_10_parameter_s {
68 uint32 last_logical_block_address;
69 uint32 logical_block_length;
70 } _PACKED scsi_read_capacity_10_parameter;
72 // request sense keys/codes
73 typedef enum {
74 SCSI_SENSE_KEY_NO_SENSE = 0x00,
75 SCSI_SENSE_KEY_RECOVERED_ERROR = 0x01,
76 SCSI_SENSE_KEY_NOT_READY = 0x02,
77 SCSI_SENSE_KEY_MEDIUM_ERROR = 0x03,
78 SCSI_SENSE_KEY_HARDWARE_ERROR = 0x04,
79 SCSI_SENSE_KEY_ILLEGAL_REQUEST = 0x05,
80 SCSI_SENSE_KEY_UNIT_ATTENTION = 0x06,
81 SCSI_SENSE_KEY_DATA_PROTECT = 0x07,
82 SCSI_SENSE_KEY_ABORTED_COMMAND = 0x0b,
83 } scsi_sense_key;
85 // request sense additional sense codes
86 #define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3a
88 // mode sense page code/parameter
89 #define SCSI_MODE_PAGE_DEVICE_CONFIGURATION 0x10
90 #define SCSI_DEVICE_SPECIFIC_WRITE_PROTECT 0x80
92 #endif // _USB_DISK_SCSI_H_