summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2015-02-10 23:43:47 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2015-02-10 23:43:47 +0000
commit069e00b7331b5b5ed223061c254c840d7de0989a (patch)
treee821cd00cba1f6750d79dc54ae7740f56dfa7c7d /sys/dev/usb
parent7e834c8e2d6dc18f06a1e4a8372ad7914e15db1c (diff)
Adjust usb(9) API differences to at least compile.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/dwc2/dwc2.c106
-rw-r--r--sys/dev/usb/dwc2/dwc2_core.h6
-rw-r--r--sys/dev/usb/dwc2/dwc2_hcd.c6
-rw-r--r--sys/dev/usb/dwc2/dwc2_hcd.h6
-rw-r--r--sys/dev/usb/dwc2/dwc2_hcdddma.c4
-rw-r--r--sys/dev/usb/dwc2/dwc2var.h19
6 files changed, 82 insertions, 65 deletions
diff --git a/sys/dev/usb/dwc2/dwc2.c b/sys/dev/usb/dwc2/dwc2.c
index 55b3e04a25f..50aebf1228b 100644
--- a/sys/dev/usb/dwc2/dwc2.c
+++ b/sys/dev/usb/dwc2/dwc2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2.c,v 1.15 2015/02/10 23:38:13 uebayasi Exp $ */
+/* $OpenBSD: dwc2.c,v 1.16 2015/02/10 23:43:46 uebayasi Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
@@ -95,12 +95,16 @@ static void dwc2_poll(struct usbd_bus *);
static void dwc2_softintr(void *);
static void dwc2_waitintr(struct dwc2_softc *, struct usbd_xfer *);
+#if 0
static usbd_status dwc2_allocm(struct usbd_bus *, struct usb_dma *, uint32_t);
static void dwc2_freem(struct usbd_bus *, struct usb_dma *);
+#endif
-static struct usbd_xfer * dwc2_allocx(struct usbd_bus *);
+static struct usbd_xfer *dwc2_allocx(struct usbd_bus *);
static void dwc2_freex(struct usbd_bus *, struct usbd_xfer *);
+#if 0
static void dwc2_get_lock(struct usbd_bus *, struct mutex **);
+#endif
static usbd_status dwc2_root_ctrl_transfer(struct usbd_xfer *);
static usbd_status dwc2_root_ctrl_start(struct usbd_xfer *);
@@ -152,8 +156,6 @@ static void dwc2_rhc(void *);
static void dwc2_timeout(void *);
static void dwc2_timeout_task(void *);
-
-
static inline void
dwc2_allocate_bus_bandwidth(struct dwc2_hsotg *hsotg, u16 bw,
struct usbd_xfer *xfer)
@@ -168,18 +170,22 @@ dwc2_free_bus_bandwidth(struct dwc2_hsotg *hsotg, u16 bw,
#define DWC2_INTR_ENDPT 1
-static const struct usbd_bus_methods dwc2_bus_methods = {
+static struct usbd_bus_methods dwc2_bus_methods = {
.open_pipe = dwc2_open,
.soft_intr = dwc2_softintr,
.do_poll = dwc2_poll,
+#if 0
.allocm = dwc2_allocm,
.freem = dwc2_freem,
+#endif
.allocx = dwc2_allocx,
.freex = dwc2_freex,
+#if 0
.get_lock = dwc2_get_lock,
+#endif
};
-static const struct usbd_pipe_methods dwc2_root_ctrl_methods = {
+static struct usbd_pipe_methods dwc2_root_ctrl_methods = {
.transfer = dwc2_root_ctrl_transfer,
.start = dwc2_root_ctrl_start,
.abort = dwc2_root_ctrl_abort,
@@ -188,7 +194,7 @@ static const struct usbd_pipe_methods dwc2_root_ctrl_methods = {
.done = dwc2_root_ctrl_done,
};
-static const struct usbd_pipe_methods dwc2_root_intr_methods = {
+static struct usbd_pipe_methods dwc2_root_intr_methods = {
.transfer = dwc2_root_intr_transfer,
.start = dwc2_root_intr_start,
.abort = dwc2_root_intr_abort,
@@ -197,7 +203,7 @@ static const struct usbd_pipe_methods dwc2_root_intr_methods = {
.done = dwc2_root_intr_done,
};
-static const struct usbd_pipe_methods dwc2_device_ctrl_methods = {
+static struct usbd_pipe_methods dwc2_device_ctrl_methods = {
.transfer = dwc2_device_ctrl_transfer,
.start = dwc2_device_ctrl_start,
.abort = dwc2_device_ctrl_abort,
@@ -206,7 +212,7 @@ static const struct usbd_pipe_methods dwc2_device_ctrl_methods = {
.done = dwc2_device_ctrl_done,
};
-static const struct usbd_pipe_methods dwc2_device_intr_methods = {
+static struct usbd_pipe_methods dwc2_device_intr_methods = {
.transfer = dwc2_device_intr_transfer,
.start = dwc2_device_intr_start,
.abort = dwc2_device_intr_abort,
@@ -215,7 +221,7 @@ static const struct usbd_pipe_methods dwc2_device_intr_methods = {
.done = dwc2_device_intr_done,
};
-static const struct usbd_pipe_methods dwc2_device_bulk_methods = {
+static struct usbd_pipe_methods dwc2_device_bulk_methods = {
.transfer = dwc2_device_bulk_transfer,
.start = dwc2_device_bulk_start,
.abort = dwc2_device_bulk_abort,
@@ -224,7 +230,7 @@ static const struct usbd_pipe_methods dwc2_device_bulk_methods = {
.done = dwc2_device_bulk_done,
};
-static const struct usbd_pipe_methods dwc2_device_isoc_methods = {
+static struct usbd_pipe_methods dwc2_device_isoc_methods = {
.transfer = dwc2_device_isoc_transfer,
.start = dwc2_device_isoc_start,
.abort = dwc2_device_isoc_abort,
@@ -233,6 +239,7 @@ static const struct usbd_pipe_methods dwc2_device_isoc_methods = {
.done = dwc2_device_isoc_done,
};
+#if 0
static usbd_status
dwc2_allocm(struct usbd_bus *bus, struct usb_dma *dma, uint32_t size)
{
@@ -260,6 +267,7 @@ dwc2_freem(struct usbd_bus *bus, struct usb_dma *dma)
}
usb_freemem(&sc->sc_bus, dma);
}
+#endif
struct usbd_xfer *
dwc2_allocx(struct usbd_bus *bus)
@@ -277,8 +285,8 @@ dwc2_allocx(struct usbd_bus *bus)
dxfer->urb = dwc2_hcd_urb_alloc(sc->sc_hsotg,
DWC2_MAXISOCPACKETS, GFP_KERNEL);
-#ifdef DIAGNOSTIC
- dxfer->xfer.busy_free = XFER_BUSY;
+#ifdef DWC2_DEBUG
+ dxfer->xfer->busy_free = XFER_ONQU;
#endif
}
return (struct usbd_xfer *)dxfer;
@@ -292,8 +300,8 @@ dwc2_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
DPRINTFN(10, "\n");
-#ifdef DIAGNOSTIC
- if (xfer->busy_free != XFER_BUSY) {
+#ifdef DWC2_DEBUG
+ if (xfer->busy_free != XFER_ONQU) {
DPRINTF("xfer=%p not busy, 0x%08x\n", xfer, xfer->busy_free);
}
xfer->busy_free = XFER_FREE;
@@ -303,6 +311,7 @@ dwc2_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
pool_put(&sc->sc_xferpool, xfer);
}
+#if 0
static void
dwc2_get_lock(struct usbd_bus *bus, struct mutex **lock)
{
@@ -310,6 +319,7 @@ dwc2_get_lock(struct usbd_bus *bus, struct mutex **lock)
*lock = &sc->sc_lock;
}
+#endif
static void
dwc2_rhc(void *addr)
@@ -353,15 +363,15 @@ dwc2_softintr(void *v)
mtx_enter(&hsotg->lock);
while ((dxfer = TAILQ_FIRST(&sc->sc_complete)) != NULL) {
- KASSERTMSG(!timeout_pending(&dxfer->xfer.timeout_handle),
- "xfer %p pipe %p\n", dxfer, dxfer->xfer.pipe);
+ KASSERTMSG(!timeout_pending(&dxfer->xfer->timeout_handle),
+ "xfer %p pipe %p\n", dxfer, dxfer->xfer->pipe);
/*
* dwc2_abort_xfer will remove this transfer from the
* sc_complete queue
*/
/*XXXNH not tested */
- if (dxfer->xfer.hcflags & UXFER_ABORTING) {
+ if (dxfer->flags & DWC2_XFER_ABORTING) {
wakeup(&dxfer->flags);
continue;
}
@@ -369,7 +379,7 @@ dwc2_softintr(void *v)
TAILQ_REMOVE(&sc->sc_complete, dxfer, xnext);
mtx_leave(&hsotg->lock);
- usb_transfer_complete(&dxfer->xfer);
+ usb_transfer_complete(dxfer->xfer);
mtx_enter(&hsotg->lock);
}
mtx_leave(&hsotg->lock);
@@ -421,16 +431,15 @@ dwc2_timeout(void *addr)
if (sc->sc_dying) {
mtx_enter(&sc->sc_lock);
- dwc2_abort_xfer(&dxfer->xfer, USBD_TIMEOUT);
+ dwc2_abort_xfer(dxfer->xfer, USBD_TIMEOUT);
mtx_leave(&sc->sc_lock);
return;
}
/* Execute the abort in a process context. */
usb_init_task(&dxfer->abort_task, dwc2_timeout_task, addr,
- USB_TASKQ_MPSAFE);
- usb_add_task(dxfer->xfer.pipe->device, &dxfer->abort_task,
- USB_TASKQ_HC);
+ USB_TASK_TYPE_GENERIC);
+ usb_add_task(dxfer->xfer->pipe->device, &dxfer->abort_task);
}
static void
@@ -526,8 +535,8 @@ dwc2_poll(struct usbd_bus *bus)
static void
dwc2_close_pipe(struct usbd_pipe * pipe)
{
-#ifdef DIAGNOSTIC
- struct dwc2_softc *sc = pipe->device->bus->hci_private;
+#ifdef DWC2_DEBUG
+ struct dwc2_softc *sc = DWC2_PIPE2SC(pipe);
#endif
KASSERT(mtx_owned(&sc->sc_lock));
@@ -562,10 +571,10 @@ dwc2_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
* If an abort is already in progress then just wait for it to
* complete and return.
*/
- if (xfer->hcflags & UXFER_ABORTING) {
+ if (dxfer->flags & DWC2_XFER_ABORTING) {
xfer->status = status;
- xfer->hcflags |= UXFER_ABORTWAIT;
- while (xfer->hcflags & UXFER_ABORTING)
+ dxfer->flags |= DWC2_XFER_ABORTWAIT;
+ while (dxfer->flags & DWC2_XFER_ABORTING)
tsleep(&dxfer->flags, PZERO, "dwc2xfer", 0);
return;
}
@@ -574,7 +583,7 @@ dwc2_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
* Step 1: Make the stack ignore it and stop the timeout.
*/
mtx_enter(&hsotg->lock);
- xfer->hcflags |= UXFER_ABORTING;
+ dxfer->flags |= DWC2_XFER_ABORTING;
xfer->status = status; /* make software ignore it */
timeout_del(&xfer->timeout_handle);
@@ -596,8 +605,8 @@ dwc2_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
/*
* Step 2: Execute callback.
*/
- wake = xfer->hcflags & UXFER_ABORTWAIT;
- xfer->hcflags &= ~(UXFER_ABORTING | UXFER_ABORTWAIT);
+ wake = dxfer->flags & DWC2_XFER_ABORTWAIT;
+ dxfer->flags &= ~(DWC2_XFER_ABORTING | DWC2_XFER_ABORTWAIT);
usb_transfer_complete(xfer);
if (wake) {
@@ -772,13 +781,13 @@ dwc2_root_ctrl_start(struct usbd_xfer *xfer)
break;
#define sd ((usb_string_descriptor_t *)buf)
case C(0, UDESC_STRING):
- totlen = usb_makelangtbl(sd, len);
+ totlen = usbd_str(sd, len, "\001");
break;
case C(1, UDESC_STRING):
- totlen = usb_makestrdesc(sd, len, sc->sc_vendor);
+ totlen = usbd_str(sd, len, sc->sc_vendor);
break;
case C(2, UDESC_STRING):
- totlen = usb_makestrdesc(sd, len, "DWC2 root hub");
+ totlen = usbd_str(sd, len, "DWC2 root hub");
break;
#undef sd
default:
@@ -995,7 +1004,7 @@ dwc2_device_ctrl_start(struct usbd_xfer *xfer)
static void
dwc2_device_ctrl_abort(struct usbd_xfer *xfer)
{
-#ifdef DIAGNOSTIC
+#ifdef DWC2_DEBUG
struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
#endif
KASSERT(mtx_owned(&sc->sc_lock));
@@ -1058,7 +1067,7 @@ dwc2_device_bulk_start(struct usbd_xfer *xfer)
static void
dwc2_device_bulk_abort(struct usbd_xfer *xfer)
{
-#ifdef DIAGNOSTIC
+#ifdef DWC2_DEBUG
struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
#endif
KASSERT(mtx_owned(&sc->sc_lock));
@@ -1108,8 +1117,7 @@ static usbd_status
dwc2_device_intr_start(struct usbd_xfer *xfer)
{
struct dwc2_pipe *dpipe = DWC2_XFER2DPIPE(xfer)
- struct usbd_device *dev = dpipe->pipe.device;
- struct dwc2_softc *sc = dev->bus->hci_private;
+ struct dwc2_softc *sc = DWC2_DPIPE2SC(dpipe);
usbd_status err;
mtx_enter(&sc->sc_lock);
@@ -1130,7 +1138,7 @@ dwc2_device_intr_start(struct usbd_xfer *xfer)
static void
dwc2_device_intr_abort(struct usbd_xfer *xfer)
{
-#ifdef DIAGNOSTIC
+#ifdef DWC2_DEBUG
struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
#endif
@@ -1188,8 +1196,7 @@ usbd_status
dwc2_device_isoc_start(struct usbd_xfer *xfer)
{
struct dwc2_pipe *dpipe = DWC2_XFER2DPIPE(xfer);
- struct usbd_device *dev = dpipe->pipe.device;
- struct dwc2_softc *sc = dev->bus->hci_private;
+ struct dwc2_softc *sc = DWC2_DPIPE2SC(dpipe);
usbd_status err;
mtx_enter(&sc->sc_lock);
@@ -1206,7 +1213,7 @@ dwc2_device_isoc_start(struct usbd_xfer *xfer)
void
dwc2_device_isoc_abort(struct usbd_xfer *xfer)
{
-#ifdef DIAGNOSTIC
+#ifdef DWC2_DEBUG
struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
#endif
KASSERT(mtx_owned(&sc->sc_lock));
@@ -1318,7 +1325,7 @@ dwc2_device_start(struct usbd_xfer *xfer)
} else {
/* XXXNH - % mps required? */
if ((xfer->flags & USBD_FORCE_SHORT_XFER) && (len % mps) == 0)
- flags |= URB_SEND_ZERO_PACKET;
+ flags |= URB_SEND_ZERO_PACKET;
}
flags |= URB_GIVEBACK_ASAP;
@@ -1456,7 +1463,7 @@ Debugger();
KASSERT(dwork->xfer != NULL);
KASSERT(dxfer->queued == true);
- if (!(xfer->hcflags & UXFER_ABORTING)) {
+ if (!(dxfer->flags & DWC2_XFER_ABORTING)) {
dwc2_start_standard_chain(xfer);
}
dxfer->queued = false;
@@ -1551,6 +1558,7 @@ dwc2_activate(struct device *self, int act)
return 0;
}
+#if 0
bool
dwc2_resume(struct device *dv, const pmf_qual_t *qual)
{
@@ -1570,6 +1578,7 @@ dwc2_suspend(struct device *dv, const pmf_qual_t *qual)
return true;
}
+#endif
/***********************************************************************/
int
@@ -1577,7 +1586,6 @@ dwc2_init(struct dwc2_softc *sc)
{
int err = 0;
- sc->sc_bus.hci_private = sc;
sc->sc_bus.usbrev = USBREV_2_0;
sc->sc_bus.methods = &dwc2_bus_methods;
sc->sc_bus.pipe_size = sizeof(struct dwc2_pipe);
@@ -1590,8 +1598,10 @@ dwc2_init(struct dwc2_softc *sc)
sc->sc_rhc_si = softintr_establish(IPL_SOFTNET,
dwc2_rhc, sc);
- usb_setup_reserve(sc->sc_dev, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
- USB_MEM_RESERVE);
+#if 0
+ usb_setup_reserve(&sc->sc_bus, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
+ USB_MEM_RESERVE);
+#endif
pool_init(&sc->sc_xferpool, sizeof(struct dwc2_xfer), 0, 0, 0,
"dwc2xfer", NULL);
@@ -1611,7 +1621,7 @@ dwc2_init(struct dwc2_softc *sc)
}
sc->sc_hsotg->hsotg_sc = sc;
- sc->sc_hsotg->dev = sc->sc_dev;
+ sc->sc_hsotg->dev = &sc->sc_bus.bdev;
sc->sc_hcdenabled = true;
err = dwc2_hcd_init(sc->sc_hsotg, sc->sc_params);
diff --git a/sys/dev/usb/dwc2/dwc2_core.h b/sys/dev/usb/dwc2/dwc2_core.h
index bef355bdcbe..0bd1ec12b8b 100644
--- a/sys/dev/usb/dwc2/dwc2_core.h
+++ b/sys/dev/usb/dwc2/dwc2_core.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2_core.h,v 1.6 2015/02/10 14:15:14 uebayasi Exp $ */
+/* $OpenBSD: dwc2_core.h,v 1.7 2015/02/10 23:43:46 uebayasi Exp $ */
/* $NetBSD: dwc2_core.h,v 1.5 2014/04/03 06:34:58 skrll Exp $ */
/*
@@ -461,7 +461,7 @@ struct dwc2_hsotg {
int non_periodic_channels;
int available_host_channels;
struct dwc2_host_chan *hc_ptr_array[MAX_EPS_CHANNELS];
- struct usb_dma * status_buf_usbdma;
+ struct usb_dma status_buf_usbdma;
u8 *status_buf;
dma_addr_t status_buf_dma;
#define DWC2_HCD_STATUS_BUF_SIZE 64
@@ -471,7 +471,7 @@ struct dwc2_hsotg {
spinlock_t lock;
void *priv;
u8 otg_port;
- struct usb_dma * frame_list_usbdma;
+ struct usb_dma frame_list_usbdma;
u32 *frame_list;
dma_addr_t frame_list_dma;
diff --git a/sys/dev/usb/dwc2/dwc2_hcd.c b/sys/dev/usb/dwc2/dwc2_hcd.c
index ec74246bed7..baf41d2b96d 100644
--- a/sys/dev/usb/dwc2/dwc2_hcd.c
+++ b/sys/dev/usb/dwc2/dwc2_hcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2_hcd.c,v 1.9 2015/02/10 23:38:13 uebayasi Exp $ */
+/* $OpenBSD: dwc2_hcd.c,v 1.10 2015/02/10 23:43:46 uebayasi Exp $ */
/* $NetBSD: dwc2_hcd.c,v 1.15 2014/11/24 10:14:14 skrll Exp $ */
/*
@@ -2316,9 +2316,9 @@ error1:
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
free(hsotg->last_frame_num_array, M_DEVBUF,
- sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+ sizeof(*hsotg->last_frame_num_array) * FRAME_NUM_ARRAY_SIZE);
free(hsotg->frame_num_array, M_DEVBUF,
- sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
+ sizeof(*hsotg->frame_num_array) * FRAME_NUM_ARRAY_SIZE);
#endif
dev_err(hsotg->dev, "%s() FAILED, returning %d\n", __func__, retval);
diff --git a/sys/dev/usb/dwc2/dwc2_hcd.h b/sys/dev/usb/dwc2/dwc2_hcd.h
index c41fe0e75da..edc8603c3b5 100644
--- a/sys/dev/usb/dwc2/dwc2_hcd.h
+++ b/sys/dev/usb/dwc2/dwc2_hcd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2_hcd.h,v 1.6 2015/02/10 13:49:48 uebayasi Exp $ */
+/* $OpenBSD: dwc2_hcd.h,v 1.7 2015/02/10 23:43:46 uebayasi Exp $ */
/* $NetBSD: dwc2_hcd.h,v 1.9 2014/09/03 10:00:08 skrll Exp $ */
/*
@@ -283,13 +283,13 @@ struct dwc2_qh {
u16 frame_usecs[8];
u16 start_split_frame;
u16 ntd;
- struct usb_dma * dw_align_buf_usbdma;
+ struct usb_dma dw_align_buf_usbdma;
u8 *dw_align_buf;
dma_addr_t dw_align_buf_dma;
struct list_head qtd_list;
struct dwc2_host_chan *channel;
struct list_head qh_list_entry;
- struct usb_dma * desc_list_usbdma;
+ struct usb_dma desc_list_usbdma;
struct dwc2_hcd_dma_desc *desc_list;
dma_addr_t desc_list_dma;
u32 *n_bytes;
diff --git a/sys/dev/usb/dwc2/dwc2_hcdddma.c b/sys/dev/usb/dwc2/dwc2_hcdddma.c
index baf3358c430..ffba3e46965 100644
--- a/sys/dev/usb/dwc2/dwc2_hcdddma.c
+++ b/sys/dev/usb/dwc2/dwc2_hcdddma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2_hcdddma.c,v 1.7 2015/02/10 23:38:13 uebayasi Exp $ */
+/* $OpenBSD: dwc2_hcdddma.c,v 1.8 2015/02/10 23:43:46 uebayasi Exp $ */
/* $NetBSD: dwc2_hcdddma.c,v 1.6 2014/04/03 06:34:58 skrll Exp $ */
/*
@@ -172,7 +172,7 @@ static int dwc2_frame_list_alloc(struct dwc2_hsotg *hsotg, gfp_t mem_flags)
static void dwc2_frame_list_free(struct dwc2_hsotg *hsotg)
{
- struct usb_dma * frame_list_usbdma;
+ struct usb_dma frame_list_usbdma;
unsigned long flags;
spin_lock_irqsave(&hsotg->lock, flags);
diff --git a/sys/dev/usb/dwc2/dwc2var.h b/sys/dev/usb/dwc2/dwc2var.h
index 7152d13fd3a..bec84b5ef42 100644
--- a/sys/dev/usb/dwc2/dwc2var.h
+++ b/sys/dev/usb/dwc2/dwc2var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2var.h,v 1.8 2015/02/10 23:38:13 uebayasi Exp $ */
+/* $OpenBSD: dwc2var.h,v 1.9 2015/02/10 23:43:46 uebayasi Exp $ */
/* $NetBSD: dwc2var.h,v 1.3 2013/10/22 12:57:40 skrll Exp $ */
/*-
@@ -35,18 +35,24 @@
#include <sys/pool.h>
+struct task;
+
#define DWC2_MAXISOCPACKETS 16
struct dwc2_hsotg;
struct dwc2_qtd;
struct dwc2_xfer {
- struct usbd_xfer xfer; /* Needs to be first */
+ struct usbd_xfer *xfer; /* Needs to be first */
struct usb_task abort_task;
struct dwc2_hcd_urb *urb;
int packet_count;
TAILQ_ENTRY(dwc2_xfer) xnext; /* list of complete xfers */
+
+ u_int32_t flags;
+#define DWC2_XFER_ABORTING 0x0001 /* xfer is aborting. */
+#define DWC2_XFER_ABORTWAIT 0x0002 /* abort completion is being awaited. */
};
struct dwc2_pipe {
@@ -56,11 +62,11 @@ struct dwc2_pipe {
void *priv; /* QH */
/* DMA buffer for control endpoint requests */
- struct usb_dma * req_dma;
+ struct usb_dma req_dma;
};
-#define DWC2_BUS2SC(bus) ((bus)->hci_private)
+#define DWC2_BUS2SC(bus) ((void *)(bus))
#define DWC2_PIPE2SC(pipe) DWC2_BUS2SC((pipe)->device->bus)
#define DWC2_XFER2SC(xfer) DWC2_PIPE2SC((xfer)->pipe)
#define DWC2_DPIPE2SC(d) DWC2_BUS2SC((d)->pipe.device->bus)
@@ -72,7 +78,7 @@ struct dwc2_pipe {
typedef struct dwc2_softc {
- struct device *sc_dev;
+ struct usbd_bus sc_bus;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
@@ -83,7 +89,6 @@ typedef struct dwc2_softc {
* Private
*/
- struct usbd_bus sc_bus;
struct dwc2_hsotg *sc_hsotg;
struct mutex sc_lock;
@@ -95,7 +100,9 @@ typedef struct dwc2_softc {
struct device *sc_child; /* /dev/usb# device */
char sc_dying;
+#if 0
struct usb_dma_reserve sc_dma_reserve;
+#endif
char sc_vendor[32]; /* vendor string for root hub */
int sc_id_vendor; /* vendor ID for root hub */