think_time = dev->tt ? dev->tt->think_time : 0; stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time ( dev->speed, is_input, 1, maxp)); 
iso_stream_init (	struct ehci_hcd		*ehci,	struct ehci_iso_stream	*stream,	struct usb_device	*dev,	int			pipe,	unsigned		interval){	static const u8 smask_out [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f };	u32			buf1;	unsigned		epnum, maxp;	int			is_input;	long			bandwidth;	/*	 * this might be a "high bandwidth" highspeed endpoint,	 * as encoded in the ep descriptor's wMaxPacket field	 */	epnum = usb_pipeendpoint (pipe);	is_input = usb_pipein (pipe) ? USB_DIR_IN : 0;	maxp = usb_maxpacket(dev, pipe, !is_input);	if (is_input) {		buf1 = (1 << 11);	} else {		buf1 = 0;	}	/* knows about ITD vs SITD */	if (dev->speed == USB_SPEED_HIGH) {		unsigned multi = hb_mult(maxp);		stream->highspeed = 1;		maxp = max_packet(maxp);		buf1 |= maxp;		maxp *= multi;		stream->buf0 = cpu_to_le32 ((epnum << 8) | dev->devnum);		stream->buf1 = cpu_to_le32 (buf1);		stream->buf2 = cpu_to_le32 (multi);		/* usbfs wants to report the average usecs per frame tied up		 * when transfers on this endpoint are scheduled ...		 */		stream->usecs = HS_USECS_ISO (maxp);		bandwidth = stream->usecs * 8;		bandwidth /= 1 << (interval - 1);	} else {		u32		addr;		addr = dev->ttport << 24;		if (!ehci_is_TDI(ehci)				|| (dev->tt->hub !=					ehci_to_hcd(ehci)->self.root_hub))			addr |= dev->tt->hub->devnum << 16;		addr |= epnum << 8;		addr |= dev->devnum;		stream->usecs = HS_USECS_ISO (maxp);		if (is_input) {			u32	tmp;			addr |= 1 << 31;			stream->c_usecs = stream->usecs;			stream->usecs = HS_USECS_ISO (1);			stream->raw_mask = 1;			/* pessimistic c-mask */			tmp = usb_calc_bus_time (USB_SPEED_FULL, 1, 0, maxp)					/ (125 * 1000);			stream->raw_mask |= 3 << (tmp + 9);		} else			stream->raw_mask = smask_out [maxp / 188];		bandwidth = stream->usecs + stream->c_usecs;		bandwidth /= 1 << (interval + 2);		/* stream->splits gets created from raw_mask later */		stream->address = cpu_to_le32 (addr);	}	stream->bandwidth = bandwidth;	stream->udev = dev;	stream->bEndpointAddress = is_input | epnum;	stream->interval = interval;	stream->maxp = maxp;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/d0384200f6b608e77fb5ddf7dfae1bf0e42c1c6e/ehci-sched.c/buggy/drivers/usb/host/ehci-sched.c