void ubsa_set(void *addr, int portno, int reg, int onoff) { struct ubsa_softc *sc; sc = addr; switch (reg) { case UCOM_SET_DTR: if (sc->sc_quadumts) ubsa_quadumts_dtr(sc, portno, onoff); else ubsa_dtr(sc, portno, onoff); break; case UCOM_SET_RTS: if (sc->sc_quadumts) ubsa_quadumts_rts(sc, portno, onoff); else ubsa_rts(sc, portno, onoff); break; case UCOM_SET_BREAK: if (!sc->sc_quadumts) ubsa_break(sc, portno, onoff); break; default: break; } }
static void ubsa_set(void *addr, int portno, int reg, int onoff) { struct ubsa_softc *sc; sc = addr; switch (reg) { case UCOM_SET_DTR: ubsa_dtr(sc, onoff); break; case UCOM_SET_RTS: ubsa_rts(sc, onoff); break; case UCOM_SET_BREAK: ubsa_break(sc, onoff); break; default: break; } }
void ubsa_baudrate(struct ubsa_softc *sc, speed_t speed) { u_int16_t value = 0; DPRINTF(("ubsa_baudrate: speed = %d\n", speed)); switch(speed) { case B0: break; case B300: case B600: case B1200: case B2400: case B4800: case B9600: case B19200: case B38400: case B57600: case B115200: case B230400: value = B230400 / speed; break; default: DPRINTF(("%s: ubsa_param: unsupported baudrate, " "forcing default of 9600\n", sc->sc_dev.dv_xname)); value = B230400 / B9600; break; }; if (speed == B0) { ubsa_flow(sc, 0, 0); ubsa_dtr(sc, 0); ubsa_rts(sc, 0); } else ubsa_request(sc, UBSA_SET_BAUDRATE, value); }