Hi Michael,
> Hi.  I'm using the ohci-isp1362 driver, and I'm finally getting it
> working.  However, I can make it crash every time I use a
> usb-serial adapter.
> 
> I seem to trigger the BUG_ON(xfer_size < mps) in process_td.
> (ohci-isp1362-emu.c)  It seems the null pointer dereference is
> caused by the BUG_ON macro.. but I'd prefer not to trigger this bug
>
That's the purpose of the BUG() and BUG_ON() macros. They complain
loud and clear so that an error won't get through unnoticed.

>  xfer_size = ptd_xfer_size(ptd_q, xfer_type, len);
>  printk("len = %d, xfer_size = %d, mps = %d, xfer_type = %d\n",
> len, xfer_size, mps, xfer_type);
>  if (xfer_size < len && xfer_size % mps) {
>          BUG_ON(xfer_size < mps);
>          // round down to an integer multiple of max_packet_size
>          xfer_size -= xfer_size % mps;
>
If xfer_size is less than mps this assignment would give a bogus
result, thus the BUG_ON() macro to catch this case.

> len = 64, xfer_size = 8, mps = 64, xfer_type = 3
>
It looks like your blocksize for the INT transfer buffer is set to 8
and the device requires 64 byte max packet size. A data block of >
max_packet_size byte is divided into an integral number of packets of
max_packet_size byte plus one packet (the last one) that may carry
less than max_packet_size byte of data. Thus the block size of each
buffer area need to be at least 'max_packet_size' of the corresponding
transfer type.


Lothar


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to