Changeset 3f08fd2b in mainline for uspace/drv/bus/usb/usbmast/cmds.h
- Timestamp:
- 2011-07-03T10:41:29Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6430ac6
- Parents:
- b361bdd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/cmds.h
rb361bdd r3f08fd2b 57 57 } __attribute__((packed)) usb_massstor_csw_t; 58 58 59 static inline void usb_massstor_cbw_prepare(usb_massstor_cbw_t *cbw, 60 uint32_t tag, uint32_t transfer_length, usb_direction_t dir, 61 uint8_t lun, uint8_t cmd_len, uint8_t *cmd) 62 { 63 cbw->dCBWSignature = uint32_host2usb(0x43425355); 64 cbw->dCBWTag = tag; 65 cbw->dCBWDataTransferLength = transfer_length; 66 67 cbw->bmCBWFlags = 0; 68 if (dir == USB_DIRECTION_IN) { 69 cbw->bmCBWFlags |= (1 << 7); 70 } 71 72 /* Only lowest 4 bits. */ 73 cbw->bCBWLUN = lun & 0x0F; 74 75 /* Only lowest 5 bits. */ 76 cbw->bCBWBLength = cmd_len & 0x1F; 77 78 memcpy(cbw->CBWCB, cmd, cbw->bCBWBLength); 79 } 59 extern void usb_massstor_cbw_prepare(usb_massstor_cbw_t *, uint32_t, uint32_t, 60 usb_direction_t, uint8_t, uint8_t, uint8_t *); 80 61 81 62 #endif
Note:
See TracChangeset
for help on using the changeset viewer.