Fix FreeBSD build.
[haiku.git] / headers / os / drivers / usb / USB_massbulk.h
blob39ef27ab51a81340e43d657c2bd3fb6970b23512
1 /*
2 * Copyright 2014, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _USB_MSC_H
6 #define _USB_MSC_H
9 // (Partial) USB Class Definitions for Mass Storage Devices (MSC), version 1.0
10 // Reference: http://www.usb.org/developers/devclass_docs/usbmassbulk_10.pdf
13 #define USB_MASS_STORAGE_DEVICE_CLASS 0x08
15 #define USB_MASSBULK_CBW_SIGNATURE 0x43425355
16 #define USB_MASSBULK_CBW_DATA_OUTPUT 0x00
17 #define USB_MASSBULK_CBW_DATA_INPUT 0x80
19 #define USB_MASSBULK_CSW_SIGNATURE 0x53425355
20 #define USB_MASSBULK_CSW_STATUS_COMMAND_PASSED 0x00
21 #define USB_MASSBULK_CSW_STATUS_COMMAND_FAILED 0x01
22 #define USB_MASSBULK_CSW_STATUS_PHASE_ERROR 0x02
24 #define USB_MASSBULK_REQUEST_MASS_STORAGE_RESET 0xff
25 #define USB_MASSBULK_REQUEST_GET_MAX_LUN 0xfe
28 typedef struct {
29 uint32 signature;
30 uint32 tag;
31 uint32 data_transfer_length;
32 uint8 flags;
33 uint8 lun;
34 uint8 command_block_length;
35 uint8 command_block[16];
36 } _PACKED usb_massbulk_command_block_wrapper;
39 typedef struct {
40 uint32 signature;
41 uint32 tag;
42 uint32 data_residue;
43 uint8 status;
44 } _PACKED usb_massbulk_command_status_wrapper;
47 #endif