Hi All,

I need to write Linux driver for USB Scanner device on fedora core4 Os. that
is 2.6.11 kernel.

Scanner device has three endpoints, one is Bulk-out (ep->EndpointAddress =
0x02) and two bulk-in ednpoints ( 0x84 and 0x86).
i need to send commands on bulk-out endpoints. I have allocated memory for
this by kmalloc(), then allocated and filled URB as follows...

        dev->bulk_out_buffer = kmalloc(dev->bulk_out_bufsize, GFP_KERNEL);
        if(!dev->bulk_out_buffer)
                return -1;

        dev->write_urb = usb_alloc_urb(0, GFP_KERNEL);

        // copied the command to dev->bulk_out_buffer here

        usb_fill_bulk_urb(dev->write_urb, dev->udev,
                usb_sndbulkpipe(dev->udev, dev->bulk_out_ep_no),
                dev->bulk_out_buffer, dev->bulk_out_bufsize,
                write_callback_fun, dev);

        dev->write_urb->transfer_flags = URB_ASYNC_UNLINK;

        res = usb_submit_urb (dev->write_urb, GFP_KERNEL);

        if(res == 0)
                printk("Successfully sent command ------------->\n");
        else
                printk("Failed send command \n");

The return value of usb_submit_urb shows, it has submitted the URB
successfully, but the scanner shows no responce for that command,
ex: i am sending command to turn the LED ON, which is not happening.

before submitting this URB, i have submitted both bulk-in URBs, these URB's
call back functions are not at all called when the scanner has to respond to
some commands sent to it on bulk-out EP( like firmware version no).

Why is this happening? Scanner has responded for version no and LED ON, only
once or twice in one months effort, after that no responce. the same code
worked for few minutes well and its not working now. why?

i have also tried to allocate memory for bulk out using usb_alloc_buffer and
seeting transfer_flags to URB_NO_TRANSFER_DMA_MAP, but no result. NO idea of
whats happening!!!!!!

Any sort of help or inputs will be greately appreciated.
Thanks in advance.
Savita




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to