minix/drivers/usb_storage/bulk.c
Kees Jongenburger dfb2b8398d usb:adding usb mass storage driver.
Change-Id: I9e431d56eddfeec21413c290b2fa7ad35b566f6b

http://gerrit.minix3.org/#/c/2690/
2014-07-28 17:05:39 +02:00

39 lines
1 KiB
C
Executable file

/*
* "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));
}