bus = to_usb_bus(class_dev); 
bus = class_get_devdata(class_dev); 
show_periodic (struct class_device *class_dev, char *buf){	struct usb_bus		*bus;	struct usb_hcd		*hcd;	struct ohci_hcd		*ohci;	struct ed		**seen, *ed;	unsigned long		flags;	unsigned		temp, size, seen_count;	char			*next;	unsigned		i;	if (!(seen = kmalloc (DBG_SCHED_LIMIT * sizeof *seen, SLAB_ATOMIC)))		return 0;	seen_count = 0;	bus = to_usb_bus(class_dev);	hcd = bus->hcpriv;	ohci = hcd_to_ohci(hcd);	next = buf;	size = PAGE_SIZE;	temp = scnprintf (next, size, "size = %d\n", NUM_INTS);	size -= temp;	next += temp;	/* dump a snapshot of the periodic schedule (and load) */	spin_lock_irqsave (&ohci->lock, flags);	for (i = 0; i < NUM_INTS; i++) {		if (!(ed = ohci->periodic [i]))			continue;		temp = scnprintf (next, size, "%2d [%3d]:", i, ohci->load [i]);		size -= temp;		next += temp;		do {			temp = scnprintf (next, size, " ed%d/%p",				ed->interval, ed);			size -= temp;			next += temp;			for (temp = 0; temp < seen_count; temp++) {				if (seen [temp] == ed)					break;			}			/* show more info the first time around */			if (temp == seen_count) {				u32	info = hc32_to_cpu (ohci, ed->hwINFO);				struct list_head	*entry;				unsigned		qlen = 0;				/* qlen measured here in TDs, not urbs */				list_for_each (entry, &ed->td_list)					qlen++;				temp = scnprintf (next, size,					" (%cs dev%d ep%d%s-%s qlen %u"					" max %d %08x%s%s)",					(info & ED_LOWSPEED) ? 'l' : 'f',					info & 0x7f,					(info >> 7) & 0xf,					(info & ED_IN) ? "in" : "out",					(info & ED_ISO) ? "iso" : "int",					qlen,					0x03ff & (info >> 16),					info,					(info & ED_SKIP) ? " K" : "",					(ed->hwHeadP &						cpu_to_hc32(ohci, ED_H)) ? 							" H" : "");				size -= temp;				next += temp;				if (seen_count < DBG_SCHED_LIMIT)					seen [seen_count++] = ed;				ed = ed->ed_next;			} else {				/* we've seen it and what's after */				temp = 0;				ed = NULL;			}		} while (ed);		temp = scnprintf (next, size, "\n");		size -= temp;		next += temp;	}	spin_unlock_irqrestore (&ohci->lock, flags);	kfree (seen);	return PAGE_SIZE - size;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8561b10f6e7ef0a085709ffc844f74130a067abe/ohci-dbg.c/buggy/drivers/usb/host/ohci-dbg.c