Guest User

Untitled

a guest
Aug 25th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. uint8_t hc_addPort(usb_device_t* usbDevice)
  2. {
  3.     hc_t* hc = ((hc_port_t*)usbDevice->port->data)->hc;
  4.     hc_port_t* port = malloc(sizeof(hc_port_t), 0, "hc_port");
  5.     uint8_t num = hc_aquirePort(hc, port);
  6.  
  7.     if (usbDevice->port->type == &USB_EHCI)
  8.     {
  9.         ehci_constructPort(port, hc, num);
  10.     }
  11.     else if (usbDevice->port->type == &USB_OHCI)
  12.     {
  13.         ohci_constructPort(port, hc, num);
  14.     }
  15.     else if (usbDevice->port->type == &USB_UHCI)
  16.     {
  17.         uhci_constructPort(port, hc, num);
  18.     }
  19.     else
  20.     {
  21.         printf("\nUnknown port type.");
  22.     }
  23.     return num;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment