// Unit number for this device (0-9)
ULONG m_Unit;
KUsbLowerDevice m_Lower;
KUsbInterface m_Interface;
// Pipe for USB endpoint 2 IN (address 0x82)
KUsbPipe m_Endpoint2IN;
// Pipe for USB endpoint 6 OUT (address 0x6)
KUsbPipe m_Endpoint6OUT;
....................................
NTSTATUS USB30Device::USB30_BULK_READ(KIrp I)
{
NTSTATUS status = STATUS_INSUFFICIENT_RESOURCES;
t << "Entering USB30_BULK_READ\n";
PURB pUrb=NULL;
USB_current_buffer=m_buffer1;
pUrb = m_Endpoint2IN.BuildBulkTransfer(
USB_current_buffer, // Where data write to?
USB_transfer_size, // How much data to read?
TRUE, // direction (TRUE = IN)
NULL // Link to next URB);
if ( pUrb != NULL)
{
pUrb->UrbBulkOrInterruptTransfer.TransferFlags =(USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK);
status = m_Endpoint2IN.SubmitUrb(pUrb, NULL, NULL,URB_mSecTimeOut);
t<<"after send SubmitUrb ,status="<
//返回0x00000000
pUrb2 = m_Endpoint6OUT.BuildBulkTransfer(
WrData_Buf, // Where the data is from?
USB_WRITE_SIZE, // How much data to write?
FALSE, // direction (FALSE = OUT)
NULL, // Link to next URB
FALSE,
NULL);
t << "Entering BuildBulkTransfer ok!\n";