Tom,

All valid questions.  I'll try to answer some of
them now.

> > @@ -178,16 +182,16 @@
> > 
> >         tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L;
> >         return (((input_dir) ? 7268L : 6265L) + 
> BW_HOST_DELAY + tmp);
> > -} /* end calc_bus_time */
> > +}
> 
> How did you derive the magic constants?

These came from USB 1.1 spec, section 5.9.3, Calculating
Bus Transaction Times.
I'll double-check to see if I munged them.
I plugged numbers and formulae into a spreadsheet
to make sure that I could derive with numbers that
are close to the tables in the USB 1.1 spec and I did.
(Table 5-3, page 42, Isoc. Transaction Limits;
Table 5-4, page 45, Full-speed Interrupt Transaction Limits;
and Table 5-5, page 46, Low-speed Interrupt Transaction
Limits.)  However, IIRC, the tables don't take
bit-stuffing into account.

Some of the constants and macros in usb.h take
bit stuffing into account, although I chose not to
do worst-case bit stuffing calculations (subject
to change).  The calculcations do perform worst-case
hub-device {connectivity, topology, depth},
which I understand is also done in WindowsXXX.
We could use topology to develop more accurate
timing information but it's probably not needed.


> > +       bustime = usb_calc_bus_time (usb_pipeslow(pipe), 
> usb_pipein(pipe),
> > +                       usb_pipeisoc(pipe), 
> usb_maxpacket(dev, pipe, usb_pipeout(pipe)));
> > +       if (usb_pipeisoc(pipe))
> > +               bustime = NS_TO_US(bustime) / 
> urb->number_of_packets;
> > +       else
> > +               bustime = NS_TO_US(bustime);
> 
> I don't quite understand the logic of this. Why don't you take into
> account the actual lengths of the packets? And why the 
> division by urb->number_of_packets?

Do you mean actual length as opposed to max packet size,
or do you mean why don't I use packet length at all?
usb_calc_bus_time() does use bytecount, which is
actually max packet size.

I'm still thinking about/reasoning/justifying dividing
isoc. transfer times by number_of_packets.  It's not
finished.  Nemosoft and I had several discussions
about this last October (?) and I still have an
email trail to go thru about this subject.
It has to do with seeing URBs as linked vertically
or horizontally and accounting for their bandwidth
simultaneously or not.

Thanks,
Randy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to