kernels/linux-2.4.0/drivers/usb/uhci.c
/*-------------------------------------------------------------------------*/
/* prepare Interrupt pipe transaction data; HUB INTERRUPT ENDPOINT */
prepare Interrupt pipe transaction data; HUB INTERRUPT ENDPOINT
prepare Interrupt pipe transaction data ; HUB INTERRUPT ENDPOINT
static int rh_send_irq(struct urb *urb)
{
	int i, len = 1;
	struct uhci *uhci = (struct uhci *)urb->dev->bus->hcpriv;
	unsigned int io_addr = uhci->io_addr;
	__u16 data = 0;
	for (i = 0; i < uhci->rh.numports; i++) {
		data |= ((inw(io_addr + USBPORTSC1 + i * 2) & 0xa) > 0 ? (1 << (i + 1)) : 0);
		len = (i + 1) / 8 + 1;
	}
	*(__u16 *) urb->transfer_buffer = cpu_to_le16(data);
	urb->actual_length = len;
	urb->status = USB_ST_NOERROR;
	if ((data > 0) && (uhci->rh.send != 0)) {
		dbg("root-hub INT complete: port1: %x port2: %x data: %x",
			inw(io_addr + USBPORTSC1), inw(io_addr + USBPORTSC2), data);
		urb->complete(urb);
	}
	return USB_ST_NOERROR;
}
static int rh_send_irq ( struct urb * urb ) { int i , len = 1 ; struct uhci * uhci = ( struct uhci * ) urb -> dev -> bus -> hcpriv ; unsigned int io_addr = uhci -> io_addr ; __u16 data = 0 ; for ( i = 0 ; i < uhci -> rh . numports ; i ++ ) { data |= ( ( inw ( io_addr + USBPORTSC1 + i * 2 ) & 0xa ) > 0 ? ( 1 << ( i + 1 ) ) : 0 ) ; len = ( i + 1 ) / 8 + 1 ; } * ( __u16 * ) urb -> transfer_buffer = cpu_to_le16 ( data ) ; urb -> actual_length = len ; urb -> status = USB_ST_NOERROR ; if ( ( data > 0 ) && ( uhci -> rh . send != 0 ) ) { dbg ( " " , inw ( io_addr + USBPORTSC1 ) , inw ( io_addr + USBPORTSC2 ) , data ) ; urb -> complete ( urb ) ; } return USB_ST_NOERROR ; }
prepare Interrupt pipe transaction data; HUB INTERRUPT ENDPOINT
prepare Interrupt pipe transaction data ; HUB INTERRUPT ENDPOINT