Lines Matching +full:modem +full:- +full:control +full:- +full:line +full:- +full:ports
5 * * parts from ubsa.c 183348 2008-09-25 12:00:56Z phk *
23 * - The detour through the tty layer is ridiculously expensive wrt
109 uint16_t sc_line[U3G_MAXPORTS]; /* line status */
508 /* the following is a RNDIS device, no modem features */
687 * This function returns non-zero if the interface being in u3g_huawei_is_cdce()
778 if (len > (sizeof(setup[0]) - 8)) { in u3g_sael_m460_init()
801 * The following function handles 3G modem devices (E220, Mobile,
802 * etc.) with auto-install flash disks for Windows/MacOSX on the first
804 * to a modem.
815 if (uaa->dev_state != UAA_DEV_READY) in u3g_test_autoinst()
821 id = iface->idesc; in u3g_test_autoinst()
822 if (id == NULL || id->bInterfaceClass != UICLASS_MASS) in u3g_test_autoinst()
907 uaa->dev_state = UAA_DEV_EJECTING; in u3g_test_autoinst()
934 if (uaa->usb_mode != USB_MODE_HOST) { in u3g_probe()
937 if (uaa->info.bConfigIndex != U3G_CONFIG_INDEX) { in u3g_probe()
940 if (uaa->info.bInterfaceClass != UICLASS_VENDOR) { in u3g_probe()
943 if (u3g_huawei_is_cdce(uaa->info.idVendor, uaa->info.bInterfaceSubClass, in u3g_probe()
944 uaa->info.bInterfaceProtocol)) { in u3g_probe()
968 u3g_sael_m460_init(uaa->device); in u3g_attach()
976 mtx_init(&sc->sc_mtx, "u3g", NULL, MTX_DEF); in u3g_attach()
977 ucom_ref(&sc->sc_super_ucom); in u3g_attach()
979 sc->sc_udev = uaa->device; in u3g_attach()
983 for (i = uaa->info.bIfaceIndex; i < USB_IFACE_MAX; i++) { in u3g_attach()
984 iface = usbd_get_iface(uaa->device, i); in u3g_attach()
988 if (id == NULL || id->bInterfaceClass != UICLASS_VENDOR) in u3g_attach()
990 if (u3g_huawei_is_cdce(uaa->info.idVendor, in u3g_attach()
991 id->bInterfaceSubClass, id->bInterfaceProtocol)) in u3g_attach()
993 usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex); in u3g_attach()
999 nports = 0; /* number of ports */ in u3g_attach()
1011 error = usbd_transfer_setup(uaa->device, &i, in u3g_attach()
1012 sc->sc_xfer[nports], u3g_config_tmp, U3G_N_TRANSFER, in u3g_attach()
1013 &sc->sc_ucom[nports], &sc->sc_mtx); in u3g_attach()
1021 iface = usbd_get_iface(uaa->device, i); in u3g_attach()
1023 sc->sc_iface[nports] = id->bInterfaceNumber; in u3g_attach()
1025 if (bootverbose && sc->sc_xfer[nports][U3G_INTR]) { in u3g_attach()
1026 device_printf(dev, "port %d supports modem control\n", in u3g_attach()
1031 mtx_lock(&sc->sc_mtx); in u3g_attach()
1032 usbd_xfer_set_stall(sc->sc_xfer[nports][U3G_BULK_WR]); in u3g_attach()
1033 usbd_xfer_set_stall(sc->sc_xfer[nports][U3G_BULK_RD]); in u3g_attach()
1034 mtx_unlock(&sc->sc_mtx); in u3g_attach()
1042 device_printf(dev, "no ports found\n"); in u3g_attach()
1045 sc->sc_numports = nports; in u3g_attach()
1047 error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, in u3g_attach()
1048 sc->sc_numports, sc, &u3g_callback, &sc->sc_mtx); in u3g_attach()
1053 ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); in u3g_attach()
1054 device_printf(dev, "Found %u port%s.\n", sc->sc_numports, in u3g_attach()
1055 sc->sc_numports > 1 ? "s":""); in u3g_attach()
1072 /* NOTE: It is not dangerous to detach more ports than attached! */ in u3g_detach()
1073 ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); in u3g_detach()
1076 usbd_transfer_unsetup(sc->sc_xfer[subunit], U3G_N_TRANSFER); in u3g_detach()
1090 if (ucom_unref(&sc->sc_super_ucom)) { in u3g_free_softc()
1091 mtx_destroy(&sc->sc_mtx); in u3g_free_softc()
1099 u3g_free_softc(ucom->sc_parent); in u3g_free()
1105 struct u3g_softc *sc = ucom->sc_parent; in u3g_start_read()
1108 usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_INTR]); in u3g_start_read()
1111 usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); in u3g_start_read()
1117 struct u3g_softc *sc = ucom->sc_parent; in u3g_stop_read()
1120 usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_INTR]); in u3g_stop_read()
1123 usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); in u3g_stop_read()
1129 struct u3g_softc *sc = ucom->sc_parent; in u3g_start_write()
1131 usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]); in u3g_start_write()
1137 struct u3g_softc *sc = ucom->sc_parent; in u3g_stop_write()
1139 usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]); in u3g_stop_write()
1170 /* do a builtin clear-stall */ in u3g_write_callback()
1200 /* do a builtin clear-stall */ in u3g_read_callback()
1211 struct u3g_softc *sc = ucom->sc_parent; in u3g_cfg_get_status()
1214 *lsr = sc->sc_lsr[ucom->sc_subunit]; in u3g_cfg_get_status()
1215 *msr = sc->sc_msr[ucom->sc_subunit]; in u3g_cfg_get_status()
1221 struct u3g_softc *sc = ucom->sc_parent; in u3g_cfg_set_line()
1226 USETW(req.wValue, sc->sc_line[ucom->sc_subunit]); in u3g_cfg_set_line()
1227 req.wIndex[0] = sc->sc_iface[ucom->sc_subunit]; in u3g_cfg_set_line()
1231 ucom_cfg_do_request(sc->sc_udev, ucom, in u3g_cfg_set_line()
1238 struct u3g_softc *sc = ucom->sc_parent; in u3g_cfg_set_dtr()
1243 sc->sc_line[ucom->sc_subunit] |= UCDC_LINE_DTR; in u3g_cfg_set_dtr()
1245 sc->sc_line[ucom->sc_subunit] &= ~UCDC_LINE_DTR; in u3g_cfg_set_dtr()
1253 struct u3g_softc *sc = ucom->sc_parent; in u3g_cfg_set_rts()
1258 sc->sc_line[ucom->sc_subunit] |= UCDC_LINE_RTS; in u3g_cfg_set_rts()
1260 sc->sc_line[ucom->sc_subunit] &= ~UCDC_LINE_RTS; in u3g_cfg_set_rts()
1269 struct u3g_softc *sc = ucom->sc_parent; in u3g_intr_callback()
1303 sc->sc_lsr[ucom->sc_subunit] = 0; in u3g_intr_callback()
1304 sc->sc_msr[ucom->sc_subunit] = 0; in u3g_intr_callback()
1309 sc->sc_msr[ucom->sc_subunit] |= SER_RI; in u3g_intr_callback()
1311 sc->sc_msr[ucom->sc_subunit] |= SER_DSR; in u3g_intr_callback()
1313 sc->sc_msr[ucom->sc_subunit] |= SER_DCD; in u3g_intr_callback()
1336 struct u3g_softc *sc = ucom->sc_parent; in u3g_poll()
1337 usbd_transfer_poll(sc->sc_xfer[ucom->sc_subunit], U3G_N_TRANSFER); in u3g_poll()