/* @usb_hcd is refcounted, so it won't dissapear under us and before killing a host, the polling of the root hub would be stopped anyway.  */
int wusbhc_rh_status_data(struct usb_hcd *usb_hcd, char *_buf)
/* @usb_hcd is refcounted, so it won't dissapear under us and before killing a host, the polling of the root hub would be stopped anyway.  */
int wusbhc_rh_status_data(struct usb_hcd *usb_hcd, char *_buf)
{
	struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
	size_t cnt, size;
	unsigned long *buf = (unsigned long *) _buf;
	size = wusbhc->ports_max + 1;
	size = (size + 8 - 1) / 8;
	for (cnt = 0; cnt < wusbhc->ports_max; cnt++)
		if (wusb_port_by_idx(wusbhc, cnt)->change)
			set_bit(cnt + 1, buf);
		else
			clear_bit(cnt + 1, buf);
	return size;
}