struct usb_ehci_s *cntl = malloc_tmphigh(sizeof(*cntl));
memset(cntl, 0, sizeof(*cntl));
cntl->usb.busid = busid;
+ cntl->usb.bdf = bdf;
cntl->usb.type = USB_TYPE_EHCI;
cntl->caps = caps;
cntl->regs = (void*)caps + readb(&caps->caplength);
struct usb_ohci_s *cntl = malloc_tmphigh(sizeof(*cntl));
memset(cntl, 0, sizeof(*cntl));
cntl->usb.busid = busid;
+ cntl->usb.bdf = bdf;
cntl->usb.type = USB_TYPE_OHCI;
u32 baseaddr = pci_config_readl(bdf, PCI_BASE_ADDRESS_0);
struct usb_uhci_s *cntl = malloc_tmphigh(sizeof(*cntl));
memset(cntl, 0, sizeof(*cntl));
cntl->usb.busid = busid;
+ cntl->usb.bdf = bdf;
cntl->usb.type = USB_TYPE_UHCI;
cntl->iobase = (pci_config_readl(bdf, PCI_BASE_ADDRESS_4)
& PCI_BASE_ADDRESS_IO_MASK);
dummy.cntl = cntl;
dummy.type = cntl->type;
dummy.maxpacket = 8;
+ dummy.path = (u64)-1;
cntl->defaultpipe = defpipe = alloc_default_control_pipe(&dummy);
if (!defpipe)
return NULL;
defpipe->devaddr = cntl->maxaddr;
struct usb_pipe *pipe = alloc_default_control_pipe(defpipe);
defpipe->devaddr = 0;
+ if (hub->pipe)
+ pipe->path = hub->pipe->path;
+ pipe->path = (pipe->path << 8) | port;
return pipe;
}
// Information on a USB end point.
struct usb_pipe {
struct usb_s *cntl;
+ u64 path;
u8 type;
u8 ep;
u8 devaddr;
struct usb_pipe *defaultpipe;
struct mutex_s resetlock;
int busid;
+ u16 bdf;
u8 type;
u8 maxaddr;
};