Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t hc_addPort(usb_device_t* usbDevice)
- {
- hc_t* hc = ((hc_port_t*)usbDevice->port->data)->hc;
- hc_port_t* port = malloc(sizeof(hc_port_t), 0, "hc_port");
- uint8_t num = hc_aquirePort(hc, port);
- if (usbDevice->port->type == &USB_EHCI)
- {
- ehci_constructPort(port, hc, num);
- }
- else if (usbDevice->port->type == &USB_OHCI)
- {
- ohci_constructPort(port, hc, num);
- }
- else if (usbDevice->port->type == &USB_UHCI)
- {
- uhci_constructPort(port, hc, num);
- }
- else
- {
- printf("\nUnknown port type.");
- }
- return num;
- }
Advertisement
Add Comment
Please, Sign In to add comment