xref: /minix3/minix/drivers/usb/usb_storage/bulk.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 /*
2  * "Bulk only transfer" related implementation
3  */
4 
5 #include <assert.h>
6 #include <string.h>			/* memset */
7 
8 #include "common.h"
9 #include "bulk.h"
10 
11 /*===========================================================================*
12  *    init_cbw                                                               *
13  *===========================================================================*/
14 void
init_cbw(mass_storage_cbw * cbw,unsigned int tag)15 init_cbw(mass_storage_cbw * cbw, unsigned int tag)
16 {
17 	assert(NULL != cbw);
18 
19 	/* Clearing "Command Block Wrapper" */
20 	memset(cbw, 0, sizeof(*cbw));
21 
22 	/* Filling Command Block Wrapper */
23 	cbw->dCBWSignature = CBW_SIGNATURE;
24 	cbw->dCBWTag = tag;
25 	cbw->bCBWLUN = 0;
26 }
27 
28 
29 /*===========================================================================*
30  *    init_csw                                                               *
31  *===========================================================================*/
32 void
init_csw(mass_storage_csw * csw)33 init_csw(mass_storage_csw * csw)
34 {
35 	assert(NULL != csw);
36 
37 	/* Clearing "Command Status Wrapper" so we can receive data into it */
38 	memset(csw, 0, sizeof(*csw));
39 }
40