* NOTE: if we can do this, we don't need a root hub timer! 
ohci_hub_status_data (struct usb_hcd *hcd, char *buf){	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);	int		i, changed = 0, length = 1;	int		can_suspend = hcd->can_wakeup;	unsigned long	flags;	spin_lock_irqsave (&ohci->lock, flags);	/* handle autosuspended root:  finish resuming before	 * letting khubd or root hub timer see state changes.	 */	if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER			|| !HC_IS_RUNNING(hcd->state)) {		can_suspend = 0;		goto done;	}	/* undocumented erratum seen on at least rev D */	if ((ohci->flags & OHCI_QUIRK_AMD756)			&& (roothub_a (ohci) & RH_A_NDP) > MAX_ROOT_PORTS) {		ohci_warn (ohci, "bogus NDP, rereads as NDP=%d\n",			  ohci_readl (ohci, &ohci->regs->roothub.a) & RH_A_NDP);		/* retry later; "should not happen" */		goto done;	}	/* init status */	if (roothub_status (ohci) & (RH_HS_LPSC | RH_HS_OCIC))		buf [0] = changed = 1;	else		buf [0] = 0;	if (ohci->num_ports > 7) {		buf [1] = 0;		length++;	}	/* look at each port */	for (i = 0; i < ohci->num_ports; i++) {		u32	status = roothub_portstatus (ohci, i);		if (status & (RH_PS_CSC | RH_PS_PESC | RH_PS_PSSC				| RH_PS_OCIC | RH_PS_PRSC)) {			changed = 1;			if (i < 7)			    buf [0] |= 1 << (i + 1);			else			    buf [1] |= 1 << (i - 7);			continue;		}		/* can suspend if no ports are enabled; or if all all		 * enabled ports are suspended AND remote wakeup is on.		 */		if (!(status & RH_PS_CCS))			continue;		if ((status & RH_PS_PSS) && hcd->remote_wakeup)			continue;		can_suspend = 0;	}done:	spin_unlock_irqrestore (&ohci->lock, flags);#ifdef CONFIG_PM	/* save power by suspending idle root hubs;	 * INTR_RD wakes us when there's work	 * NOTE: if we can do this, we don't need a root hub timer!	 */	if (can_suspend			&& !changed			&& !ohci->ed_rm_list			&& ((OHCI_CTRL_HCFS | OHCI_SCHED_ENABLES)					& ohci->hc_control)				== OHCI_USB_OPER			&& time_after (jiffies, ohci->next_statechange)			&& usb_trylock_device (hcd->self.root_hub)			) {		ohci_vdbg (ohci, "autosuspend\n");		(void) ohci_hub_suspend (hcd);		hcd->state = HC_STATE_RUNNING;		usb_unlock_device (hcd->self.root_hub);	}#endif	return changed ? length : 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f197b2c54b9d9a133a9a8ff92f35cadf8945ea14/ohci-hub.c/buggy/drivers/usb/host/ohci-hub.c