aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/serial
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2018-04-24 19:11:05 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2018-04-24 19:11:05 +0000
commitc653786de0e2e9db1cab6da5b65ea9a0591ed06c (patch)
tree26b869c6428701b53e3e0d41710040baa15f9ae8 /sys/dev/usb/serial
parent65df12484508401ce2ee43b2f4e21ba77a8a5670 (diff)
Notes
Diffstat (limited to 'sys/dev/usb/serial')
-rw-r--r--sys/dev/usb/serial/uslcom.c17
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);
}