Deleted Added
full compact
xhci.c (259023) xhci.c (259218)
1/* $FreeBSD: head/sys/dev/usb/controller/xhci.c 259023 2013-12-06 08:42:41Z hselasky $ */
1/* $FreeBSD: head/sys/dev/usb/controller/xhci.c 259218 2013-12-11 13:20:32Z hselasky $ */
2/*-
3 * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

--- 145 unchanged lines hidden (view full) ---

155static void xhci_endpoint_doorbell(struct usb_xfer *);
156static void xhci_ctx_set_le32(struct xhci_softc *sc, volatile uint32_t *ptr, uint32_t val);
157static uint32_t xhci_ctx_get_le32(struct xhci_softc *sc, volatile uint32_t *ptr);
158static void xhci_ctx_set_le64(struct xhci_softc *sc, volatile uint64_t *ptr, uint64_t val);
159#ifdef USB_DEBUG
160static uint64_t xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr);
161#endif
162
2/*-
3 * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

--- 145 unchanged lines hidden (view full) ---

155static void xhci_endpoint_doorbell(struct usb_xfer *);
156static void xhci_ctx_set_le32(struct xhci_softc *sc, volatile uint32_t *ptr, uint32_t val);
157static uint32_t xhci_ctx_get_le32(struct xhci_softc *sc, volatile uint32_t *ptr);
158static void xhci_ctx_set_le64(struct xhci_softc *sc, volatile uint64_t *ptr, uint64_t val);
159#ifdef USB_DEBUG
160static uint64_t xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr);
161#endif
162
163extern struct usb_bus_methods xhci_bus_methods;
163static const struct usb_bus_methods xhci_bus_methods;
164
165#ifdef USB_DEBUG
166static void
167xhci_dump_trb(struct xhci_trb *trb)
168{
169 DPRINTFN(5, "trb = %p\n", trb);
170 DPRINTFN(5, "qwTrb0 = 0x%016llx\n", (long long)le64toh(trb->qwTrb0));
171 DPRINTFN(5, "dwTrb2 = 0x%08x\n", le32toh(trb->dwTrb2));

--- 2892 unchanged lines hidden (view full) ---

3064 /* add transfer last on interrupt queue */
3065 usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
3066
3067 /* start timeout, if any */
3068 if (xfer->timeout != 0)
3069 usbd_transfer_timeout_ms(xfer, &xhci_timeout, xfer->timeout);
3070}
3071
164
165#ifdef USB_DEBUG
166static void
167xhci_dump_trb(struct xhci_trb *trb)
168{
169 DPRINTFN(5, "trb = %p\n", trb);
170 DPRINTFN(5, "qwTrb0 = 0x%016llx\n", (long long)le64toh(trb->qwTrb0));
171 DPRINTFN(5, "dwTrb2 = 0x%08x\n", le32toh(trb->dwTrb2));

--- 2892 unchanged lines hidden (view full) ---

3064 /* add transfer last on interrupt queue */
3065 usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
3066
3067 /* start timeout, if any */
3068 if (xfer->timeout != 0)
3069 usbd_transfer_timeout_ms(xfer, &xhci_timeout, xfer->timeout);
3070}
3071
3072struct usb_pipe_methods xhci_device_generic_methods =
3072static const struct usb_pipe_methods xhci_device_generic_methods =
3073{
3074 .open = xhci_device_generic_open,
3075 .close = xhci_device_generic_close,
3076 .enter = xhci_device_generic_enter,
3077 .start = xhci_device_generic_start,
3078};
3079
3080/*------------------------------------------------------------------------*

--- 1149 unchanged lines hidden (view full) ---

4230 udev->speed != USB_SPEED_SUPER)
4231 return (USB_ERR_INVAL);
4232 return (0);
4233 default:
4234 return (USB_ERR_INVAL);
4235 }
4236}
4237
3073{
3074 .open = xhci_device_generic_open,
3075 .close = xhci_device_generic_close,
3076 .enter = xhci_device_generic_enter,
3077 .start = xhci_device_generic_start,
3078};
3079
3080/*------------------------------------------------------------------------*

--- 1149 unchanged lines hidden (view full) ---

4230 udev->speed != USB_SPEED_SUPER)
4231 return (USB_ERR_INVAL);
4232 return (0);
4233 default:
4234 return (USB_ERR_INVAL);
4235 }
4236}
4237
4238struct usb_bus_methods xhci_bus_methods = {
4238static const struct usb_bus_methods xhci_bus_methods = {
4239 .endpoint_init = xhci_ep_init,
4240 .endpoint_uninit = xhci_ep_uninit,
4241 .xfer_setup = xhci_xfer_setup,
4242 .xfer_unsetup = xhci_xfer_unsetup,
4243 .get_dma_delay = xhci_get_dma_delay,
4244 .device_init = xhci_device_init,
4245 .device_uninit = xhci_device_uninit,
4246 .device_resume = xhci_device_resume,
4247 .device_suspend = xhci_device_suspend,
4248 .set_hw_power = xhci_set_hw_power,
4249 .roothub_exec = xhci_roothub_exec,
4250 .xfer_poll = xhci_do_poll,
4251 .start_dma_delay = xhci_start_dma_delay,
4252 .set_address = xhci_set_address,
4253 .clear_stall = xhci_ep_clear_stall,
4254 .device_state_change = xhci_device_state_change,
4255 .set_hw_power_sleep = xhci_set_hw_power_sleep,
4256 .set_endpoint_mode = xhci_set_endpoint_mode,
4257};
4239 .endpoint_init = xhci_ep_init,
4240 .endpoint_uninit = xhci_ep_uninit,
4241 .xfer_setup = xhci_xfer_setup,
4242 .xfer_unsetup = xhci_xfer_unsetup,
4243 .get_dma_delay = xhci_get_dma_delay,
4244 .device_init = xhci_device_init,
4245 .device_uninit = xhci_device_uninit,
4246 .device_resume = xhci_device_resume,
4247 .device_suspend = xhci_device_suspend,
4248 .set_hw_power = xhci_set_hw_power,
4249 .roothub_exec = xhci_roothub_exec,
4250 .xfer_poll = xhci_do_poll,
4251 .start_dma_delay = xhci_start_dma_delay,
4252 .set_address = xhci_set_address,
4253 .clear_stall = xhci_ep_clear_stall,
4254 .device_state_change = xhci_device_state_change,
4255 .set_hw_power_sleep = xhci_set_hw_power_sleep,
4256 .set_endpoint_mode = xhci_set_endpoint_mode,
4257};