/* Intialises the XHCI host controller and allocates the necessary data structures */
int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
/* Intialises the XHCI host controller and allocates the necessary data structures */
int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
{
	struct xhci_hccr *hccr;
	struct xhci_hcor *hcor;
	struct xhci_ctrl *ctrl;
	int ret;
	*controller = NULL;
	if (xhci_hcd_init(index, &hccr, (struct xhci_hcor **)&hcor) != 0)
		return -ENODEV;
	if (xhci_reset(hcor) != 0)
		return -ENODEV;
	ctrl = &xhcic[index];
	ctrl->hccr = hccr;
	ctrl->hcor = hcor;
	ret = xhci_lowlevel_init(ctrl);
	if (ret) {
		ctrl->hccr = NULL;
		ctrl->hcor = NULL;
	} else {
		*controller = &xhcic[index];
	}
	return ret;
}