Bulk questions

bridged with qdn.public.ddk.usb
Post Reply
Jean-Louis Villecroze

Bulk questions

Post by Jean-Louis Villecroze » Tue Jul 30, 2002 6:15 am

Hello there,

I'm having a little hard time understanding how I'm suppose to send a
command to a usb device (using the Bulk protocol only) and then get the
device to answer.

From the USB 1.1 documentation for mass storage, the CBW are to be
sent on the Bulk-Out endpoint of the device, and the CSW is to
be read from the Bulk-In endpoint.

How do I specify to the URB I created to send the CBW, to wait for
data on the Bulk-In ? Do I have to create 2 URB, one for sending
and one for receiving ?

The printer example in the DDK, seems to be using only one URB ...

Here what I'm doing right now :

urb = usbd_alloc_urb(NULL);
T_CBW *cbw = (T_CBW *)buffer;

cbw->dCBWSignature = ENDIAN_LE32(CBW_SIGNATURE);
= ENDIAN_LE32((uint32_t)mass); // use a unique tag
= 12;

cbw->CBWCB[0] = 0; // TEST
cbw->CBWCB[1] = 0; // lun 0
cbw->CBWCB[4] = 0; // max lun buffer

status = usbd_io(urb,mass->ep_out,cb_test,mass,USBD_TIME_INFINITY);
if(status == EOK)
status = Mass_Bulk_Wait(mass,urb,mass->ep_out);

// free the urb


My driver seems to be locked in the Mass_Bulk_Wait function, which is
the same that the one in the printer example.

Thanks for any help.



Post Reply

Return to “qdn.public.ddk.usb”