Prusa MINI Firmware overview
masstorage.h
Go to the documentation of this file.
1 /**
2  * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Contact information
19  * -------------------
20  *
21  * Circuits At Home, LTD
22  * Web : http://www.circuitsathome.com
23  * e-mail : support@circuitsathome.com
24  */
25 
26 #pragma once
27 
28 // Cruft removal, makes driver smaller, faster.
29 #ifndef MS_WANT_PARSER
30  #define MS_WANT_PARSER 0
31 #endif
32 
33 #include "Usb.h"
34 
35 #define bmREQ_MASSOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
36 #define bmREQ_MASSIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
37 
38 // Mass Storage Subclass Constants
39 #define MASS_SUBCLASS_SCSI_NOT_REPORTED 0x00 // De facto use
40 #define MASS_SUBCLASS_RBC 0x01
41 #define MASS_SUBCLASS_ATAPI 0x02 // MMC-5 (ATAPI)
42 #define MASS_SUBCLASS_OBSOLETE1 0x03 // Was QIC-157
43 #define MASS_SUBCLASS_UFI 0x04 // Specifies how to interface Floppy Disk Drives to USB
44 #define MASS_SUBCLASS_OBSOLETE2 0x05 // Was SFF-8070i
45 #define MASS_SUBCLASS_SCSI 0x06 // SCSI Transparent Command Set
46 #define MASS_SUBCLASS_LSDFS 0x07 // Specifies how host has to negotiate access before trying SCSI
47 #define MASS_SUBCLASS_IEEE1667 0x08
48 
49 // Mass Storage Class Protocols
50 #define MASS_PROTO_CBI 0x00 // CBI (with command completion interrupt)
51 #define MASS_PROTO_CBI_NO_INT 0x01 // CBI (without command completion interrupt)
52 #define MASS_PROTO_OBSOLETE 0x02
53 #define MASS_PROTO_BBB 0x50 // Bulk Only Transport
54 #define MASS_PROTO_UAS 0x62
55 
56 // Request Codes
57 #define MASS_REQ_ADSC 0x00
58 #define MASS_REQ_GET 0xFC
59 #define MASS_REQ_PUT 0xFD
60 #define MASS_REQ_GET_MAX_LUN 0xFE
61 #define MASS_REQ_BOMSR 0xFF // Bulk-Only Mass Storage Reset
62 
63 #define MASS_CBW_SIGNATURE 0x43425355
64 #define MASS_CSW_SIGNATURE 0x53425355
65 
66 #define MASS_CMD_DIR_OUT 0 // (0 << 7)
67 #define MASS_CMD_DIR_IN 0x80 //(1 << 7)
68 
69 /*
70  * Reference documents from T10 (http://www.t10.org)
71  * SCSI Primary Commands - 3 (SPC-3)
72  * SCSI Block Commands - 2 (SBC-2)
73  * Multi-Media Commands - 5 (MMC-5)
74  */
75 
76 /* Group 1 commands (CDB's here are should all be 6-bytes) */
77 #define SCSI_CMD_TEST_UNIT_READY 0x00
78 #define SCSI_CMD_REQUEST_SENSE 0x03
79 #define SCSI_CMD_FORMAT_UNIT 0x04
80 #define SCSI_CMD_READ_6 0x08
81 #define SCSI_CMD_WRITE_6 0x0A
82 #define SCSI_CMD_INQUIRY 0x12
83 #define SCSI_CMD_MODE_SELECT_6 0x15
84 #define SCSI_CMD_MODE_SENSE_6 0x1A
85 #define SCSI_CMD_START_STOP_UNIT 0x1B
86 #define SCSI_CMD_PREVENT_REMOVAL 0x1E
87 /* Group 2 Commands (CDB's here are 10-bytes) */
88 #define SCSI_CMD_READ_FORMAT_CAPACITIES 0x23
89 #define SCSI_CMD_READ_CAPACITY_10 0x25
90 #define SCSI_CMD_READ_10 0x28
91 #define SCSI_CMD_WRITE_10 0x2A
92 #define SCSI_CMD_SEEK_10 0x2B
93 #define SCSI_CMD_ERASE_10 0x2C
94 #define SCSI_CMD_WRITE_AND_VERIFY_10 0x2E
95 #define SCSI_CMD_VERIFY_10 0x2F
96 #define SCSI_CMD_SYNCHRONIZE_CACHE 0x35
97 #define SCSI_CMD_WRITE_BUFFER 0x3B
98 #define SCSI_CMD_READ_BUFFER 0x3C
99 #define SCSI_CMD_READ_SUBCHANNEL 0x42
100 #define SCSI_CMD_READ_TOC 0x43
101 #define SCSI_CMD_READ_HEADER 0x44
102 #define SCSI_CMD_PLAY_AUDIO_10 0x45
103 #define SCSI_CMD_GET_CONFIGURATION 0x46
104 #define SCSI_CMD_PLAY_AUDIO_MSF 0x47
105 #define SCSI_CMD_PLAY_AUDIO_TI 0x48
106 #define SCSI_CMD_PLAY_TRACK_REL_10 0x49
107 #define SCSI_CMD_GET_EVENT_STATUS 0x4A
108 #define SCSI_CMD_PAUSE_RESUME 0x4B
109 #define SCSI_CMD_READ_DISC_INFORMATION 0x51
110 #define SCSI_CMD_READ_TRACK_INFORMATION 0x52
111 #define SCSI_CMD_RESERVE_TRACK 0x53
112 #define SCSI_CMD_SEND_OPC_INFORMATION 0x54
113 #define SCSI_CMD_MODE_SELECT_10 0x55
114 #define SCSI_CMD_REPAIR_TRACK 0x58
115 #define SCSI_CMD_MODE_SENSE_10 0x5A
116 #define SCSI_CMD_CLOSE_TRACK_SESSION 0x5B
117 #define SCSI_CMD_READ_BUFFER_CAPACITY 0x5C
118 #define SCSI_CMD_SEND_CUE_SHEET 0x5D
119 /* Group 5 Commands (CDB's here are 12-bytes) */
120 #define SCSI_CMD_REPORT_LUNS 0xA0
121 #define SCSI_CMD_BLANK 0xA1
122 #define SCSI_CMD_SECURITY_PROTOCOL_IN 0xA2
123 #define SCSI_CMD_SEND_KEY 0xA3
124 #define SCSI_CMD_REPORT_KEY 0xA4
125 #define SCSI_CMD_PLAY_AUDIO_12 0xA5
126 #define SCSI_CMD_LOAD_UNLOAD 0xA6
127 #define SCSI_CMD_SET_READ_AHEAD 0xA7
128 #define SCSI_CMD_READ_12 0xA8
129 #define SCSI_CMD_PLAY_TRACK_REL_12 0xA9
130 #define SCSI_CMD_WRITE_12 0xAA
131 #define SCSI_CMD_READ_MEDIA_SERIAL_12 0xAB
132 #define SCSI_CMD_GET_PERFORMANCE 0xAC
133 #define SCSI_CMD_READ_DVD_STRUCTURE 0xAD
134 #define SCSI_CMD_SECURITY_PROTOCOL_OUT 0xB5
135 #define SCSI_CMD_SET_STREAMING 0xB6
136 #define SCSI_CMD_READ_MSF 0xB9
137 #define SCSI_CMD_SET_SPEED 0xBB
138 #define SCSI_CMD_MECHANISM_STATUS 0xBD
139 #define SCSI_CMD_READ_CD 0xBE
140 #define SCSI_CMD_SEND_DISC_STRUCTURE 0xBF
141 /* Vendor-unique Commands, included for completeness */
142 #define SCSI_CMD_CD_PLAYBACK_STATUS 0xC4 /* SONY unique */
143 #define SCSI_CMD_PLAYBACK_CONTROL 0xC9 /* SONY unique */
144 #define SCSI_CMD_READ_CDDA 0xD8 /* Vendor unique */
145 #define SCSI_CMD_READ_CDXA 0xDB /* Vendor unique */
146 #define SCSI_CMD_READ_ALL_SUBCODES 0xDF /* Vendor unique */
147 
148 /* SCSI error codes */
149 #define SCSI_S_NOT_READY 0x02
150 #define SCSI_S_MEDIUM_ERROR 0x03
151 #define SCSI_S_ILLEGAL_REQUEST 0x05
152 #define SCSI_S_UNIT_ATTENTION 0x06
153 #define SCSI_ASC_LBA_OUT_OF_RANGE 0x21
154 #define SCSI_ASC_MEDIA_CHANGED 0x28
155 #define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A
156 
157 /* USB error codes */
158 #define MASS_ERR_SUCCESS 0x00
159 #define MASS_ERR_PHASE_ERROR 0x02
160 #define MASS_ERR_UNIT_NOT_READY 0x03
161 #define MASS_ERR_UNIT_BUSY 0x04
162 #define MASS_ERR_STALL 0x05
163 #define MASS_ERR_CMD_NOT_SUPPORTED 0x06
164 #define MASS_ERR_INVALID_CSW 0x07
165 #define MASS_ERR_NO_MEDIA 0x08
166 #define MASS_ERR_BAD_LBA 0x09
167 #define MASS_ERR_MEDIA_CHANGED 0x0A
168 #define MASS_ERR_DEVICE_DISCONNECTED 0x11
169 #define MASS_ERR_UNABLE_TO_RECOVER 0x12 // Reset recovery error
170 #define MASS_ERR_INVALID_LUN 0x13
171 #define MASS_ERR_WRITE_STALL 0x14
172 #define MASS_ERR_READ_NAKS 0x15
173 #define MASS_ERR_WRITE_NAKS 0x16
174 #define MASS_ERR_WRITE_PROTECTED 0x17
175 #define MASS_ERR_NOT_IMPLEMENTED 0xFD
176 #define MASS_ERR_GENERAL_SCSI_ERROR 0xFE
177 #define MASS_ERR_GENERAL_USB_ERROR 0xFF
178 #define MASS_ERR_USER 0xA0 // For subclasses to define their own error codes
179 
180 #define MASS_TRANS_FLG_CALLBACK 0x01 // Callback is involved
181 #define MASS_TRANS_FLG_NO_STALL_CHECK 0x02 // STALL condition is not checked
182 #define MASS_TRANS_FLG_NO_PHASE_CHECK 0x04 // PHASE_ERROR is not checked
183 
184 #define MASS_MAX_ENDPOINTS 3
185 
186 struct Capacity {
188  //uint32_t dwBlockAddress;
189  //uint32_t dwBlockLength;
190 } __attribute__((packed));
191 
192 struct BASICCDB {
194 
195  unsigned unused : 5;
196  unsigned LUN : 3;
197 
199 } __attribute__((packed));
200 
202 
203 struct CDB6 {
205 
206  unsigned LBAMSB : 5;
207  unsigned LUN : 3;
208 
213 
214 public:
215 
216  CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control) :
217  Opcode(_Opcode), LBAMSB(BGRAB2(LBA) & 0x1f), LUN(_LUN), LBAHB(BGRAB1(LBA)), LBALB(BGRAB0(LBA)),
218  AllocationLength(_AllocationLength), Control(_Control) {
219  }
220 
221  CDB6(uint8_t _Opcode, uint8_t _LUN, uint8_t _AllocationLength, uint8_t _Control) :
222  Opcode(_Opcode), LBAMSB(0), LUN(_LUN), LBAHB(0), LBALB(0),
223  AllocationLength(_AllocationLength), Control(_Control) {
224  }
225 } __attribute__((packed));
226 
227 typedef CDB6 CDB6_t;
228 
229 struct CDB10 {
231 
232  unsigned Service_Action : 5;
233  unsigned LUN : 3;
234 
239 
241 
244 
246 public:
247 
248  CDB10(uint8_t _Opcode, uint8_t _LUN) :
249  Opcode(_Opcode), Service_Action(0), LUN(_LUN),
251  Misc2(0), ALC_MB(0), ALC_LB(0), Control(0) {
252  }
253 
254  CDB10(uint8_t _Opcode, uint8_t _LUN, uint16_t xflen, uint32_t _LBA) :
255  Opcode(_Opcode), Service_Action(0), LUN(_LUN),
256  LBA_L_M_MB(BGRAB3(_LBA)), LBA_L_M_LB(BGRAB2(_LBA)), LBA_L_L_MB(BGRAB1(_LBA)), LBA_L_L_LB(BGRAB0(_LBA)),
257  Misc2(0), ALC_MB(BGRAB1(xflen)), ALC_LB(BGRAB0(xflen)), Control(0) {
258  }
259 } __attribute__((packed));
260 
261 typedef CDB10 CDB10_t;
262 
263 struct CDB12 {
265 
266  unsigned Service_Action : 5;
267  unsigned Misc : 3;
268 
272 
277 } __attribute__((packed));
278 
279 typedef CDB12 CDB12_t;
280 
281 struct CDB_LBA32_16 {
283 
284  unsigned Service_Action : 5;
285  unsigned Misc : 3;
286 
291 
296 
301 
304 } __attribute__((packed));
305 
306 struct CDB_LBA64_16 {
309 
314 
319 
324 
327 } __attribute__((packed));
328 
332 
333  unsigned Reserved : 7;
334  unsigned Removable : 1;
335 
337 
338  unsigned ResponseDataFormat : 4;
339  unsigned HISUP : 1;
340  unsigned NormACA : 1;
341  unsigned TrmTsk : 1;
342  unsigned AERC : 1;
343 
345  //uint8_t Reserved3[2];
346 
347  unsigned PROTECT : 1;
348  unsigned Res : 2;
349  unsigned ThreePC : 1;
350  unsigned TPGS : 2;
351  unsigned ACC : 1;
352  unsigned SCCS : 1;
353 
354  unsigned ADDR16 : 1;
355  unsigned R1 : 1;
356  unsigned R2 : 1;
357  unsigned MCHNGR : 1;
358  unsigned MULTIP : 1;
359  unsigned VS : 1;
360  unsigned ENCSERV : 1;
361  unsigned BQUE : 1;
362 
363  unsigned SoftReset : 1;
364  unsigned CmdQue : 1;
365  unsigned Reserved4 : 1;
366  unsigned Linked : 1;
367  unsigned Sync : 1;
368  unsigned WideBus16Bit : 1;
369  unsigned WideBus32Bit : 1;
370  unsigned RelAddr : 1;
371 
375 } __attribute__((packed));
376 
378  uint32_t dCBWSignature;
379  uint32_t dCBWTag;
382 public:
383 
385  }
386 
387  CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs) :
389  }
390 } __attribute__((packed));
391 
393 
394  struct {
397  };
398 
399  struct {
402  };
403 
405 
406 public:
407  // All zeroed.
408 
411  for (int i = 0; i < 16; i++) CBWCB[i] = 0;
412  }
413 
414  // Generic Wrap, CDB zeroed.
415 
416  CommandBlockWrapper(uint32_t tag, uint32_t xflen, uint8_t flgs, uint8_t lu, uint8_t cmdlen, uint8_t cmd) :
417  CommandBlockWrapperBase(tag, xflen, flgs),
418  bmCBWLUN(lu), bmReserved1(0), bmCBWCBLength(cmdlen), bmReserved2(0) {
419  for (int i = 0; i < 16; i++) CBWCB[i] = 0;
420  // Type punning can cause optimization problems and bugs.
421  // Using reinterpret_cast to a dreinterpretifferent object is the proper way to do this.
422  //(((BASICCDB_t *) CBWCB)->LUN) = cmd;
423  BASICCDB_t *x = reinterpret_cast<BASICCDB_t *>(CBWCB);
424  x->LUN = cmd;
425  }
426 
427  // Wrap for CDB of 6
428 
429  CommandBlockWrapper(uint32_t tag, uint32_t xflen, CDB6_t *cdb, uint8_t dir) :
430  CommandBlockWrapperBase(tag, xflen, dir),
431  bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(6), bmReserved2(0) {
432  memcpy(&CBWCB, cdb, 6);
433  }
434  // Wrap for CDB of 10
435 
436  CommandBlockWrapper(uint32_t tag, uint32_t xflen, CDB10_t *cdb, uint8_t dir) :
437  CommandBlockWrapperBase(tag, xflen, dir),
438  bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(10), bmReserved2(0) {
439  memcpy(&CBWCB, cdb, 10);
440  }
441 } __attribute__((packed));
442 
444  uint32_t dCSWSignature;
445  uint32_t dCSWTag;
446  uint32_t dCSWDataResidue;
448 } __attribute__((packed));
449 
453 
459 
467 } __attribute__((packed));
468 
470 protected:
471  static const uint8_t epDataInIndex; // DataIn endpoint index
472  static const uint8_t epDataOutIndex; // DataOUT endpoint index
473  static const uint8_t epInterruptInIndex; // InterruptIN endpoint index
474 
477  uint8_t bConfNum; // configuration number
478  uint8_t bIface; // interface value
479  uint8_t bNumEP; // total number of EP in the configuration
480  uint32_t qNextPollTime; // next poll time
481  bool bPollEnable; // poll enable flag
482 
484 
485  uint32_t dCBWTag; // Tag
486  //uint32_t dCBWDataTransferLength; // Data Transfer Length
487  uint8_t bLastUsbError; // Last USB error
488  uint8_t bMaxLUN; // Max LUN
489  uint8_t bTheLUN; // Active LUN
490  uint32_t CurrentCapacity[MASS_MAX_SUPPORTED_LUN]; // Total sectors
491  uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]; // Sector size, clipped to 16 bits
492  bool LUNOk[MASS_MAX_SUPPORTED_LUN]; // use this to check for media changes.
494  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
495 
496  // Additional Initialization Method for Subclasses
497 
498  virtual uint8_t OnInit() { return 0; }
499 
500 public:
501  BulkOnly(USB *p);
502 
504 
505  uint8_t GetbMaxLUN() { return bMaxLUN; } // Max LUN
506  uint8_t GetbTheLUN() { return bTheLUN; } // Active LUN
507 
508  bool WriteProtected(uint8_t lun);
509  uint8_t MediaCTL(uint8_t lun, uint8_t ctl);
510  uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf);
511  uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs);
512  uint8_t Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf);
513  uint8_t LockMedia(uint8_t lun, uint8_t lock);
514 
515  bool LUNIsGood(uint8_t lun);
516  uint32_t GetCapacity(uint8_t lun);
517  uint16_t GetSectorSize(uint8_t lun);
518 
519  // USBDeviceConfig implementation
520  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
521  uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
522 
523  uint8_t Release();
524  uint8_t Poll();
525 
526  virtual uint8_t GetAddress() { return bAddress; }
527 
528  // UsbConfigXtracter implementation
529  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
530 
531  virtual bool DEVCLASSOK(uint8_t klass) { return klass == USB_CLASS_MASS_STORAGE; }
532 
533  uint8_t SCSITransaction6(CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir);
534  uint8_t SCSITransaction10(CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir);
535 
536 private:
537  uint8_t Inquiry(uint8_t lun, uint16_t size, uint8_t *buf);
538  uint8_t TestUnitReady(uint8_t lun);
539  uint8_t RequestSense(uint8_t lun, uint16_t size, uint8_t *buf);
540  uint8_t ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t *buf);
541  uint8_t GetMaxLUN(uint8_t *max_lun);
542  uint8_t SetCurLUN(uint8_t lun);
543  void Reset();
544  uint8_t ResetRecovery();
545  uint8_t ReadCapacity10(uint8_t lun, uint8_t *buf);
546  void ClearAllEP();
547  void CheckMedia();
548  bool CheckLUN(uint8_t lun);
549  uint8_t Page3F(uint8_t lun);
550  bool IsValidCBW(uint8_t size, uint8_t *pcbw);
551  bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw);
552 
553  bool IsValidCSW(CommandStatusWrapper *pcsw, CommandBlockWrapperBase *pcbw);
554 
555  uint8_t ClearEpHalt(uint8_t index);
556  #if MS_WANT_PARSER
557  uint8_t Transaction(CommandBlockWrapper *cbw, uint16_t bsize, void *buf, uint8_t flags);
558  #endif
559  uint8_t Transaction(CommandBlockWrapper *cbw, uint16_t bsize, void *buf);
560  uint8_t HandleUsbError(uint8_t error, uint8_t index);
561  uint8_t HandleSCSIError(uint8_t status);
562 };
USB::outTransfer
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
BulkOnly::Release
uint8_t Release()
InquiryResponse::MCHNGR
unsigned MCHNGR
Definition: masstorage.h:357
hrNAK
#define hrNAK
Definition: max3421e.h:228
hrSTALL
#define hrSTALL
Definition: max3421e.h:229
SCSI_ASC_LBA_OUT_OF_RANGE
#define SCSI_ASC_LBA_OUT_OF_RANGE
Definition: masstorage.h:153
hrSUCCESS
#define hrSUCCESS
Definition: max3421e.h:224
InquiryResponse::ProductID
uint8_t ProductID[16]
Definition: masstorage.h:373
MASS_ERR_UNIT_NOT_READY
#define MASS_ERR_UNIT_NOT_READY
Definition: masstorage.h:160
CDB_LBA32_16::Opcode
uint8_t Opcode
Definition: masstorage.h:282
CDB_LBA64_16::Misc
uint8_t Misc
Definition: masstorage.h:308
Capacity::data
uint8_t data[8]
Definition: masstorage.h:187
MASS_ERR_WRITE_PROTECTED
#define MASS_ERR_WRITE_PROTECTED
Definition: masstorage.h:174
CDB_LBA32_16
Definition: masstorage.h:281
InquiryResponse::R1
unsigned R1
Definition: masstorage.h:355
CommandStatusWrapper::dCSWTag
uint32_t dCSWTag
Definition: masstorage.h:445
USB_SETUP_TYPE_STANDARD
#define USB_SETUP_TYPE_STANDARD
Definition: usb_ch9.h:60
BulkOnly::bIface
uint8_t bIface
Definition: masstorage.h:478
CommandBlockWrapper::CBWCB
uint8_t CBWCB[16]
Definition: masstorage.h:404
BulkOnly
Definition: masstorage.h:469
AddressPool::GetUsbDevicePtr
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
CDB12::Service_Action
unsigned Service_Action
Definition: masstorage.h:266
USBDeviceConfig
Definition: UsbCore.h:137
InquiryResponse::R2
unsigned R2
Definition: masstorage.h:356
CommandBlockWrapper
CommandBlockWrapper()
Definition: masstorage.h:296
SCSI_CMD_READ_CAPACITY_10
#define SCSI_CMD_READ_CAPACITY_10
Definition: masstorage.h:89
InquiryResponse::Reserved
unsigned Reserved
Definition: masstorage.h:333
auto_build.error
bool error
Definition: auto_build.py:637
CDB12::LBA_L_L_LB
uint8_t LBA_L_L_LB
Definition: masstorage.h:271
EpInfo::bmSndToggle
uint8_t bmSndToggle
Definition: address.h:46
AddressPool
Definition: address.h:87
CDB10::LBA_L_L_MB
uint8_t LBA_L_L_MB
Definition: masstorage.h:237
RequestSenseResponce::bResponseCode
uint8_t bResponseCode
Definition: masstorage.h:451
InquiryResponse::RelAddr
unsigned RelAddr
Definition: masstorage.h:370
CommandStatusWrapper::bCSWStatus
uint8_t bCSWStatus
Definition: masstorage.h:447
lowspeed
bool lowspeed
Definition: address.h:204
NotifyFail
#define NotifyFail(...)
Definition: message.h:64
CDB_LBA32_16::Service_Action
unsigned Service_Action
Definition: masstorage.h:284
CDB12::Misc
unsigned Misc
Definition: masstorage.h:267
UsbDevice::lowspeed
bool lowspeed
Definition: address.h:83
USB_TRANSFER_TYPE_INTERRUPT
#define USB_TRANSFER_TYPE_INTERRUPT
Definition: usb_ch9.h:92
InquiryResponse::AdditionalLength
uint8_t AdditionalLength
Definition: masstorage.h:344
CDB_LBA64_16::LBA_M_M_MB
uint8_t LBA_M_M_MB
Definition: masstorage.h:310
CDB12::ALC_M_LB
uint8_t ALC_M_LB
Definition: masstorage.h:273
AddressPool::AllocAddress
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
BulkOnly::CurrentCapacity
uint32_t CurrentCapacity[MASS_MAX_SUPPORTED_LUN]
Definition: masstorage.h:490
InquiryResponse::BQUE
unsigned BQUE
Definition: masstorage.h:361
CDB_LBA64_16::LBA_L_L_MB
uint8_t LBA_L_L_MB
Definition: masstorage.h:317
USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:101
BulkOnly::bMaxLUN
uint8_t bMaxLUN
Definition: masstorage.h:488
CDB12
Definition: masstorage.h:263
MASS_CBW_SIGNATURE
#define MASS_CBW_SIGNATURE
Definition: masstorage.h:63
USB_SETUP_HOST_TO_DEVICE
#define USB_SETUP_HOST_TO_DEVICE
Definition: usb_ch9.h:58
NotifyFailSetDevTblEntry
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:60
BulkOnly::epDataInIndex
static const uint8_t epDataInIndex
Definition: masstorage.h:471
CDB_LBA64_16::ALC_L_LB
uint8_t ALC_L_LB
Definition: masstorage.h:323
CDB10::CDB10
CDB10(uint8_t _Opcode, uint8_t _LUN)
Definition: masstorage.h:248
RequestSenseResponce::CmdSpecificInformation
uint8_t CmdSpecificInformation[4]
Definition: masstorage.h:462
InquiryResponse::TrmTsk
unsigned TrmTsk
Definition: masstorage.h:341
CDB12_t
CDB12 CDB12_t
Definition: masstorage.h:279
CommandBlockWrapper::CommandBlockWrapper
CommandBlockWrapper(uint32_t tag, uint32_t xflen, CDB10_t *cdb, uint8_t dir)
Definition: masstorage.h:436
USB::getDevDescr
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
CDB_LBA32_16::LBA_L_L_MB
uint8_t LBA_L_L_MB
Definition: masstorage.h:289
CDB6::CDB6
CDB6(uint8_t _Opcode, uint8_t _LUN, uint8_t _AllocationLength, uint8_t _Control)
Definition: masstorage.h:221
CDB10::LUN
unsigned LUN
Definition: masstorage.h:233
BASICCDB::Opcode
uint8_t Opcode
Definition: masstorage.h:193
CommandBlockWrapper
Definition: masstorage.h:392
InquiryResponse::Reserved4
unsigned Reserved4
Definition: masstorage.h:365
UsbConfigXtracter
Definition: confdescparser.h:31
dCBWTag
uint32_t dCBWTag
Definition: masstorage.h:281
RequestSenseResponce::bmFileMark
uint8_t bmFileMark
Definition: masstorage.h:458
NotifyFailGetConfDescr
#define NotifyFailGetConfDescr(...)
Definition: message.h:61
__attribute__
bool boolean __attribute__((deprecated))
Definition: wiring_constants.h:110
BulkOnly::epInterruptInIndex
static const uint8_t epInterruptInIndex
Definition: masstorage.h:473
CDB10::ALC_LB
uint8_t ALC_LB
Definition: masstorage.h:243
BulkOnly::SCSITransaction10
uint8_t SCSITransaction10(CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)
CDB_LBA32_16::A_M_M_LB
uint8_t A_M_M_LB
Definition: masstorage.h:293
InquiryResponse::Version
uint8_t Version
Definition: masstorage.h:336
i
uint8_t i
Definition: screen_test_graph.c:72
CDB_LBA32_16::LBA_L_L_LB
uint8_t LBA_L_L_LB
Definition: masstorage.h:290
BGRAB0
#define BGRAB0(__usi__)
Definition: macros.h:57
InquiryResponse::MULTIP
unsigned MULTIP
Definition: masstorage.h:358
BulkOnly::bPollEnable
bool bPollEnable
Definition: masstorage.h:481
MASS_ERR_DEVICE_DISCONNECTED
#define MASS_ERR_DEVICE_DISCONNECTED
Definition: masstorage.h:168
CDB6::Opcode
uint8_t Opcode
Definition: masstorage.h:204
USBTRACE
#define USBTRACE(s)
Definition: macros.h:83
EpInfo::epAddr
uint8_t epAddr
Definition: address.h:39
CommandBlockWrapper::bmReserved1
uint8_t bmReserved1
Definition: masstorage.h:396
millis
uint32_t millis(void)
Definition: wiring_time.c:29
CDB12::LBA_L_M_LB
uint8_t LBA_L_M_LB
Definition: masstorage.h:269
MASS_ERR_INVALID_LUN
#define MASS_ERR_INVALID_LUN
Definition: masstorage.h:170
MASS_REQ_BOMSR
#define MASS_REQ_BOMSR
Definition: masstorage.h:61
CDB_LBA32_16::ALC_L_LB
uint8_t ALC_L_LB
Definition: masstorage.h:300
CDB_LBA64_16::LBA_M_M_LB
uint8_t LBA_M_M_LB
Definition: masstorage.h:311
BulkOnly::Poll
uint8_t Poll()
BulkOnly::bNumEP
uint8_t bNumEP
Definition: masstorage.h:479
BGRAB3
#define BGRAB3(__usi__)
Definition: macros.h:60
Notify
#define Notify(...)
Definition: message.h:53
BASICCDB::unused
unsigned unused
Definition: masstorage.h:195
BulkOnly::dCBWTag
uint32_t dCBWTag
Definition: masstorage.h:485
CDB10::Control
uint8_t Control
Definition: masstorage.h:245
RequestSenseResponce::bAdditionalSenseCode
uint8_t bAdditionalSenseCode
Definition: masstorage.h:463
BulkOnly::epDataOutIndex
static const uint8_t epDataOutIndex
Definition: masstorage.h:472
InquiryResponse::ACC
unsigned ACC
Definition: masstorage.h:351
BulkOnly::ConfigureDevice
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
CommandBlockWrapper::CommandBlockWrapper
CommandBlockWrapper()
Definition: masstorage.h:409
MASS_ERR_STALL
#define MASS_ERR_STALL
Definition: masstorage.h:162
CDB_LBA64_16::ALC_L_MB
uint8_t ALC_L_MB
Definition: masstorage.h:322
CDB10::Misc2
uint8_t Misc2
Definition: masstorage.h:240
bmREQ_MASSIN
#define bmREQ_MASSIN
Definition: masstorage.h:36
InquiryResponse::SCCS
unsigned SCCS
Definition: masstorage.h:352
InquiryResponse::WideBus16Bit
unsigned WideBus16Bit
Definition: masstorage.h:368
BulkOnly::bTheLUN
uint8_t bTheLUN
Definition: masstorage.h:489
NotifyFailGetDevDescr
#define NotifyFailGetDevDescr(...)
Definition: message.h:59
USBReadParser
Definition: UsbCore.h:208
CDB_LBA64_16::ALC_M_MB
uint8_t ALC_M_MB
Definition: masstorage.h:320
CP_MASK_COMPARE_SUBCLASS
#define CP_MASK_COMPARE_SUBCLASS
Definition: confdescparser.h:41
BulkOnly::GetbMaxLUN
uint8_t GetbMaxLUN()
Definition: masstorage.h:505
EpInfo::bmNakPower
uint8_t bmNakPower
Definition: address.h:48
MASS_ERR_WRITE_STALL
#define MASS_ERR_WRITE_STALL
Definition: masstorage.h:171
CommandBlockWrapperBase::dCBWSignature
uint32_t dCBWSignature
Definition: masstorage.h:378
SCSI_CMD_START_STOP_UNIT
#define SCSI_CMD_START_STOP_UNIT
Definition: masstorage.h:85
BulkOnly::Read
uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf)
RequestSenseResponce::Information
uint8_t Information[4]
Definition: masstorage.h:460
InquiryResponse::AERC
unsigned AERC
Definition: masstorage.h:342
hrTOGERR
#define hrTOGERR
Definition: max3421e.h:230
InquiryResponse::VS
unsigned VS
Definition: masstorage.h:359
CDB10::Opcode
uint8_t Opcode
Definition: masstorage.h:230
CDB10::ALC_MB
uint8_t ALC_MB
Definition: masstorage.h:242
CDB_LBA64_16::LBA_M_L_LB
uint8_t LBA_M_L_LB
Definition: masstorage.h:313
MASS_ERR_CMD_NOT_SUPPORTED
#define MASS_ERR_CMD_NOT_SUPPORTED
Definition: masstorage.h:163
BulkOnly::bAddress
uint8_t bAddress
Definition: masstorage.h:476
InquiryResponse::VendorID
uint8_t VendorID[8]
Definition: masstorage.h:372
InquiryResponse::PeripheralQualifier
uint8_t PeripheralQualifier
Definition: masstorage.h:331
CDB12::Control
uint8_t Control
Definition: masstorage.h:276
CDB_LBA64_16::LBA_L_M_MB
uint8_t LBA_L_M_MB
Definition: masstorage.h:315
USB::getConfDescr
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
BulkOnly::WriteProtected
bool WriteProtected(uint8_t lun)
InquiryResponse::Res
unsigned Res
Definition: masstorage.h:348
CDB_LBA32_16::Misc
unsigned Misc
Definition: masstorage.h:285
CDB6::LBALB
uint8_t LBALB
Definition: masstorage.h:210
CDB10::LBA_L_M_LB
uint8_t LBA_L_M_LB
Definition: masstorage.h:236
CDB12::ALC_L_MB
uint8_t ALC_L_MB
Definition: masstorage.h:274
CDB10::Service_Action
unsigned Service_Action
Definition: masstorage.h:232
CDB10_t
CDB10 CDB10_t
Definition: masstorage.h:261
RequestSenseResponce::bmILI
uint8_t bmILI
Definition: masstorage.h:456
BulkOnly::qNextPollTime
uint32_t qNextPollTime
Definition: masstorage.h:480
CDB12::LBA_L_L_MB
uint8_t LBA_L_L_MB
Definition: masstorage.h:270
InquiryResponse::Linked
unsigned Linked
Definition: masstorage.h:366
SCSI_CMD_PREVENT_REMOVAL
#define SCSI_CMD_PREVENT_REMOVAL
Definition: masstorage.h:86
CP_MASK_COMPARE_PROTOCOL
#define CP_MASK_COMPARE_PROTOCOL
Definition: confdescparser.h:42
CDB_LBA32_16::A_M_L_LB
uint8_t A_M_L_LB
Definition: masstorage.h:295
MASS_ERR_BAD_LBA
#define MASS_ERR_BAD_LBA
Definition: masstorage.h:166
InquiryResponse::WideBus32Bit
unsigned WideBus32Bit
Definition: masstorage.h:369
MS_WANT_PARSER
#define MS_WANT_PARSER
Definition: masstorage.h:30
CommandStatusWrapper::dCSWSignature
uint32_t dCSWSignature
Definition: masstorage.h:444
BGRAB2
#define BGRAB2(__usi__)
Definition: macros.h:59
BulkOnly::LockMedia
uint8_t LockMedia(uint8_t lun, uint8_t lock)
RequestSenseResponce::bSegmentNumber
uint8_t bSegmentNumber
Definition: masstorage.h:452
CDB_LBA32_16::Misc2
uint8_t Misc2
Definition: masstorage.h:302
CDB10::LBA_L_L_LB
uint8_t LBA_L_L_LB
Definition: masstorage.h:238
bmUSB_TRANSFER_TYPE
#define bmUSB_TRANSFER_TYPE
Definition: usb_ch9.h:93
InquiryResponse::NormACA
unsigned NormACA
Definition: masstorage.h:340
CDB10::CDB10
CDB10(uint8_t _Opcode, uint8_t _LUN, uint16_t xflen, uint32_t _LBA)
Definition: masstorage.h:254
InquiryResponse::RevisionID
uint8_t RevisionID[4]
Definition: masstorage.h:374
EpInfo
Definition: address.h:38
InquiryResponse::ThreePC
unsigned ThreePC
Definition: masstorage.h:349
BulkOnly::PrintEndpointDescriptor
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
CP_MASK_COMPARE_CLASS
#define CP_MASK_COMPARE_CLASS
Definition: confdescparser.h:40
BulkOnly::WriteOk
bool WriteOk[MASS_MAX_SUPPORTED_LUN]
Definition: masstorage.h:493
BASICCDB
Definition: masstorage.h:192
USBTRACE2
#define USBTRACE2(s, r)
Definition: macros.h:85
SCSI_CMD_REQUEST_SENSE
#define SCSI_CMD_REQUEST_SENSE
Definition: masstorage.h:78
MASS_ERR_GENERAL_SCSI_ERROR
#define MASS_ERR_GENERAL_SCSI_ERROR
Definition: masstorage.h:176
EpInfo::bmRcvToggle
uint8_t bmRcvToggle
Definition: address.h:47
InquiryResponse::HISUP
unsigned HISUP
Definition: masstorage.h:339
USB_REQUEST_CLEAR_FEATURE
#define USB_REQUEST_CLEAR_FEATURE
Definition: usb_ch9.h:41
CDB12::ALC_L_LB
uint8_t ALC_L_LB
Definition: masstorage.h:275
MASS_ERR_NOT_IMPLEMENTED
#define MASS_ERR_NOT_IMPLEMENTED
Definition: masstorage.h:175
InquiryResponse::SoftReset
unsigned SoftReset
Definition: masstorage.h:363
CDB_LBA32_16::Control
uint8_t Control
Definition: masstorage.h:303
CDB10::LBA_L_M_MB
uint8_t LBA_L_M_MB
Definition: masstorage.h:235
InquiryResponse::PROTECT
unsigned PROTECT
Definition: masstorage.h:347
USB::ctrlReq
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
CDB10
Definition: masstorage.h:229
BulkOnly::EndpointXtract
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
CDB_LBA64_16::Opcode
uint8_t Opcode
Definition: masstorage.h:307
CommandBlockWrapperBase::CommandBlockWrapperBase
CommandBlockWrapperBase()
Definition: masstorage.h:384
SCSI_S_ILLEGAL_REQUEST
#define SCSI_S_ILLEGAL_REQUEST
Definition: masstorage.h:151
InquiryResponse::ResponseDataFormat
unsigned ResponseDataFormat
Definition: masstorage.h:338
CommandStatusWrapper::dCSWDataResidue
uint32_t dCSWDataResidue
Definition: masstorage.h:446
InquiryResponse::DeviceType
uint8_t DeviceType
Definition: masstorage.h:330
BGRAB1
#define BGRAB1(__usi__)
Definition: macros.h:58
hrJERR
#define hrJERR
Definition: max3421e.h:237
masstorage.h
hrTIMEOUT
#define hrTIMEOUT
Definition: max3421e.h:238
MASS_ERR_NO_MEDIA
#define MASS_ERR_NO_MEDIA
Definition: masstorage.h:165
CommandBlockWrapperBase::bmCBWFlags
uint8_t bmCBWFlags
Definition: masstorage.h:381
USB
Definition: UsbCore.h:213
epAddr
uint8_t epAddr
Definition: address.h:201
BulkOnly::GetCapacity
uint32_t GetCapacity(uint8_t lun)
BulkOnly::BulkOnly
BulkOnly(USB *p)
L
#define L(CODE)
Definition: macros.h:76
BulkOnly::GetSectorSize
uint16_t GetSectorSize(uint8_t lun)
USB::inTransfer
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval=0)
CDB_LBA32_16::A_M_M_MB
uint8_t A_M_M_MB
Definition: masstorage.h:292
bmREQ_MASSOUT
#define bmREQ_MASSOUT
Definition: masstorage.h:35
RequestSenseResponce::bAdditionalSenseQualifier
uint8_t bAdditionalSenseQualifier
Definition: masstorage.h:464
RequestSenseResponce::bAdditionalLength
uint8_t bAdditionalLength
Definition: masstorage.h:461
CommandBlockWrapper::CommandBlockWrapper
CommandBlockWrapper(uint32_t tag, uint32_t xflen, uint8_t flgs, uint8_t lu, uint8_t cmdlen, uint8_t cmd)
Definition: masstorage.h:416
CommandBlockWrapperBase::dCBWTag
uint32_t dCBWTag
Definition: masstorage.h:379
SCSI_CMD_INQUIRY
#define SCSI_CMD_INQUIRY
Definition: masstorage.h:82
uint8_t
const uint8_t[]
Definition: 404_html.c:3
CDB_LBA64_16::LBA_L_L_LB
uint8_t LBA_L_L_LB
Definition: masstorage.h:318
InquiryResponse::Sync
unsigned Sync
Definition: masstorage.h:367
MASS_ERR_UNIT_BUSY
#define MASS_ERR_UNIT_BUSY
Definition: masstorage.h:161
CDB6::LBAMSB
unsigned LBAMSB
Definition: masstorage.h:206
MASS_ERR_MEDIA_CHANGED
#define MASS_ERR_MEDIA_CHANGED
Definition: masstorage.h:167
USB_ERROR_EPINFO_IS_NULL
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:99
BulkOnly::CurrentSectorSize
uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]
Definition: masstorage.h:491
SCSI_CMD_TEST_UNIT_READY
#define SCSI_CMD_TEST_UNIT_READY
Definition: masstorage.h:77
CommandBlockWrapper::CommandBlockWrapper
CommandBlockWrapper(uint32_t tag, uint32_t xflen, CDB6_t *cdb, uint8_t dir)
Definition: masstorage.h:429
CDB12::Opcode
uint8_t Opcode
Definition: masstorage.h:264
UsbDevice
Definition: address.h:79
BASICCDB::info
uint8_t info[12]
Definition: masstorage.h:198
delay
void delay(uint32_t ms)
Definition: wiring_time.c:42
CommandBlockWrapper::bmCBWLUN
uint8_t bmCBWLUN
Definition: masstorage.h:395
RequestSenseResponce::bFieldReplaceableUnitCode
uint8_t bFieldReplaceableUnitCode
Definition: masstorage.h:465
USB_NAK_DEFAULT
#define USB_NAK_DEFAULT
Definition: address.h:34
SCSI_CMD_MODE_SENSE_6
#define SCSI_CMD_MODE_SENSE_6
Definition: masstorage.h:84
Capacity
Definition: masstorage.h:186
MASS_ERR_SUCCESS
#define MASS_ERR_SUCCESS
Definition: masstorage.h:158
CDB_LBA64_16::Misc2
uint8_t Misc2
Definition: masstorage.h:325
USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:98
CDB_LBA32_16::LBA_L_M_MB
uint8_t LBA_L_M_MB
Definition: masstorage.h:287
BulkOnly::LUNOk
bool LUNOk[MASS_MAX_SUPPORTED_LUN]
Definition: masstorage.h:492
BulkOnly::bLastUsbError
uint8_t bLastUsbError
Definition: masstorage.h:487
CommandBlockWrapperBase::dCBWDataTransferLength
uint32_t dCBWDataTransferLength
Definition: masstorage.h:380
USB::setConf
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
status
static status_t status
Definition: filament_sensor.c:37
ConfigDescParser
Definition: confdescparser.h:48
RequestSenseResponce
Definition: masstorage.h:450
RequestSenseResponce::bmSenseKey
uint8_t bmSenseKey
Definition: masstorage.h:454
InquiryResponse::ADDR16
unsigned ADDR16
Definition: masstorage.h:354
InquiryResponse
Definition: masstorage.h:329
CDB6::LBAHB
uint8_t LBAHB
Definition: masstorage.h:209
USB_SETUP_RECIPIENT_ENDPOINT
#define USB_SETUP_RECIPIENT_ENDPOINT
Definition: usb_ch9.h:65
CDB_LBA32_16::LBA_L_M_LB
uint8_t LBA_L_M_LB
Definition: masstorage.h:288
SCSI_CMD_READ_10
#define SCSI_CMD_READ_10
Definition: masstorage.h:90
MASS_CMD_DIR_OUT
#define MASS_CMD_DIR_OUT
Definition: masstorage.h:66
BulkOnly::OnInit
virtual uint8_t OnInit()
Definition: masstorage.h:498
CDB6
Definition: masstorage.h:203
InquiryResponse::CmdQue
unsigned CmdQue
Definition: masstorage.h:364
BMAKE32
#define BMAKE32(__usc3__, __usc2__, __usc1__, __usc0__)
Definition: macros.h:76
BulkOnly::LUNIsGood
bool LUNIsGood(uint8_t lun)
InquiryResponse::TPGS
unsigned TPGS
Definition: masstorage.h:350
BulkOnly::epInfo
EpInfo epInfo[MASS_MAX_ENDPOINTS]
Definition: masstorage.h:483
BulkOnly::Write
uint8_t Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf)
BulkOnly::GetAddress
virtual uint8_t GetAddress()
Definition: masstorage.h:526
CDB_LBA64_16::LBA_L_M_LB
uint8_t LBA_L_M_LB
Definition: masstorage.h:316
Usb.h
InquiryResponse::ENCSERV
unsigned ENCSERV
Definition: masstorage.h:360
MASS_TRANS_FLG_CALLBACK
#define MASS_TRANS_FLG_CALLBACK
Definition: masstorage.h:180
USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:96
CDB_LBA64_16::LBA_M_L_MB
uint8_t LBA_M_L_MB
Definition: masstorage.h:312
CommandBlockWrapperBase
Definition: masstorage.h:377
NotifyFailSetConfDescr
#define NotifyFailSetConfDescr(...)
Definition: message.h:62
__attribute__
BulkOnly __attribute__
unused
unsigned unused
Definition: masstorage.h:51
BulkOnly::bConfNum
uint8_t bConfNum
Definition: masstorage.h:477
InquiryResponse::Removable
unsigned Removable
Definition: masstorage.h:334
SCSI_ASC_MEDIUM_NOT_PRESENT
#define SCSI_ASC_MEDIUM_NOT_PRESENT
Definition: masstorage.h:155
AddressPool::FreeAddress
virtual void FreeAddress(uint8_t addr)=0
USB_ERROR_FailGetDevDescr
#define USB_ERROR_FailGetDevDescr
Definition: UsbCore.h:105
USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:93
USB::setAddr
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
CDB6_t
CDB6 CDB6_t
Definition: masstorage.h:227
EpInfo::maxPktSize
uint8_t maxPktSize
Definition: address.h:40
USB::setEpInfoEntry
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
RequestSenseResponce::bmReserved
uint8_t bmReserved
Definition: masstorage.h:455
SCSI_ASC_MEDIA_CHANGED
#define SCSI_ASC_MEDIA_CHANGED
Definition: masstorage.h:154
CDB6::Control
uint8_t Control
Definition: masstorage.h:212
CDB_LBA32_16::ALC_M_LB
uint8_t ALC_M_LB
Definition: masstorage.h:298
CommandBlockWrapperBase::CommandBlockWrapperBase
CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs)
Definition: masstorage.h:387
hrBUSY
#define hrBUSY
Definition: max3421e.h:225
USB_FEATURE_ENDPOINT_HALT
#define USB_FEATURE_ENDPOINT_HALT
Definition: usb_ch9.h:52
MASS_ERR_GENERAL_USB_ERROR
#define MASS_ERR_GENERAL_USB_ERROR
Definition: masstorage.h:177
MASS_MAX_SUPPORTED_LUN
#define MASS_MAX_SUPPORTED_LUN
Definition: settings.h:103
BulkOnly::MediaCTL
uint8_t MediaCTL(uint8_t lun, uint8_t ctl)
pbuf
Definition: pbuf.h:142
MASS_SUBCLASS_SCSI
#define MASS_SUBCLASS_SCSI
Definition: masstorage.h:45
CDB6::AllocationLength
uint8_t AllocationLength
Definition: masstorage.h:211
MASS_PROTO_BBB
#define MASS_PROTO_BBB
Definition: masstorage.h:53
CommandStatusWrapper
Definition: masstorage.h:443
CDB_LBA64_16
Definition: masstorage.h:306
CDB_LBA64_16::Control
uint8_t Control
Definition: masstorage.h:326
SCSI_CMD_WRITE_10
#define SCSI_CMD_WRITE_10
Definition: masstorage.h:91
MASS_ERR_INVALID_CSW
#define MASS_ERR_INVALID_CSW
Definition: masstorage.h:164
CDB_LBA64_16::ALC_M_LB
uint8_t ALC_M_LB
Definition: masstorage.h:321
BASICCDB_t
BASICCDB BASICCDB_t
Definition: masstorage.h:201
SCSI_S_NOT_READY
#define SCSI_S_NOT_READY
Definition: masstorage.h:149
CommandBlockWrapper::bmReserved2
uint8_t bmReserved2
Definition: masstorage.h:401
MASS_REQ_GET_MAX_LUN
#define MASS_REQ_GET_MAX_LUN
Definition: masstorage.h:60
MASS_CSW_SIGNATURE
#define MASS_CSW_SIGNATURE
Definition: masstorage.h:64
BASICCDB::LUN
unsigned LUN
Definition: masstorage.h:196
MASS_CMD_DIR_IN
#define MASS_CMD_DIR_IN
Definition: masstorage.h:67
write
static int write(struct _reent *_r, void *pv, const char *pc, int n)
Definition: gcode_file.cpp:17
CommandBlockWrapper::bmCBWCBLength
uint8_t bmCBWCBLength
Definition: masstorage.h:400
CDB6::CDB6
CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control)
Definition: masstorage.h:216
BulkOnly::SCSITransaction6
uint8_t SCSITransaction6(CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)
CDB_LBA32_16::ALC_L_MB
uint8_t ALC_L_MB
Definition: masstorage.h:299
BulkOnly::pUsb
USB * pUsb
Definition: masstorage.h:475
RequestSenseResponce::SenseKeySpecific
uint8_t SenseKeySpecific[3]
Definition: masstorage.h:466
USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:104
BulkOnly::Init
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
USB_TRANSFER_TYPE_BULK
#define USB_TRANSFER_TYPE_BULK
Definition: usb_ch9.h:91
BulkOnly::GetbTheLUN
uint8_t GetbTheLUN()
Definition: masstorage.h:506
BulkOnly::GetLastUsbError
uint8_t GetLastUsbError()
Definition: masstorage.h:503
SCSI_S_UNIT_ATTENTION
#define SCSI_S_UNIT_ATTENTION
Definition: masstorage.h:152
CDB6::LUN
unsigned LUN
Definition: masstorage.h:207
RequestSenseResponce::bmEOM
uint8_t bmEOM
Definition: masstorage.h:457
size
static png_bytep size_t size
Definition: pngwrite.c:2170
CDB_LBA32_16::A_M_L_MB
uint8_t A_M_L_MB
Definition: masstorage.h:294
CDB_LBA32_16::ALC_M_MB
uint8_t ALC_M_MB
Definition: masstorage.h:297
MASS_MAX_ENDPOINTS
#define MASS_MAX_ENDPOINTS
Definition: masstorage.h:184
LUN
unsigned LUN
Definition: masstorage.h:52
USB::GetAddressPool
AddressPool & GetAddressPool()
Definition: UsbCore.h:229
BulkOnly::DEVCLASSOK
virtual bool DEVCLASSOK(uint8_t klass)
Definition: masstorage.h:531
UsbDevice::epinfo
EpInfo * epinfo
Definition: address.h:80
USB_CLASS_MASS_STORAGE
#define USB_CLASS_MASS_STORAGE
Definition: UsbCore.h:79