diff options
Diffstat (limited to 'sys/dev/usb/net/uhso.c')
-rw-r--r-- | sys/dev/usb/net/uhso.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/dev/usb/net/uhso.c b/sys/dev/usb/net/uhso.c index 8571458..06ac416 100644 --- a/sys/dev/usb/net/uhso.c +++ b/sys/dev/usb/net/uhso.c @@ -633,11 +633,10 @@ uhso_attach(device_t self) ht->ht_name[0] = 0; if (sc->sc_ttys == 1) - snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_unit); + snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_super->sc_unit); else { snprintf(ht->ht_name, 32, "cuaU%d.%d", - ucom->sc_unit - ucom->sc_local_unit, - ucom->sc_local_unit); + ucom->sc_super->sc_unit, ucom->sc_subunit); } desc = uhso_port_type[port]; @@ -666,7 +665,7 @@ uhso_detach(device_t self) usbd_transfer_unsetup(sc->sc_xfer, 3); usbd_transfer_unsetup(sc->sc_ctrl_xfer, UHSO_CTRL_MAX); if (sc->sc_ttys > 0) { - ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_ttys); + ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); for (i = 0; i < sc->sc_ttys; i++) { if (sc->sc_tty[i].ht_muxport != -1) { @@ -903,6 +902,7 @@ uhso_probe_iface(struct uhso_softc *sc, int index, device_printf(sc->sc_dev, "ucom_attach failed\n"); return (ENXIO); } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev); mtx_lock(&sc->sc_mtx); usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); @@ -921,6 +921,7 @@ uhso_probe_iface(struct uhso_softc *sc, int index, device_printf(sc->sc_dev, "ucom_attach failed\n"); return (ENXIO); } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev); } else { UHSO_DPRINTF(0, "Unknown type %x\n", type); @@ -1448,11 +1449,11 @@ uhso_ucom_start_read(struct ucom_softc *ucom) { struct uhso_softc *sc = ucom->sc_parent; - UHSO_DPRINTF(3, "unit=%d, local_unit=%d\n", - ucom->sc_unit, ucom->sc_local_unit); + UHSO_DPRINTF(3, "unit=%d, subunit=%d\n", + ucom->sc_super->sc_unit, ucom->sc_subunit); if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { - sc->sc_tty[ucom->sc_local_unit].ht_open = 1; + sc->sc_tty[ucom->sc_subunit].ht_open = 1; usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { @@ -1470,9 +1471,9 @@ uhso_ucom_stop_read(struct ucom_softc *ucom) struct uhso_softc *sc = ucom->sc_parent; if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { - sc->sc_tty[ucom->sc_local_unit].ht_open = 0; + sc->sc_tty[ucom->sc_subunit].ht_open = 0; usbd_transfer_stop( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_READ]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_READ]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { sc->sc_tty[0].ht_open = 0; @@ -1488,15 +1489,15 @@ uhso_ucom_start_write(struct ucom_softc *ucom) struct uhso_softc *sc = ucom->sc_parent; if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { - UHSO_DPRINTF(3, "local unit %d\n", ucom->sc_local_unit); + UHSO_DPRINTF(3, "local unit %d\n", ucom->sc_subunit); usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); usbd_xfer_set_priv( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE], - &sc->sc_tty[ucom->sc_local_unit]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE], + &sc->sc_tty[ucom->sc_subunit]); usbd_transfer_start( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { @@ -1511,7 +1512,7 @@ uhso_ucom_stop_write(struct ucom_softc *ucom) if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { usbd_transfer_stop( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { usbd_transfer_stop(sc->sc_xfer[UHSO_BULK_ENDPT_WRITE]); |