Pete Zaitcev wrote:
On Mon, 04 Feb 2008 08:30:37 -0800, Alan Nisota <[EMAIL PROTECTED]> wrote:

[...] If I do this using blocking reads, the device never sends any data back It appears to be waiting for multiple bulk request URBS in the queue. This apparently eliminates my ability to use libusb, so now I need to do the same thing in kernel-space.

You can submit multiply outstanding URBs and reap them using usbfs.

I'll have to play with that. It would be easier for me if I don't need to do this through kernel-space.

One thing I noticed is that endpoint 82 declares a max packet size of 0x400 where I thought the largest allowed size for usb 2.0 is 0x200. The requests from Windows also have a buffer size of 0x20000, but I assume the driver is splitting that into smaller packets.

I get the babble error regardless of the read-size I specify for the URB request.

Very interesting. The EHCI spec allows for 1024 maximum packet size
in clause 3.6.2. The USB spec allows 1024 byte isochronous payloads
in clause 5.6.3. However, as far as I understand, bulk transfers
are limited to 512 maximum packet size. What type is endpoint 82?

It's bulk.

Whatever is DMA-ed into the buffer is there, however if we set
actual_len to zero, most likely nothing was transferred.
How could I get an overflow if nothing was transferred?


If it is useful, my read handler looks sort of like this:
         urb = usb_alloc_urb(0, GFP_KERNEL);
         buf = usb_buffer_alloc(dev->udev, readsize, GFP_KERNEL, 
&urb->transfer_dma);
         usb_fill_bulk_urb(urb, dev->udev,
                           usb_rcvbulkpipe(dev->udev, 0x82),
                           buf, readsize, skel_read_bulk_callback, dev);
         urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
         retval = usb_submit_urb(urb, GFP_KERNEL);
        usb_free_urb(urb);

Allocating a buffer with usb_buffer_alloc makes no sense for high-
bandwidth transfers, please use normal kmalloc or get_free_page.

I don't actually know what I'm doing here if it isn't already obvious. I just took the write code from usb_skeleton and copied it over to the read code. I don't know how to properly handle this DMA memory stuff.

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to