Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Apply PR kern/49659 patch from Takahiro HAYASHI.



details:   https://anonhg.NetBSD.org/src/rev/68a16c59f071
branches:  trunk
changeset: 806243:68a16c59f071
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Thu Feb 12 13:07:37 2015 +0000

description:
Apply PR kern/49659 patch from Takahiro HAYASHI.

diffstat:

 sys/dev/usb/if_axen.c |  22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r 07ec32a036f3 -r 68a16c59f071 sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c     Thu Feb 12 10:59:44 2015 +0000
+++ b/sys/dev/usb/if_axen.c     Thu Feb 12 13:07:37 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axen.c,v 1.3 2014/08/10 16:44:36 tls Exp $  */
+/*     $NetBSD: if_axen.c,v 1.4 2015/02/12 13:07:37 nonaka Exp $       */
 /*     $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.3 2014/08/10 16:44:36 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.4 2015/02/12 13:07:37 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -688,10 +688,18 @@
 
        id = usbd_get_interface_descriptor(sc->axen_iface);
 
-       /* XXX fix when USB3.0 HC is supported */
        /* decide on what our bufsize will be */
-       sc->axen_bufsz = (sc->axen_udev->speed == USB_SPEED_HIGH) ?
-           AXEN_BUFSZ_HS * 1024 : AXEN_BUFSZ_LS * 1024;
+       switch (sc->axen_udev->speed) {
+       case USB_SPEED_SUPER:
+               sc->axen_bufsz = AXEN_BUFSZ_SS * 1024;
+               break;
+       case USB_SPEED_HIGH:
+               sc->axen_bufsz = AXEN_BUFSZ_HS * 1024;
+               break;
+       default:
+               sc->axen_bufsz = AXEN_BUFSZ_LS * 1024;
+               break;
+       }
 
        /* Find endpoints. */
        for (i = 0; i < id->bNumEndpoints; i++) {
@@ -1071,7 +1079,7 @@
                /* skip pseudo header (2byte) */
                ifp->if_ipackets++;
                m->m_pkthdr.rcvif = ifp;
-               m->m_pkthdr.len = m->m_len = pkt_len - 2;
+               m->m_pkthdr.len = m->m_len = pkt_len - 6;
 
 #ifdef AXEN_TOE
                /* cheksum err */
@@ -1094,7 +1102,7 @@
                }
 #endif
 
-               memcpy(mtod(m, char *), buf + 2, pkt_len - 2);
+               memcpy(mtod(m, char *), buf + 2, pkt_len - 6);
 
                /* push the packet up */
                s = splnet();



Home | Main Index | Thread Index | Old Index