return 0;
}
-void
-ehci_free_pipe(struct usb_pipe *pipe)
-{
- if (! CONFIG_USB_EHCI)
- return;
- // Add to controller's free list.
- struct usb_s *cntl = pipe->cntl;
- pipe->freenext = cntl->freelist;
- cntl->freelist = pipe;
-}
-
static struct usb_pipe *
ehci_alloc_pipe(struct usb_pipe *dummy, int iscontrol)
{
// usb-ehci.c
int ehci_init(struct pci_device *pci, int busid, struct pci_device *comppci);
struct usb_pipe;
-void ehci_free_pipe(struct usb_pipe *p);
struct usb_pipe *ehci_alloc_control_pipe(struct usb_pipe *dummy);
int ehci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
, void *data, int datasize);
}
}
-void
-ohci_free_pipe(struct usb_pipe *pipe)
-{
- // Add to controller's free list.
- struct usb_s *cntl = pipe->cntl;
- pipe->freenext = cntl->freelist;
- cntl->freelist = pipe;
-}
-
struct usb_pipe *
ohci_alloc_control_pipe(struct usb_pipe *dummy)
{
// usb-ohci.c
void ohci_init(struct pci_device *pci, int busid);
struct usb_pipe;
-void ohci_free_pipe(struct usb_pipe *p);
struct usb_pipe *ohci_alloc_control_pipe(struct usb_pipe *dummy);
int ohci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
, void *data, int datasize);
}
}
-void
-uhci_free_pipe(struct usb_pipe *pipe)
-{
- if (! CONFIG_USB_UHCI)
- return;
- // Add to controller's free list.
- struct usb_s *cntl = pipe->cntl;
- pipe->freenext = cntl->freelist;
- cntl->freelist = pipe;
-}
-
static struct usb_pipe *
uhci_alloc_pipe(struct usb_pipe *dummy, int iscontrol)
{
// usb-uhci.c
void uhci_init(struct pci_device *pci, int busid);
struct usb_pipe;
-void uhci_free_pipe(struct usb_pipe *p);
struct usb_pipe *uhci_alloc_control_pipe(struct usb_pipe *dummy);
int uhci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
, void *data, int datasize);
ASSERT32FLAT();
if (!pipe)
return;
- switch (pipe->type) {
- default:
- case USB_TYPE_UHCI:
- return uhci_free_pipe(pipe);
- case USB_TYPE_OHCI:
- return ohci_free_pipe(pipe);
- case USB_TYPE_EHCI:
- return ehci_free_pipe(pipe);
- }
+ // Add to controller's free list.
+ struct usb_s *cntl = pipe->cntl;
+ pipe->freenext = cntl->freelist;
+ cntl->freelist = pipe;
}
// Allocate a control pipe to a default endpoint (which can only be