Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb PR/47245: Toby Karyadi: Add AX88772B support to ...
details: https://anonhg.NetBSD.org/src/rev/d8911ae48e96
branches: trunk
changeset: 782900:d8911ae48e96
user: christos <christos%NetBSD.org@localhost>
date: Sun Nov 25 22:22:39 2012 +0000
description:
PR/47245: Toby Karyadi: Add AX88772B support to axe(4), e.g. for DLINK
DUB-E100 C1
diffstat:
sys/dev/usb/if_axe.c | 15 ++++++++++-----
sys/dev/usb/if_axereg.h | 9 ++++++++-
2 files changed, 18 insertions(+), 6 deletions(-)
diffs (84 lines):
diff -r ccc0ed2b6c94 -r d8911ae48e96 sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c Sun Nov 25 21:55:50 2012 +0000
+++ b/sys/dev/usb/if_axe.c Sun Nov 25 22:22:39 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axe.c,v 1.57 2012/08/24 09:01:23 msaitoh Exp $ */
+/* $NetBSD: if_axe.c,v 1.58 2012/11/25 22:22:39 christos Exp $ */
/* $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */
/*
@@ -89,7 +89,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.57 2012/08/24 09:01:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.58 2012/11/25 22:22:39 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -145,6 +145,7 @@
{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88172}, 0 },
{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88772}, AX772 },
{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88772A}, AX772 },
+ { { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88772B}, AX772 | AX772B },
{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88178}, AX178 },
{ { USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC210T}, 0 },
{ { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D5055 }, AX178 },
@@ -918,12 +919,14 @@
total_len -= sizeof(hdr);
buf += sizeof(hdr);
- if ((hdr.len ^ hdr.ilen) != 0xffff) {
+ if (((le16toh(hdr.len) & AXE_RH1M_RXLEN_MASK) ^
+ (le16toh(hdr.ilen) & AXE_RH1M_RXLEN_MASK)) !=
+ AXE_RH1M_RXLEN_MASK) {
ifp->if_ierrors++;
goto done;
}
- rxlen = le16toh(hdr.len);
+ rxlen = le16toh(hdr.len & AXE_RH1M_RXLEN_MASK);
if (total_len < rxlen) {
pktlen = total_len;
total_len = 0;
@@ -1241,7 +1244,9 @@
/* Enable receiver, set RX mode */
rxmode = AXE_RXCMD_BROADCAST | AXE_RXCMD_MULTICAST | AXE_RXCMD_ENABLE;
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772) {
+ if (sc->axe_flags & AX772B)
+ rxmode |= AXE_772B_RXCMD_RH1M;
+ else if (sc->axe_flags & AX178 || sc->axe_flags & AX772) {
if (sc->axe_udev->speed == USB_SPEED_HIGH) {
/* Largest possible USB buffer size for AX88178 */
rxmode |= AXE_178_RXCMD_MFB;
diff -r ccc0ed2b6c94 -r d8911ae48e96 sys/dev/usb/if_axereg.h
--- a/sys/dev/usb/if_axereg.h Sun Nov 25 21:55:50 2012 +0000
+++ b/sys/dev/usb/if_axereg.h Sun Nov 25 22:22:39 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axereg.h,v 1.14 2012/02/02 19:43:07 tls Exp $ */
+/* $NetBSD: if_axereg.h,v 1.15 2012/11/25 22:22:39 christos Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -134,6 +134,12 @@
#define AXE_NOPHY 0xE0
#define AXE_INTPHY 0x10
+#define AXE_772B_RXCMD_RH1M 0x0100
+#define AXE_772B_RXCMD_RH2M 0x0200
+#define AXE_772B_RXCMD_RH3M 0x0400
+
+#define AXE_RH1M_RXLEN_MASK 0x07ff
+
#define AXE_TIMEOUT 1000
#define AXE_172_BUFSZ 1536
@@ -167,6 +173,7 @@
uint16_t axe_flags;
#define AX178 0x0001 /* AX88178 */
#define AX772 0x0002 /* AX88772 */
+#define AX772B 0x0004 /* AX88772B */
#define AXE_ANY_PHY 0x1000 /* Chip lies about valid phys */
#define AXE_MII 0x2000 /* Chip-specific MII handling */
};
Home |
Main Index |
Thread Index |
Old Index