Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
usb_msc.h
Go to the documentation of this file.
1/* usb_msc.h - USB MSC public header */
2
3/*
4 * Copyright (c) 2017 PHYTEC Messtechnik GmbH
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 *
8 * This file is based on mass_storage.h
9 *
10 * This file are derived from material that is
11 * Copyright (c) 2010-2011 mbed.org, MIT License
12 * Copyright (c) 2016 Intel Corporation.
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this software and associated documentation files (the "Software"), to deal
16 * in the Software without restriction, including without limitation the rights
17 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 * copies of the Software, and to permit persons to whom the Software is
19 * furnished to do so, subject to the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 *
32 */
33
34
46#ifndef ZEPHYR_INCLUDE_USB_CLASS_USB_MSC_H_
47#define ZEPHYR_INCLUDE_USB_CLASS_USB_MSC_H_
48
50#define SCSI_TRANSPARENT_SUBCLASS 0x06
51#define BULK_ONLY_TRANSPORT_PROTOCOL 0x50
52
54#define MSC_REQUEST_GET_MAX_LUN 0xFE
55#define MSC_REQUEST_RESET 0xFF
56
58#define CBW_Signature 0x43425355
59
61#define CBW_DIRECTION_DATA_IN 0x80
62
64struct CBW {
72} __packed;
73
75#define CSW_Signature 0x53425355
76
78#define CSW_STATUS_CMD_PASSED 0x00
79#define CSW_STATUS_CMD_FAILED 0x01
80#define CSW_STATUS_PHASE_ERROR 0x02
81
83struct CSW {
88} __packed;
89
91#define TEST_UNIT_READY 0x00
92#define REQUEST_SENSE 0x03
93#define FORMAT_UNIT 0x04
94#define INQUIRY 0x12
95#define MODE_SELECT6 0x15
96#define MODE_SENSE6 0x1A
97#define START_STOP_UNIT 0x1B
98#define MEDIA_REMOVAL 0x1E
99#define READ_FORMAT_CAPACITIES 0x23
100#define READ_CAPACITY 0x25
101#define READ10 0x28
102#define WRITE10 0x2A
103#define VERIFY10 0x2F
104#define READ12 0xA8
105#define WRITE12 0xAA
106#define MODE_SELECT10 0x55
107#define MODE_SENSE10 0x5A
108
109#endif /* ZEPHYR_INCLUDE_USB_CLASS_USB_MSC_H_ */
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Definition: usb_msc.h:64
uint8_t Flags
Definition: usb_msc.h:68
uint8_t CB[16]
Definition: usb_msc.h:71
uint32_t Tag
Definition: usb_msc.h:66
uint8_t CBLength
Definition: usb_msc.h:70
uint32_t DataLength
Definition: usb_msc.h:67
uint32_t Signature
Definition: usb_msc.h:65
uint8_t LUN
Definition: usb_msc.h:69
Definition: usb_msc.h:83
uint32_t Signature
Definition: usb_msc.h:84
uint32_t DataResidue
Definition: usb_msc.h:86
uint32_t Tag
Definition: usb_msc.h:85
uint8_t Status
Definition: usb_msc.h:87