Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/dev/usb Pull up following revision(s) (requested by s...
details: https://anonhg.NetBSD.org/src/rev/f8513add7b5b
branches: netbsd-9
changeset: 963774:f8513add7b5b
user: martin <martin%NetBSD.org@localhost>
date: Sun Apr 12 08:44:42 2020 +0000
description:
Pull up following revision(s) (requested by simonb in ticket #828):
share/man/man4/uxrcom.4: revision 1.1
distrib/sets/lists/man/mi: revision 1.1687
share/man/man4/uxrcom.4: revision 1.2
share/man/man4/ucom.4: revision 1.28
sys/dev/usb/uxrcom.c: revision 1.1
sys/dev/usb/umodem.c: revision 1.74
sys/dev/usb/umodem_common.c: revision 1.33
sys/dev/usb/ukyopon.c: revision 1.26
sys/dev/usb/files.usb: revision 1.173
share/man/man4/Makefile: revision 1.704
sys/dev/usb/usbdevs: revision 1.781
sys/dev/usb/usbdevices.config: revision 1.38
Add uxrcom driver for Exar XR21V141x USB serial adapters. Based in part
on the OpenBSD single-port XR21V1410 uxrcom driver, but adds support
for multi-port chipsets and uses the common umodem framework instead of
being a standalone driver.
Thanks to skrll@ for much USB clue and mrg@ for financing the
development of this driver.
Add NetBSD CVS tag.
diffstat:
distrib/sets/lists/man/mi | 5 +-
share/man/man4/Makefile | 7 +-
share/man/man4/ucom.4 | 6 +-
share/man/man4/uxrcom.4 | 80 ++++++++++
sys/dev/usb/files.usb | 7 +-
sys/dev/usb/ukyopon.c | 6 +-
sys/dev/usb/umodem.c | 6 +-
sys/dev/usb/umodem_common.c | 26 ++-
sys/dev/usb/usbdevices.config | 5 +-
sys/dev/usb/usbdevs | 8 +-
sys/dev/usb/uxrcom.c | 323 ++++++++++++++++++++++++++++++++++++++++++
11 files changed, 458 insertions(+), 21 deletions(-)
diffs (truncated from 676 to 300 lines):
diff -r 3273bfcb9da9 -r f8513add7b5b distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sun Apr 12 08:39:42 2020 +0000
+++ b/distrib/sets/lists/man/mi Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1649.2.5 2019/11/25 20:47:25 martin Exp $
+# $NetBSD: mi,v 1.1649.2.6 2020/04/12 08:44:42 martin Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -1918,6 +1918,7 @@
./usr/share/man/cat4/uvideo.0 man-sys-catman .cat
./usr/share/man/cat4/uvisor.0 man-sys-catman .cat
./usr/share/man/cat4/uvscom.0 man-sys-catman .cat
+./usr/share/man/cat4/uxrcom.0 man-sys-catman .cat
./usr/share/man/cat4/uyap.0 man-sys-catman .cat
./usr/share/man/cat4/uyurex.0 man-sys-catman .cat
./usr/share/man/cat4/vald.0 man-sys-catman .cat
@@ -5017,6 +5018,7 @@
./usr/share/man/html4/uvideo.html man-sys-htmlman html
./usr/share/man/html4/uvisor.html man-sys-htmlman html
./usr/share/man/html4/uvscom.html man-sys-htmlman html
+./usr/share/man/html4/uxrcom.html man-sys-htmlman html
./usr/share/man/html4/uyap.html man-sys-htmlman html
./usr/share/man/html4/uyurex.html man-sys-htmlman html
./usr/share/man/html4/vald.html man-sys-htmlman html
@@ -8040,6 +8042,7 @@
./usr/share/man/man4/uvideo.4 man-sys-man .man
./usr/share/man/man4/uvisor.4 man-sys-man .man
./usr/share/man/man4/uvscom.4 man-sys-man .man
+./usr/share/man/man4/uxrcom.4 man-sys-man .man
./usr/share/man/man4/uyap.4 man-sys-man .man
./usr/share/man/man4/uyurex.4 man-sys-man .man
./usr/share/man/man4/vald.4 man-sys-man .man
diff -r 3273bfcb9da9 -r f8513add7b5b share/man/man4/Makefile
--- a/share/man/man4/Makefile Sun Apr 12 08:39:42 2020 +0000
+++ b/share/man/man4/Makefile Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.680.2.3 2019/11/25 20:47:25 martin Exp $
+# $NetBSD: Makefile,v 1.680.2.4 2020/04/12 08:44:42 martin Exp $
# @(#)Makefile 8.1 (Berkeley) 6/18/93
MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -85,9 +85,8 @@
ulpt.4 umass.4 umcs.4 umct.4 umidi.4 umodem.4 ums.4 upgt.4 upl.4 \
uplcom.4 ure.4 urio.4 url.4 urndis.4 urtw.4 urtwn.4 \
usb.4 uscanner.4 uslsa.4 usmsc.4 usscanner.4 \
- ustir.4 uthum.4 utoppy.4 uts.4 uvideo.4 uvisor.4 uvscom.4 uyap.4 \
- uyurex.4 \
- xhci.4 \
+ ustir.4 uthum.4 utoppy.4 uts.4 uvideo.4 uvisor.4 uvscom.4 uxrcom.4 \
+ uyap.4 uyurex.4 xhci.4
# Ir devices
MAN+= irframe.4 cir.4 irframetty.4 oboe.4
diff -r 3273bfcb9da9 -r f8513add7b5b share/man/man4/ucom.4
--- a/share/man/man4/ucom.4 Sun Apr 12 08:39:42 2020 +0000
+++ b/share/man/man4/ucom.4 Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ucom.4,v 1.27 2019/05/05 00:12:34 pgoyette Exp $
+.\" $NetBSD: ucom.4,v 1.27.2.1 2020/04/12 08:44:42 martin Exp $
.\"
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -50,6 +50,7 @@
.Cd "ucom* at uslsa?"
.Cd "ucom* at uvisor? portno ?"
.Cd "ucom* at uvscom?"
+.Cd "ucom* at uxrcom?"
.Sh DESCRIPTION
The
.Nm
@@ -103,7 +104,8 @@
.Xr usb 4 ,
.Xr uslsa 4 ,
.Xr uvisor 4 ,
-.Xr uvscom 4
+.Xr uvscom 4 ,
+.Xr uxrcom 4
.Sh HISTORY
The
.Nm
diff -r 3273bfcb9da9 -r f8513add7b5b share/man/man4/uxrcom.4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/uxrcom.4 Sun Apr 12 08:44:42 2020 +0000
@@ -0,0 +1,80 @@
+.\" $NetBSD: uxrcom.4,v 1.2.2.2 2020/04/12 08:44:42 martin Exp $
+.\" $OpenBSD: uxrcom.4,v 1.1 2019/03/27 22:11:21 kettenis Exp $
+.\"
+.\" Copyright (c) 2019 Mark Kettenis <kettenis%openbsd.org@localhost>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: March 27 2019 $
+.Dt UXRCOM 4
+.Os
+.Sh NAME
+.Nm uxrcom
+.Nd Exar XR21V141x USB serial adapter
+.Sh SYNOPSIS
+.Cd "uxrcom* at uhub?"
+.Cd "ucom* at uxrcom?"
+.Sh HARDWARE
+The
+.Nm
+driver supports serial adapters based on the
+XR21V1410, XR21V1412 and XR21V1414 chipsets.
+Devices range from single port to eight port (implemented as a
+USB hub and two
+.Nm
+four port instances behind it).
+Examples of hardware known to work with this driver are:
+.Pp
+.Bl -tag -width Dv -offset indent -compact
+.It Gearmo GM-U28RS232 8 Port USB to Serial DB9 RS232 Adapter
+.El
+.Sh DESCRIPTION
+The
+.Nm
+driver attaches the Exar XR21V141x multiport chipset with individual
+port drivers via
+.Xr ucom 4 ,
+which makes it behave like a
+.Xr tty 4 .
+.Sh SEE ALSO
+.Xr tty 4 ,
+.Xr ucom 4 ,
+.Xr uhub 4 ,
+.Xr modem 4 ,
+.Xr usb 4
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Ox 6.5
+and in
+.Nx 9.1 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver for the single port XR21V1410 was written by
+.An Mark Kettenis Aq Mt kettenis%openbsd.org@localhost .
+The multi-port
+.Nx
+driver is based on the
+.Ox
+driver but uses the common
+.Xr umodem 4
+framework.
+The
+.Nx
+driver was written by
+by
+.An Simon Burge
+.Aq simonb%netbsd.org@localhost .
diff -r 3273bfcb9da9 -r f8513add7b5b sys/dev/usb/files.usb
--- a/sys/dev/usb/files.usb Sun Apr 12 08:39:42 2020 +0000
+++ b/sys/dev/usb/files.usb Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.usb,v 1.156.2.1 2019/09/01 13:00:37 martin Exp $
+# $NetBSD: files.usb,v 1.156.2.2 2020/04/12 08:44:42 martin Exp $
#
# Config file and device description for machine-independent USB code.
# Included by ports that need it. Ports that use it must provide
@@ -431,6 +431,11 @@
attach uvscom at usbdevif
file dev/usb/uvscom.c uvscom
+# Exar XR21V141x serial driver (mostly CDC)
+device uxrcom: ucombus, umodem_common
+attach uxrcom at usbifif
+file dev/usb/uxrcom.c uxrcom
+
# Belkin & other serial driver
define ubsa_common
file dev/usb/ubsa_common.c ubsa_common
diff -r 3273bfcb9da9 -r f8513add7b5b sys/dev/usb/ukyopon.c
--- a/sys/dev/usb/ukyopon.c Sun Apr 12 08:39:42 2020 +0000
+++ b/sys/dev/usb/ukyopon.c Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ukyopon.c,v 1.24 2019/05/09 02:43:35 mrg Exp $ */
+/* $NetBSD: ukyopon.c,v 1.24.2.1 2020/04/12 08:44:42 martin Exp $ */
/*
* Copyright (c) 1998, 2005 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukyopon.c,v 1.24 2019/05/09 02:43:35 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukyopon.c,v 1.24.2.1 2020/04/12 08:44:42 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -130,6 +130,8 @@
struct usbif_attach_arg *uiaa = aux;
struct ucom_attach_args ucaa;
+ memset(&ucaa, 0, sizeof(ucaa));
+
ucaa.ucaa_portno = (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX) ?
UKYOPON_PORT_MODEM : UKYOPON_PORT_DATA;
ucaa.ucaa_methods = &ukyopon_methods;
diff -r 3273bfcb9da9 -r f8513add7b5b sys/dev/usb/umodem.c
--- a/sys/dev/usb/umodem.c Sun Apr 12 08:39:42 2020 +0000
+++ b/sys/dev/usb/umodem.c Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umodem.c,v 1.72 2019/05/09 02:43:35 mrg Exp $ */
+/* $NetBSD: umodem.c,v 1.72.2.1 2020/04/12 08:44:42 martin Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umodem.c,v 1.72 2019/05/09 02:43:35 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umodem.c,v 1.72.2.1 2020/04/12 08:44:42 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -114,6 +114,8 @@
struct usbif_attach_arg *uiaa = aux;
struct ucom_attach_args ucaa;
+ memset(&ucaa, 0, sizeof(ucaa));
+
ucaa.ucaa_portno = UCOM_UNK_PORTNO;
ucaa.ucaa_methods = &umodem_methods;
ucaa.ucaa_info = NULL;
diff -r 3273bfcb9da9 -r f8513add7b5b sys/dev/usb/umodem_common.c
--- a/sys/dev/usb/umodem_common.c Sun Apr 12 08:39:42 2020 +0000
+++ b/sys/dev/usb/umodem_common.c Sun Apr 12 08:44:42 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umodem_common.c,v 1.30 2019/05/09 02:43:35 mrg Exp $ */
+/* $NetBSD: umodem_common.c,v 1.30.2.1 2020/04/12 08:44:42 martin Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.30 2019/05/09 02:43:35 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.30.2.1 2020/04/12 08:44:42 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -105,6 +105,12 @@
static void umodem_set_line_state(struct umodem_softc *);
static void umodem_intr(struct usbd_xfer *, void *, usbd_status);
+/*
+ * NOTE: Callers of umodem_common_attach() should initialise their ucaa
+ * to 0 before assigning any fields. ucaa_ibufsize, ucaa_ibufsize and
+ * ucaa_obufsize may be set by the caller, but if 0 are set to default
+ * umodem values.
+ */
int
umodem_common_attach(device_t self, struct umodem_softc *sc,
struct usbif_attach_arg *uiaa, struct ucom_attach_args *ucaa)
@@ -239,10 +245,16 @@
sc->sc_dtr = -1;
- /* ucaa_bulkin, ucaa_bulkout set above */
- ucaa->ucaa_ibufsize = UMODEMIBUFSIZE;
- ucaa->ucaa_obufsize = UMODEMOBUFSIZE;
- ucaa->ucaa_ibufsizepad = UMODEMIBUFSIZE;
+ /*
+ * ucaa_bulkin, ucaa_bulkout set above. ucaa_ibufsize,
+ * ucaa_ibufsize, ucaa_obufsize may be initialised by caller
+ */
+ if (ucaa->ucaa_ibufsize == 0)
+ ucaa->ucaa_ibufsize = UMODEMIBUFSIZE;
+ if (ucaa->ucaa_obufsize == 0)
+ ucaa->ucaa_obufsize = UMODEMOBUFSIZE;
+ if (ucaa->ucaa_ibufsizepad == 0)
+ ucaa->ucaa_ibufsizepad = UMODEMIBUFSIZE;
ucaa->ucaa_opkthdrlen = 0;
ucaa->ucaa_device = sc->sc_udev;
ucaa->ucaa_iface = sc->sc_data_iface;
@@ -356,7 +368,7 @@
sc->sc_notify_buf.data[0],
sc->sc_notify_buf.data[1]));
/* Currently, lsr is always zero. */
- sc->sc_lsr = sc->sc_msr = 0;
+ sc->sc_lsr = sc->sc_msr = 0;
mstatus = sc->sc_notify_buf.data[0];
Home |
Main Index |
Thread Index |
Old Index