diff --git a/src/userland/usb/include/usb.h b/src/userland/usb/include/usb.h index b9595da..42c3602 100644 --- a/src/userland/usb/include/usb.h +++ b/src/userland/usb/include/usb.h @@ -63,6 +63,8 @@ void (*setupEndpoints)(void *, ListElement *, uint32_t); void (*setupHID)(void *, uint32_t, void *); void (*doNormal)(void *, void *); + void (*setProtocol)(void *); + void (*setIdle)(void *); } UsbHostControllerInterface; typedef struct { diff --git a/src/userland/usb/include/usb.h b/src/userland/usb/include/usb.h index b9595da..42c3602 100644 --- a/src/userland/usb/include/usb.h +++ b/src/userland/usb/include/usb.h @@ -63,6 +63,8 @@ void (*setupEndpoints)(void *, ListElement *, uint32_t); void (*setupHID)(void *, uint32_t, void *); void (*doNormal)(void *, void *); + void (*setProtocol)(void *); + void (*setIdle)(void *); } UsbHostControllerInterface; typedef struct { diff --git a/src/userland/usb/main.c b/src/userland/usb/main.c index e355d29..7757a01 100644 --- a/src/userland/usb/main.c +++ b/src/userland/usb/main.c @@ -25,9 +25,6 @@ } REQUEST(registerHID, "hid", "registerHID"); -#include "xhci/xhci.h" -extern void setProtocol(SlotXHCI *slot); -extern void setIdle(SlotXHCI *slot); void setupInterfaces(UsbSlot *slot, void *start, uint32_t configurationValue) { UsbInterfaceDescriptor *interface = start; @@ -67,8 +64,8 @@ uint8_t direction = endpoint->address >> 7; uint8_t endpointIndex = (endpointNumber)*2 - 1 + direction; printf("endpoint index: %i\n", endpointIndex); - setProtocol(slot->data); - setIdle(slot->data); + slot->interface->setProtocol(slot->data); + slot->interface->setIdle(slot->data); registerHID(slot->id, 0); }) // clear list diff --git a/src/userland/usb/include/usb.h b/src/userland/usb/include/usb.h index b9595da..42c3602 100644 --- a/src/userland/usb/include/usb.h +++ b/src/userland/usb/include/usb.h @@ -63,6 +63,8 @@ void (*setupEndpoints)(void *, ListElement *, uint32_t); void (*setupHID)(void *, uint32_t, void *); void (*doNormal)(void *, void *); + void (*setProtocol)(void *); + void (*setIdle)(void *); } UsbHostControllerInterface; typedef struct { diff --git a/src/userland/usb/main.c b/src/userland/usb/main.c index e355d29..7757a01 100644 --- a/src/userland/usb/main.c +++ b/src/userland/usb/main.c @@ -25,9 +25,6 @@ } REQUEST(registerHID, "hid", "registerHID"); -#include "xhci/xhci.h" -extern void setProtocol(SlotXHCI *slot); -extern void setIdle(SlotXHCI *slot); void setupInterfaces(UsbSlot *slot, void *start, uint32_t configurationValue) { UsbInterfaceDescriptor *interface = start; @@ -67,8 +64,8 @@ uint8_t direction = endpoint->address >> 7; uint8_t endpointIndex = (endpointNumber)*2 - 1 + direction; printf("endpoint index: %i\n", endpointIndex); - setProtocol(slot->data); - setIdle(slot->data); + slot->interface->setProtocol(slot->data); + slot->interface->setIdle(slot->data); registerHID(slot->id, 0); }) // clear list diff --git a/src/userland/usb/xhci/xhci.c b/src/userland/usb/xhci/xhci.c index a697220..06d37d7 100644 --- a/src/userland/usb/xhci/xhci.c +++ b/src/userland/usb/xhci/xhci.c @@ -208,4 +208,6 @@ .setupEndpoints = (void *)xhciSetupEndpoints, .pciClass = 0x0C0330, .doNormal = (void *)xhciNormal, + .setProtocol = (void *)setProtocol, + .setIdle = (void *)setIdle, };