Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2018 19:11:05 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332963 - head/sys/dev/usb/serial
Message-ID:  <201804241911.w3OJB50x089307@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Tue Apr 24 19:11:05 2018
New Revision: 332963
URL: https://svnweb.freebsd.org/changeset/base/332963

Log:
  uslcom: Both CP2104 and CP2105 can support up to 2Mbps baudrate
  
  MFC after:	1 week

Modified:
  head/sys/dev/usb/serial/uslcom.c

Modified: head/sys/dev/usb/serial/uslcom.c
==============================================================================
--- head/sys/dev/usb/serial/uslcom.c	Tue Apr 24 19:10:51 2018	(r332962)
+++ head/sys/dev/usb/serial/uslcom.c	Tue Apr 24 19:11:05 2018	(r332963)
@@ -612,7 +612,22 @@ uslcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t on
 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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804241911.w3OJB50x089307>