rx_process for isoc
Duncan Sands
duncan.sands at math.u-psud.fr
Fri Nov 18 13:04:41 EST 2005
On Friday 18 November 2005 17:04, Stanislaw Gruszka wrote:
> > that would work too, but in the case when data is coming in fast,
> > so all iso packets are full, you have to do a partial copy to
> > cell_buf for *every* iso packet (at least with the speedtouch)
> > because the packet length is not divisible by the stride (for
> > the speedtouch, the stride is 53, and the packet size is 640
> > or 960). Maybe it should be profiled.
> AFIAK when all iso packets are full then urb->actual_length
> == packet_size*num_packets == rx_channel.buf_size.
Yes, but the same situation arises partially whenever large network
packets are coming in (large = bigger than the iso packet size). For
example, a standard maximum ethernet packet amounts to about 2 full
iso packets followed by a partial packet (assuming an iso packet size
of 640 bytes). It seems a pity to do two pointless copies to cell_buf.
I can't deny that it adds complexity. I will try to do some profiling
and see if it actually gains anything (probably not). If not, then it
is easy to go back to the original, simpler version.
> if (usb_pipeisoc(urb->pipe)) {
> if (urb->actual_length == instance->rx_channel.buf_size)
> urbatm_extract_cells(instance, urb->transfer_buffer, urb->actual_lenght)
> else
> for (i = 0; i < urb->number_of_packets; i++) {
>
> The only problem here is if assumption
>
> len = 0
> for (i = 0; i < urb->number_of_packets; i++)
> len += urb->iso_fame_desc[i].actual_length
> ASSERT(urb->actual_length == len);
>
> is true and actual_length == 0 when error occurs.
> USB guys should know this.
Yes - want to ask them?
Ciao,
Duncan.
More information about the Usbatm
mailing list