Hi all,

I'm writing a driver for our (custom-made) USB-serial converter using
the usb_serial module. In order to setup the converter I have to send
some Control URBs to the converter. Sending one Control URB works fine.
But if I want to send more than one Control URB, I have to wait for the
completion hanlder to finish, before I can send the next URB. (Please
correct me, if I'm wrong) I need the result of the previous Control URB
to determine what Control URB to send next.

Now here comes my question: How do I wait?

I tried to wait with wait_queue and wake_up, but the kernel hangs.
Kernel 2.4.18-3 (Red hat 7.3)


Kind regards

        Thomas Wahrenbruch




static void my_complete( struct urb *purb )
{
   char* p_dummy;
   int i;
   struct usb_serial_port *port;

   p_dummy = purb->transfer_buffer;
   printk(KERN_DEBUG "Transfer Buffer: ");
   for (i = 0; i < 8; i++) {
     printk(KERN_DEBUG "%02X ", (short)( p_dummy[i] & 0x00FF) );
   }
   usb_unlink_urb( purb );
   // notify ?!
}


static int open()
{
    FILL_CONTROL_URB(.....);
    result = usb_submit_urb( my_urb );

    // wait for completion handler !?

    if (transfer_buffer[x] == z) {
       FILL_CONTROL_URB(.....);
       result = usb_submit_urb( my_urb );
    } else {
       ....
    }
    return 0;
}





_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to