usb: add an interface for usb controllers using the new driver API

Change-Id: I25f481c8a7c3e4aafa3080640ce156b9232eaf73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5707
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2022-09-28 22:43:42 +02:00 committed by waddlesplash
parent 2ca24be640
commit 1eebcfa03e
2 changed files with 54 additions and 0 deletions

View File

@ -895,8 +895,44 @@ struct usb_module_info_v2 gModuleInfoV2 = {
//
status_t
usb_added_device(device_node *parent)
{
dprintf("usb_added_device\n");
return B_OK;
}
status_t
usb_get_stack(void** stack)
{
*stack = gUSBStack;
return B_OK;
}
usb_for_controller_interface gForControllerModule = {
{
{
USB_FOR_CONTROLLER_MODULE_NAME,
B_KEEP_LOADED,
&bus_std_ops
},
NULL, // supported devices
usb_added_device,
NULL,
NULL,
NULL
},
usb_get_stack,
};
module_info *modules[] = {
(module_info *)&gModuleInfoV2,
(module_info *)&gModuleInfoV3,
(module_info *)&gForControllerModule,
NULL
};

View File

@ -759,4 +759,22 @@ private:
uint16 fBandwidth;
};
#include <device_manager.h>
// Interface between usb_bus and underlying implementation (xhci_pci)
typedef struct usb_bus_interface {
driver_module_info info;
} usb_bus_interface;
typedef struct {
driver_module_info info;
status_t (*get_stack)(void** stack);
} usb_for_controller_interface;
#define USB_FOR_CONTROLLER_MODULE_NAME "bus_managers/usb/controller/driver_v1"
#endif // _USB_PRIVATE_H