XilinxProcessorIPLib/drivers/usbpsu/examples/xusb_composite_example.c
static void Usb_StorageOutHandler(void *CallBackRef, u32 RequestedBytes, u32 BytesTxed)
{
	struct Usb_DevData *InstancePtr = CallBackRef;
	USBCH9_DATA *ch9_ptr =
		(USBCH9_DATA *) Get_DrvData(InstancePtr->PrivateData);
	struct composite_dev *dev = (struct composite_dev *)(ch9_ptr->data_ptr);
	struct storage_if *f = &(dev->f_storage);

	if (f->phase == USB_EP_STATE_COMMAND) {
		ParseCBW(InstancePtr, f);

	} else if (f->phase == USB_EP_STATE_DATA_OUT) {
		/* WRITE command */
		switch (f->cbw.CBWCB[0]) {
			case USB_RBC_WRITE:
				f->diskptr += BytesTxed;
				f->bytesleft -= BytesTxed;
				break;
			default:
				break;
		}
		SendCSW(InstancePtr, f, 0);
	}
}
/****************************************************************************/
/**
* This function is Bulk Out Endpoint handler/Callback called by driver when
* data is received.
*
* @param	CallBackRef is pointer to Usb_DevData instance.
* @param	RequestedBytes is number of bytes requested for reception.
* @param	BytesTxed is actual number of bytes received from Host.
*
* @return	None
*
* @note		None.
*
*****************************************************************************/
This function is Bulk Out Endpoint handler/Callback called by driver when
data is received.
This function is Bulk Out Endpoint handler / Callback called by driver when data is received .
static void Usb_StorageOutHandler(void *CallBackRef, u32 RequestedBytes, u32 BytesTxed)
{
	struct Usb_DevData *InstancePtr = CallBackRef;
	USBCH9_DATA *ch9_ptr =
		(USBCH9_DATA *) Get_DrvData(InstancePtr->PrivateData);
	struct composite_dev *dev = (struct composite_dev *)(ch9_ptr->data_ptr);
	struct storage_if *f = &(dev->f_storage);
	if (f->phase == USB_EP_STATE_COMMAND) {
		ParseCBW(InstancePtr, f);
	} else if (f->phase == USB_EP_STATE_DATA_OUT) {
		switch (f->cbw.CBWCB[0]) {
			case USB_RBC_WRITE:
				f->diskptr += BytesTxed;
				f->bytesleft -= BytesTxed;
				break;
			default:
				break;
		}
		SendCSW(InstancePtr, f, 0);
	}
}
static void Usb_StorageOutHandler ( void * CallBackRef , u32 RequestedBytes , u32 BytesTxed ) { struct Usb_DevData * InstancePtr = CallBackRef ; USBCH9_DATA * ch9_ptr = ( USBCH9_DATA * ) Get_DrvData ( InstancePtr -> PrivateData ) ; struct composite_dev * dev = ( struct composite_dev * ) ( ch9_ptr -> data_ptr ) ; struct storage_if * f = & ( dev -> f_storage ) ; if ( f -> phase == USB_EP_STATE_COMMAND ) { ParseCBW ( InstancePtr , f ) ; } else if ( f -> phase == USB_EP_STATE_DATA_OUT ) { switch ( f -> cbw . CBWCB [ 0 ] ) { case USB_RBC_WRITE : f -> diskptr += BytesTxed ; f -> bytesleft -= BytesTxed ; break ; default : break ; } SendCSW ( InstancePtr , f , 0 ) ; } }
This function is Bulk Out Endpoint handler/Callback called by driver when
data is received.
This function is Bulk Out Endpoint handler / Callback called by driver when data is received .
/* WRITE command */