diff options
| author | Emmanuel Vadot <manu@FreeBSD.org> | 2018-04-24 19:11:05 +0000 |
|---|---|---|
| committer | Emmanuel Vadot <manu@FreeBSD.org> | 2018-04-24 19:11:05 +0000 |
| commit | c653786de0e2e9db1cab6da5b65ea9a0591ed06c (patch) | |
| tree | 26b869c6428701b53e3e0d41710040baa15f9ae8 /sys/dev/usb/serial | |
| parent | 65df12484508401ce2ee43b2f4e21ba77a8a5670 (diff) | |
Notes
Diffstat (limited to 'sys/dev/usb/serial')
| -rw-r--r-- | sys/dev/usb/serial/uslcom.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/usb/serial/uslcom.c b/sys/dev/usb/serial/uslcom.c index 7660e3f31212..d832da09c5a0 100644 --- a/sys/dev/usb/serial/uslcom.c +++ b/sys/dev/usb/serial/uslcom.c @@ -612,7 +612,22 @@ uslcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff) static int uslcom_pre_param(struct ucom_softc *ucom, struct termios *t) { - if (t->c_ospeed <= 0 || t->c_ospeed > 921600) + struct uslcom_softc *sc = ucom->sc_parent; + uint32_t maxspeed; + + switch (sc->sc_partnum) { + case USLCOM_PARTNUM_CP2104: + case USLCOM_PARTNUM_CP2105: + maxspeed = 2000000; + break; + case USLCOM_PARTNUM_CP2101: + case USLCOM_PARTNUM_CP2102: + case USLCOM_PARTNUM_CP2103: + default: + maxspeed = 921600; + break; + } + if (t->c_ospeed <= 0 || t->c_ospeed > maxspeed) return (EINVAL); return (0); } |
