summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/at91dci.c24
-rw-r--r--sys/dev/usb/controller/at91dci_atmelarm.c6
-rw-r--r--sys/dev/usb/controller/atmegadci.c26
-rw-r--r--sys/dev/usb/controller/atmegadci_atmelarm.c4
-rw-r--r--sys/dev/usb/controller/avr32dci.c24
-rw-r--r--sys/dev/usb/controller/ehci.c214
-rw-r--r--sys/dev/usb/controller/ehci_ixp4xx.c4
-rw-r--r--sys/dev/usb/controller/ehci_mbus.c4
-rw-r--r--sys/dev/usb/controller/ehci_pci.c6
-rw-r--r--sys/dev/usb/controller/musb_otg.c40
-rw-r--r--sys/dev/usb/controller/musb_otg_atmelarm.c4
-rw-r--r--sys/dev/usb/controller/ohci.c130
-rw-r--r--sys/dev/usb/controller/ohci_atmelarm.c4
-rw-r--r--sys/dev/usb/controller/ohci_pci.c4
-rw-r--r--sys/dev/usb/controller/uhci.c154
-rw-r--r--sys/dev/usb/controller/uhci_pci.c4
-rw-r--r--sys/dev/usb/controller/usb_controller.c198
-rw-r--r--sys/dev/usb/controller/uss820dci.c22
-rw-r--r--sys/dev/usb/controller/uss820dci_atmelarm.c4
19 files changed, 438 insertions, 438 deletions
diff --git a/sys/dev/usb/controller/at91dci.c b/sys/dev/usb/controller/at91dci.c
index 5831a7e..fd1b684 100644
--- a/sys/dev/usb/controller/at91dci.c
+++ b/sys/dev/usb/controller/at91dci.c
@@ -260,7 +260,7 @@ at91dci_wakeup_peer(struct at91dci_softc *sc)
/* wait 8 milliseconds */
/* Wait for reset to complete. */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, 0);
}
@@ -321,7 +321,7 @@ at91dci_setup_rx(struct at91dci_td *td)
td->fifo_reg, (void *)&req, sizeof(req));
/* copy data into real buffer */
- usb2_copy_in(td->pc, 0, &req, sizeof(req));
+ usbd_copy_in(td->pc, 0, &req, sizeof(req));
td->offset = sizeof(req);
td->remainder = 0;
@@ -442,7 +442,7 @@ repeat:
return (0); /* we are complete */
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -549,7 +549,7 @@ repeat:
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -865,7 +865,7 @@ at91dci_setup_standard_chain(struct usb_xfer *xfer)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -1046,11 +1046,11 @@ at91dci_start_standard_chain(struct usb_xfer *xfer)
DPRINTFN(15, "enable interrupts on endpoint %d\n", ep_no);
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer,
+ usbd_transfer_timeout_ms(xfer,
&at91dci_timeout, xfer->timeout);
}
}
@@ -1203,7 +1203,7 @@ at91dci_device_done(struct usb_xfer *xfer, usb_error_t error)
DPRINTFN(15, "disable interrupts on endpoint %d\n", ep_no);
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
static void
@@ -1375,7 +1375,7 @@ at91dci_init(struct at91dci_softc *sc)
(sc->sc_clocks_on) (sc->sc_clocks_arg);
}
/* wait a little for things to stabilise */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
/* disable and clear all interrupts */
@@ -1632,7 +1632,7 @@ at91dci_device_isoc_fs_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + temp +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + temp +
xfer->nframes;
/* compute frame number for next insertion */
@@ -2165,7 +2165,7 @@ at91dci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_packet_count = 1;
parm->hc_max_frame_size = 0x500;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
/*
* compute maximum number of TDs
@@ -2193,7 +2193,7 @@ at91dci_xfer_setup(struct usb_setup_params *parm)
}
/*
- * check if "usb2_transfer_setup_sub" set an error
+ * check if "usbd_transfer_setup_sub" set an error
*/
if (parm->err) {
return;
diff --git a/sys/dev/usb/controller/at91dci_atmelarm.c b/sys/dev/usb/controller/at91dci_atmelarm.c
index aedd30f..37d79e5 100644
--- a/sys/dev/usb/controller/at91dci_atmelarm.c
+++ b/sys/dev/usb/controller/at91dci_atmelarm.c
@@ -144,7 +144,7 @@ at91_udp_attach(device_t dev)
sc->sc_dci.sc_bus.devices_max = AT91_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_dci.sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_dci.sc_bus,
USB_GET_DMA_TAG(dev), NULL)) {
return (ENOMEM);
}
@@ -166,7 +166,7 @@ at91_udp_attach(device_t dev)
at91_udp_pull_down(sc);
/* wait 10ms for pulldown to stabilise */
- usb2_pause_mtx(NULL, hz / 100);
+ usb_pause_mtx(NULL, hz / 100);
sc->sc_iclk = at91_pmc_clock_ref("udc_clk");
sc->sc_fclk = at91_pmc_clock_ref("udpck");
@@ -295,7 +295,7 @@ at91_udp_detach(device_t dev)
sc->sc_dci.sc_io_res);
sc->sc_dci.sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL);
+ usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL);
/* disable clocks */
at91_pmc_clock_disable(sc->sc_iclk);
diff --git a/sys/dev/usb/controller/atmegadci.c b/sys/dev/usb/controller/atmegadci.c
index 0f4ef24..79d9fcb 100644
--- a/sys/dev/usb/controller/atmegadci.c
+++ b/sys/dev/usb/controller/atmegadci.c
@@ -204,7 +204,7 @@ atmegadci_wakeup_peer(struct atmegadci_softc *sc)
/* wait 8 milliseconds */
/* Wait for reset to complete. */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
/* hardware should have cleared RMWKUP bit */
}
@@ -267,7 +267,7 @@ atmegadci_setup_rx(struct atmegadci_td *td)
(void *)&req, sizeof(req));
/* copy data into real buffer */
- usb2_copy_in(td->pc, 0, &req, sizeof(req));
+ usbd_copy_in(td->pc, 0, &req, sizeof(req));
td->offset = sizeof(req);
td->remainder = 0;
@@ -378,7 +378,7 @@ repeat:
return (0); /* we are complete */
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -465,7 +465,7 @@ repeat:
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -768,7 +768,7 @@ atmegadci_setup_standard_chain(struct usb_xfer *xfer)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -929,11 +929,11 @@ atmegadci_start_standard_chain(struct usb_xfer *xfer)
if (atmegadci_xfer_do_fifo(xfer)) {
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer,
+ usbd_transfer_timeout_ms(xfer,
&atmegadci_timeout, xfer->timeout);
}
}
@@ -1089,7 +1089,7 @@ atmegadci_device_done(struct usb_xfer *xfer, usb_error_t error)
DPRINTFN(15, "disabled interrupts!\n");
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
static void
@@ -1236,7 +1236,7 @@ atmegadci_init(struct atmegadci_softc *sc)
if (ATMEGA_READ_1(sc, 0x49) & 0x01)
break;
/* wait a little bit for PLL to start */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
}
/* make sure USB is enabled */
@@ -1252,7 +1252,7 @@ atmegadci_init(struct atmegadci_softc *sc)
ATMEGA_WRITE_1(sc, ATMEGA_UDCON, ATMEGA_UDCON_DETACH);
/* wait a little for things to stabilise */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 20);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 20);
/* enable interrupts */
ATMEGA_WRITE_1(sc, ATMEGA_UDIEN,
@@ -1453,7 +1453,7 @@ atmegadci_device_isoc_fs_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + temp +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + temp +
xfer->nframes;
/* compute frame number for next insertion */
@@ -2017,7 +2017,7 @@ atmegadci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_packet_count = 1;
parm->hc_max_frame_size = 0x500;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
/*
* compute maximum number of TDs
@@ -2032,7 +2032,7 @@ atmegadci_xfer_setup(struct usb_setup_params *parm)
}
/*
- * check if "usb2_transfer_setup_sub" set an error
+ * check if "usbd_transfer_setup_sub" set an error
*/
if (parm->err)
return;
diff --git a/sys/dev/usb/controller/atmegadci_atmelarm.c b/sys/dev/usb/controller/atmegadci_atmelarm.c
index 6412851..3a85b50 100644
--- a/sys/dev/usb/controller/atmegadci_atmelarm.c
+++ b/sys/dev/usb/controller/atmegadci_atmelarm.c
@@ -84,7 +84,7 @@ atmegadci_attach(device_t dev)
sc->sc_otg.sc_bus.devices_max = ATMEGA_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_otg.sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_otg.sc_bus,
USB_GET_DMA_TAG(dev), NULL)) {
return (ENOMEM);
}
@@ -168,7 +168,7 @@ atmegadci_detach(device_t dev)
sc->sc_otg.sc_io_res);
sc->sc_otg.sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);
+ usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);
return (0);
}
diff --git a/sys/dev/usb/controller/avr32dci.c b/sys/dev/usb/controller/avr32dci.c
index 5463b7f..edf7879 100644
--- a/sys/dev/usb/controller/avr32dci.c
+++ b/sys/dev/usb/controller/avr32dci.c
@@ -237,7 +237,7 @@ avr32dci_wakeup_peer(struct avr32dci_softc *sc)
/* wait 8 milliseconds */
/* Wait for reset to complete. */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
/* hardware should have cleared RMWKUP bit */
}
@@ -289,7 +289,7 @@ avr32dci_setup_rx(struct avr32dci_td *td)
memcpy(&req, sc->physdata, sizeof(req));
/* copy data into real buffer */
- usb2_copy_in(td->pc, 0, &req, sizeof(req));
+ usbd_copy_in(td->pc, 0, &req, sizeof(req));
td->offset = sizeof(req);
td->remainder = 0;
@@ -390,7 +390,7 @@ repeat:
return (0); /* we are complete */
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -466,7 +466,7 @@ repeat:
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -738,7 +738,7 @@ avr32dci_setup_standard_chain(struct usb_xfer *xfer)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpoint),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -900,11 +900,11 @@ avr32dci_start_standard_chain(struct usb_xfer *xfer)
avr32dci_mod_ien(sc, AVR32_INT_EPT_INT(ep_no), 0);
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer,
+ usbd_transfer_timeout_ms(xfer,
&avr32dci_timeout, xfer->timeout);
}
}
@@ -1057,7 +1057,7 @@ avr32dci_device_done(struct usb_xfer *xfer, usb_error_t error)
DPRINTFN(15, "disabled interrupts!\n");
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
static void
@@ -1198,7 +1198,7 @@ avr32dci_init(struct avr32dci_softc *sc)
avr32dci_mod_ctrl(sc, AVR32_CTRL_DEV_DETACH, 0);
/* wait a little for things to stabilise */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 20);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 20);
/* disable interrupts */
avr32dci_mod_ien(sc, 0, 0xFFFFFFFF);
@@ -1387,7 +1387,7 @@ avr32dci_device_isoc_fs_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + temp +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + temp +
xfer->nframes;
/* compute frame number for next insertion */
@@ -1950,7 +1950,7 @@ avr32dci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_packet_count = 1;
parm->hc_max_frame_size = 0x400;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
/*
* compute maximum number of TDs
@@ -1965,7 +1965,7 @@ avr32dci_xfer_setup(struct usb_setup_params *parm)
}
/*
- * check if "usb2_transfer_setup_sub" set an error
+ * check if "usbd_transfer_setup_sub" set an error
*/
if (parm->err)
return;
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c
index 6b51600..9bbb7c4 100644
--- a/sys/dev/usb/controller/ehci.c
+++ b/sys/dev/usb/controller/ehci.c
@@ -153,7 +153,7 @@ ehci_reset(ehci_softc_t *sc)
EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
for (i = 0; i < 100; i++) {
- usb2_pause_mtx(NULL, hz / 1000);
+ usb_pause_mtx(NULL, hz / 1000);
hcr = EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_HCRESET;
if (!hcr) {
if (sc->sc_flags & (EHCI_SCFLG_SETMODE | EHCI_SCFLG_BIGEMMIO)) {
@@ -189,7 +189,7 @@ ehci_hcreset(ehci_softc_t *sc)
EOWRITE4(sc, EHCI_USBCMD, 0); /* Halt controller */
for (i = 0; i < 100; i++) {
- usb2_pause_mtx(NULL, hz / 1000);
+ usb_pause_mtx(NULL, hz / 1000);
hcr = EOREAD4(sc, EHCI_USBSTS) & EHCI_STS_HCH;
if (hcr)
break;
@@ -221,7 +221,7 @@ ehci_init(ehci_softc_t *sc)
DPRINTF("start\n");
- usb2_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
+ usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
#if USB_DEBUG
if (ehcidebug > 2) {
@@ -274,7 +274,7 @@ ehci_init(ehci_softc_t *sc)
for (i = 0; i < EHCI_VIRTUAL_FRAMELIST_COUNT; i++) {
ehci_qh_t *qh;
- usb2_get_page(sc->sc_hw.intr_start_pc + i, 0, &buf_res);
+ usbd_get_page(sc->sc_hw.intr_start_pc + i, 0, &buf_res);
qh = buf_res.buffer;
@@ -342,7 +342,7 @@ ehci_init(ehci_softc_t *sc)
ehci_sitd_t *sitd;
ehci_itd_t *itd;
- usb2_get_page(sc->sc_hw.isoc_fs_start_pc + i, 0, &buf_res);
+ usbd_get_page(sc->sc_hw.isoc_fs_start_pc + i, 0, &buf_res);
sitd = buf_res.buffer;
@@ -367,7 +367,7 @@ ehci_init(ehci_softc_t *sc)
sc->sc_intr_p_last[i | (EHCI_VIRTUAL_FRAMELIST_COUNT / 2)]->qh_self;
- usb2_get_page(sc->sc_hw.isoc_hs_start_pc + i, 0, &buf_res);
+ usbd_get_page(sc->sc_hw.isoc_hs_start_pc + i, 0, &buf_res);
itd = buf_res.buffer;
@@ -389,7 +389,7 @@ ehci_init(ehci_softc_t *sc)
sitd->sitd_self;
}
- usb2_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
if (1) {
uint32_t *pframes;
@@ -409,7 +409,7 @@ ehci_init(ehci_softc_t *sc)
/* setup sync list pointer */
EOWRITE4(sc, EHCI_PERIODICLISTBASE, buf_res.physaddr);
- usb2_get_page(&sc->sc_hw.async_start_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.async_start_pc, 0, &buf_res);
if (1) {
@@ -445,7 +445,7 @@ ehci_init(ehci_softc_t *sc)
}
/* flush all cache into memory */
- usb2_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc);
+ usb_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc);
#if USB_DEBUG
if (ehcidebug) {
@@ -472,7 +472,7 @@ ehci_init(ehci_softc_t *sc)
EOWRITE4(sc, EHCI_CONFIGFLAG, EHCI_CONF_CF);
for (i = 0; i < 100; i++) {
- usb2_pause_mtx(NULL, hz / 1000);
+ usb_pause_mtx(NULL, hz / 1000);
hcr = EOREAD4(sc, EHCI_USBSTS) & EHCI_STS_HCH;
if (!hcr) {
break;
@@ -498,7 +498,7 @@ ehci_detach(ehci_softc_t *sc)
{
USB_BUS_LOCK(&sc->sc_bus);
- usb2_callout_stop(&sc->sc_tmo_pcd);
+ usb_callout_stop(&sc->sc_tmo_pcd);
EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
USB_BUS_UNLOCK(&sc->sc_bus);
@@ -508,9 +508,9 @@ ehci_detach(ehci_softc_t *sc)
}
/* XXX let stray task complete */
- usb2_pause_mtx(NULL, hz / 20);
+ usb_pause_mtx(NULL, hz / 20);
- usb2_callout_drain(&sc->sc_tmo_pcd);
+ usb_callout_drain(&sc->sc_tmo_pcd);
}
void
@@ -543,7 +543,7 @@ ehci_suspend(ehci_softc_t *sc)
if (hcr == 0) {
break;
}
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
}
if (hcr != 0) {
@@ -557,7 +557,7 @@ ehci_suspend(ehci_softc_t *sc)
if (hcr == EHCI_STS_HCH) {
break;
}
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
}
if (hcr != EHCI_STS_HCH) {
@@ -580,10 +580,10 @@ ehci_resume(ehci_softc_t *sc)
/* restore things in case the bios doesn't */
EOWRITE4(sc, EHCI_CTRLDSSEGMENT, 0);
- usb2_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
EOWRITE4(sc, EHCI_PERIODICLISTBASE, buf_res.physaddr);
- usb2_get_page(&sc->sc_hw.async_start_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.async_start_pc, 0, &buf_res);
EOWRITE4(sc, EHCI_ASYNCLISTADDR, buf_res.physaddr | EHCI_LINK_QH);
EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
@@ -600,7 +600,7 @@ ehci_resume(ehci_softc_t *sc)
}
if (hcr) {
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_RESUME_WAIT));
for (i = 1; i <= sc->sc_noport; i++) {
@@ -619,7 +619,7 @@ ehci_resume(ehci_softc_t *sc)
if (hcr != EHCI_STS_HCH) {
break;
}
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
}
if (hcr == EHCI_STS_HCH) {
device_printf(sc->sc_bus.bdev, "config timeout\n");
@@ -627,7 +627,7 @@ ehci_resume(ehci_softc_t *sc)
USB_BUS_UNLOCK(&sc->sc_bus);
- usb2_pause_mtx(NULL,
+ usb_pause_mtx(NULL,
USB_MS_TO_TICKS(USB_RESUME_WAIT));
/* catch any lost interrupts */
@@ -793,7 +793,7 @@ ehci_dump_sqtd(ehci_softc_t *sc, ehci_qtd_t *sqtd)
{
uint8_t temp;
- usb2_pc_cpu_invalidate(sqtd->page_cache);
+ usb_pc_cpu_invalidate(sqtd->page_cache);
printf("QTD(%p) at 0x%08x:\n", sqtd, hc32toh(sc, sqtd->qtd_self));
ehci_dump_qtd(sc, sqtd);
temp = (sqtd->qtd_next & htohc32(sc, EHCI_LINK_TERMINATE)) ? 1 : 0;
@@ -821,7 +821,7 @@ ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *qh)
uint32_t endp;
uint32_t endphub;
- usb2_pc_cpu_invalidate(qh->page_cache);
+ usb_pc_cpu_invalidate(qh->page_cache);
printf("QH(%p) at 0x%08x:\n", qh, hc32toh(sc, qh->qh_self) & ~0x1F);
printf(" link=");
ehci_dump_link(sc, qh->qh_link, 1);
@@ -851,7 +851,7 @@ ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *qh)
static void
ehci_dump_sitd(ehci_softc_t *sc, ehci_sitd_t *sitd)
{
- usb2_pc_cpu_invalidate(sitd->page_cache);
+ usb_pc_cpu_invalidate(sitd->page_cache);
printf("SITD(%p) at 0x%08x\n", sitd, hc32toh(sc, sitd->sitd_self) & ~0x1F);
printf(" next=0x%08x\n", hc32toh(sc, sitd->sitd_next));
printf(" portaddr=0x%08x dir=%s addr=%d endpt=0x%x port=0x%x huba=0x%x\n",
@@ -877,7 +877,7 @@ ehci_dump_sitd(ehci_softc_t *sc, ehci_sitd_t *sitd)
static void
ehci_dump_itd(ehci_softc_t *sc, ehci_itd_t *itd)
{
- usb2_pc_cpu_invalidate(itd->page_cache);
+ usb_pc_cpu_invalidate(itd->page_cache);
printf("ITD(%p) at 0x%08x\n", itd, hc32toh(sc, itd->itd_self) & ~0x1F);
printf(" next=0x%08x\n", hc32toh(sc, itd->itd_next));
printf(" status[0]=0x%08x; <%s>\n", hc32toh(sc, itd->itd_status[0]),
@@ -959,11 +959,11 @@ ehci_transfer_intr_enqueue(struct usb_xfer *xfer)
return;
}
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer, &ehci_timeout, xfer->timeout);
+ usbd_transfer_timeout_ms(xfer, &ehci_timeout, xfer->timeout);
}
}
@@ -980,7 +980,7 @@ _ehci_append_fs_td(ehci_sitd_t *std, ehci_sitd_t *last)
std->prev = last;
- usb2_pc_cpu_flush(std->page_cache);
+ usb_pc_cpu_flush(std->page_cache);
/*
* the last->next->prev is never followed: std->next->prev = std;
@@ -988,7 +988,7 @@ _ehci_append_fs_td(ehci_sitd_t *std, ehci_sitd_t *last)
last->next = std;
last->sitd_next = std->sitd_self;
- usb2_pc_cpu_flush(last->page_cache);
+ usb_pc_cpu_flush(last->page_cache);
return (std);
}
@@ -1006,7 +1006,7 @@ _ehci_append_hs_td(ehci_itd_t *std, ehci_itd_t *last)
std->prev = last;
- usb2_pc_cpu_flush(std->page_cache);
+ usb_pc_cpu_flush(std->page_cache);
/*
* the last->next->prev is never followed: std->next->prev = std;
@@ -1014,7 +1014,7 @@ _ehci_append_hs_td(ehci_itd_t *std, ehci_itd_t *last)
last->next = std;
last->itd_next = std->itd_self;
- usb2_pc_cpu_flush(last->page_cache);
+ usb_pc_cpu_flush(last->page_cache);
return (std);
}
@@ -1037,7 +1037,7 @@ _ehci_append_qh(ehci_qh_t *sqh, ehci_qh_t *last)
sqh->prev = last;
- usb2_pc_cpu_flush(sqh->page_cache);
+ usb_pc_cpu_flush(sqh->page_cache);
/*
* the last->next->prev is never followed: sqh->next->prev = sqh;
@@ -1046,7 +1046,7 @@ _ehci_append_qh(ehci_qh_t *sqh, ehci_qh_t *last)
last->next = sqh;
last->qh_link = sqh->qh_self;
- usb2_pc_cpu_flush(last->page_cache);
+ usb_pc_cpu_flush(last->page_cache);
return (sqh);
}
@@ -1062,11 +1062,11 @@ _ehci_remove_fs_td(ehci_sitd_t *std, ehci_sitd_t *last)
std->prev->next = std->next;
std->prev->sitd_next = std->sitd_next;
- usb2_pc_cpu_flush(std->prev->page_cache);
+ usb_pc_cpu_flush(std->prev->page_cache);
if (std->next) {
std->next->prev = std->prev;
- usb2_pc_cpu_flush(std->next->page_cache);
+ usb_pc_cpu_flush(std->next->page_cache);
}
return ((last == std) ? std->prev : last);
}
@@ -1082,11 +1082,11 @@ _ehci_remove_hs_td(ehci_itd_t *std, ehci_itd_t *last)
std->prev->next = std->next;
std->prev->itd_next = std->itd_next;
- usb2_pc_cpu_flush(std->prev->page_cache);
+ usb_pc_cpu_flush(std->prev->page_cache);
if (std->next) {
std->next->prev = std->prev;
- usb2_pc_cpu_flush(std->next->page_cache);
+ usb_pc_cpu_flush(std->next->page_cache);
}
return ((last == std) ? std->prev : last);
}
@@ -1105,17 +1105,17 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_t *last)
sqh->prev->next = sqh->next;
sqh->prev->qh_link = sqh->qh_link;
- usb2_pc_cpu_flush(sqh->prev->page_cache);
+ usb_pc_cpu_flush(sqh->prev->page_cache);
if (sqh->next) {
sqh->next->prev = sqh->prev;
- usb2_pc_cpu_flush(sqh->next->page_cache);
+ usb_pc_cpu_flush(sqh->next->page_cache);
}
last = ((last == sqh) ? sqh->prev : last);
sqh->prev = 0;
- usb2_pc_cpu_flush(sqh->page_cache);
+ usb_pc_cpu_flush(sqh->page_cache);
}
return (last);
}
@@ -1137,7 +1137,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
}
while (1) {
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = hc32toh(sc, td->qtd_status);
len = EHCI_QTD_GET_BYTES(status);
@@ -1287,13 +1287,13 @@ ehci_check_transfer(struct usb_xfer *xfer)
/* isochronous full speed transfer */
td = xfer->td_transfer_last;
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = hc32toh(sc, td->sitd_status);
/* also check if first is complete */
td = xfer->td_transfer_first;
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status |= hc32toh(sc, td->sitd_status);
if (!(status & EHCI_SITD_ACTIVE)) {
@@ -1306,7 +1306,7 @@ ehci_check_transfer(struct usb_xfer *xfer)
/* isochronous high speed transfer */
td = xfer->td_transfer_last;
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status =
td->itd_status[0] | td->itd_status[1] |
td->itd_status[2] | td->itd_status[3] |
@@ -1315,7 +1315,7 @@ ehci_check_transfer(struct usb_xfer *xfer)
/* also check first transfer */
td = xfer->td_transfer_first;
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status |=
td->itd_status[0] | td->itd_status[1] |
td->itd_status[2] | td->itd_status[3] |
@@ -1339,7 +1339,7 @@ ehci_check_transfer(struct usb_xfer *xfer)
td = xfer->td_transfer_cache;
while (1) {
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = hc32toh(sc, td->qtd_status);
/*
@@ -1475,7 +1475,7 @@ ehci_interrupt(ehci_softc_t *sc)
ehci_root_intr(sc);
/* do not allow RHSC interrupts > 1 per second */
- usb2_callout_reset(&sc->sc_tmo_pcd, hz,
+ usb_callout_reset(&sc->sc_tmo_pcd, hz,
(void *)&ehci_pcd_enable, sc);
}
status &= ~(EHCI_STS_INT | EHCI_STS_ERRINT | EHCI_STS_PCD | EHCI_STS_IAA);
@@ -1634,7 +1634,7 @@ restart:
/* fill out buffer pointers */
- usb2_get_page(temp->pc, buf_offset, &buf_res);
+ usbd_get_page(temp->pc, buf_offset, &buf_res);
td->qtd_buffer[0] =
htohc32(temp->sc, buf_res.physaddr);
td->qtd_buffer_hi[0] = 0;
@@ -1644,7 +1644,7 @@ restart:
while (average > EHCI_PAGE_SIZE) {
average -= EHCI_PAGE_SIZE;
buf_offset += EHCI_PAGE_SIZE;
- usb2_get_page(temp->pc, buf_offset, &buf_res);
+ usbd_get_page(temp->pc, buf_offset, &buf_res);
td->qtd_buffer[x] =
htohc32(temp->sc,
buf_res.physaddr & (~0xFFF));
@@ -1661,7 +1661,7 @@ restart:
* of a valid page !
*/
buf_offset += average;
- usb2_get_page(temp->pc, buf_offset - 1, &buf_res);
+ usbd_get_page(temp->pc, buf_offset - 1, &buf_res);
td->qtd_buffer[x] =
htohc32(temp->sc,
buf_res.physaddr & (~0xFFF));
@@ -1675,7 +1675,7 @@ restart:
td->qtd_altnext = qtd_altnext;
td->alt_next = td_alt_next;
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
}
if (precompute) {
@@ -1717,7 +1717,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.average = xfer->max_hc_frame_size;
temp.max_frame_size = xfer->max_frame_size;
@@ -1749,7 +1749,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
temp.auto_data_toggle = 1;
}
- if (usb2_get_speed(xfer->xroot->udev) != USB_SPEED_HIGH) {
+ if (usbd_get_speed(xfer->xroot->udev) != USB_SPEED_HIGH) {
/* max 3 retries */
temp.qtd_status |=
htohc32(temp.sc, EHCI_QTD_SET_CERR(3));
@@ -1872,7 +1872,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
td->qtd_altnext = htohc32(temp.sc, EHCI_LINK_TERMINATE);
td->qtd_status |= htohc32(temp.sc, EHCI_QTD_IOC);
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
/* must have at least one frame! */
@@ -1898,14 +1898,14 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
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) {
+ if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) |
EHCI_QH_DTC);
if (methods != &ehci_device_intr_methods)
qh_endp |= EHCI_QH_SET_NRL(8);
} else {
- if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) {
+ if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) {
qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL) |
EHCI_QH_DTC);
} else {
@@ -1926,8 +1926,8 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
qh_endphub =
(EHCI_QH_SET_MULT(xfer->max_packet_count & 3) |
- EHCI_QH_SET_CMASK(xfer->usb2_cmask) |
- EHCI_QH_SET_SMASK(xfer->usb2_smask) |
+ EHCI_QH_SET_CMASK(xfer->usb_cmask) |
+ EHCI_QH_SET_SMASK(xfer->usb_smask) |
EHCI_QH_SET_HUBA(xfer->xroot->udev->hs_hub_addr) |
EHCI_QH_SET_PORT(xfer->xroot->udev->hs_port_no));
@@ -1955,7 +1955,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
qh->qh_qtd.qtd_altnext =
htohc32(temp.sc, EHCI_LINK_TERMINATE);
- usb2_pc_cpu_flush(qh->page_cache);
+ usb_pc_cpu_flush(qh->page_cache);
if (xfer->xroot->udev->flags.self_suspended == 0) {
EHCI_APPEND_QH(qh, *qh_last);
@@ -2016,7 +2016,7 @@ ehci_isoc_fs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
ehci_dump_sitd(sc, td);
}
#endif
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = hc32toh(sc, td->sitd_status);
len = EHCI_SITD_GET_LEN(status);
@@ -2071,7 +2071,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
}
#endif
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = hc32toh(sc, td->itd_status[td_no]);
len = EHCI_ITD_GET_LEN(status);
@@ -2155,7 +2155,7 @@ ehci_device_done(struct usb_xfer *xfer, usb_error_t error)
xfer->td_transfer_last = NULL;
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
/*------------------------------------------------------------------------*
@@ -2263,17 +2263,17 @@ ehci_device_intr_open(struct usb_xfer *xfer)
/* Allocate a microframe slot first: */
- slot = usb2_intr_schedule_adjust
+ slot = usb_intr_schedule_adjust
(xfer->xroot->udev, xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX);
- if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
- xfer->usb2_uframe = slot;
- xfer->usb2_smask = (1 << slot) & 0xFF;
- xfer->usb2_cmask = 0;
+ if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
+ xfer->usb_uframe = slot;
+ xfer->usb_smask = (1 << slot) & 0xFF;
+ xfer->usb_cmask = 0;
} else {
- xfer->usb2_uframe = slot;
- xfer->usb2_smask = (1 << slot) & 0x3F;
- xfer->usb2_cmask = (-(4 << slot)) & 0xFE;
+ xfer->usb_uframe = slot;
+ xfer->usb_smask = (1 << slot) & 0x3F;
+ xfer->usb_cmask = (-(4 << slot)) & 0xFE;
}
/*
@@ -2311,8 +2311,8 @@ ehci_device_intr_close(struct usb_xfer *xfer)
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
uint8_t slot;
- slot = usb2_intr_schedule_adjust
- (xfer->xroot->udev, -(xfer->max_frame_size), xfer->usb2_uframe);
+ slot = usb_intr_schedule_adjust
+ (xfer->xroot->udev, -(xfer->max_frame_size), xfer->usb_uframe);
sc->sc_intr_stat[xfer->qh_pos]--;
@@ -2384,7 +2384,7 @@ ehci_device_isoc_fs_open(struct usb_xfer *xfer)
*/
td->sitd_back = htohc32(sc, EHCI_LINK_TERMINATE);
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
}
}
}
@@ -2459,7 +2459,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_fs_isoc_schedule_isoc_time_expand
+ usbd_fs_isoc_schedule_isoc_time_expand
(xfer->xroot->udev, &fss_start, &fss_end, nframes) + buf_offset +
xfer->nframes;
@@ -2515,7 +2515,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
* We currently don't care if the ISOCHRONOUS schedule is
* full!
*/
- error = usb2_fs_isoc_schedule_alloc(fss, &sa, *plen);
+ error = usbd_fs_isoc_schedule_alloc(fss, &sa, *plen);
if (error) {
/*
* The FULL speed schedule is FULL! Set length
@@ -2525,17 +2525,17 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
}
if (*plen) {
/*
- * only call "usb2_get_page()" when we have a
+ * only call "usbd_get_page()" when we have a
* non-zero length
*/
- usb2_get_page(xfer->frbuffers, buf_offset, &buf_res);
+ usbd_get_page(xfer->frbuffers, buf_offset, &buf_res);
td->sitd_bp[0] = htohc32(sc, buf_res.physaddr);
buf_offset += *plen;
/*
* NOTE: We need to subtract one from the offset so
* that we are on a valid page!
*/
- usb2_get_page(xfer->frbuffers, buf_offset - 1,
+ usbd_get_page(xfer->frbuffers, buf_offset - 1,
&buf_res);
temp = buf_res.physaddr & ~0xFFF;
} else {
@@ -2588,7 +2588,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
EHCI_SITD_ACTIVE |
EHCI_SITD_SET_LEN(*plen));
}
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
#if USB_DEBUG
if (ehcidebug > 15) {
@@ -2673,7 +2673,7 @@ ehci_device_isoc_hs_open(struct usb_xfer *xfer)
/* set transfer multiplier */
td->itd_bp[2] = htohc32(sc, xfer->max_packet_count & 3);
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
}
}
}
@@ -2745,7 +2745,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + buf_offset +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + buf_offset +
((xfer->nframes + 7) / 8);
/* get the real number of frames */
@@ -2812,7 +2812,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
itd_offset[td_no] = buf_offset;
/* get first page offset */
- usb2_get_page(xfer->frbuffers, itd_offset[0], &buf_res);
+ usbd_get_page(xfer->frbuffers, itd_offset[0], &buf_res);
/* get page address */
page_addr = buf_res.physaddr & ~0xFFF;
/* update page address */
@@ -2832,9 +2832,9 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
* we don't go off the last
* page!
*/
- usb2_get_page(xfer->frbuffers, buf_offset - 1, &buf_res);
+ usbd_get_page(xfer->frbuffers, buf_offset - 1, &buf_res);
} else {
- usb2_get_page(xfer->frbuffers, itd_offset[x + 1], &buf_res);
+ usbd_get_page(xfer->frbuffers, itd_offset[x + 1], &buf_res);
}
/* check if we need a new page */
@@ -2855,7 +2855,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
if (nframes == 0) {
td->itd_status[7] |= htohc32(sc, EHCI_ITD_IOC);
}
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
#if USB_DEBUG
if (ehcidebug > 15) {
DPRINTF("HS-TD %d\n", nframes);
@@ -3081,7 +3081,7 @@ ehci_roothub_exec(struct usb_device *udev,
break;
}
- len = usb2_make_str_desc(
+ len = usb_make_str_desc(
sc->sc_hub_desc.temp,
sizeof(sc->sc_hub_desc.temp),
str_ptr);
@@ -3156,13 +3156,13 @@ ehci_roothub_exec(struct usb_device *udev,
EOWRITE4(sc, port, v | EHCI_PS_FPR);
}
/* wait 20ms for resume sequence to complete */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50);
EOWRITE4(sc, port, v & ~(EHCI_PS_SUSP |
EHCI_PS_FPR | (3 << 10) /* High Speed */ ));
/* 4ms settle time */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250);
break;
case UHF_PORT_POWER:
EOWRITE4(sc, port, v & ~EHCI_PS_PP);
@@ -3313,7 +3313,7 @@ ehci_roothub_exec(struct usb_device *udev,
EOWRITE4(sc, port, v | EHCI_PS_PR);
/* Wait for reset to complete. */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY));
/* Terminate reset sequence. */
@@ -3321,7 +3321,7 @@ ehci_roothub_exec(struct usb_device *udev,
EOWRITE4(sc, port, v);
/* Wait for HC to complete reset. */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE));
v = EOREAD4(sc, port);
@@ -3438,7 +3438,7 @@ ehci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_frame_size = EHCI_QTD_PAYLOAD_MAX;
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 1;
nqtd = ((2 * xfer->nframes) + 1 /* STATUS */
@@ -3451,7 +3451,7 @@ ehci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_frame_size = EHCI_QTD_PAYLOAD_MAX;
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 1;
nqtd = ((2 * xfer->nframes)
@@ -3473,7 +3473,7 @@ ehci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_frame_size = EHCI_QTD_PAYLOAD_MAX;
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 1;
nqtd = ((2 * xfer->nframes)
@@ -3486,7 +3486,7 @@ ehci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_frame_size = 0x3FF;
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nsitd = xfer->nframes;
@@ -3497,7 +3497,7 @@ ehci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_frame_size = 0xC00;
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nitd = (xfer->nframes + 7) / 8;
@@ -3507,7 +3507,7 @@ ehci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_packet_count = 1;
parm->hc_max_frame_size = 0x400;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
}
alloc_dma_set:
@@ -3520,7 +3520,7 @@ alloc_dma_set:
*/
last_obj = NULL;
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ehci_itd_t),
EHCI_ITD_ALIGN, nitd)) {
parm->err = USB_ERR_NOMEM;
@@ -3530,7 +3530,7 @@ alloc_dma_set:
for (n = 0; n != nitd; n++) {
ehci_itd_t *td;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
td = page_info.buffer;
@@ -3541,10 +3541,10 @@ alloc_dma_set:
last_obj = td;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ehci_sitd_t),
EHCI_SITD_ALIGN, nsitd)) {
parm->err = USB_ERR_NOMEM;
@@ -3554,7 +3554,7 @@ alloc_dma_set:
for (n = 0; n != nsitd; n++) {
ehci_sitd_t *td;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
td = page_info.buffer;
@@ -3565,10 +3565,10 @@ alloc_dma_set:
last_obj = td;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ehci_qtd_t),
EHCI_QTD_ALIGN, nqtd)) {
parm->err = USB_ERR_NOMEM;
@@ -3578,7 +3578,7 @@ alloc_dma_set:
for (n = 0; n != nqtd; n++) {
ehci_qtd_t *qtd;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
qtd = page_info.buffer;
@@ -3589,14 +3589,14 @@ alloc_dma_set:
last_obj = qtd;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
xfer->td_start[xfer->flags_int.curr_dma_set] = last_obj;
last_obj = NULL;
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ehci_qh_t),
EHCI_QH_ALIGN, nqh)) {
parm->err = USB_ERR_NOMEM;
@@ -3606,7 +3606,7 @@ alloc_dma_set:
for (n = 0; n != nqh; n++) {
ehci_qh_t *qh;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
qh = page_info.buffer;
@@ -3617,7 +3617,7 @@ alloc_dma_set:
last_obj = qh;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
xfer->qh_start[xfer->flags_int.curr_dma_set] = last_obj;
diff --git a/sys/dev/usb/controller/ehci_ixp4xx.c b/sys/dev/usb/controller/ehci_ixp4xx.c
index 672a6ee..a29375f 100644
--- a/sys/dev/usb/controller/ehci_ixp4xx.c
+++ b/sys/dev/usb/controller/ehci_ixp4xx.c
@@ -131,7 +131,7 @@ ehci_ixp_attach(device_t self)
sc->sc_bus.devices_max = EHCI_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_bus,
USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) {
return (ENOMEM);
}
@@ -273,7 +273,7 @@ ehci_ixp_detach(device_t self)
sc->sc_io_res);
sc->sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
+ usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
return (0);
}
diff --git a/sys/dev/usb/controller/ehci_mbus.c b/sys/dev/usb/controller/ehci_mbus.c
index eb9c101..73a8faf 100644
--- a/sys/dev/usb/controller/ehci_mbus.c
+++ b/sys/dev/usb/controller/ehci_mbus.c
@@ -140,7 +140,7 @@ ehci_mbus_attach(device_t self)
sc->sc_bus.devices_max = EHCI_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_bus,
USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) {
return (ENOMEM);
}
@@ -307,7 +307,7 @@ ehci_mbus_detach(device_t self)
sc->sc_io_res);
sc->sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
+ usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
return (0);
}
diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c
index 744f5f5..77efeb3 100644
--- a/sys/dev/usb/controller/ehci_pci.c
+++ b/sys/dev/usb/controller/ehci_pci.c
@@ -231,7 +231,7 @@ ehci_pci_attach(device_t self)
sc->sc_bus.devices_max = EHCI_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_bus,
USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) {
return (ENOMEM);
}
@@ -408,7 +408,7 @@ ehci_pci_detach(device_t self)
sc->sc_io_res);
sc->sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
+ usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
return (0);
}
@@ -453,7 +453,7 @@ ehci_pci_takecontroller(device_t self)
"timed out waiting for BIOS\n");
break;
}
- usb2_pause_mtx(NULL, hz / 100); /* wait 10ms */
+ usb_pause_mtx(NULL, hz / 100); /* wait 10ms */
}
}
}
diff --git a/sys/dev/usb/controller/musb_otg.c b/sys/dev/usb/controller/musb_otg.c
index d242574..22ce005 100644
--- a/sys/dev/usb/controller/musb_otg.c
+++ b/sys/dev/usb/controller/musb_otg.c
@@ -209,7 +209,7 @@ musbotg_wakeup_peer(struct musbotg_softc *sc)
/* wait 8 milliseconds */
/* Wait for reset to complete. */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125);
temp = MUSB2_READ_1(sc, MUSB2_REG_POWER);
temp &= ~MUSB2_MASK_RESUME;
@@ -301,7 +301,7 @@ musbotg_setup_rx(struct musbotg_td *td)
MUSB2_REG_EPFIFO(0), (void *)&req, sizeof(req));
/* copy data into real buffer */
- usb2_copy_in(td->pc, 0, &req, sizeof(req));
+ usbd_copy_in(td->pc, 0, &req, sizeof(req));
td->offset = sizeof(req);
td->remainder = 0;
@@ -404,7 +404,7 @@ musbotg_setup_data_rx(struct musbotg_td *td)
while (count > 0) {
uint32_t temp;
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -428,7 +428,7 @@ musbotg_setup_data_rx(struct musbotg_td *td)
MUSB2_REG_EPFIFO(0),
(void *)(&sc->sc_bounce_buf[count / 4]), temp);
}
- usb2_copy_in(td->pc, td->offset,
+ usbd_copy_in(td->pc, td->offset,
sc->sc_bounce_buf, count);
/* update offset and remainder */
@@ -522,7 +522,7 @@ musbotg_setup_data_tx(struct musbotg_td *td)
while (count > 0) {
uint32_t temp;
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -531,7 +531,7 @@ musbotg_setup_data_tx(struct musbotg_td *td)
/* check for unaligned memory address */
if (USB_P2U(buf_res.buffer) & 3) {
- usb2_copy_out(td->pc, td->offset,
+ usbd_copy_out(td->pc, td->offset,
sc->sc_bounce_buf, count);
temp = count & ~3;
@@ -692,7 +692,7 @@ repeat:
while (count > 0) {
uint32_t temp;
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -716,7 +716,7 @@ repeat:
sc->sc_io_hdl, MUSB2_REG_EPFIFO(td->ep_no),
((void *)&sc->sc_bounce_buf[count / 4]), temp);
}
- usb2_copy_in(td->pc, td->offset,
+ usbd_copy_in(td->pc, td->offset,
sc->sc_bounce_buf, count);
/* update offset and remainder */
@@ -810,7 +810,7 @@ repeat:
while (count > 0) {
uint32_t temp;
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -819,7 +819,7 @@ repeat:
/* check for unaligned memory address */
if (USB_P2U(buf_res.buffer) & 3) {
- usb2_copy_out(td->pc, td->offset,
+ usbd_copy_out(td->pc, td->offset,
sc->sc_bounce_buf, count);
temp = count & ~3;
@@ -1115,7 +1115,7 @@ musbotg_setup_standard_chain(struct usb_xfer *xfer)
DPRINTFN(8, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -1297,11 +1297,11 @@ musbotg_start_standard_chain(struct usb_xfer *xfer)
DPRINTFN(14, "enabled interrupts on endpoint\n");
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer,
+ usbd_transfer_timeout_ms(xfer,
&musbotg_timeout, xfer->timeout);
}
}
@@ -1449,7 +1449,7 @@ musbotg_device_done(struct usb_xfer *xfer, usb_error_t error)
DPRINTFN(14, "disabled interrupts on endpoint\n");
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
static void
@@ -1689,7 +1689,7 @@ musbotg_init(struct musbotg_softc *sc)
(sc->sc_clocks_on) (sc->sc_clocks_arg);
}
/* wait a little for things to stabilise */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
/* disable all interrupts */
@@ -1702,7 +1702,7 @@ musbotg_init(struct musbotg_softc *sc)
musbotg_pull_common(sc, 0);
/* wait a little bit (10ms) */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
/* disable double packet buffering */
MUSB2_WRITE_2(sc, MUSB2_REG_RXDBDIS, 0xFFFF);
@@ -2011,7 +2011,7 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
*/
temp = (nframes - xfer->endpoint->isoc_next) & MUSB2_MASK_FRAME;
- if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
+ if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) {
fs_frames = (xfer->nframes + 7) / 8;
} else {
fs_frames = xfer->nframes;
@@ -2039,7 +2039,7 @@ musbotg_device_isoc_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + temp +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + temp +
fs_frames;
/* compute frame number for next insertion */
@@ -2581,7 +2581,7 @@ musbotg_xfer_setup(struct usb_setup_params *parm)
else
parm->hc_max_packet_count = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
/*
* compute maximum number of TDs
@@ -2608,7 +2608,7 @@ musbotg_xfer_setup(struct usb_setup_params *parm)
}
/*
- * check if "usb2_transfer_setup_sub" set an error
+ * check if "usbd_transfer_setup_sub" set an error
*/
if (parm->err) {
return;
diff --git a/sys/dev/usb/controller/musb_otg_atmelarm.c b/sys/dev/usb/controller/musb_otg_atmelarm.c
index 2589287..fa5f7ed 100644
--- a/sys/dev/usb/controller/musb_otg_atmelarm.c
+++ b/sys/dev/usb/controller/musb_otg_atmelarm.c
@@ -99,7 +99,7 @@ musbotg_attach(device_t dev)
sc->sc_otg.sc_bus.devices_max = MUSB2_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_otg.sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_otg.sc_bus,
USB_GET_DMA_TAG(dev), NULL)) {
return (ENOMEM);
}
@@ -192,7 +192,7 @@ musbotg_detach(device_t dev)
sc->sc_otg.sc_io_res);
sc->sc_otg.sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);
+ usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL);
return (0);
}
diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c
index 2e6e6bc..5bce062 100644
--- a/sys/dev/usb/controller/ohci.c
+++ b/sys/dev/usb/controller/ohci.c
@@ -115,7 +115,7 @@ struct ohci_std_temp {
static struct ohci_hcca *
ohci_get_hcca(ohci_softc_t *sc)
{
- usb2_pc_cpu_invalidate(&sc->sc_hw.hcca_pc);
+ usb_pc_cpu_invalidate(&sc->sc_hw.hcca_pc);
return (sc->sc_hcca_p);
}
@@ -162,7 +162,7 @@ ohci_controller_init(ohci_softc_t *sc)
DPRINTF("SMM active, request owner change\n");
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR);
for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) {
- usb2_pause_mtx(NULL, hz / 1000);
+ usb_pause_mtx(NULL, hz / 1000);
ctl = OREAD4(sc, OHCI_CONTROL);
}
if (ctl & OHCI_IR) {
@@ -175,7 +175,7 @@ ohci_controller_init(ohci_softc_t *sc)
DPRINTF("cold started\n");
reset:
/* controller was cold started */
- usb2_pause_mtx(NULL,
+ usb_pause_mtx(NULL,
USB_MS_TO_TICKS(USB_BUS_RESET_DELAY));
}
@@ -186,7 +186,7 @@ reset:
DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev));
OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- usb2_pause_mtx(NULL,
+ usb_pause_mtx(NULL,
USB_MS_TO_TICKS(USB_BUS_RESET_DELAY));
/* we now own the host controller and the bus has been reset */
@@ -214,13 +214,13 @@ reset:
/* The controller is now in SUSPEND state, we have 2ms to finish. */
/* set up HC registers */
- usb2_get_page(&sc->sc_hw.hcca_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.hcca_pc, 0, &buf_res);
OWRITE4(sc, OHCI_HCCA, buf_res.physaddr);
- usb2_get_page(&sc->sc_hw.ctrl_start_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.ctrl_start_pc, 0, &buf_res);
OWRITE4(sc, OHCI_CONTROL_HEAD_ED, buf_res.physaddr);
- usb2_get_page(&sc->sc_hw.bulk_start_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.bulk_start_pc, 0, &buf_res);
OWRITE4(sc, OHCI_BULK_HEAD_ED, buf_res.physaddr);
/* disable all interrupts and then switch on all desired interrupts */
@@ -249,7 +249,7 @@ reset:
desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A);
OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca | OHCI_NOCP);
OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */
- usb2_pause_mtx(NULL,
+ usb_pause_mtx(NULL,
USB_MS_TO_TICKS(OHCI_ENABLE_POWER_DELAY));
OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca);
@@ -259,7 +259,7 @@ reset:
*/
sc->sc_noport = 0;
for (i = 0; (i < 10) && (sc->sc_noport == 0); i++) {
- usb2_pause_mtx(NULL,
+ usb_pause_mtx(NULL,
USB_MS_TO_TICKS(OHCI_READ_DESC_DELAY));
sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
}
@@ -278,7 +278,7 @@ ohci_init_ed(struct usb_page_cache *pc)
struct usb_page_search buf_res;
struct ohci_ed *ed;
- usb2_get_page(pc, 0, &buf_res);
+ usbd_get_page(pc, 0, &buf_res);
ed = buf_res.buffer;
@@ -359,7 +359,7 @@ ohci_init(ohci_softc_t *sc)
ed_int->next = ed_isc;
ed_int->ed_next = ed_isc->ed_self;
}
- usb2_get_page(&sc->sc_hw.hcca_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.hcca_pc, 0, &buf_res);
sc->sc_hcca_p = buf_res.buffer;
@@ -373,12 +373,12 @@ ohci_init(ohci_softc_t *sc)
}
/* flush all cache into memory */
- usb2_bus_mem_flush_all(&sc->sc_bus, &ohci_iterate_hw_softc);
+ usb_bus_mem_flush_all(&sc->sc_bus, &ohci_iterate_hw_softc);
/* set up the bus struct */
sc->sc_bus.methods = &ohci_bus_methods;
- usb2_callout_init_mtx(&sc->sc_tmo_rhsc, &sc->sc_bus.bus_mtx, 0);
+ usb_callout_init_mtx(&sc->sc_tmo_rhsc, &sc->sc_bus.bus_mtx, 0);
#if USB_DEBUG
if (ohcidebug > 15) {
@@ -410,7 +410,7 @@ ohci_detach(struct ohci_softc *sc)
{
USB_BUS_LOCK(&sc->sc_bus);
- usb2_callout_stop(&sc->sc_tmo_rhsc);
+ usb_callout_stop(&sc->sc_tmo_rhsc);
OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS);
OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
@@ -418,9 +418,9 @@ ohci_detach(struct ohci_softc *sc)
USB_BUS_UNLOCK(&sc->sc_bus);
/* XXX let stray task complete */
- usb2_pause_mtx(NULL, hz / 20);
+ usb_pause_mtx(NULL, hz / 20);
- usb2_callout_drain(&sc->sc_tmo_rhsc);
+ usb_callout_drain(&sc->sc_tmo_rhsc);
}
/* NOTE: suspend/resume is called from
@@ -452,7 +452,7 @@ ohci_suspend(ohci_softc_t *sc)
ctl |= OHCI_HCFS_SUSPEND;
OWRITE4(sc, OHCI_CONTROL, ctl);
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_RESUME_WAIT));
USB_BUS_UNLOCK(&sc->sc_bus);
@@ -483,11 +483,11 @@ ohci_resume(ohci_softc_t *sc)
ctl = OREAD4(sc, OHCI_CONTROL);
ctl |= OHCI_HCFS_RESUME;
OWRITE4(sc, OHCI_CONTROL, ctl);
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_RESUME_DELAY));
ctl = (ctl & ~OHCI_HCFS_MASK) | OHCI_HCFS_OPERATIONAL;
OWRITE4(sc, OHCI_CONTROL, ctl);
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_RESUME_RECOVERY));
sc->sc_control = sc->sc_intre = 0;
@@ -557,7 +557,7 @@ ohci_dump_td(ohci_td_t *std)
uint32_t td_flags;
uint8_t temp;
- usb2_pc_cpu_invalidate(std->page_cache);
+ usb_pc_cpu_invalidate(std->page_cache);
td_flags = le32toh(std->td_flags);
temp = (std->td_next == 0);
@@ -587,7 +587,7 @@ ohci_dump_itd(ohci_itd_t *sitd)
uint16_t i;
uint8_t temp;
- usb2_pc_cpu_invalidate(sitd->page_cache);
+ usb_pc_cpu_invalidate(sitd->page_cache);
itd_flags = le32toh(sitd->itd_flags);
temp = (sitd->itd_next == 0);
@@ -627,7 +627,7 @@ ohci_dump_ed(ohci_ed_t *sed)
uint32_t ed_flags;
uint32_t ed_headp;
- usb2_pc_cpu_invalidate(sed->page_cache);
+ usb_pc_cpu_invalidate(sed->page_cache);
ed_flags = le32toh(sed->ed_flags);
ed_headp = le32toh(sed->ed_headp);
@@ -660,11 +660,11 @@ ohci_transfer_intr_enqueue(struct usb_xfer *xfer)
return;
}
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer, &ohci_timeout, xfer->timeout);
+ usbd_transfer_timeout_ms(xfer, &ohci_timeout, xfer->timeout);
}
}
@@ -687,7 +687,7 @@ _ohci_append_qh(ohci_ed_t *sed, ohci_ed_t *last)
sed->prev = last;
- usb2_pc_cpu_flush(sed->page_cache);
+ usb_pc_cpu_flush(sed->page_cache);
/*
* the last->next->prev is never followed: sed->next->prev = sed;
@@ -696,7 +696,7 @@ _ohci_append_qh(ohci_ed_t *sed, ohci_ed_t *last)
last->next = sed;
last->ed_next = sed->ed_self;
- usb2_pc_cpu_flush(last->page_cache);
+ usb_pc_cpu_flush(last->page_cache);
return (sed);
}
@@ -715,17 +715,17 @@ _ohci_remove_qh(ohci_ed_t *sed, ohci_ed_t *last)
sed->prev->next = sed->next;
sed->prev->ed_next = sed->ed_next;
- usb2_pc_cpu_flush(sed->prev->page_cache);
+ usb_pc_cpu_flush(sed->prev->page_cache);
if (sed->next) {
sed->next->prev = sed->prev;
- usb2_pc_cpu_flush(sed->next->page_cache);
+ usb_pc_cpu_flush(sed->next->page_cache);
}
last = ((last == sed) ? sed->prev : last);
sed->prev = 0;
- usb2_pc_cpu_flush(sed->page_cache);
+ usb_pc_cpu_flush(sed->page_cache);
}
return (last);
}
@@ -750,7 +750,7 @@ ohci_isoc_done(struct usb_xfer *xfer)
ohci_dump_itd(td);
}
#endif
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
nframes = td->frames;
olen = &td->itd_offset[0];
@@ -832,7 +832,7 @@ ohci_non_isoc_done_sub(struct usb_xfer *xfer)
}
while (1) {
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
phy_start = le32toh(td->td_cbp);
td_flags = le32toh(td->td_flags);
cc = OHCI_TD_GET_CC(td_flags);
@@ -971,7 +971,7 @@ ohci_check_transfer_sub(struct usb_xfer *xfer)
while (1) {
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
phy_start = le32toh(td->td_cbp);
td_flags = le32toh(td->td_flags);
td_next = le32toh(td->td_next);
@@ -1011,7 +1011,7 @@ ohci_check_transfer_sub(struct usb_xfer *xfer)
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
ed->ed_headp = td->td_self;
- usb2_pc_cpu_flush(ed->page_cache);
+ usb_pc_cpu_flush(ed->page_cache);
DPRINTFN(13, "xfer=%p following alt next\n", xfer);
@@ -1052,7 +1052,7 @@ ohci_check_transfer(struct usb_xfer *xfer)
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
- usb2_pc_cpu_invalidate(ed->page_cache);
+ usb_pc_cpu_invalidate(ed->page_cache);
ed_headp = le32toh(ed->ed_headp);
ed_tailp = le32toh(ed->ed_tailp);
@@ -1169,7 +1169,7 @@ ohci_interrupt(ohci_softc_t *sc)
}
hcca->hcca_done_head = 0;
- usb2_pc_cpu_flush(&sc->sc_hw.hcca_pc);
+ usb_pc_cpu_flush(&sc->sc_hw.hcca_pc);
} else {
status = OREAD4(sc, OHCI_INTERRUPT_STATUS) & ~OHCI_WDH;
}
@@ -1215,7 +1215,7 @@ ohci_interrupt(ohci_softc_t *sc)
ohci_root_intr(sc);
/* do not allow RHSC interrupts > 1 per second */
- usb2_callout_reset(&sc->sc_tmo_rhsc, hz,
+ usb_callout_reset(&sc->sc_tmo_rhsc, hz,
(void *)&ohci_rhsc_enable, sc);
}
}
@@ -1351,11 +1351,11 @@ restart:
} else {
- usb2_get_page(temp->pc, buf_offset, &buf_res);
+ usbd_get_page(temp->pc, buf_offset, &buf_res);
td->td_cbp = htole32(buf_res.physaddr);
buf_offset += (average - 1);
- usb2_get_page(temp->pc, buf_offset, &buf_res);
+ usbd_get_page(temp->pc, buf_offset, &buf_res);
td->td_be = htole32(buf_res.physaddr);
buf_offset++;
@@ -1380,7 +1380,7 @@ restart:
td->alt_next = td_alt_next;
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
}
if (precompute) {
@@ -1416,7 +1416,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.average = xfer->max_hc_frame_size;
temp.max_frame_size = xfer->max_frame_size;
@@ -1558,7 +1558,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
td->td_flags &= ~htole32(OHCI_TD_INTR_MASK);
td->td_flags |= htole32(OHCI_TD_SET_DI(1));
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
/* must have at least one frame! */
@@ -1604,7 +1604,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
}
} else {
- usb2_pc_cpu_flush(ed->page_cache);
+ usb_pc_cpu_flush(ed->page_cache);
}
}
@@ -1659,7 +1659,7 @@ ohci_device_done(struct usb_xfer *xfer, usb_error_t error)
ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (ed) {
- usb2_pc_cpu_invalidate(ed->page_cache);
+ usb_pc_cpu_invalidate(ed->page_cache);
}
if (methods == &ohci_device_bulk_methods) {
OHCI_REMOVE_QH(ed, sc->sc_bulk_p_last);
@@ -1677,7 +1677,7 @@ ohci_device_done(struct usb_xfer *xfer, usb_error_t error)
xfer->td_transfer_last = NULL;
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
/*------------------------------------------------------------------------*
@@ -1897,7 +1897,7 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- (usb2_isoc_time_expand(&sc->sc_bus, nframes) + buf_offset +
+ (usb_isoc_time_expand(&sc->sc_bus, nframes) + buf_offset +
xfer->nframes);
/* get the real number of frames */
@@ -1957,12 +1957,12 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
htole16(OHCI_ITD_MK_OFFS(0));
}
} else {
- usb2_get_page(xfer->frbuffers, buf_offset - length, &buf_res);
+ usbd_get_page(xfer->frbuffers, buf_offset - length, &buf_res);
length = OHCI_PAGE_MASK(buf_res.physaddr);
buf_res.physaddr =
OHCI_PAGE(buf_res.physaddr);
td->itd_bp0 = htole32(buf_res.physaddr);
- usb2_get_page(xfer->frbuffers, buf_offset - 1, &buf_res);
+ usbd_get_page(xfer->frbuffers, buf_offset - 1, &buf_res);
td->itd_be = htole32(buf_res.physaddr);
while (ncur--) {
@@ -1982,7 +1982,7 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
/* link the last TD with the next one */
td_last->itd_next = td->itd_self;
}
- usb2_pc_cpu_flush(td_last->page_cache);
+ usb_pc_cpu_flush(td_last->page_cache);
}
}
@@ -1991,7 +1991,7 @@ ohci_device_isoc_enter(struct usb_xfer *xfer)
td_last->itd_flags |= htole32(OHCI_ITD_SET_DI(0));
td_last->itd_next = 0;
- usb2_pc_cpu_flush(td_last->page_cache);
+ usb_pc_cpu_flush(td_last->page_cache);
xfer->td_transfer_last = td_last;
@@ -2189,7 +2189,7 @@ ohci_roothub_exec(struct usb_device *udev,
break;
}
- len = usb2_make_str_desc(
+ len = usb_make_str_desc(
sc->sc_hub_desc.temp,
sizeof(sc->sc_hub_desc.temp),
str_ptr);
@@ -2365,7 +2365,7 @@ ohci_roothub_exec(struct usb_device *udev,
OWRITE4(sc, port, UPS_RESET);
for (v = 0;; v++) {
if (v < 12) {
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY));
if ((OREAD4(sc, port) & UPS_RESET) == 0) {
@@ -2424,7 +2424,7 @@ ohci_xfer_setup(struct usb_setup_params *parm)
if (parm->methods == &ohci_device_ctrl_methods) {
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nitd = 0;
ntd = ((2 * xfer->nframes) + 1 /* STATUS */
@@ -2434,7 +2434,7 @@ ohci_xfer_setup(struct usb_setup_params *parm)
} else if (parm->methods == &ohci_device_bulk_methods) {
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nitd = 0;
ntd = ((2 * xfer->nframes)
@@ -2444,7 +2444,7 @@ ohci_xfer_setup(struct usb_setup_params *parm)
} else if (parm->methods == &ohci_device_intr_methods) {
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nitd = 0;
ntd = ((2 * xfer->nframes)
@@ -2454,7 +2454,7 @@ ohci_xfer_setup(struct usb_setup_params *parm)
} else if (parm->methods == &ohci_device_isoc_methods) {
xfer->flags_int.bdma_enable = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nitd = ((xfer->max_data_length / OHCI_PAGE_SIZE) +
((xfer->nframes + OHCI_ITD_NOFFSET - 1) / OHCI_ITD_NOFFSET) +
@@ -2464,7 +2464,7 @@ ohci_xfer_setup(struct usb_setup_params *parm)
} else {
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nitd = 0;
ntd = 0;
@@ -2478,7 +2478,7 @@ alloc_dma_set:
}
last_obj = NULL;
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ohci_td_t),
OHCI_TD_ALIGN, ntd)) {
parm->err = USB_ERR_NOMEM;
@@ -2488,7 +2488,7 @@ alloc_dma_set:
for (n = 0; n != ntd; n++) {
ohci_td_t *td;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
td = page_info.buffer;
@@ -2499,10 +2499,10 @@ alloc_dma_set:
last_obj = td;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ohci_itd_t),
OHCI_ITD_ALIGN, nitd)) {
parm->err = USB_ERR_NOMEM;
@@ -2512,7 +2512,7 @@ alloc_dma_set:
for (n = 0; n != nitd; n++) {
ohci_itd_t *itd;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
itd = page_info.buffer;
@@ -2523,14 +2523,14 @@ alloc_dma_set:
last_obj = itd;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
xfer->td_start[xfer->flags_int.curr_dma_set] = last_obj;
last_obj = NULL;
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(ohci_ed_t),
OHCI_ED_ALIGN, nqh)) {
parm->err = USB_ERR_NOMEM;
@@ -2540,7 +2540,7 @@ alloc_dma_set:
for (n = 0; n != nqh; n++) {
ohci_ed_t *ed;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
ed = page_info.buffer;
@@ -2551,7 +2551,7 @@ alloc_dma_set:
last_obj = ed;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
xfer->qh_start[xfer->flags_int.curr_dma_set] = last_obj;
diff --git a/sys/dev/usb/controller/ohci_atmelarm.c b/sys/dev/usb/controller/ohci_atmelarm.c
index 0f213c5..a757611 100644
--- a/sys/dev/usb/controller/ohci_atmelarm.c
+++ b/sys/dev/usb/controller/ohci_atmelarm.c
@@ -73,7 +73,7 @@ ohci_atmelarm_attach(device_t dev)
sc->sc_ohci.sc_bus.devices_max = OHCI_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_ohci.sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_ohci.sc_bus,
USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) {
return (ENOMEM);
}
@@ -191,7 +191,7 @@ ohci_atmelarm_detach(device_t dev)
sc->sc_ohci.sc_io_res);
sc->sc_ohci.sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_ohci.sc_bus, &ohci_iterate_hw_softc);
+ usb_bus_mem_free_all(&sc->sc_ohci.sc_bus, &ohci_iterate_hw_softc);
return (0);
}
diff --git a/sys/dev/usb/controller/ohci_pci.c b/sys/dev/usb/controller/ohci_pci.c
index 031be52..76943c4 100644
--- a/sys/dev/usb/controller/ohci_pci.c
+++ b/sys/dev/usb/controller/ohci_pci.c
@@ -199,7 +199,7 @@ ohci_pci_attach(device_t self)
sc->sc_bus.devices_max = OHCI_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self),
+ if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self),
&ohci_iterate_hw_softc)) {
return (ENOMEM);
}
@@ -353,7 +353,7 @@ ohci_pci_detach(device_t self)
sc->sc_io_res);
sc->sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc);
+ usb_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc);
return (0);
}
diff --git a/sys/dev/usb/controller/uhci.c b/sys/dev/usb/controller/uhci.c
index d1ec1d1..6d6a67e 100644
--- a/sys/dev/usb/controller/uhci.c
+++ b/sys/dev/usb/controller/uhci.c
@@ -191,13 +191,13 @@ uhci_mem_layout_init(struct uhci_mem_layout *ml, struct usb_xfer *xfer)
static void
uhci_mem_layout_fixup(struct uhci_mem_layout *ml, struct uhci_td *td)
{
- usb2_get_page(ml->buf_pc, ml->buf_offset, &ml->buf_res);
+ usbd_get_page(ml->buf_pc, ml->buf_offset, &ml->buf_res);
if (ml->buf_res.length < td->len) {
/* need to do a fixup */
- usb2_get_page(ml->fix_pc, 0, &ml->fix_res);
+ usbd_get_page(ml->fix_pc, 0, &ml->fix_res);
td->td_buffer = htole32(ml->fix_res.physaddr);
@@ -219,17 +219,17 @@ uhci_mem_layout_fixup(struct uhci_mem_layout *ml, struct uhci_td *td)
if ((td->td_token & htole32(UHCI_TD_PID)) ==
htole32(UHCI_TD_PID_IN)) {
td->fix_pc = ml->fix_pc;
- usb2_pc_cpu_invalidate(ml->fix_pc);
+ usb_pc_cpu_invalidate(ml->fix_pc);
} else {
td->fix_pc = NULL;
/* copy data to fixup location */
- usb2_copy_out(ml->buf_pc, ml->buf_offset,
+ usbd_copy_out(ml->buf_pc, ml->buf_offset,
ml->fix_res.buffer, td->len);
- usb2_pc_cpu_flush(ml->fix_pc);
+ usb_pc_cpu_flush(ml->fix_pc);
}
/* prepare next fixup */
@@ -266,7 +266,7 @@ uhci_restart(uhci_softc_t *sc)
DPRINTFN(2, "Restarting\n");
- usb2_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
/* Reload fresh base address */
UWRITE4(sc, UHCI_FLBASEADDR, buf_res.physaddr);
@@ -278,7 +278,7 @@ uhci_restart(uhci_softc_t *sc)
/* wait 10 milliseconds */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
/* check that controller has started */
@@ -308,7 +308,7 @@ uhci_reset(uhci_softc_t *sc)
/* wait */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_BUS_RESET_DELAY));
/* terminate all transfers */
@@ -321,7 +321,7 @@ uhci_reset(uhci_softc_t *sc)
while (n--) {
/* wait one millisecond */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
if (!(UREAD2(sc, UHCI_CMD) & UHCI_CMD_HCRESET)) {
goto done_1;
@@ -337,7 +337,7 @@ done_1:
while (n--) {
/* wait one millisecond */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000);
/* check if HC is stopped */
if (UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) {
@@ -357,7 +357,7 @@ done_2:
USB_BUS_UNLOCK(&sc->sc_bus);
/* stop root interrupt */
- usb2_callout_drain(&sc->sc_root_intr);
+ usb_callout_drain(&sc->sc_root_intr);
USB_BUS_LOCK(&sc->sc_bus);
}
@@ -392,7 +392,7 @@ uhci_init_qh(struct usb_page_cache *pc)
struct usb_page_search buf_res;
struct uhci_qh *qh;
- usb2_get_page(pc, 0, &buf_res);
+ usbd_get_page(pc, 0, &buf_res);
qh = buf_res.buffer;
@@ -411,7 +411,7 @@ uhci_init_td(struct usb_page_cache *pc)
struct usb_page_search buf_res;
struct uhci_td *td;
- usb2_get_page(pc, 0, &buf_res);
+ usbd_get_page(pc, 0, &buf_res);
td = buf_res.buffer;
@@ -433,7 +433,7 @@ uhci_init(uhci_softc_t *sc)
DPRINTF("start\n");
- usb2_callout_init_mtx(&sc->sc_root_intr, &sc->sc_bus.bus_mtx, 0);
+ usb_callout_init_mtx(&sc->sc_root_intr, &sc->sc_bus.bus_mtx, 0);
#if USB_DEBUG
if (uhcidebug > 2) {
@@ -594,7 +594,7 @@ uhci_init(uhci_softc_t *sc)
struct usb_page_search buf_res;
uint32_t *pframes;
- usb2_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
+ usbd_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
pframes = buf_res.buffer;
@@ -616,7 +616,7 @@ uhci_init(uhci_softc_t *sc)
}
/* flush all cache into memory */
- usb2_bus_mem_flush_all(&sc->sc_bus, &uhci_iterate_hw_softc);
+ usb_bus_mem_flush_all(&sc->sc_bus, &uhci_iterate_hw_softc);
/* set up the bus struct */
sc->sc_bus.methods = &uhci_bus_methods;
@@ -662,7 +662,7 @@ uhci_suspend(uhci_softc_t *sc)
UHCICMD(sc, UHCI_CMD_EGSM);
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_RESUME_WAIT));
USB_BUS_UNLOCK(&sc->sc_bus);
@@ -681,7 +681,7 @@ uhci_resume(uhci_softc_t *sc)
UHCICMD(sc, UHCI_CMD_FGR);
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_RESUME_DELAY));
/* and start traffic again */
@@ -725,7 +725,7 @@ uhci_dump_td(uhci_td_t *p)
uint32_t td_token;
uint8_t temp;
- usb2_pc_cpu_invalidate(p->page_cache);
+ usb_pc_cpu_invalidate(p->page_cache);
td_next = le32toh(p->td_next);
td_status = le32toh(p->td_status);
@@ -781,7 +781,7 @@ uhci_dump_qh(uhci_qh_t *sqh)
uint32_t qh_h_next;
uint32_t qh_e_next;
- usb2_pc_cpu_invalidate(sqh->page_cache);
+ usb_pc_cpu_invalidate(sqh->page_cache);
qh_h_next = le32toh(sqh->qh_h_next);
qh_e_next = le32toh(sqh->qh_e_next);
@@ -872,7 +872,7 @@ uhci_add_loop(uhci_softc_t *sc)
/* NOTE: we don't loop back the soft pointer */
qh_lst->qh_h_next = qh_rec->qh_self;
- usb2_pc_cpu_flush(qh_lst->page_cache);
+ usb_pc_cpu_flush(qh_lst->page_cache);
}
}
@@ -891,7 +891,7 @@ uhci_rem_loop(uhci_softc_t *sc)
qh_lst = sc->sc_last_qh_p;
qh_lst->qh_h_next = htole32(UHCI_PTR_T);
- usb2_pc_cpu_flush(qh_lst->page_cache);
+ usb_pc_cpu_flush(qh_lst->page_cache);
}
}
@@ -903,11 +903,11 @@ uhci_transfer_intr_enqueue(struct usb_xfer *xfer)
return;
}
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer, &uhci_timeout, xfer->timeout);
+ usbd_transfer_timeout_ms(xfer, &uhci_timeout, xfer->timeout);
}
}
@@ -924,7 +924,7 @@ _uhci_append_td(uhci_td_t *std, uhci_td_t *last)
std->prev = last;
- usb2_pc_cpu_flush(std->page_cache);
+ usb_pc_cpu_flush(std->page_cache);
/*
* the last->next->prev is never followed: std->next->prev = std;
@@ -932,7 +932,7 @@ _uhci_append_td(uhci_td_t *std, uhci_td_t *last)
last->next = std;
last->td_next = std->td_self;
- usb2_pc_cpu_flush(last->page_cache);
+ usb_pc_cpu_flush(last->page_cache);
return (std);
}
@@ -955,7 +955,7 @@ _uhci_append_qh(uhci_qh_t *sqh, uhci_qh_t *last)
sqh->h_prev = last;
- usb2_pc_cpu_flush(sqh->page_cache);
+ usb_pc_cpu_flush(sqh->page_cache);
/*
* The "last->h_next->h_prev" is never followed:
@@ -966,7 +966,7 @@ _uhci_append_qh(uhci_qh_t *sqh, uhci_qh_t *last)
last->h_next = sqh;
last->qh_h_next = sqh->qh_self;
- usb2_pc_cpu_flush(last->page_cache);
+ usb_pc_cpu_flush(last->page_cache);
return (sqh);
}
@@ -984,11 +984,11 @@ _uhci_remove_td(uhci_td_t *std, uhci_td_t *last)
std->prev->next = std->next;
std->prev->td_next = std->td_next;
- usb2_pc_cpu_flush(std->prev->page_cache);
+ usb_pc_cpu_flush(std->prev->page_cache);
if (std->next) {
std->next->prev = std->prev;
- usb2_pc_cpu_flush(std->next->page_cache);
+ usb_pc_cpu_flush(std->next->page_cache);
}
return ((last == std) ? std->prev : last);
}
@@ -1007,17 +1007,17 @@ _uhci_remove_qh(uhci_qh_t *sqh, uhci_qh_t *last)
sqh->h_prev->h_next = sqh->h_next;
sqh->h_prev->qh_h_next = sqh->qh_h_next;
- usb2_pc_cpu_flush(sqh->h_prev->page_cache);
+ usb_pc_cpu_flush(sqh->h_prev->page_cache);
if (sqh->h_next) {
sqh->h_next->h_prev = sqh->h_prev;
- usb2_pc_cpu_flush(sqh->h_next->page_cache);
+ usb_pc_cpu_flush(sqh->h_next->page_cache);
}
last = ((last == sqh) ? sqh->h_prev : last);
sqh->h_prev = 0;
- usb2_pc_cpu_flush(sqh->page_cache);
+ usb_pc_cpu_flush(sqh->page_cache);
}
return (last);
}
@@ -1039,7 +1039,7 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
/* sync any DMA memory before doing fixups */
- usb2_bdma_post_sync(xfer);
+ usb_bdma_post_sync(xfer);
while (nframes--) {
if (td == NULL) {
@@ -1055,7 +1055,7 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
uhci_dump_td(td);
}
#endif
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = le32toh(td->td_status);
len = UHCI_TD_GET_ACTLEN(status);
@@ -1065,13 +1065,13 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
}
if (td->fix_pc) {
- usb2_get_page(td->fix_pc, 0, &res);
+ usbd_get_page(td->fix_pc, 0, &res);
/* copy data from fixup location to real location */
- usb2_pc_cpu_invalidate(td->fix_pc);
+ usb_pc_cpu_invalidate(td->fix_pc);
- usb2_copy_in(xfer->frbuffers, offset,
+ usbd_copy_in(xfer->frbuffers, offset,
res.buffer, len);
}
offset += *plen;
@@ -1107,7 +1107,7 @@ uhci_non_isoc_done_sub(struct usb_xfer *xfer)
}
while (1) {
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = le32toh(td->td_status);
token = le32toh(td->td_token);
@@ -1127,16 +1127,16 @@ uhci_non_isoc_done_sub(struct usb_xfer *xfer)
if (td->fix_pc) {
- usb2_get_page(td->fix_pc, 0, &res);
+ usbd_get_page(td->fix_pc, 0, &res);
/*
* copy data from fixup location to real
* location
*/
- usb2_pc_cpu_invalidate(td->fix_pc);
+ usb_pc_cpu_invalidate(td->fix_pc);
- usb2_copy_in(xfer->frbuffers + xfer->aframes,
+ usbd_copy_in(xfer->frbuffers + xfer->aframes,
xfer->frlengths[xfer->aframes], res.buffer, len);
}
/* update actual length */
@@ -1218,7 +1218,7 @@ uhci_non_isoc_done(struct usb_xfer *xfer)
/* sync any DMA memory before doing fixups */
- usb2_bdma_post_sync(xfer);
+ usb_bdma_post_sync(xfer);
/* reset scanner */
@@ -1291,7 +1291,7 @@ uhci_check_transfer_sub(struct usb_xfer *xfer)
while (1) {
td->td_token ^= htole32(UHCI_TD_SET_DT(1));
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
if (td == xfer->td_transfer_last) {
/* last transfer */
@@ -1308,7 +1308,7 @@ skip:
/* update the QH */
qh->qh_e_next = td_self;
- usb2_pc_cpu_flush(qh->page_cache);
+ usb_pc_cpu_flush(qh->page_cache);
DPRINTFN(13, "xfer=%p following alt next\n", xfer);
}
@@ -1334,14 +1334,14 @@ uhci_check_transfer(struct usb_xfer *xfer)
td = xfer->td_transfer_last;
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = le32toh(td->td_status);
/* check also if the first is complete */
td = xfer->td_transfer_first;
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status |= le32toh(td->td_status);
if (!(status & UHCI_TD_ACTIVE)) {
@@ -1359,7 +1359,7 @@ uhci_check_transfer(struct usb_xfer *xfer)
td = xfer->td_transfer_cache;
while (1) {
- usb2_pc_cpu_invalidate(td->page_cache);
+ usb_pc_cpu_invalidate(td->page_cache);
status = le32toh(td->td_status);
token = le32toh(td->td_token);
@@ -1652,7 +1652,7 @@ restart:
}
}
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
}
if (precompute) {
@@ -1684,7 +1684,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.average = xfer->max_frame_size;
temp.max_frame_size = xfer->max_frame_size;
@@ -1836,7 +1836,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
td->td_status |= htole32(UHCI_TD_IOC);
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
/* must have at least one frame! */
@@ -1870,7 +1870,7 @@ uhci_device_done(struct usb_xfer *xfer, usb_error_t error)
qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
if (qh) {
- usb2_pc_cpu_invalidate(qh->page_cache);
+ usb_pc_cpu_invalidate(qh->page_cache);
}
if (xfer->flags_int.bandwidth_reclaimed) {
xfer->flags_int.bandwidth_reclaimed = 0;
@@ -1902,7 +1902,7 @@ uhci_device_done(struct usb_xfer *xfer, usb_error_t error)
xfer->td_transfer_last = NULL;
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
/*------------------------------------------------------------------------*
@@ -1947,7 +1947,7 @@ uhci_device_bulk_start(struct usb_xfer *xfer)
uhci_add_loop(sc);
xfer->flags_int.bandwidth_reclaimed = 1;
} else {
- usb2_pc_cpu_flush(qh->page_cache);
+ usb_pc_cpu_flush(qh->page_cache);
}
/* put transfer on interrupt queue */
@@ -2010,7 +2010,7 @@ uhci_device_ctrl_start(struct usb_xfer *xfer)
UHCI_APPEND_QH(qh, sc->sc_fs_ctl_p_last);
}
} else {
- usb2_pc_cpu_flush(qh->page_cache);
+ usb_pc_cpu_flush(qh->page_cache);
}
/* put transfer on interrupt queue */
uhci_transfer_intr_enqueue(xfer);
@@ -2096,7 +2096,7 @@ uhci_device_intr_start(struct usb_xfer *xfer)
/* enter QHs into the controller data structures */
UHCI_APPEND_QH(qh, sc->sc_intr_p_last[xfer->qh_pos]);
} else {
- usb2_pc_cpu_flush(qh->page_cache);
+ usb_pc_cpu_flush(qh->page_cache);
}
/* put transfer on interrupt queue */
@@ -2138,7 +2138,7 @@ uhci_device_isoc_open(struct usb_xfer *xfer)
td->td_status = htole32(UHCI_TD_IOS);
td->td_token = td_token;
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
}
}
}
@@ -2197,7 +2197,7 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + temp +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + temp +
xfer->nframes;
/* get the real number of frames */
@@ -2280,7 +2280,7 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
UHCI_TD_IOS));
}
- usb2_pc_cpu_flush(td->page_cache);
+ usb_pc_cpu_flush(td->page_cache);
#if USB_DEBUG
if (uhcidebug > 5) {
@@ -2415,7 +2415,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_t index)
x = URWMASK(UREAD2(sc, port));
UWRITE2(sc, port, x | UHCI_PORTSC_PR);
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY));
DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n",
@@ -2443,7 +2443,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_t index)
for (lim = 0; lim < 12; lim++) {
- usb2_pause_mtx(&sc->sc_bus.bus_mtx,
+ usb_pause_mtx(&sc->sc_bus.bus_mtx,
USB_MS_TO_TICKS(USB_PORT_RESET_DELAY));
x = UREAD2(sc, port);
@@ -2577,7 +2577,7 @@ uhci_roothub_exec(struct usb_device *udev,
break;
}
- len = usb2_make_str_desc
+ len = usb_make_str_desc
(sc->sc_hub_desc.temp,
sizeof(sc->sc_hub_desc.temp),
str_ptr);
@@ -2738,14 +2738,14 @@ uhci_roothub_exec(struct usb_device *udev,
UWRITE2(sc, port, URWMASK(x));
/* wait 20ms for resume sequence to complete */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50);
/* clear suspend and resume detect */
UWRITE2(sc, port, URWMASK(x) & ~(UHCI_PORTSC_RD |
UHCI_PORTSC_SUSP));
/* wait a little bit */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 500);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 500);
sc->sc_isresumed |= (1 << index);
@@ -2837,7 +2837,7 @@ uhci_root_intr(uhci_softc_t *sc)
}
/* restart timer */
- usb2_callout_reset(&sc->sc_root_intr, hz,
+ usb_callout_reset(&sc->sc_root_intr, hz,
(void *)&uhci_root_intr, sc);
if (sc->sc_hub_idata[0] != 0) {
@@ -2874,7 +2874,7 @@ uhci_xfer_setup(struct usb_setup_params *parm)
xfer->flags_int.bdma_enable = 1;
xfer->flags_int.bdma_no_post_sync = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
/* see EHCI HC driver for proof of "ntd" formula */
@@ -2886,7 +2886,7 @@ uhci_xfer_setup(struct usb_setup_params *parm)
xfer->flags_int.bdma_enable = 1;
xfer->flags_int.bdma_no_post_sync = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 1;
ntd = ((2 * xfer->nframes)
@@ -2896,7 +2896,7 @@ uhci_xfer_setup(struct usb_setup_params *parm)
xfer->flags_int.bdma_enable = 1;
xfer->flags_int.bdma_no_post_sync = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 1;
ntd = ((2 * xfer->nframes)
@@ -2906,14 +2906,14 @@ uhci_xfer_setup(struct usb_setup_params *parm)
xfer->flags_int.bdma_enable = 1;
xfer->flags_int.bdma_no_post_sync = 1;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 0;
ntd = xfer->nframes;
} else {
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
nqh = 0;
ntd = 0;
@@ -2957,7 +2957,7 @@ uhci_xfer_setup(struct usb_setup_params *parm)
}
align = (1 << n);
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, xfer->max_frame_size,
align, nfixup)) {
parm->err = USB_ERR_NOMEM;
@@ -2972,7 +2972,7 @@ alloc_dma_set:
}
last_obj = NULL;
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(uhci_td_t),
UHCI_TD_ALIGN, ntd)) {
parm->err = USB_ERR_NOMEM;
@@ -2982,7 +2982,7 @@ alloc_dma_set:
for (n = 0; n != ntd; n++) {
uhci_td_t *td;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
td = page_info.buffer;
@@ -3003,14 +3003,14 @@ alloc_dma_set:
last_obj = td;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
xfer->td_start[xfer->flags_int.curr_dma_set] = last_obj;
last_obj = NULL;
- if (usb2_transfer_setup_sub_malloc(
+ if (usbd_transfer_setup_sub_malloc(
parm, &pc, sizeof(uhci_qh_t),
UHCI_QH_ALIGN, nqh)) {
parm->err = USB_ERR_NOMEM;
@@ -3020,7 +3020,7 @@ alloc_dma_set:
for (n = 0; n != nqh; n++) {
uhci_qh_t *qh;
- usb2_get_page(pc + n, 0, &page_info);
+ usbd_get_page(pc + n, 0, &page_info);
qh = page_info.buffer;
@@ -3031,7 +3031,7 @@ alloc_dma_set:
last_obj = qh;
- usb2_pc_cpu_flush(pc + n);
+ usb_pc_cpu_flush(pc + n);
}
}
xfer->qh_start[xfer->flags_int.curr_dma_set] = last_obj;
diff --git a/sys/dev/usb/controller/uhci_pci.c b/sys/dev/usb/controller/uhci_pci.c
index 061a178..ed7819e 100644
--- a/sys/dev/usb/controller/uhci_pci.c
+++ b/sys/dev/usb/controller/uhci_pci.c
@@ -250,7 +250,7 @@ uhci_pci_attach(device_t self)
sc->sc_bus.devices_max = UHCI_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self),
+ if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self),
&uhci_iterate_hw_softc)) {
return ENOMEM;
}
@@ -409,7 +409,7 @@ uhci_pci_detach(device_t self)
sc->sc_io_res);
sc->sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_bus, &uhci_iterate_hw_softc);
+ usb_bus_mem_free_all(&sc->sc_bus, &uhci_iterate_hw_softc);
return (0);
}
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index 1e91643..3e7c0a7 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -28,7 +28,7 @@
#include <dev/usb/usb_error.h>
#include <dev/usb/usb.h>
-#define USB_DEBUG_VAR usb2_ctrl_debug
+#define USB_DEBUG_VAR usb_ctrl_debug
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_debug.h>
@@ -43,66 +43,66 @@
/* function prototypes */
-static device_probe_t usb2_probe;
-static device_attach_t usb2_attach;
-static device_detach_t usb2_detach;
+static device_probe_t usb_probe;
+static device_attach_t usb_attach;
+static device_detach_t usb_detach;
-static void usb2_attach_sub(device_t, struct usb_bus *);
-static void usb2_post_init(void *);
+static void usb_attach_sub(device_t, struct usb_bus *);
+static void usb_post_init(void *);
/* static variables */
#if USB_DEBUG
-static int usb2_ctrl_debug = 0;
+static int usb_ctrl_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller");
-SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug, CTLFLAG_RW, &usb2_ctrl_debug, 0,
+SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug, CTLFLAG_RW, &usb_ctrl_debug, 0,
"Debug level");
#endif
-static uint8_t usb2_post_init_called = 0;
+static uint8_t usb_post_init_called = 0;
-static devclass_t usb2_devclass;
+static devclass_t usb_devclass;
-static device_method_t usb2_methods[] = {
- DEVMETHOD(device_probe, usb2_probe),
- DEVMETHOD(device_attach, usb2_attach),
- DEVMETHOD(device_detach, usb2_detach),
+static device_method_t usb_methods[] = {
+ DEVMETHOD(device_probe, usb_probe),
+ DEVMETHOD(device_attach, usb_attach),
+ DEVMETHOD(device_detach, usb_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
{0, 0}
};
-static driver_t usb2_driver = {
+static driver_t usb_driver = {
.name = "usbus",
- .methods = usb2_methods,
+ .methods = usb_methods,
.size = 0,
};
-DRIVER_MODULE(usbus, ohci, usb2_driver, usb2_devclass, 0, 0);
-DRIVER_MODULE(usbus, uhci, usb2_driver, usb2_devclass, 0, 0);
-DRIVER_MODULE(usbus, ehci, usb2_driver, usb2_devclass, 0, 0);
-DRIVER_MODULE(usbus, at91_udp, usb2_driver, usb2_devclass, 0, 0);
-DRIVER_MODULE(usbus, uss820, usb2_driver, usb2_devclass, 0, 0);
+DRIVER_MODULE(usbus, ohci, usb_driver, usb_devclass, 0, 0);
+DRIVER_MODULE(usbus, uhci, usb_driver, usb_devclass, 0, 0);
+DRIVER_MODULE(usbus, ehci, usb_driver, usb_devclass, 0, 0);
+DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0);
+DRIVER_MODULE(usbus, uss820, usb_driver, usb_devclass, 0, 0);
/*------------------------------------------------------------------------*
- * usb2_probe
+ * usb_probe
*
* This function is called from "{ehci,ohci,uhci}_pci_attach()".
*------------------------------------------------------------------------*/
static int
-usb2_probe(device_t dev)
+usb_probe(device_t dev)
{
DPRINTF("\n");
return (0);
}
/*------------------------------------------------------------------------*
- * usb2_attach
+ * usb_attach
*------------------------------------------------------------------------*/
static int
-usb2_attach(device_t dev)
+usb_attach(device_t dev)
{
struct usb_bus *bus = device_get_ivars(dev);
@@ -116,20 +116,20 @@ usb2_attach(device_t dev)
/* delay vfs_mountroot until the bus is explored */
bus->bus_roothold = root_mount_hold(device_get_nameunit(dev));
- if (usb2_post_init_called) {
+ if (usb_post_init_called) {
mtx_lock(&Giant);
- usb2_attach_sub(dev, bus);
+ usb_attach_sub(dev, bus);
mtx_unlock(&Giant);
- usb2_needs_explore(bus, 1);
+ usb_needs_explore(bus, 1);
}
return (0); /* return success */
}
/*------------------------------------------------------------------------*
- * usb2_detach
+ * usb_detach
*------------------------------------------------------------------------*/
static int
-usb2_detach(device_t dev)
+usb_detach(device_t dev)
{
struct usb_bus *bus = device_get_softc(dev);
@@ -140,7 +140,7 @@ usb2_detach(device_t dev)
return (0);
}
/* Stop power watchdog */
- usb2_callout_drain(&bus->power_wdog);
+ usb_callout_drain(&bus->power_wdog);
/* Let the USB explore process detach all devices. */
if (bus->bus_roothold != NULL) {
@@ -149,40 +149,40 @@ usb2_detach(device_t dev)
}
USB_BUS_LOCK(bus);
- if (usb2_proc_msignal(&bus->explore_proc,
+ if (usb_proc_msignal(&bus->explore_proc,
&bus->detach_msg[0], &bus->detach_msg[1])) {
/* ignore */
}
/* Wait for detach to complete */
- usb2_proc_mwait(&bus->explore_proc,
+ usb_proc_mwait(&bus->explore_proc,
&bus->detach_msg[0], &bus->detach_msg[1]);
USB_BUS_UNLOCK(bus);
/* Get rid of USB callback processes */
- usb2_proc_free(&bus->giant_callback_proc);
- usb2_proc_free(&bus->non_giant_callback_proc);
+ usb_proc_free(&bus->giant_callback_proc);
+ usb_proc_free(&bus->non_giant_callback_proc);
/* Get rid of USB explore process */
- usb2_proc_free(&bus->explore_proc);
+ usb_proc_free(&bus->explore_proc);
/* Get rid of control transfer process */
- usb2_proc_free(&bus->control_xfer_proc);
+ usb_proc_free(&bus->control_xfer_proc);
return (0);
}
/*------------------------------------------------------------------------*
- * usb2_bus_explore
+ * usb_bus_explore
*
* This function is used to explore the device tree from the root.
*------------------------------------------------------------------------*/
static void
-usb2_bus_explore(struct usb_proc_msg *pm)
+usb_bus_explore(struct usb_proc_msg *pm)
{
struct usb_bus *bus;
struct usb_device *udev;
@@ -207,7 +207,7 @@ usb2_bus_explore(struct usb_proc_msg *pm)
/*
* First update the USB power state!
*/
- usb2_bus_powerd(bus);
+ usb_bus_powerd(bus);
/*
* Explore the Root USB HUB. This call can sleep,
* exiting Giant, which is actually Giant.
@@ -225,12 +225,12 @@ usb2_bus_explore(struct usb_proc_msg *pm)
}
/*------------------------------------------------------------------------*
- * usb2_bus_detach
+ * usb_bus_detach
*
* This function is used to detach the device tree from the root.
*------------------------------------------------------------------------*/
static void
-usb2_bus_detach(struct usb_proc_msg *pm)
+usb_bus_detach(struct usb_proc_msg *pm)
{
struct usb_bus *bus;
struct usb_device *udev;
@@ -252,7 +252,7 @@ usb2_bus_detach(struct usb_proc_msg *pm)
* Free USB Root device, but not any sub-devices, hence they
* are freed by the caller of this function:
*/
- usb2_free_device(udev,
+ usb_free_device(udev,
USB_UNCFG_FLAG_FREE_EP0);
mtx_unlock(&Giant);
@@ -262,29 +262,29 @@ usb2_bus_detach(struct usb_proc_msg *pm)
}
static void
-usb2_power_wdog(void *arg)
+usb_power_wdog(void *arg)
{
struct usb_bus *bus = arg;
USB_BUS_LOCK_ASSERT(bus, MA_OWNED);
- usb2_callout_reset(&bus->power_wdog,
- 4 * hz, usb2_power_wdog, arg);
+ usb_callout_reset(&bus->power_wdog,
+ 4 * hz, usb_power_wdog, arg);
USB_BUS_UNLOCK(bus);
- usb2_bus_power_update(bus);
+ usb_bus_power_update(bus);
USB_BUS_LOCK(bus);
}
/*------------------------------------------------------------------------*
- * usb2_bus_attach
+ * usb_bus_attach
*
* This function attaches USB in context of the explore thread.
*------------------------------------------------------------------------*/
static void
-usb2_bus_attach(struct usb_proc_msg *pm)
+usb_bus_attach(struct usb_proc_msg *pm)
{
struct usb_bus *bus;
struct usb_device *child;
@@ -342,10 +342,10 @@ usb2_bus_attach(struct usb_proc_msg *pm)
/* Allocate the Root USB device */
- child = usb2_alloc_device(bus->bdev, bus, NULL, 0, 0, 1,
+ child = usb_alloc_device(bus->bdev, bus, NULL, 0, 0, 1,
speed, USB_MODE_HOST);
if (child) {
- err = usb2_probe_and_attach(child,
+ err = usb_probe_and_attach(child,
USB_IFACE_INDEX_ANY);
if (!err) {
if ((bus->devices[USB_ROOT_HUB_ADDR] == NULL) ||
@@ -362,68 +362,68 @@ usb2_bus_attach(struct usb_proc_msg *pm)
if (err) {
device_printf(bus->bdev, "Root HUB problem, error=%s\n",
- usb2_errstr(err));
+ usbd_errstr(err));
}
/* set softc - we are ready */
device_set_softc(dev, bus);
/* start watchdog */
- usb2_power_wdog(bus);
+ usb_power_wdog(bus);
}
/*------------------------------------------------------------------------*
- * usb2_attach_sub
+ * usb_attach_sub
*
* This function creates a thread which runs the USB attach code. It
* is factored out, hence it can be called at two different places in
* time. During bootup this function is called from
- * "usb2_post_init". During hot-plug it is called directly from the
- * "usb2_attach()" method.
+ * "usb_post_init". During hot-plug it is called directly from the
+ * "usb_attach()" method.
*------------------------------------------------------------------------*/
static void
-usb2_attach_sub(device_t dev, struct usb_bus *bus)
+usb_attach_sub(device_t dev, struct usb_bus *bus)
{
const char *pname = device_get_nameunit(dev);
/* Initialise USB process messages */
- bus->explore_msg[0].hdr.pm_callback = &usb2_bus_explore;
+ bus->explore_msg[0].hdr.pm_callback = &usb_bus_explore;
bus->explore_msg[0].bus = bus;
- bus->explore_msg[1].hdr.pm_callback = &usb2_bus_explore;
+ bus->explore_msg[1].hdr.pm_callback = &usb_bus_explore;
bus->explore_msg[1].bus = bus;
- bus->detach_msg[0].hdr.pm_callback = &usb2_bus_detach;
+ bus->detach_msg[0].hdr.pm_callback = &usb_bus_detach;
bus->detach_msg[0].bus = bus;
- bus->detach_msg[1].hdr.pm_callback = &usb2_bus_detach;
+ bus->detach_msg[1].hdr.pm_callback = &usb_bus_detach;
bus->detach_msg[1].bus = bus;
- bus->attach_msg[0].hdr.pm_callback = &usb2_bus_attach;
+ bus->attach_msg[0].hdr.pm_callback = &usb_bus_attach;
bus->attach_msg[0].bus = bus;
- bus->attach_msg[1].hdr.pm_callback = &usb2_bus_attach;
+ bus->attach_msg[1].hdr.pm_callback = &usb_bus_attach;
bus->attach_msg[1].bus = bus;
/* Create USB explore and callback processes */
- if (usb2_proc_create(&bus->giant_callback_proc,
+ if (usb_proc_create(&bus->giant_callback_proc,
&bus->bus_mtx, pname, USB_PRI_MED)) {
printf("WARNING: Creation of USB Giant "
"callback process failed.\n");
- } else if (usb2_proc_create(&bus->non_giant_callback_proc,
+ } else if (usb_proc_create(&bus->non_giant_callback_proc,
&bus->bus_mtx, pname, USB_PRI_HIGH)) {
printf("WARNING: Creation of USB non-Giant "
"callback process failed.\n");
- } else if (usb2_proc_create(&bus->explore_proc,
+ } else if (usb_proc_create(&bus->explore_proc,
&bus->bus_mtx, pname, USB_PRI_MED)) {
printf("WARNING: Creation of USB explore "
"process failed.\n");
- } else if (usb2_proc_create(&bus->control_xfer_proc,
+ } else if (usb_proc_create(&bus->control_xfer_proc,
&bus->bus_mtx, pname, USB_PRI_MED)) {
printf("WARNING: Creation of USB control transfer "
"process failed.\n");
} else {
/* Get final attach going */
USB_BUS_LOCK(bus);
- if (usb2_proc_msignal(&bus->explore_proc,
+ if (usb_proc_msignal(&bus->explore_proc,
&bus->attach_msg[0], &bus->attach_msg[1])) {
/* ignore */
}
@@ -432,13 +432,13 @@ usb2_attach_sub(device_t dev, struct usb_bus *bus)
}
/*------------------------------------------------------------------------*
- * usb2_post_init
+ * usb_post_init
*
* This function is called to attach all USB busses that were found
* during bootup.
*------------------------------------------------------------------------*/
static void
-usb2_post_init(void *arg)
+usb_post_init(void *arg)
{
struct usb_bus *bus;
devclass_t dc;
@@ -448,9 +448,9 @@ usb2_post_init(void *arg)
mtx_lock(&Giant);
- usb2_devclass_ptr = devclass_find("usbus");
+ usb_devclass_ptr = devclass_find("usbus");
- dc = usb2_devclass_ptr;
+ dc = usb_devclass_ptr;
if (dc) {
max = devclass_get_maxunit(dc) + 1;
for (n = 0; n != max; n++) {
@@ -459,7 +459,7 @@ usb2_post_init(void *arg)
bus = device_get_ivars(dev);
if (bus) {
mtx_lock(&Giant);
- usb2_attach_sub(dev, bus);
+ usb_attach_sub(dev, bus);
mtx_unlock(&Giant);
}
}
@@ -467,69 +467,69 @@ usb2_post_init(void *arg)
} else {
DPRINTFN(0, "no devclass\n");
}
- usb2_post_init_called = 1;
+ usb_post_init_called = 1;
/* explore all USB busses in parallell */
- usb2_needs_explore_all();
+ usb_needs_explore_all();
mtx_unlock(&Giant);
}
-SYSINIT(usb2_post_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, usb2_post_init, NULL);
-SYSUNINIT(usb2_bus_unload, SI_SUB_KLD, SI_ORDER_ANY, usb2_bus_unload, NULL);
+SYSINIT(usb_post_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, usb_post_init, NULL);
+SYSUNINIT(usb_bus_unload, SI_SUB_KLD, SI_ORDER_ANY, usb_bus_unload, NULL);
/*------------------------------------------------------------------------*
- * usb2_bus_mem_flush_all_cb
+ * usb_bus_mem_flush_all_cb
*------------------------------------------------------------------------*/
#if USB_HAVE_BUSDMA
static void
-usb2_bus_mem_flush_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
+usb_bus_mem_flush_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
struct usb_page *pg, usb_size_t size, usb_size_t align)
{
- usb2_pc_cpu_flush(pc);
+ usb_pc_cpu_flush(pc);
}
#endif
/*------------------------------------------------------------------------*
- * usb2_bus_mem_flush_all - factored out code
+ * usb_bus_mem_flush_all - factored out code
*------------------------------------------------------------------------*/
#if USB_HAVE_BUSDMA
void
-usb2_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
+usb_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
{
if (cb) {
- cb(bus, &usb2_bus_mem_flush_all_cb);
+ cb(bus, &usb_bus_mem_flush_all_cb);
}
}
#endif
/*------------------------------------------------------------------------*
- * usb2_bus_mem_alloc_all_cb
+ * usb_bus_mem_alloc_all_cb
*------------------------------------------------------------------------*/
#if USB_HAVE_BUSDMA
static void
-usb2_bus_mem_alloc_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
+usb_bus_mem_alloc_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
struct usb_page *pg, usb_size_t size, usb_size_t align)
{
/* need to initialize the page cache */
pc->tag_parent = bus->dma_parent_tag;
- if (usb2_pc_alloc_mem(pc, pg, size, align)) {
+ if (usb_pc_alloc_mem(pc, pg, size, align)) {
bus->alloc_failed = 1;
}
}
#endif
/*------------------------------------------------------------------------*
- * usb2_bus_mem_alloc_all - factored out code
+ * usb_bus_mem_alloc_all - factored out code
*
* Returns:
* 0: Success
* Else: Failure
*------------------------------------------------------------------------*/
uint8_t
-usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat,
+usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat,
usb_bus_mem_cb_t *cb)
{
bus->alloc_failed = 0;
@@ -537,13 +537,13 @@ usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat,
mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent),
NULL, MTX_DEF | MTX_RECURSE);
- usb2_callout_init_mtx(&bus->power_wdog,
+ usb_callout_init_mtx(&bus->power_wdog,
&bus->bus_mtx, 0);
TAILQ_INIT(&bus->intr_q.head);
#if USB_HAVE_BUSDMA
- usb2_dma_tag_setup(bus->dma_parent_tag, bus->dma_tags,
+ usb_dma_tag_setup(bus->dma_parent_tag, bus->dma_tags,
dmat, &bus->bus_mtx, NULL, 32, USB_BUS_DMA_TAG_MAX);
#endif
if ((bus->devices_max > USB_MAX_DEVICES) ||
@@ -555,38 +555,38 @@ usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat,
}
#if USB_HAVE_BUSDMA
if (cb) {
- cb(bus, &usb2_bus_mem_alloc_all_cb);
+ cb(bus, &usb_bus_mem_alloc_all_cb);
}
#endif
if (bus->alloc_failed) {
- usb2_bus_mem_free_all(bus, cb);
+ usb_bus_mem_free_all(bus, cb);
}
return (bus->alloc_failed);
}
/*------------------------------------------------------------------------*
- * usb2_bus_mem_free_all_cb
+ * usb_bus_mem_free_all_cb
*------------------------------------------------------------------------*/
#if USB_HAVE_BUSDMA
static void
-usb2_bus_mem_free_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
+usb_bus_mem_free_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
struct usb_page *pg, usb_size_t size, usb_size_t align)
{
- usb2_pc_free_mem(pc);
+ usb_pc_free_mem(pc);
}
#endif
/*------------------------------------------------------------------------*
- * usb2_bus_mem_free_all - factored out code
+ * usb_bus_mem_free_all - factored out code
*------------------------------------------------------------------------*/
void
-usb2_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
+usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
{
#if USB_HAVE_BUSDMA
if (cb) {
- cb(bus, &usb2_bus_mem_free_all_cb);
+ cb(bus, &usb_bus_mem_free_all_cb);
}
- usb2_dma_tag_unsetup(bus->dma_parent_tag);
+ usb_dma_tag_unsetup(bus->dma_parent_tag);
#endif
mtx_destroy(&bus->bus_mtx);
diff --git a/sys/dev/usb/controller/uss820dci.c b/sys/dev/usb/controller/uss820dci.c
index f3078d3..9f29bbf 100644
--- a/sys/dev/usb/controller/uss820dci.c
+++ b/sys/dev/usb/controller/uss820dci.c
@@ -303,7 +303,7 @@ uss820dci_setup_rx(struct uss820dci_td *td)
USS820_RXCON, temp);
/* copy data into real buffer */
- usb2_copy_in(td->pc, 0, &req, sizeof(req));
+ usbd_copy_in(td->pc, 0, &req, sizeof(req));
td->offset = sizeof(req);
td->remainder = 0;
@@ -446,7 +446,7 @@ repeat:
return (0); /* we are complete */
}
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -545,7 +545,7 @@ repeat:
count_copy = count;
while (count > 0) {
- usb2_get_page(td->pc, td->offset, &buf_res);
+ usbd_get_page(td->pc, td->offset, &buf_res);
/* get correct length */
if (buf_res.length > count) {
@@ -830,7 +830,7 @@ uss820dci_setup_standard_chain(struct usb_xfer *xfer)
DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n",
xfer->address, UE_GET_ADDR(xfer->endpointno),
- xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
+ xfer->sumlen, usbd_get_speed(xfer->xroot->udev));
temp.max_frame_size = xfer->max_frame_size;
@@ -1030,11 +1030,11 @@ uss820dci_start_standard_chain(struct usb_xfer *xfer)
uss820dci_intr_set(xfer, 1);
/* put transfer on interrupt queue */
- usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
+ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer);
/* start timeout, if any */
if (xfer->timeout != 0) {
- usb2_transfer_timeout_ms(xfer,
+ usbd_transfer_timeout_ms(xfer,
&uss820dci_timeout, xfer->timeout);
}
}
@@ -1179,7 +1179,7 @@ uss820dci_device_done(struct usb_xfer *xfer, usb_error_t error)
uss820dci_intr_set(xfer, 0);
}
/* dequeue transfer and start next transfer */
- usb2_transfer_done(xfer, error);
+ usbd_transfer_done(xfer, error);
}
static void
@@ -1341,7 +1341,7 @@ uss820dci_init(struct uss820dci_softc *sc)
uss820dci_pull_down(sc);
/* wait 10ms for pulldown to stabilise */
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
+ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
/* check hardware revision */
temp = USS820_READ_1(sc, USS820_REV);
@@ -1676,7 +1676,7 @@ uss820dci_device_isoc_fs_enter(struct usb_xfer *xfer)
* pre-compute when the isochronous transfer will be finished:
*/
xfer->isoc_time_complete =
- usb2_isoc_time_expand(&sc->sc_bus, nframes) + temp +
+ usb_isoc_time_expand(&sc->sc_bus, nframes) + temp +
xfer->nframes;
/* compute frame number for next insertion */
@@ -2201,7 +2201,7 @@ uss820dci_xfer_setup(struct usb_setup_params *parm)
parm->hc_max_packet_count = 1;
parm->hc_max_frame_size = 0x500;
- usb2_transfer_setup_sub(parm);
+ usbd_transfer_setup_sub(parm);
/*
* compute maximum number of TDs
@@ -2228,7 +2228,7 @@ uss820dci_xfer_setup(struct usb_setup_params *parm)
}
/*
- * check if "usb2_transfer_setup_sub" set an error
+ * check if "usbd_transfer_setup_sub" set an error
*/
if (parm->err) {
return;
diff --git a/sys/dev/usb/controller/uss820dci_atmelarm.c b/sys/dev/usb/controller/uss820dci_atmelarm.c
index 18b0eb3..f8988b8 100644
--- a/sys/dev/usb/controller/uss820dci_atmelarm.c
+++ b/sys/dev/usb/controller/uss820dci_atmelarm.c
@@ -137,7 +137,7 @@ uss820_atmelarm_attach(device_t dev)
sc->sc_bus.devices_max = USS820_MAX_DEVICES;
/* get all DMA memory */
- if (usb2_bus_mem_alloc_all(&sc->sc_bus,
+ if (usb_bus_mem_alloc_all(&sc->sc_bus,
USB_GET_DMA_TAG(dev), NULL)) {
return (ENOMEM);
}
@@ -227,7 +227,7 @@ uss820_atmelarm_detach(device_t dev)
sc->sc_io_res);
sc->sc_io_res = NULL;
}
- usb2_bus_mem_free_all(&sc->sc_bus, NULL);
+ usb_bus_mem_free_all(&sc->sc_bus, NULL);
return (0);
}
OpenPOWER on IntegriCloud