summaryrefslogtreecommitdiff
path: root/minix/drivers/usb/usb_storage/bulk.c
blob: e7199833a28902cebfeb0a80e27d6e4824cdedda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * "Bulk only transfer" related implementation
 */

#include <assert.h>
#include <string.h>			/* memset */

#include "common.h"
#include "bulk.h"

/*===========================================================================*
 *    init_cbw                                                               *
 *===========================================================================*/
void
init_cbw(mass_storage_cbw * cbw, unsigned int tag)
{
	assert(NULL != cbw);

	/* Clearing "Command Block Wrapper" */
	memset(cbw, 0, sizeof(*cbw));

	/* Filling Command Block Wrapper */
	cbw->dCBWSignature = CBW_SIGNATURE;
	cbw->dCBWTag = tag;
	cbw->bCBWLUN = 0;
}


/*===========================================================================*
 *    init_csw                                                               *
 *===========================================================================*/
void
init_csw(mass_storage_csw * csw)
{
	assert(NULL != csw);

	/* Clearing "Command Status Wrapper" so we can receive data into it */
	memset(csw, 0, sizeof(*csw));
}