summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-06-07 19:41:11 +0000
committerthompsa <thompsa@FreeBSD.org>2009-06-07 19:41:11 +0000
commit2d149b09c57b22367f7e05e3efaf23f0cb328621 (patch)
treec74029825164c1a63bb75e5f673438c24b743f22 /sys/dev/usb/controller
parent919e3cbf2805715b8fefeab48237aaec49b8b9e9 (diff)
downloadFreeBSD-src-2d149b09c57b22367f7e05e3efaf23f0cb328621.zip
FreeBSD-src-2d149b09c57b22367f7e05e3efaf23f0cb328621.tar.gz
Rename usb pipes to endpoints as it better represents what they are, and struct
usb_pipe may be used for a different purpose later on.
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/at91dci.c72
-rw-r--r--sys/dev/usb/controller/atmegadci.c64
-rw-r--r--sys/dev/usb/controller/avr32dci.c10
-rw-r--r--sys/dev/usb/controller/ehci.c116
-rw-r--r--sys/dev/usb/controller/musb_otg.c66
-rw-r--r--sys/dev/usb/controller/ohci.c82
-rw-r--r--sys/dev/usb/controller/uhci.c80
-rw-r--r--sys/dev/usb/controller/uss820dci.c74
8 files changed, 282 insertions, 282 deletions
diff --git a/sys/dev/usb/controller/at91dci.c b/sys/dev/usb/controller/at91dci.c
index f563399..5831a7e 100644
--- a/sys/dev/usb/controller/at91dci.c
+++ b/sys/dev/usb/controller/at91dci.c
@@ -687,7 +687,7 @@ at91dci_xfer_do_fifo(struct usb_xfer *xfer)
done:
sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
- temp = (xfer->endpoint & UE_ADDR);
+ temp = (xfer->endpointno & UE_ADDR);
/* update FIFO bank flag and multi buffer */
if (td->fifo_bank) {
@@ -864,7 +864,7 @@ at91dci_setup_standard_chain(struct usb_xfer *xfer)
uint8_t need_sync;
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -882,7 +882,7 @@ at91dci_setup_standard_chain(struct usb_xfer *xfer)
temp.did_stall = !xfer->flags_int.control_stall;
sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
- ep_no = (xfer->endpoint & UE_ADDR);
+ ep_no = (xfer->endpointno & UE_ADDR);
/* check if we should prepend a setup message */
@@ -908,7 +908,7 @@ at91dci_setup_standard_chain(struct usb_xfer *xfer)
}
if (x != xfer->nframes) {
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
temp.func = &at91dci_data_tx;
need_sync = 1;
} else {
@@ -984,7 +984,7 @@ at91dci_setup_standard_chain(struct usb_xfer *xfer)
* Send a DATA1 message and invert the current
* endpoint direction.
*/
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
temp.func = &at91dci_data_rx;
need_sync = 0;
} else {
@@ -1034,7 +1034,7 @@ at91dci_start_standard_chain(struct usb_xfer *xfer)
if (at91dci_xfer_do_fifo(xfer)) {
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
- uint8_t ep_no = xfer->endpoint & UE_ADDR;
+ uint8_t ep_no = xfer->endpointno & UE_ADDR;
/*
* Only enable the endpoint interrupt when we are actually
@@ -1139,8 +1139,8 @@ at91dci_standard_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
/* reset scanner */
@@ -1191,11 +1191,11 @@ at91dci_device_done(struct usb_xfer *xfer, usb_error_t error)
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
- DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
- ep_no = (xfer->endpoint & UE_ADDR);
+ ep_no = (xfer->endpointno & UE_ADDR);
/* disable endpoint interrupt */
AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, AT91_UDP_INT_EP(ep_no));
@@ -1208,7 +1208,7 @@ at91dci_device_done(struct usb_xfer *xfer, usb_error_t error)
static void
at91dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
- struct usb_pipe *pipe)
+ struct usb_endpoint *ep)
{
struct at91dci_softc *sc;
uint32_t csr_val;
@@ -1216,7 +1216,7 @@ at91dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
- DPRINTFN(5, "pipe=%p\n", pipe);
+ DPRINTFN(5, "endpoint=%p\n", ep);
if (xfer) {
/* cancel any ongoing transfers */
@@ -1224,7 +1224,7 @@ at91dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
}
/* set FORCESTALL */
sc = AT9100_DCI_BUS2SC(udev->bus);
- csr_reg = (pipe->edesc->bEndpointAddress & UE_ADDR);
+ csr_reg = (ep->edesc->bEndpointAddress & UE_ADDR);
csr_reg = AT91_UDP_CSR(csr_reg);
csr_val = AT91_UDP_READ_4(sc, csr_reg);
AT91_CSR_ACK(csr_val, AT91_UDP_CSR_FORCESTALL);
@@ -1328,12 +1328,12 @@ at91dci_clear_stall_sub(struct at91dci_softc *sc, uint8_t ep_no,
}
static void
-at91dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
+at91dci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep)
{
struct at91dci_softc *sc;
struct usb_endpoint_descriptor *ed;
- DPRINTFN(5, "pipe=%p\n", pipe);
+ DPRINTFN(5, "endpoint=%p\n", ep);
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
@@ -1346,7 +1346,7 @@ at91dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
sc = AT9100_DCI_BUS2SC(udev->bus);
/* get endpoint descriptor */
- ed = pipe->edesc;
+ ed = ep->edesc;
/* reset endpoint */
at91dci_clear_stall_sub(sc,
@@ -1598,7 +1598,7 @@ at91dci_device_isoc_fs_enter(struct usb_xfer *xfer)
uint32_t nframes;
DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
/* get the current frame index */
@@ -1608,25 +1608,25 @@ at91dci_device_isoc_fs_enter(struct usb_xfer *xfer)
* check if the frame index is within the window where the frames
* will be inserted
*/
- temp = (nframes - xfer->pipe->isoc_next) & AT91_UDP_FRM_MASK;
+ temp = (nframes - xfer->endpoint->isoc_next) & AT91_UDP_FRM_MASK;
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(temp < xfer->nframes)) {
/*
- * If there is data underflow or the pipe queue is
+ * If there is data underflow or the endpoint queue is
* empty we schedule the transfer a few frames ahead
* of the current frame position. Else two isochronous
* transfers might overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) & AT91_UDP_FRM_MASK;
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->isoc_next = (nframes + 3) & AT91_UDP_FRM_MASK;
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- temp = (xfer->pipe->isoc_next - nframes) & AT91_UDP_FRM_MASK;
+ temp = (xfer->endpoint->isoc_next - nframes) & AT91_UDP_FRM_MASK;
/*
* pre-compute when the isochronous transfer will be finished:
@@ -1636,7 +1636,7 @@ at91dci_device_isoc_fs_enter(struct usb_xfer *xfer)
xfer->nframes;
/* compute frame number for next insertion */
- xfer->pipe->isoc_next += xfer->nframes;
+ xfer->endpoint->isoc_next += xfer->nframes;
/* setup TDs */
at91dci_setup_standard_chain(xfer);
@@ -2208,7 +2208,7 @@ at91dci_xfer_setup(struct usb_setup_params *parm)
*/
if (ntd) {
- ep_no = xfer->endpoint & UE_ADDR;
+ ep_no = xfer->endpointno & UE_ADDR;
at91dci_get_hw_ep_profile(parm->udev, &pf, ep_no);
if (pf == NULL) {
@@ -2258,13 +2258,13 @@ at91dci_xfer_unsetup(struct usb_xfer *xfer)
}
static void
-at91dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+at91dci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_rt_addr);
@@ -2280,16 +2280,16 @@ at91dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc
}
switch (edesc->bmAttributes & UE_XFERTYPE) {
case UE_CONTROL:
- pipe->methods = &at91dci_device_ctrl_methods;
+ ep->methods = &at91dci_device_ctrl_methods;
break;
case UE_INTERRUPT:
- pipe->methods = &at91dci_device_intr_methods;
+ ep->methods = &at91dci_device_intr_methods;
break;
case UE_ISOCHRONOUS:
- pipe->methods = &at91dci_device_isoc_fs_methods;
+ ep->methods = &at91dci_device_isoc_fs_methods;
break;
case UE_BULK:
- pipe->methods = &at91dci_device_bulk_methods;
+ ep->methods = &at91dci_device_bulk_methods;
break;
default:
/* do nothing */
@@ -2300,7 +2300,7 @@ at91dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc
struct usb_bus_methods at91dci_bus_methods =
{
- .pipe_init = &at91dci_pipe_init,
+ .endpoint_init = &at91dci_ep_init,
.xfer_setup = &at91dci_xfer_setup,
.xfer_unsetup = &at91dci_xfer_unsetup,
.get_hw_ep_profile = &at91dci_get_hw_ep_profile,
diff --git a/sys/dev/usb/controller/atmegadci.c b/sys/dev/usb/controller/atmegadci.c
index 2735c59..0f4ef24 100644
--- a/sys/dev/usb/controller/atmegadci.c
+++ b/sys/dev/usb/controller/atmegadci.c
@@ -767,7 +767,7 @@ atmegadci_setup_standard_chain(struct usb_xfer *xfer)
uint8_t need_sync;
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -785,7 +785,7 @@ atmegadci_setup_standard_chain(struct usb_xfer *xfer)
temp.did_stall = !xfer->flags_int.control_stall;
sc = ATMEGA_BUS2SC(xfer->xroot->bus);
- ep_no = (xfer->endpoint & UE_ADDR);
+ ep_no = (xfer->endpointno & UE_ADDR);
/* check if we should prepend a setup message */
@@ -811,7 +811,7 @@ atmegadci_setup_standard_chain(struct usb_xfer *xfer)
}
if (x != xfer->nframes) {
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
temp.func = &atmegadci_data_tx;
need_sync = 1;
} else {
@@ -886,7 +886,7 @@ atmegadci_setup_standard_chain(struct usb_xfer *xfer)
* Send a DATA1 message and invert the current
* endpoint direction.
*/
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
temp.func = &atmegadci_data_rx;
need_sync = 0;
} else {
@@ -1022,8 +1022,8 @@ atmegadci_standard_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
/* reset scanner */
@@ -1074,11 +1074,11 @@ atmegadci_device_done(struct usb_xfer *xfer, usb_error_t error)
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
- DPRINTFN(9, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(9, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
- ep_no = (xfer->endpoint & UE_ADDR);
+ ep_no = (xfer->endpointno & UE_ADDR);
/* select endpoint number */
ATMEGA_WRITE_1(sc, ATMEGA_UENUM, ep_no);
@@ -1094,14 +1094,14 @@ atmegadci_device_done(struct usb_xfer *xfer, usb_error_t error)
static void
atmegadci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
- struct usb_pipe *pipe)
+ struct usb_endpoint *ep)
{
struct atmegadci_softc *sc;
uint8_t ep_no;
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
- DPRINTFN(5, "pipe=%p\n", pipe);
+ DPRINTFN(5, "endpoint=%p\n", ep);
if (xfer) {
/* cancel any ongoing transfers */
@@ -1109,7 +1109,7 @@ atmegadci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
}
sc = ATMEGA_BUS2SC(udev->bus);
/* get endpoint number */
- ep_no = (pipe->edesc->bEndpointAddress & UE_ADDR);
+ ep_no = (ep->edesc->bEndpointAddress & UE_ADDR);
/* select endpoint number */
ATMEGA_WRITE_1(sc, ATMEGA_UENUM, ep_no);
/* set stall */
@@ -1178,12 +1178,12 @@ atmegadci_clear_stall_sub(struct atmegadci_softc *sc, uint8_t ep_no,
}
static void
-atmegadci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
+atmegadci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep)
{
struct atmegadci_softc *sc;
struct usb_endpoint_descriptor *ed;
- DPRINTFN(5, "pipe=%p\n", pipe);
+ DPRINTFN(5, "endpoint=%p\n", ep);
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
@@ -1196,7 +1196,7 @@ atmegadci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
sc = ATMEGA_BUS2SC(udev->bus);
/* get endpoint descriptor */
- ed = pipe->edesc;
+ ed = ep->edesc;
/* reset endpoint */
atmegadci_clear_stall_sub(sc,
@@ -1415,7 +1415,7 @@ atmegadci_device_isoc_fs_enter(struct usb_xfer *xfer)
uint32_t nframes;
DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
/* get the current frame index */
@@ -1429,9 +1429,9 @@ atmegadci_device_isoc_fs_enter(struct usb_xfer *xfer)
* check if the frame index is within the window where the frames
* will be inserted
*/
- temp = (nframes - xfer->pipe->isoc_next) & ATMEGA_FRAME_MASK;
+ temp = (nframes - xfer->endpoint->isoc_next) & ATMEGA_FRAME_MASK;
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(temp < xfer->nframes)) {
/*
* If there is data underflow or the pipe queue is
@@ -1439,15 +1439,15 @@ atmegadci_device_isoc_fs_enter(struct usb_xfer *xfer)
* of the current frame position. Else two isochronous
* transfers might overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) & ATMEGA_FRAME_MASK;
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->isoc_next = (nframes + 3) & ATMEGA_FRAME_MASK;
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- temp = (xfer->pipe->isoc_next - nframes) & ATMEGA_FRAME_MASK;
+ temp = (xfer->endpoint->isoc_next - nframes) & ATMEGA_FRAME_MASK;
/*
* pre-compute when the isochronous transfer will be finished:
@@ -1457,7 +1457,7 @@ atmegadci_device_isoc_fs_enter(struct usb_xfer *xfer)
xfer->nframes;
/* compute frame number for next insertion */
- xfer->pipe->isoc_next += xfer->nframes;
+ xfer->endpoint->isoc_next += xfer->nframes;
/* setup TDs */
atmegadci_setup_standard_chain(xfer);
@@ -2022,7 +2022,7 @@ atmegadci_xfer_setup(struct usb_setup_params *parm)
/*
* compute maximum number of TDs
*/
- if ((xfer->pipe->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) {
+ if ((xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) {
ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */
+ 1 /* SYNC 2 */ ;
@@ -2045,7 +2045,7 @@ atmegadci_xfer_setup(struct usb_setup_params *parm)
/*
* get profile stuff
*/
- ep_no = xfer->endpoint & UE_ADDR;
+ ep_no = xfer->endpointno & UE_ADDR;
atmegadci_get_hw_ep_profile(parm->udev, &pf, ep_no);
if (pf == NULL) {
@@ -2088,13 +2088,13 @@ atmegadci_xfer_unsetup(struct usb_xfer *xfer)
}
static void
-atmegadci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+atmegadci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
struct atmegadci_softc *sc = ATMEGA_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d,%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d,%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_rt_addr, udev->device_index);
@@ -2109,15 +2109,15 @@ atmegadci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *ede
return;
}
if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS)
- pipe->methods = &atmegadci_device_isoc_fs_methods;
+ ep->methods = &atmegadci_device_isoc_fs_methods;
else
- pipe->methods = &atmegadci_device_non_isoc_methods;
+ ep->methods = &atmegadci_device_non_isoc_methods;
}
}
struct usb_bus_methods atmegadci_bus_methods =
{
- .pipe_init = &atmegadci_pipe_init,
+ .endpoint_init = &atmegadci_ep_init,
.xfer_setup = &atmegadci_xfer_setup,
.xfer_unsetup = &atmegadci_xfer_unsetup,
.get_hw_ep_profile = &atmegadci_get_hw_ep_profile,
diff --git a/sys/dev/usb/controller/avr32dci.c b/sys/dev/usb/controller/avr32dci.c
index 2bdf11e..5463b7f 100644
--- a/sys/dev/usb/controller/avr32dci.c
+++ b/sys/dev/usb/controller/avr32dci.c
@@ -1062,7 +1062,7 @@ avr32dci_device_done(struct usb_xfer *xfer, usb_error_t error)
static void
avr32dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
- struct usb_pipe *pipe)
+ struct usb_endpoint *ep)
{
struct avr32dci_softc *sc;
uint8_t ep_no;
@@ -1148,7 +1148,7 @@ avr32dci_clear_stall_sub(struct avr32dci_softc *sc, uint8_t ep_no,
}
static void
-avr32dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
+avr32dci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep)
{
struct avr32dci_softc *sc;
struct usb_endpoint_descriptor *ed;
@@ -2025,8 +2025,8 @@ avr32dci_xfer_unsetup(struct usb_xfer *xfer)
}
static void
-avr32dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+avr32dci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
struct avr32dci_softc *sc = AVR32_BUS2SC(udev->bus);
@@ -2055,7 +2055,7 @@ avr32dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edes
struct usb_bus_methods avr32dci_bus_methods =
{
- .pipe_init = &avr32dci_pipe_init,
+ .endpoint_init = &avr32dci_ep_init,
.xfer_setup = &avr32dci_xfer_setup,
.xfer_unsetup = &avr32dci_xfer_unsetup,
.get_hw_ep_profile = &avr32dci_get_hw_ep_profile,
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c
index e827575..6b51600 100644
--- a/sys/dev/usb/controller/ehci.c
+++ b/sys/dev/usb/controller/ehci.c
@@ -1190,14 +1190,14 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
/* update data toggle */
- xfer->pipe->toggle_next =
+ xfer->endpoint->toggle_next =
(status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0;
#if USB_DEBUG
if (status & EHCI_QTD_STATERRS) {
DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x"
"status=%s%s%s%s%s%s%s%s\n",
- xfer->address, xfer->endpoint, xfer->aframes,
+ xfer->address, xfer->endpointno, xfer->aframes,
(status & EHCI_QTD_ACTIVE) ? "[ACTIVE]" : "[NOT_ACTIVE]",
(status & EHCI_QTD_HALTED) ? "[HALTED]" : "",
(status & EHCI_QTD_BUFERR) ? "[BUFERR]" : "",
@@ -1218,8 +1218,8 @@ ehci_non_isoc_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
#if USB_DEBUG
if (ehcidebug > 10) {
@@ -1274,7 +1274,7 @@ done:
static uint8_t
ehci_check_transfer(struct usb_xfer *xfer)
{
- struct usb_pipe_methods *methods = xfer->pipe->methods;
+ struct usb_pipe_methods *methods = xfer->endpoint->methods;
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
uint32_t status;
@@ -1716,7 +1716,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
uint32_t x;
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.average = xfer->max_hc_frame_size;
@@ -1739,7 +1739,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
temp.setup_alt_next = xfer->flags_int.short_frames_ok;
if (xfer->flags_int.control_xfr) {
- if (xfer->pipe->toggle_next) {
+ if (xfer->endpoint->toggle_next) {
/* DATA1 is next */
temp.qtd_status |=
htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1));
@@ -1827,7 +1827,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
/* set endpoint direction */
temp.qtd_status |=
- (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) ?
+ (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) ?
htohc32(temp.sc, EHCI_QTD_ACTIVE |
EHCI_QTD_SET_PID(EHCI_QTD_PID_IN)) :
htohc32(temp.sc, EHCI_QTD_ACTIVE |
@@ -1849,7 +1849,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
temp.qtd_status &= htohc32(temp.sc, EHCI_QTD_SET_CERR(3) |
EHCI_QTD_SET_TOGGLE(1));
temp.qtd_status |=
- (UE_GET_DIR(xfer->endpoint) == UE_DIR_OUT) ?
+ (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT) ?
htohc32(temp.sc, EHCI_QTD_ACTIVE |
EHCI_QTD_SET_PID(EHCI_QTD_PID_IN) |
EHCI_QTD_SET_TOGGLE(1)) :
@@ -1881,13 +1881,13 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
#if USB_DEBUG
if (ehcidebug > 8) {
DPRINTF("nexttog=%d; data before transfer:\n",
- xfer->pipe->toggle_next);
+ xfer->endpoint->toggle_next);
ehci_dump_sqtds(temp.sc,
xfer->td_transfer_first);
}
#endif
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
@@ -1895,7 +1895,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
qh_endp =
(EHCI_QH_SET_ADDR(xfer->address) |
- EHCI_QH_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)) |
+ EHCI_QH_SET_ENDPT(UE_GET_ADDR(xfer->endpointno)) |
EHCI_QH_SET_MPL(xfer->max_packet_size));
if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
@@ -1943,7 +1943,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
qh->qh_endp &= htohc32(temp.sc, ~EHCI_QH_DTC);
- if (xfer->pipe->toggle_next) {
+ if (xfer->endpoint->toggle_next) {
/* DATA1 is next */
qh->qh_qtd.qtd_status |=
htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1));
@@ -1999,8 +1999,8 @@ ehci_isoc_fs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
ehci_sitd_t *td = xfer->td_transfer_first;
ehci_sitd_t **pp_last = &sc->sc_isoc_fs_p_last[xfer->qh_pos];
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
while (nframes--) {
if (td == NULL) {
@@ -2053,8 +2053,8 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
ehci_itd_t *td = xfer->td_transfer_first;
ehci_itd_t **pp_last = &sc->sc_isoc_hs_p_last[xfer->qh_pos];
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
while (nframes--) {
if (td == NULL) {
@@ -2113,20 +2113,20 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
static void
ehci_device_done(struct usb_xfer *xfer, usb_error_t error)
{
- struct usb_pipe_methods *methods = xfer->pipe->methods;
+ struct usb_pipe_methods *methods = xfer->endpoint->methods;
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
- DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
if ((methods == &ehci_device_bulk_methods) ||
(methods == &ehci_device_ctrl_methods)) {
#if USB_DEBUG
if (ehcidebug > 8) {
DPRINTF("nexttog=%d; data after transfer:\n",
- xfer->pipe->toggle_next);
+ xfer->endpoint->toggle_next);
ehci_dump_sqtds(sc,
xfer->td_transfer_first);
}
@@ -2358,11 +2358,11 @@ ehci_device_isoc_fs_open(struct usb_xfer *xfer)
sitd_portaddr =
EHCI_SITD_SET_ADDR(xfer->address) |
- EHCI_SITD_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)) |
+ EHCI_SITD_SET_ENDPT(UE_GET_ADDR(xfer->endpointno)) |
EHCI_SITD_SET_HUBA(xfer->xroot->udev->hs_hub_addr) |
EHCI_SITD_SET_PORT(xfer->xroot->udev->hs_port_no);
- if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) {
+ if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) {
sitd_portaddr |= EHCI_SITD_SET_DIR_IN;
}
sitd_portaddr = htohc32(sc, sitd_portaddr);
@@ -2422,7 +2422,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
#endif
DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
/* get the current frame index */
@@ -2432,10 +2432,10 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
* check if the frame index is within the window where the frames
* will be inserted
*/
- buf_offset = (nframes - xfer->pipe->isoc_next) &
+ buf_offset = (nframes - xfer->endpoint->isoc_next) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(buf_offset < xfer->nframes)) {
/*
* If there is data underflow or the pipe queue is empty we
@@ -2443,16 +2443,16 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
* frame position. Else two isochronous transfers might
* overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) &
+ xfer->endpoint->isoc_next = (nframes + 3) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- buf_offset = (xfer->pipe->isoc_next - nframes) &
+ buf_offset = (xfer->endpoint->isoc_next - nframes) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
/*
@@ -2478,11 +2478,11 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
td = xfer->td_start[xfer->flags_int.curr_dma_set];
xfer->td_transfer_first = td;
- pp_last = &sc->sc_isoc_fs_p_last[xfer->pipe->isoc_next];
+ pp_last = &sc->sc_isoc_fs_p_last[xfer->endpoint->isoc_next];
/* store starting position */
- xfer->qh_pos = xfer->pipe->isoc_next;
+ xfer->qh_pos = xfer->endpoint->isoc_next;
fss = fss_start + (xfer->qh_pos % USB_ISOC_TIME_MAX);
@@ -2543,7 +2543,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
temp = 0;
}
- if (UE_GET_DIR(xfer->endpoint) == UE_DIR_OUT) {
+ if (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT) {
tlen = *plen;
if (tlen <= 188) {
temp |= 1; /* T-count = 1, TP = ALL */
@@ -2609,7 +2609,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
xfer->td_transfer_last = td_last;
/* update isoc_next */
- xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_fs_p_last[0]) &
+ xfer->endpoint->isoc_next = (pp_last - &sc->sc_isoc_fs_p_last[0]) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
}
@@ -2658,13 +2658,13 @@ ehci_device_isoc_hs_open(struct usb_xfer *xfer)
/* set endpoint and address */
td->itd_bp[0] = htohc32(sc,
EHCI_ITD_SET_ADDR(xfer->address) |
- EHCI_ITD_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)));
+ EHCI_ITD_SET_ENDPT(UE_GET_ADDR(xfer->endpointno)));
temp =
EHCI_ITD_SET_MPL(xfer->max_packet_size & 0x7FF);
/* set direction */
- if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) {
+ if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) {
temp |= EHCI_ITD_SET_DIR_IN;
}
/* set maximum packet size */
@@ -2708,7 +2708,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
#endif
DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
/* get the current frame index */
@@ -2718,10 +2718,10 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
* check if the frame index is within the window where the frames
* will be inserted
*/
- buf_offset = (nframes - xfer->pipe->isoc_next) &
+ buf_offset = (nframes - xfer->endpoint->isoc_next) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(buf_offset < ((xfer->nframes + 7) / 8))) {
/*
* If there is data underflow or the pipe queue is empty we
@@ -2729,16 +2729,16 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
* frame position. Else two isochronous transfers might
* overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) &
+ xfer->endpoint->isoc_next = (nframes + 3) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- buf_offset = (xfer->pipe->isoc_next - nframes) &
+ buf_offset = (xfer->endpoint->isoc_next - nframes) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
/*
@@ -2764,11 +2764,11 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
td = xfer->td_start[xfer->flags_int.curr_dma_set];
xfer->td_transfer_first = td;
- pp_last = &sc->sc_isoc_hs_p_last[xfer->pipe->isoc_next];
+ pp_last = &sc->sc_isoc_hs_p_last[xfer->endpoint->isoc_next];
/* store starting position */
- xfer->qh_pos = xfer->pipe->isoc_next;
+ xfer->qh_pos = xfer->endpoint->isoc_next;
while (nframes--) {
if (td == NULL) {
@@ -2875,7 +2875,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
xfer->td_transfer_last = td_last;
/* update isoc_next */
- xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_hs_p_last[0]) &
+ xfer->endpoint->isoc_next = (pp_last - &sc->sc_isoc_hs_p_last[0]) &
(EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
}
@@ -3635,13 +3635,13 @@ ehci_xfer_unsetup(struct usb_xfer *xfer)
}
static void
-ehci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+ehci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
ehci_softc_t *sc = EHCI_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_addr);
@@ -3661,21 +3661,21 @@ ehci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
}
switch (edesc->bmAttributes & UE_XFERTYPE) {
case UE_CONTROL:
- pipe->methods = &ehci_device_ctrl_methods;
+ ep->methods = &ehci_device_ctrl_methods;
break;
case UE_INTERRUPT:
- pipe->methods = &ehci_device_intr_methods;
+ ep->methods = &ehci_device_intr_methods;
break;
case UE_ISOCHRONOUS:
if (udev->speed == USB_SPEED_HIGH) {
- pipe->methods = &ehci_device_isoc_hs_methods;
+ ep->methods = &ehci_device_isoc_hs_methods;
} else if (udev->speed == USB_SPEED_FULL) {
- pipe->methods = &ehci_device_isoc_fs_methods;
+ ep->methods = &ehci_device_isoc_fs_methods;
}
break;
case UE_BULK:
if (udev->speed != USB_SPEED_LOW) {
- pipe->methods = &ehci_device_bulk_methods;
+ ep->methods = &ehci_device_bulk_methods;
}
break;
default:
@@ -3712,7 +3712,7 @@ ehci_device_resume(struct usb_device *udev)
if (xfer->xroot->udev == udev) {
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
if ((methods == &ehci_device_bulk_methods) ||
(methods == &ehci_device_ctrl_methods)) {
@@ -3746,7 +3746,7 @@ ehci_device_suspend(struct usb_device *udev)
if (xfer->xroot->udev == udev) {
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
if ((methods == &ehci_device_bulk_methods) ||
(methods == &ehci_device_ctrl_methods)) {
@@ -3801,7 +3801,7 @@ ehci_set_hw_power(struct usb_bus *bus)
struct usb_bus_methods ehci_bus_methods =
{
- .pipe_init = ehci_pipe_init,
+ .endpoint_init = ehci_ep_init,
.xfer_setup = ehci_xfer_setup,
.xfer_unsetup = ehci_xfer_unsetup,
.get_dma_delay = ehci_get_dma_delay,
diff --git a/sys/dev/usb/controller/musb_otg.c b/sys/dev/usb/controller/musb_otg.c
index dd3e71e..d242574 100644
--- a/sys/dev/usb/controller/musb_otg.c
+++ b/sys/dev/usb/controller/musb_otg.c
@@ -1114,7 +1114,7 @@ musbotg_setup_standard_chain(struct usb_xfer *xfer)
uint8_t ep_no;
DPRINTFN(8, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -1132,7 +1132,7 @@ musbotg_setup_standard_chain(struct usb_xfer *xfer)
temp.did_stall = !xfer->flags_int.control_stall;
sc = MUSBOTG_BUS2SC(xfer->xroot->bus);
- ep_no = (xfer->endpoint & UE_ADDR);
+ ep_no = (xfer->endpointno & UE_ADDR);
/* check if we should prepend a setup message */
@@ -1152,7 +1152,7 @@ musbotg_setup_standard_chain(struct usb_xfer *xfer)
}
if (x != xfer->nframes) {
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
if (xfer->flags_int.control_xfr)
temp.func = &musbotg_setup_data_tx;
else
@@ -1249,7 +1249,7 @@ musbotg_ep_int_set(struct usb_xfer *xfer, uint8_t on)
{
struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus);
uint16_t temp;
- uint8_t ep_no = xfer->endpoint & UE_ADDR;
+ uint8_t ep_no = xfer->endpointno & UE_ADDR;
/*
* Only enable the endpoint interrupt when we are
@@ -1390,8 +1390,8 @@ musbotg_standard_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(12, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(12, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
/* reset scanner */
@@ -1439,8 +1439,8 @@ musbotg_device_done(struct usb_xfer *xfer, usb_error_t error)
{
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
- DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
@@ -1454,14 +1454,14 @@ musbotg_device_done(struct usb_xfer *xfer, usb_error_t error)
static void
musbotg_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
- struct usb_pipe *pipe)
+ struct usb_endpoint *ep)
{
struct musbotg_softc *sc;
uint8_t ep_no;
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
- DPRINTFN(4, "pipe=%p\n", pipe);
+ DPRINTFN(4, "endpoint=%p\n", ep);
if (xfer) {
/* cancel any ongoing transfers */
@@ -1470,12 +1470,12 @@ musbotg_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
/* set FORCESTALL */
sc = MUSBOTG_BUS2SC(udev->bus);
- ep_no = (pipe->edesc->bEndpointAddress & UE_ADDR);
+ ep_no = (ep->edesc->bEndpointAddress & UE_ADDR);
/* select endpoint */
MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, ep_no);
- if (pipe->edesc->bEndpointAddress & UE_DIR_IN) {
+ if (ep->edesc->bEndpointAddress & UE_DIR_IN) {
MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL,
MUSB2_MASK_CSRL_TXSENDSTALL);
} else {
@@ -1636,12 +1636,12 @@ musbotg_clear_stall_sub(struct musbotg_softc *sc, uint16_t wMaxPacket,
}
static void
-musbotg_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
+musbotg_clear_stall(struct usb_device *udev, struct usb_endpoint *ep)
{
struct musbotg_softc *sc;
struct usb_endpoint_descriptor *ed;
- DPRINTFN(4, "pipe=%p\n", pipe);
+ DPRINTFN(4, "endpoint=%p\n", ep);
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
@@ -1654,7 +1654,7 @@ musbotg_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
sc = MUSBOTG_BUS2SC(udev->bus);
/* get endpoint descriptor */
- ed = pipe->edesc;
+ ed = ep->edesc;
/* reset endpoint */
musbotg_clear_stall_sub(sc,
@@ -1999,7 +1999,7 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
uint32_t fs_frames;
DPRINTFN(5, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
/* get the current frame index */
@@ -2009,7 +2009,7 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
* check if the frame index is within the window where the frames
* will be inserted
*/
- temp = (nframes - xfer->pipe->isoc_next) & MUSB2_MASK_FRAME;
+ temp = (nframes - xfer->endpoint->isoc_next) & MUSB2_MASK_FRAME;
if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
fs_frames = (xfer->nframes + 7) / 8;
@@ -2017,7 +2017,7 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
fs_frames = xfer->nframes;
}
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(temp < fs_frames)) {
/*
* If there is data underflow or the pipe queue is
@@ -2025,15 +2025,15 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
* of the current frame position. Else two isochronous
* transfers might overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) & MUSB2_MASK_FRAME;
- xfer->pipe->is_synced = 1;
- DPRINTFN(2, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->isoc_next = (nframes + 3) & MUSB2_MASK_FRAME;
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(2, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- temp = (xfer->pipe->isoc_next - nframes) & MUSB2_MASK_FRAME;
+ temp = (xfer->endpoint->isoc_next - nframes) & MUSB2_MASK_FRAME;
/*
* pre-compute when the isochronous transfer will be finished:
@@ -2043,7 +2043,7 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
fs_frames;
/* compute frame number for next insertion */
- xfer->pipe->isoc_next += fs_frames;
+ xfer->endpoint->isoc_next += fs_frames;
/* setup TDs */
musbotg_setup_standard_chain(xfer);
@@ -2623,7 +2623,7 @@ musbotg_xfer_setup(struct usb_setup_params *parm)
*/
if (ntd) {
- ep_no = xfer->endpoint & UE_ADDR;
+ ep_no = xfer->endpointno & UE_ADDR;
musbotg_get_hw_ep_profile(parm->udev, &pf, ep_no);
if (pf == NULL) {
@@ -2667,13 +2667,13 @@ musbotg_xfer_unsetup(struct usb_xfer *xfer)
}
static void
-musbotg_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+musbotg_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
struct musbotg_softc *sc = MUSBOTG_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_rt_addr);
@@ -2690,16 +2690,16 @@ musbotg_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc
}
switch (edesc->bmAttributes & UE_XFERTYPE) {
case UE_CONTROL:
- pipe->methods = &musbotg_device_ctrl_methods;
+ ep->methods = &musbotg_device_ctrl_methods;
break;
case UE_INTERRUPT:
- pipe->methods = &musbotg_device_intr_methods;
+ ep->methods = &musbotg_device_intr_methods;
break;
case UE_ISOCHRONOUS:
- pipe->methods = &musbotg_device_isoc_methods;
+ ep->methods = &musbotg_device_isoc_methods;
break;
case UE_BULK:
- pipe->methods = &musbotg_device_bulk_methods;
+ ep->methods = &musbotg_device_bulk_methods;
break;
default:
/* do nothing */
@@ -2710,7 +2710,7 @@ musbotg_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc
struct usb_bus_methods musbotg_bus_methods =
{
- .pipe_init = &musbotg_pipe_init,
+ .endpoint_init = &musbotg_ep_init,
.xfer_setup = &musbotg_xfer_setup,
.xfer_unsetup = &musbotg_xfer_unsetup,
.get_hw_ep_profile = &musbotg_get_hw_ep_profile,
diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c
index 225ecb0..2e6e6bc 100644
--- a/sys/dev/usb/controller/ohci.c
+++ b/sys/dev/usb/controller/ohci.c
@@ -910,8 +910,8 @@ ohci_non_isoc_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
#if USB_DEBUG
if (ohcidebug > 10) {
@@ -1022,11 +1022,11 @@ ohci_check_transfer_sub(struct usb_xfer *xfer)
if (xfer->xroot->udev->flags.self_suspended) {
/* nothing to do */
- } else if (xfer->pipe->methods == &ohci_device_bulk_methods) {
+ } else if (xfer->endpoint->methods == &ohci_device_bulk_methods) {
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
- } else if (xfer->pipe->methods == &ohci_device_ctrl_methods) {
+ } else if (xfer->endpoint->methods == &ohci_device_ctrl_methods) {
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
@@ -1058,7 +1058,7 @@ ohci_check_transfer(struct usb_xfer *xfer)
if ((ed_headp & OHCI_HALTED) ||
(((ed_headp ^ ed_tailp) & (~0xF)) == 0)) {
- if (xfer->pipe->methods == &ohci_device_isoc_methods) {
+ if (xfer->endpoint->methods == &ohci_device_isoc_methods) {
/* isochronous transfer */
ohci_isoc_done(xfer);
} else {
@@ -1071,9 +1071,9 @@ ohci_check_transfer(struct usb_xfer *xfer)
}
/* store data-toggle */
if (ed_headp & OHCI_TOGGLECARRY) {
- xfer->pipe->toggle_next = 1;
+ xfer->endpoint->toggle_next = 1;
} else {
- xfer->pipe->toggle_next = 0;
+ xfer->endpoint->toggle_next = 0;
}
/* non-isochronous transfer */
@@ -1415,7 +1415,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
uint32_t x;
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.average = xfer->max_hc_frame_size;
@@ -1435,7 +1435,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
temp.last_frame = 0;
temp.setup_alt_next = xfer->flags_int.short_frames_ok;
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
/* check if we should prepend a setup message */
@@ -1462,7 +1462,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
* XXX assume that the setup message is
* contained within one USB packet:
*/
- xfer->pipe->toggle_next = 1;
+ xfer->endpoint->toggle_next = 1;
}
x = 1;
} else {
@@ -1472,7 +1472,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
/* set data toggle */
- if (xfer->pipe->toggle_next) {
+ if (xfer->endpoint->toggle_next) {
temp.td_flags |= htole32(OHCI_TD_TOGGLE_1);
} else {
temp.td_flags |= htole32(OHCI_TD_TOGGLE_0);
@@ -1480,7 +1480,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
/* set endpoint direction */
- if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) {
+ if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) {
temp.td_flags |= htole32(OHCI_TD_IN);
} else {
temp.td_flags |= htole32(OHCI_TD_OUT);
@@ -1535,7 +1535,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
/* set endpoint direction and data toggle */
- if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) {
+ if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) {
temp.td_flags = htole32(OHCI_TD_OUT |
OHCI_TD_NOCC | OHCI_TD_TOGGLE_1 | OHCI_TD_SET_DI(1));
} else {
@@ -1567,7 +1567,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
#if USB_DEBUG
if (ohcidebug > 8) {
DPRINTF("nexttog=%d; data before transfer:\n",
- xfer->pipe->toggle_next);
+ xfer->endpoint->toggle_next);
ohci_dump_tds(xfer->td_transfer_first);
}
#endif
@@ -1575,7 +1575,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
ed_flags = (OHCI_ED_SET_FA(xfer->address) |
- OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpoint)) |
+ OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpointno)) |
OHCI_ED_SET_MAXP(xfer->max_frame_size));
ed_flags |= (OHCI_ED_FORMAT_GEN | OHCI_ED_DIR_TD);
@@ -1647,15 +1647,15 @@ ohci_root_intr(ohci_softc_t *sc)
static void
ohci_device_done(struct usb_xfer *xfer, usb_error_t error)
{
- struct usb_pipe_methods *methods = xfer->pipe->methods;
+ struct usb_pipe_methods *methods = xfer->endpoint->methods;
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
ohci_ed_t *ed;
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
- DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (ed) {
@@ -1872,26 +1872,26 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
nframes = le32toh(hcca->hcca_frame_number);
DPRINTFN(6, "xfer=%p isoc_next=%u nframes=%u hcca_fn=%u\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes, nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes, nframes);
- if ((xfer->pipe->is_synced == 0) ||
- (((nframes - xfer->pipe->isoc_next) & 0xFFFF) < xfer->nframes) ||
- (((xfer->pipe->isoc_next - nframes) & 0xFFFF) >= 128)) {
+ if ((xfer->endpoint->is_synced == 0) ||
+ (((nframes - xfer->endpoint->isoc_next) & 0xFFFF) < xfer->nframes) ||
+ (((xfer->endpoint->isoc_next - nframes) & 0xFFFF) >= 128)) {
/*
* If there is data underflow or the pipe queue is empty we
* schedule the transfer a few frames ahead of the current
* frame position. Else two isochronous transfers might
* overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) & 0xFFFF;
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->isoc_next = (nframes + 3) & 0xFFFF;
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- buf_offset = ((xfer->pipe->isoc_next - nframes) & 0xFFFF);
+ buf_offset = ((xfer->endpoint->isoc_next - nframes) & 0xFFFF);
/*
* pre-compute when the isochronous transfer will be finished:
@@ -1940,12 +1940,12 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
/* fill current ITD */
td->itd_flags = htole32(
OHCI_ITD_NOCC |
- OHCI_ITD_SET_SF(xfer->pipe->isoc_next) |
+ OHCI_ITD_SET_SF(xfer->endpoint->isoc_next) |
OHCI_ITD_NOINTR |
OHCI_ITD_SET_FC(ncur));
td->frames = ncur;
- xfer->pipe->isoc_next += ncur;
+ xfer->endpoint->isoc_next += ncur;
if (length == 0) {
/* all zero */
@@ -2003,13 +2003,13 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
#endif
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
- if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN)
+ if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN)
ed_flags = (OHCI_ED_DIR_IN | OHCI_ED_FORMAT_ISO);
else
ed_flags = (OHCI_ED_DIR_OUT | OHCI_ED_FORMAT_ISO);
ed_flags |= (OHCI_ED_SET_FA(xfer->address) |
- OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpoint)) |
+ OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpointno)) |
OHCI_ED_SET_MAXP(xfer->max_frame_size));
if (xfer->xroot->udev->speed == USB_SPEED_LOW) {
@@ -2563,13 +2563,13 @@ alloc_dma_set:
}
static void
-ohci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+ohci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
ohci_softc_t *sc = OHCI_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_addr);
@@ -2580,19 +2580,19 @@ ohci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
if (udev->device_index != sc->sc_addr) {
switch (edesc->bmAttributes & UE_XFERTYPE) {
case UE_CONTROL:
- pipe->methods = &ohci_device_ctrl_methods;
+ ep->methods = &ohci_device_ctrl_methods;
break;
case UE_INTERRUPT:
- pipe->methods = &ohci_device_intr_methods;
+ ep->methods = &ohci_device_intr_methods;
break;
case UE_ISOCHRONOUS:
if (udev->speed == USB_SPEED_FULL) {
- pipe->methods = &ohci_device_isoc_methods;
+ ep->methods = &ohci_device_isoc_methods;
}
break;
case UE_BULK:
if (udev->speed != USB_SPEED_LOW) {
- pipe->methods = &ohci_device_bulk_methods;
+ ep->methods = &ohci_device_bulk_methods;
}
break;
default:
@@ -2634,7 +2634,7 @@ ohci_device_resume(struct usb_device *udev)
if (xfer->xroot->udev == udev) {
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (methods == &ohci_device_bulk_methods) {
@@ -2672,7 +2672,7 @@ ohci_device_suspend(struct usb_device *udev)
if (xfer->xroot->udev == udev) {
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (methods == &ohci_device_bulk_methods) {
@@ -2729,7 +2729,7 @@ ohci_set_hw_power(struct usb_bus *bus)
struct usb_bus_methods ohci_bus_methods =
{
- .pipe_init = ohci_pipe_init,
+ .endpoint_init = ohci_ep_init,
.xfer_setup = ohci_xfer_setup,
.xfer_unsetup = ohci_xfer_unsetup,
.get_dma_delay = ohci_get_dma_delay,
diff --git a/sys/dev/usb/controller/uhci.c b/sys/dev/usb/controller/uhci.c
index fe5a161..d1ec1d1 100644
--- a/sys/dev/usb/controller/uhci.c
+++ b/sys/dev/usb/controller/uhci.c
@@ -1034,8 +1034,8 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
uhci_td_t *td = xfer->td_transfer_first;
uhci_td_t **pp_last = &sc->sc_isoc_p_last[xfer->qh_pos];
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
/* sync any DMA memory before doing fixups */
@@ -1178,13 +1178,13 @@ uhci_non_isoc_done_sub(struct usb_xfer *xfer)
/* update data toggle */
- xfer->pipe->toggle_next = (token & UHCI_TD_SET_DT(1)) ? 0 : 1;
+ xfer->endpoint->toggle_next = (token & UHCI_TD_SET_DT(1)) ? 0 : 1;
#if USB_DEBUG
if (status & UHCI_TD_ERROR) {
DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x "
"status=%s%s%s%s%s%s%s%s%s%s%s\n",
- xfer->address, xfer->endpoint, xfer->aframes,
+ xfer->address, xfer->endpointno, xfer->aframes,
(status & UHCI_TD_BITSTUFF) ? "[BITSTUFF]" : "",
(status & UHCI_TD_CRCTO) ? "[CRCTO]" : "",
(status & UHCI_TD_NAK) ? "[NAK]" : "",
@@ -1207,8 +1207,8 @@ uhci_non_isoc_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
#if USB_DEBUG
if (uhcidebug > 10) {
@@ -1329,7 +1329,7 @@ uhci_check_transfer(struct usb_xfer *xfer)
DPRINTFN(16, "xfer=%p checking transfer\n", xfer);
- if (xfer->pipe->methods == &uhci_device_isoc_methods) {
+ if (xfer->endpoint->methods == &uhci_device_isoc_methods) {
/* isochronous transfer */
td = xfer->td_transfer_last;
@@ -1683,7 +1683,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
uint32_t x;
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.average = xfer->max_frame_size;
@@ -1712,10 +1712,10 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
temp.td_status |= htole32(UHCI_TD_LS);
}
temp.td_token =
- htole32(UHCI_TD_SET_ENDPT(xfer->endpoint) |
+ htole32(UHCI_TD_SET_ENDPT(xfer->endpointno) |
UHCI_TD_SET_DEVADDR(xfer->address));
- if (xfer->pipe->toggle_next) {
+ if (xfer->endpoint->toggle_next) {
/* DATA1 is next */
temp.td_token |= htole32(UHCI_TD_SET_DT(1));
}
@@ -1794,7 +1794,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
/* set endpoint direction */
temp.td_token |=
- (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) ?
+ (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) ?
htole32(UHCI_TD_PID_IN) :
htole32(UHCI_TD_PID_OUT);
@@ -1815,7 +1815,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
UHCI_TD_SET_ENDPT(0xF) |
UHCI_TD_SET_DT(1));
temp.td_token |=
- (UE_GET_DIR(xfer->endpoint) == UE_DIR_OUT) ?
+ (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT) ?
htole32(UHCI_TD_PID_IN | UHCI_TD_SET_DT(1)) :
htole32(UHCI_TD_PID_OUT | UHCI_TD_SET_DT(1));
@@ -1845,7 +1845,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
#if USB_DEBUG
if (uhcidebug > 8) {
DPRINTF("nexttog=%d; data before transfer:\n",
- xfer->pipe->toggle_next);
+ xfer->endpoint->toggle_next);
uhci_dump_tds(xfer->td_transfer_first);
}
#endif
@@ -1859,14 +1859,14 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
static void
uhci_device_done(struct usb_xfer *xfer, usb_error_t error)
{
- struct usb_pipe_methods *methods = xfer->pipe->methods;
+ struct usb_pipe_methods *methods = xfer->endpoint->methods;
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
uhci_qh_t *qh;
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
- DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (qh) {
@@ -2122,9 +2122,9 @@ uhci_device_isoc_open(struct usb_xfer *xfer)
uint8_t ds;
td_token =
- (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) ?
- UHCI_TD_IN(0, xfer->endpoint, xfer->address, 0) :
- UHCI_TD_OUT(0, xfer->endpoint, xfer->address, 0);
+ (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) ?
+ UHCI_TD_IN(0, xfer->endpointno, xfer->address, 0) :
+ UHCI_TD_OUT(0, xfer->endpointno, xfer->address, 0);
td_token = htole32(td_token);
@@ -2167,14 +2167,14 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
uhci_td_t **pp_last;
DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
nframes = UREAD2(sc, UHCI_FRNUM);
- temp = (nframes - xfer->pipe->isoc_next) &
+ temp = (nframes - xfer->endpoint->isoc_next) &
(UHCI_VFRAMELIST_COUNT - 1);
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(temp < xfer->nframes)) {
/*
* If there is data underflow or the pipe queue is empty we
@@ -2182,15 +2182,15 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
* frame position. Else two isochronous transfers might
* overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) & (UHCI_VFRAMELIST_COUNT - 1);
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->isoc_next = (nframes + 3) & (UHCI_VFRAMELIST_COUNT - 1);
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- temp = (xfer->pipe->isoc_next - nframes) &
+ temp = (xfer->endpoint->isoc_next - nframes) &
(UHCI_VFRAMELIST_COUNT - 1);
/*
@@ -2215,11 +2215,11 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
td = xfer->td_start[xfer->flags_int.curr_dma_set];
xfer->td_transfer_first = td;
- pp_last = &sc->sc_isoc_p_last[xfer->pipe->isoc_next];
+ pp_last = &sc->sc_isoc_p_last[xfer->endpoint->isoc_next];
/* store starting position */
- xfer->qh_pos = xfer->pipe->isoc_next;
+ xfer->qh_pos = xfer->endpoint->isoc_next;
while (nframes--) {
if (td == NULL) {
@@ -2300,7 +2300,7 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
xfer->td_transfer_last = td_last;
/* update isoc_next */
- xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_p_last[0]) &
+ xfer->endpoint->isoc_next = (pp_last - &sc->sc_isoc_p_last[0]) &
(UHCI_VFRAMELIST_COUNT - 1);
}
@@ -3043,13 +3043,13 @@ alloc_dma_set:
}
static void
-uhci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+uhci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
uhci_softc_t *sc = UHCI_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_addr);
@@ -3060,19 +3060,19 @@ uhci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
if (udev->device_index != sc->sc_addr) {
switch (edesc->bmAttributes & UE_XFERTYPE) {
case UE_CONTROL:
- pipe->methods = &uhci_device_ctrl_methods;
+ ep->methods = &uhci_device_ctrl_methods;
break;
case UE_INTERRUPT:
- pipe->methods = &uhci_device_intr_methods;
+ ep->methods = &uhci_device_intr_methods;
break;
case UE_ISOCHRONOUS:
if (udev->speed == USB_SPEED_FULL) {
- pipe->methods = &uhci_device_isoc_methods;
+ ep->methods = &uhci_device_isoc_methods;
}
break;
case UE_BULK:
if (udev->speed != USB_SPEED_LOW) {
- pipe->methods = &uhci_device_bulk_methods;
+ ep->methods = &uhci_device_bulk_methods;
}
break;
default:
@@ -3114,7 +3114,7 @@ uhci_device_resume(struct usb_device *udev)
if (xfer->xroot->udev == udev) {
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (methods == &uhci_device_bulk_methods) {
@@ -3156,7 +3156,7 @@ uhci_device_suspend(struct usb_device *udev)
if (xfer->xroot->udev == udev) {
- methods = xfer->pipe->methods;
+ methods = xfer->endpoint->methods;
qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (xfer->flags_int.bandwidth_reclaimed) {
@@ -3224,7 +3224,7 @@ uhci_set_hw_power(struct usb_bus *bus)
struct usb_bus_methods uhci_bus_methods =
{
- .pipe_init = uhci_pipe_init,
+ .endpoint_init = uhci_ep_init,
.xfer_setup = uhci_xfer_setup,
.xfer_unsetup = uhci_xfer_unsetup,
.get_dma_delay = uhci_get_dma_delay,
diff --git a/sys/dev/usb/controller/uss820dci.c b/sys/dev/usb/controller/uss820dci.c
index bbc5ab6..f3078d3 100644
--- a/sys/dev/usb/controller/uss820dci.c
+++ b/sys/dev/usb/controller/uss820dci.c
@@ -829,7 +829,7 @@ uss820dci_setup_standard_chain(struct usb_xfer *xfer)
uint8_t ep_no;
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
- xfer->address, UE_GET_ADDR(xfer->endpoint),
+ xfer->address, UE_GET_ADDR(xfer->endpointno),
xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -847,7 +847,7 @@ uss820dci_setup_standard_chain(struct usb_xfer *xfer)
temp.did_stall = !xfer->flags_int.control_stall;
sc = USS820_DCI_BUS2SC(xfer->xroot->bus);
- ep_no = (xfer->endpoint & UE_ADDR);
+ ep_no = (xfer->endpointno & UE_ADDR);
/* check if we should prepend a setup message */
@@ -873,7 +873,7 @@ uss820dci_setup_standard_chain(struct usb_xfer *xfer)
}
if (x != xfer->nframes) {
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
temp.func = &uss820dci_data_tx;
} else {
temp.func = &uss820dci_data_rx;
@@ -939,7 +939,7 @@ uss820dci_setup_standard_chain(struct usb_xfer *xfer)
* Send a DATA1 message and invert the current
* endpoint direction.
*/
- if (xfer->endpoint & UE_DIR_IN) {
+ if (xfer->endpointno & UE_DIR_IN) {
temp.func = &uss820dci_data_rx;
need_sync = 0;
} else {
@@ -979,11 +979,11 @@ static void
uss820dci_intr_set(struct usb_xfer *xfer, uint8_t set)
{
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus);
- uint8_t ep_no = (xfer->endpoint & UE_ADDR);
+ uint8_t ep_no = (xfer->endpointno & UE_ADDR);
uint8_t ep_reg;
uint8_t temp;
- DPRINTFN(15, "endpoint 0x%02x\n", xfer->endpoint);
+ DPRINTFN(15, "endpoint 0x%02x\n", xfer->endpointno);
if (ep_no > 3) {
ep_reg = USS820_SBIE1;
@@ -1001,7 +1001,7 @@ uss820dci_intr_set(struct usb_xfer *xfer, uint8_t set)
ep_no |= (ep_no << 1); /* RX and TX interrupt */
}
} else {
- if (!(xfer->endpoint & UE_DIR_IN)) {
+ if (!(xfer->endpointno & UE_DIR_IN)) {
ep_no <<= 1;
}
}
@@ -1123,8 +1123,8 @@ uss820dci_standard_done(struct usb_xfer *xfer)
{
usb_error_t err = 0;
- DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
- xfer, xfer->pipe);
+ DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
+ xfer, xfer->endpoint);
/* reset scanner */
@@ -1172,8 +1172,8 @@ uss820dci_device_done(struct usb_xfer *xfer, usb_error_t error)
{
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
- DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
- xfer, xfer->pipe, error);
+ DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
+ xfer, xfer->endpoint, error);
if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
uss820dci_intr_set(xfer, 0);
@@ -1184,7 +1184,7 @@ uss820dci_device_done(struct usb_xfer *xfer, usb_error_t error)
static void
uss820dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
- struct usb_pipe *pipe)
+ struct usb_endpoint *ep)
{
struct uss820dci_softc *sc;
uint8_t ep_no;
@@ -1194,7 +1194,7 @@ uss820dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
- DPRINTFN(5, "pipe=%p\n", pipe);
+ DPRINTFN(5, "endpoint=%p\n", ep);
if (xfer) {
/* cancel any ongoing transfers */
@@ -1202,9 +1202,9 @@ uss820dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
}
/* set FORCESTALL */
sc = USS820_DCI_BUS2SC(udev->bus);
- ep_no = (pipe->edesc->bEndpointAddress & UE_ADDR);
- ep_dir = (pipe->edesc->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT));
- ep_type = (pipe->edesc->bmAttributes & UE_XFERTYPE);
+ ep_no = (ep->edesc->bEndpointAddress & UE_ADDR);
+ ep_dir = (ep->edesc->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT));
+ ep_type = (ep->edesc->bmAttributes & UE_XFERTYPE);
if (ep_type == UE_CONTROL) {
/* should not happen */
@@ -1271,14 +1271,14 @@ uss820dci_clear_stall_sub(struct uss820dci_softc *sc,
}
static void
-uss820dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
+uss820dci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep)
{
struct uss820dci_softc *sc;
struct usb_endpoint_descriptor *ed;
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
- DPRINTFN(5, "pipe=%p\n", pipe);
+ DPRINTFN(5, "endpoint=%p\n", ep);
/* check mode */
if (udev->flags.usb_mode != USB_MODE_DEVICE) {
@@ -1289,7 +1289,7 @@ uss820dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
sc = USS820_DCI_BUS2SC(udev->bus);
/* get endpoint descriptor */
- ed = pipe->edesc;
+ ed = ep->edesc;
/* reset endpoint */
uss820dci_clear_stall_sub(sc,
@@ -1642,7 +1642,7 @@ uss820dci_device_isoc_fs_enter(struct usb_xfer *xfer)
uint32_t nframes;
DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
- xfer, xfer->pipe->isoc_next, xfer->nframes);
+ xfer, xfer->endpoint->isoc_next, xfer->nframes);
/* get the current frame index - we don't need the high bits */
@@ -1652,9 +1652,9 @@ uss820dci_device_isoc_fs_enter(struct usb_xfer *xfer)
* check if the frame index is within the window where the
* frames will be inserted
*/
- temp = (nframes - xfer->pipe->isoc_next) & USS820_SOFL_MASK;
+ temp = (nframes - xfer->endpoint->isoc_next) & USS820_SOFL_MASK;
- if ((xfer->pipe->is_synced == 0) ||
+ if ((xfer->endpoint->is_synced == 0) ||
(temp < xfer->nframes)) {
/*
* If there is data underflow or the pipe queue is
@@ -1662,15 +1662,15 @@ uss820dci_device_isoc_fs_enter(struct usb_xfer *xfer)
* of the current frame position. Else two isochronous
* transfers might overlap.
*/
- xfer->pipe->isoc_next = (nframes + 3) & USS820_SOFL_MASK;
- xfer->pipe->is_synced = 1;
- DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next);
+ xfer->endpoint->isoc_next = (nframes + 3) & USS820_SOFL_MASK;
+ xfer->endpoint->is_synced = 1;
+ DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next);
}
/*
* compute how many milliseconds the insertion is ahead of the
* current frame position:
*/
- temp = (xfer->pipe->isoc_next - nframes) & USS820_SOFL_MASK;
+ temp = (xfer->endpoint->isoc_next - nframes) & USS820_SOFL_MASK;
/*
* pre-compute when the isochronous transfer will be finished:
@@ -1680,7 +1680,7 @@ uss820dci_device_isoc_fs_enter(struct usb_xfer *xfer)
xfer->nframes;
/* compute frame number for next insertion */
- xfer->pipe->isoc_next += xfer->nframes;
+ xfer->endpoint->isoc_next += xfer->nframes;
/* setup TDs */
uss820dci_setup_standard_chain(xfer);
@@ -2243,7 +2243,7 @@ uss820dci_xfer_setup(struct usb_setup_params *parm)
*/
if (ntd) {
- ep_no = xfer->endpoint & UE_ADDR;
+ ep_no = xfer->endpointno & UE_ADDR;
uss820dci_get_hw_ep_profile(parm->udev, &pf, ep_no);
if (pf == NULL) {
@@ -2293,13 +2293,13 @@ uss820dci_xfer_unsetup(struct usb_xfer *xfer)
}
static void
-uss820dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
- struct usb_pipe *pipe)
+uss820dci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
+ struct usb_endpoint *ep)
{
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(udev->bus);
- DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
- pipe, udev->address,
+ DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
+ ep, udev->address,
edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_rt_addr);
@@ -2315,16 +2315,16 @@ uss820dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *ede
}
switch (edesc->bmAttributes & UE_XFERTYPE) {
case UE_CONTROL:
- pipe->methods = &uss820dci_device_ctrl_methods;
+ ep->methods = &uss820dci_device_ctrl_methods;
break;
case UE_INTERRUPT:
- pipe->methods = &uss820dci_device_intr_methods;
+ ep->methods = &uss820dci_device_intr_methods;
break;
case UE_ISOCHRONOUS:
- pipe->methods = &uss820dci_device_isoc_fs_methods;
+ ep->methods = &uss820dci_device_isoc_fs_methods;
break;
case UE_BULK:
- pipe->methods = &uss820dci_device_bulk_methods;
+ ep->methods = &uss820dci_device_bulk_methods;
break;
default:
/* do nothing */
@@ -2335,7 +2335,7 @@ uss820dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *ede
struct usb_bus_methods uss820dci_bus_methods =
{
- .pipe_init = &uss820dci_pipe_init,
+ .endpoint_init = &uss820dci_ep_init,
.xfer_setup = &uss820dci_xfer_setup,
.xfer_unsetup = &uss820dci_xfer_unsetup,
.get_hw_ep_profile = &uss820dci_get_hw_ep_profile,
OpenPOWER on IntegriCloud