Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/usb/controller/xhci.c
Show First 20 Lines • Show All 4,014 Lines • ▼ Show 20 Lines | restart: | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
xhci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, | xhci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, | ||||
struct usb_endpoint *ep) | struct usb_endpoint *ep) | ||||
{ | { | ||||
struct xhci_endpoint_ext *pepext; | struct xhci_endpoint_ext *pepext; | ||||
struct xhci_softc *sc; | |||||
uint8_t index; | |||||
uint8_t epno; | |||||
DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d\n", | DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d\n", | ||||
ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode); | ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode); | ||||
if (udev->parent_hub == NULL) { | if (udev->parent_hub == NULL) { | ||||
/* root HUB has special endpoint handling */ | /* root HUB has special endpoint handling */ | ||||
return; | return; | ||||
} | } | ||||
ep->methods = &xhci_device_generic_methods; | ep->methods = &xhci_device_generic_methods; | ||||
pepext = xhci_get_endpoint_ext(udev, edesc); | pepext = xhci_get_endpoint_ext(udev, edesc); | ||||
USB_BUS_LOCK(udev->bus); | USB_BUS_LOCK(udev->bus); | ||||
pepext->trb_halted = 1; | pepext->trb_halted = 1; | ||||
pepext->trb_running = 0; | pepext->trb_running = 0; | ||||
/* | |||||
* When doing an alternate setting, except for control | |||||
* endpoints, we need to re-configure the XHCI endpoint | |||||
* context: | |||||
*/ | |||||
if ((edesc->bEndpointAddress & UE_ADDR) != 0) { | |||||
sc = XHCI_BUS2SC(udev->bus); | |||||
index = udev->controller_slot_id; | |||||
epno = XHCI_EPNO2EPID(edesc->bEndpointAddress); | |||||
sc->sc_hw.devs[index].ep_configured &= ~(1U << epno); | |||||
} | |||||
USB_BUS_UNLOCK(udev->bus); | USB_BUS_UNLOCK(udev->bus); | ||||
} | } | ||||
static void | static void | ||||
xhci_ep_uninit(struct usb_device *udev, struct usb_endpoint *ep) | xhci_ep_uninit(struct usb_device *udev, struct usb_endpoint *ep) | ||||
{ | { | ||||
} | } | ||||
▲ Show 20 Lines • Show All 335 Lines • Show Last 20 Lines |