Module Name: src Committed By: jakllsch Date: Mon Dec 10 00:22:14 UTC 2018
Modified Files: src/sys/dev/usb: uchcom.c Log Message: Don't accumulate RX data into packets on CH341. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/uchcom.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/uchcom.c diff -u src/sys/dev/usb/uchcom.c:1.18 src/sys/dev/usb/uchcom.c:1.19 --- src/sys/dev/usb/uchcom.c:1.18 Mon Dec 10 00:03:11 2018 +++ src/sys/dev/usb/uchcom.c Mon Dec 10 00:22:13 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uchcom.c,v 1.18 2018/12/10 00:03:11 jakllsch Exp $ */ +/* $NetBSD: uchcom.c,v 1.19 2018/12/10 00:22:13 jakllsch Exp $ */ /* * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.18 2018/12/10 00:03:11 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.19 2018/12/10 00:22:13 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -98,6 +98,9 @@ int uchcomdebug = 0; #define UCHCOM_VER_30 0x30 #define UCHCOM_BASE_UNKNOWN 0 + +#define UCHCOM_BPS_PRE_IMM 0x80 /* CH341: immediate RX forwarding */ + #define UCHCOM_BPS_MOD_BASE 20000000 #define UCHCOM_BPS_MOD_BASE_OFS 1100 @@ -706,7 +709,8 @@ set_dte_rate(struct uchcom_softc *sc, ui return EINVAL; if ((err = write_reg(sc, - UCHCOM_REG_BPS_PRE, dv.dv_prescaler, + UCHCOM_REG_BPS_PRE, + dv.dv_prescaler | UCHCOM_BPS_PRE_IMM, UCHCOM_REG_BPS_DIV, dv.dv_div)) || (err = write_reg(sc, UCHCOM_REG_BPS_MOD, dv.dv_mod,