Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb add mos(4) driver for Moschip MCS7730/MCS7830/MC...



details:   https://anonhg.NetBSD.org/src/rev/7b7d09def008
branches:  trunk
changeset: 965509:7b7d09def008
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Sep 20 10:34:54 2019 +0000

description:
add mos(4) driver for Moschip MCS7730/MCS7830/MCS7832 usb ethernet.
ported from openbsd.  usbnet version loses about 40% of code.

diffstat:

 distrib/sets/lists/man/mi     |    5 +-
 doc/CHANGES                   |    4 +-
 share/man/man4/Makefile       |    8 +-
 share/man/man4/mos.4          |  131 ++++++
 share/man/man4/usbnet.4       |    4 +-
 sys/dev/usb/files.usb         |   17 +-
 sys/dev/usb/if_mos.c          |  816 ++++++++++++++++++++++++++++++++++++++++++
 sys/dev/usb/if_mosreg.h       |  109 +++++
 sys/dev/usb/usbdevices.config |    4 +-
 9 files changed, 1083 insertions(+), 15 deletions(-)

diffs (truncated from 1222 to 300 lines):

diff -r 8acf84b92ee5 -r 7b7d09def008 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Fri Sep 20 10:04:45 2019 +0000
+++ b/distrib/sets/lists/man/mi Fri Sep 20 10:34:54 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1653 2019/09/16 08:31:05 mlelstv Exp $
+# $NetBSD: mi,v 1.1654 2019/09/20 10:34:54 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1454,6 +1454,7 @@
 ./usr/share/man/cat4/mlx.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/mly.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/module.0                  man-obsolete            obsolete
+./usr/share/man/cat4/mos.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/mpii.0                    man-sys-catman          .cat
 ./usr/share/man/cat4/mpl115a.0                 man-sys-catman          .cat
 ./usr/share/man/cat4/mpls.0                    man-sys-catman          .cat
@@ -4586,6 +4587,7 @@
 ./usr/share/man/html4/mlx.html                 man-sys-htmlman         html
 ./usr/share/man/html4/mly.html                 man-sys-htmlman         html
 ./usr/share/man/html4/module.html              man-obsolete            obsolete
+./usr/share/man/html4/mos.html                 man-sys-htmlman         html
 ./usr/share/man/html4/mpii.html                        man-sys-htmlman         html
 ./usr/share/man/html4/mpl115a.html             man-sys-htmlman         html
 ./usr/share/man/html4/mpls.html                        man-sys-htmlman         html
@@ -7568,6 +7570,7 @@
 ./usr/share/man/man4/mlx.4                     man-sys-man             .man
 ./usr/share/man/man4/mly.4                     man-sys-man             .man
 ./usr/share/man/man4/module.4                  man-obsolete            obsolete
+./usr/share/man/man4/mos.4                     man-sys-man             .man
 ./usr/share/man/man4/mpii.4                    man-sys-man             .man
 ./usr/share/man/man4/mpl115a.4                 man-sys-man             .man
 ./usr/share/man/man4/mpls.4                    man-sys-man             .man
diff -r 8acf84b92ee5 -r 7b7d09def008 doc/CHANGES
--- a/doc/CHANGES       Fri Sep 20 10:04:45 2019 +0000
+++ b/doc/CHANGES       Fri Sep 20 10:34:54 2019 +0000
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.2583 $>
+# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.2584 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -43,3 +43,5 @@
        dhcpcd(8): Import dhcpcd-8.0.6 [roy 20190913]
        kernel: Add vHCI, a driver that allows to send and receive USB
                packets from userland. [maxv 20190914]
+       mos(4): Ported driver for MosChip MCS7730/7830/7832 USB ethernet.
+               [mrg 20190814]
diff -r 8acf84b92ee5 -r 7b7d09def008 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Fri Sep 20 10:04:45 2019 +0000
+++ b/share/man/man4/Makefile   Fri Sep 20 10:34:54 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.681 2019/08/30 08:54:58 mrg Exp $
+#      $NetBSD: Makefile,v 1.682 2019/09/20 10:34:54 mrg Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -64,7 +64,8 @@
        tap.4 tc.4 tcds.4 tcp.4 tcu.4 tdvfb.4 tea5767radio.4 termios.4 tfb.4 \
        thinkpad.4 ti.4 tl.4 tlp.4 tlphy.4 tpm.4 tprof.4 tr.4 tra.4 \
        trm.4 tsllux.4 tty.4 tun.4 tqphy.4 twa.4 twe.4 txp.4 \
-       uark.4 ubsec.4 udp.4 uep.4 ug.4 uha.4 uk.4 ukphy.4 umb.4 unix.4 userconf.4 \
+       uark.4 ubsec.4 udp.4 uep.4 ug.4 uha.4 uk.4 ukphy.4 umb.4 \
+       unix.4 userconf.4 \
        vald.4 valz.4 veriexec.4 vga.4 vge.4 viaide.4 video.4 vioif.4 viomb.4 \
        viornd.4 vioscsi.4 virt.4 \
        virtio.4 vlan.4 vmmon.4 vmnet.4 vnd.4 voodoofb.4 vr.4 vte.4 \
@@ -75,7 +76,8 @@
        zero.4 zstty.4 zyd.4
 
 # USB devices
-MAN+=  atu.4 aubtfwl.4 aue.4 axe.4 axen.4 cdce.4 cue.4 ehci.4 kue.4 mue.4 \
+MAN+=  atu.4 aubtfwl.4 aue.4 axe.4 axen.4 cdce.4 cue.4 ehci.4 kue.4 \
+       mos.4 mue.4 \
        ohci.4 \
        slhci.4 stuirda.4 u3g.4 ualea.4 uatp.4 uaudio.4 uberry.4 ubsa.4 ubt.4 \
        uchcom.4 \
diff -r 8acf84b92ee5 -r 7b7d09def008 share/man/man4/mos.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/mos.4      Fri Sep 20 10:34:54 2019 +0000
@@ -0,0 +1,131 @@
+.\"    $NetBSD: mos.4,v 1.1 2019/09/20 10:34:54 mrg Exp $
+.\"
+.\" Copyright (c) 1997, 1998, 1999, 2000-2003
+.\"    Bill Paul <wpaul%windriver.com@localhost>. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by Bill Paul.
+.\" 4. Neither the name of the author nor the names of any co-contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"   without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+.\" THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD: /repoman/r/ncvs/src/share/man/man4/axe.4,v 1.3 2003/05/29 21:28:35 ru Exp $
+.\" $OpenBSD: mos.4,v 1.11 2014/04/08 01:18:19 brad Exp $
+.\"
+.Dd August 24 2019
+.Dt MOS 4
+.Os
+.Sh NAME
+.Nm mos
+.Nd MosChip MCS7730/7830/7832 10/100 USB Ethernet device
+.Sh SYNOPSIS
+.Cd "mos*   at uhub?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for USB Ethernet adapters based on the MosChip
+MCS7730, MCS7830 and MCS7832 USB 2.0 chipsets, including the
+following:
+.Pp
+.Bl -tag -width Ds -offset indent -compact
+.It Delock 61147
+.It Sitecom LN-030
+.It Syba SY-U2LAN
+.El
+.Pp
+All adapters operate with either USB 1.x, 2.0, or 3.x controllers,
+though performance with 1.x controllers is limited since
+the USB 1.x standard specifies a maximum transfer speed of 12Mbps.
+Users with USB 1.x controllers should therefore not expect to actually
+achieve 100Mbps speeds with these devices.
+.Pp
+A 64-bit multicast hash table is supported,
+single perfect filter entry for the station address,
+all-multicast mode, and promiscuous mode.
+Packets are
+received and transmitted over separate USB bulk transfer endpoints.
+.Pp
+The
+.Nm
+driver supports the following media types:
+.Bl -tag -width "autoselect"
+.It autoselect
+Enable autoselection of the media type and options (this is the default).
+The user can manually override the autoselected mode by adding media
+options to the appropriate
+.Xr ifconfig.if 5
+file.
+.It 10baseT
+Set 10Mbps operation.
+.It 100baseTX
+Set 100Mbps (Fast Ethernet) operation.
+.El
+.Pp
+The
+.Nm
+driver supports the following media options:
+.Bl -tag -width "full-duplex"
+.It full-duplex
+Force full-duplex operation.
+.It half-duplex
+Force half-duplex operation.
+.El
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh DIAGNOSTICS
+See
+.Xr usbnet 4
+for diagnostics.
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr ifmedia 4 ,
+.Xr intro 4 ,
+.Xr netintro 4 ,
+.Xr usb 4 ,
+.Xr usbnet 4 ,
+.Xr ifconfig.if 5 ,
+.Xr ifconfig 8 ,
+.Xr usbnet 9
+.Rs
+.%T "MosChip India"
+.%U http://www.moschip.com
+.Re
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Ox 4.5 .
+It was ported to
+.Nx
+by
+.An Matthew R. Green Aq Mt mrg%eterna.com.au@localhost
+and first appeared in
+.Nx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Johann Christian Rode Aq Mt jcrode%gmx.net@localhost .
diff -r 8acf84b92ee5 -r 7b7d09def008 share/man/man4/usbnet.4
--- a/share/man/man4/usbnet.4   Fri Sep 20 10:04:45 2019 +0000
+++ b/share/man/man4/usbnet.4   Fri Sep 20 10:34:54 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: usbnet.4,v 1.3 2019/08/30 09:24:19 wiz Exp $
+.\"    $NetBSD: usbnet.4,v 1.4 2019/09/20 10:34:54 mrg Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -81,7 +81,7 @@
 .Xr ifmedia 4 ,
 .Xr intro 4 ,
 .Xr kue 4 ,
-.\" Xr mos 4 ,
+.Xr mos 4 ,
 .Xr mue 4 ,
 .Xr netintro 4 ,
 .Xr smsc 4 ,
diff -r 8acf84b92ee5 -r 7b7d09def008 sys/dev/usb/files.usb
--- a/sys/dev/usb/files.usb     Fri Sep 20 10:04:45 2019 +0000
+++ b/sys/dev/usb/files.usb     Fri Sep 20 10:34:54 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.usb,v 1.167 2019/08/23 08:45:25 mrg Exp $
+#      $NetBSD: files.usb,v 1.168 2019/09/20 10:34:54 mrg Exp $
 #
 # Config file and device description for machine-independent USB code.
 # Included by ports that need it.  Ports that use it must provide
@@ -373,21 +373,26 @@
 attach axen at usbdevif
 file   dev/usb/if_axen.c               axen
 
+# Moscom MCS7730, MCS7830, and MCS7832
+device mos: arp, ether, ifnet, mii, mii_phy, usbnet
+attach mos at usbdevif
+file   dev/usb/if_mos.c                mos
+
 # Microchip LAN750x and LAN85xx
 device mue: arp, ether, ifnet, mii, mii_phy, usbnet
 attach mue at usbdevif
 file   dev/usb/if_mue.c                mue
 
+# Atheros AR9170
+device otus: arp, ether, firmload, ifnet, wlan
+attach otus at usbdevif
+file   dev/usb/if_otus.c               otus
+
 # DAVICOM DM9601
 device udav: arp, ether, ifnet, mii, mii_phy, usbnet
 attach udav at usbdevif
 file   dev/usb/if_udav.c               udav
 
-# Atheros AR9170
-device otus: arp, ether, firmload, ifnet, wlan
-attach otus at usbdevif
-file   dev/usb/if_otus.c               otus
-
 # Mobile Broadband Interface Model
 device umb: ifnet
 attach umb at usbifif
diff -r 8acf84b92ee5 -r 7b7d09def008 sys/dev/usb/if_mos.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/usb/if_mos.c      Fri Sep 20 10:34:54 2019 +0000
@@ -0,0 +1,816 @@
+/*     $NetBSD: if_mos.c,v 1.1 2019/09/20 10:34:54 mrg Exp $   */
+/*     $OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $       */
+
+/*
+ * Copyright (c) 2008 Johann Christian Rode <jcrode%gmx.net@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.
+ */
+
+/*
+ * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg%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.



Home | Main Index | Thread Index | Old Index