Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/serial/ucycom.c
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | ucycom_attach(device_t dev) | ||||
error = usbd_transfer_setup(uaa->device, &iface_index, | error = usbd_transfer_setup(uaa->device, &iface_index, | ||||
sc->sc_xfer, ucycom_config, UCYCOM_N_TRANSFER, | sc->sc_xfer, ucycom_config, UCYCOM_N_TRANSFER, | ||||
sc, &sc->sc_mtx); | sc, &sc->sc_mtx); | ||||
if (error) { | if (error) { | ||||
device_printf(dev, "allocating USB " | device_printf(dev, "allocating USB " | ||||
"transfers failed\n"); | "transfers failed\n"); | ||||
goto detach; | goto detach; | ||||
} | } | ||||
error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, | error = ucom_attach_usb(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, | ||||
&ucycom_callback, &sc->sc_mtx); | &ucycom_callback, &sc->sc_mtx, uaa->device); | ||||
if (error) { | if (error) { | ||||
goto detach; | goto detach; | ||||
} | } | ||||
ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); | ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); | ||||
if (urd_ptr) { | if (urd_ptr) { | ||||
free(urd_ptr, M_USBDEV); | free(urd_ptr, M_USBDEV); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 330 Lines • Show Last 20 Lines |