Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/dev/pci Pull up revision 1.59 (requested by bouyer ...



details:   https://anonhg.NetBSD.org/src/rev/f333a9e38a6d
branches:  netbsd-1-6
changeset: 531351:f333a9e38a6d
user:      tron <tron%NetBSD.org@localhost>
date:      Wed May 26 14:00:59 2004 +0000

description:
Pull up revision 1.59 (requested by bouyer in ticket #1697):
cur_rx->ti_vlan_tag holds the 802.1q VLAN tag and the 802.1p priority.
Trimm the priority, as the upper layers won't do it and will drop the packet
if priority is not 0.
While there, print the revision in the "unsupported chip revision" printf.

diffstat:

 sys/dev/pci/if_ti.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r 47b86e478ac8 -r f333a9e38a6d sys/dev/pci/if_ti.c
--- a/sys/dev/pci/if_ti.c       Thu May 20 03:44:22 2004 +0000
+++ b/sys/dev/pci/if_ti.c       Wed May 26 14:00:59 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ti.c,v 1.47.4.1 2002/07/18 04:27:26 lukem Exp $ */
+/* $NetBSD: if_ti.c,v 1.47.4.2 2004/05/26 14:00:59 tron Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.47.4.1 2002/07/18 04:27:26 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.47.4.2 2004/05/26 14:00:59 tron Exp $");
 
 #include "bpfilter.h"
 #include "opt_inet.h"
@@ -1294,6 +1294,7 @@
 {
        u_int32_t               cacheline;
        u_int32_t               pci_writemax = 0;
+       u_int32_t               rev;
 
        /* Initialize link to down state. */
        sc->ti_linkstat = TI_EV_CODE_LINK_DOWN;
@@ -1318,7 +1319,8 @@
        TI_SETBIT(sc, TI_CPU_STATE, TI_CPUSTATE_HALT);
 
        /* Figure out the hardware revision. */
-       switch(CSR_READ_4(sc, TI_MISC_HOST_CTL) & TI_MHC_CHIP_REV_MASK) {
+       rev = CSR_READ_4(sc, TI_MISC_HOST_CTL) & TI_MHC_CHIP_REV_MASK;
+       switch(rev) {
        case TI_REV_TIGON_I:
                sc->ti_hwrev = TI_HWREV_TIGON;
                break;
@@ -1326,7 +1328,8 @@
                sc->ti_hwrev = TI_HWREV_TIGON_II;
                break;
        default:
-               printf("%s: unsupported chip revision\n", sc->sc_dev.dv_xname);
+               printf("%s: unsupported chip revision 0x%x\n",
+                   sc->sc_dev.dv_xname, rev);
                return(ENODEV);
        }
 
@@ -1959,7 +1962,8 @@
 
                if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) {
                        have_tag = 1;
-                       vlan_tag = cur_rx->ti_vlan_tag;
+                       /* ti_vlan_tag also has the priority, trim it */
+                       vlan_tag = cur_rx->ti_vlan_tag & 4095;
                }
 
                if (cur_rx->ti_flags & TI_BDFLAG_JUMBO_RING) {



Home | Main Index | Thread Index | Old Index