XilinxProcessorIPLib/drivers/usbpsu/examples/xusb_composite_example.c
static void Usb_StorageInHandler(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_DATA_IN) {
		/* Send the status */
		SendCSW(InstancePtr, f, 0);

	} else if (f->phase == USB_EP_STATE_STATUS) {
		f->phase = USB_EP_STATE_COMMAND;
		/* Receive next CBW */
		EpBufferRecv(InstancePtr->PrivateData, STORAGE_EP,
				(u8*)&f->cbw, sizeof(f->cbw));
	}
}
/****************************************************************************/
/**
* This function is Bulk In Endpoint handler/Callback called by driver when
* data is sent.
*
* @param	CallBackRef is pointer to Usb_DevData instance.
* @param	RequestedBytes is number of bytes requested to send.
* @param	BytesTxed is actual number of bytes sent to Host.
*
* @return	None
*
* @note		None.
*
*****************************************************************************/
This function is Bulk In Endpoint handler/Callback called by driver when
data is sent.
This function is Bulk In Endpoint handler / Callback called by driver when data is sent .
static void Usb_StorageInHandler(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_DATA_IN) {
		SendCSW(InstancePtr, f, 0);
	} else if (f->phase == USB_EP_STATE_STATUS) {
		f->phase = USB_EP_STATE_COMMAND;
		EpBufferRecv(InstancePtr->PrivateData, STORAGE_EP,
				(u8*)&f->cbw, sizeof(f->cbw));
	}
}
static void Usb_StorageInHandler ( 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_DATA_IN ) { SendCSW ( InstancePtr , f , 0 ) ; } else if ( f -> phase == USB_EP_STATE_STATUS ) { f -> phase = USB_EP_STATE_COMMAND ; EpBufferRecv ( InstancePtr -> PrivateData , STORAGE_EP , ( u8 * ) & f -> cbw , sizeof ( f -> cbw ) ) ; } }
This function is Bulk In Endpoint handler/Callback called by driver when
data is sent.
This function is Bulk In Endpoint handler / Callback called by driver when data is sent .
/* Send the status */ /* Receive next CBW */