Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Patch from HITOSHI Osada:



details:   https://anonhg.NetBSD.org/src/rev/1a43d7f46a2a
branches:  trunk
changeset: 566645:1a43d7f46a2a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat May 15 22:24:51 2004 +0000

description:
Patch from HITOSHI Osada:
* SiS900 chips require the address of the PAUSE packet to be registered
  in the multicast filter.

diffstat:

 sys/dev/pci/if_sip.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 9389b938a827 -r 1a43d7f46a2a sys/dev/pci/if_sip.c
--- a/sys/dev/pci/if_sip.c      Sat May 15 22:19:27 2004 +0000
+++ b/sys/dev/pci/if_sip.c      Sat May 15 22:24:51 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sip.c,v 1.91 2004/05/09 03:03:55 fair Exp $ */
+/*     $NetBSD: if_sip.c,v 1.92 2004/05/15 22:24:51 thorpej Exp $      */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.91 2004/05/09 03:03:55 fair Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.92 2004/05/15 22:24:51 thorpej Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -2779,6 +2779,25 @@
 
        memset(mchash, 0, sizeof(mchash));
 
+       /*
+        * SiS900 (at least SiS963) requires us to register the address of
+        * the PAUSE packet (01:80:c2:00:00:01) into the address filter.
+        */
+       crc = 0x0ed423f9;
+
+       if (SIP_SIS900_REV(sc, SIS_REV_635) ||
+           SIP_SIS900_REV(sc, SIS_REV_960) ||
+           SIP_SIS900_REV(sc, SIS_REV_900B)) {
+               /* Just want the 8 most significant bits. */
+               crc >>= 24;
+       } else {
+               /* Just want the 7 most significant bits. */
+               crc >>= 25;
+       }
+
+       /* Set the corresponding bit in the hash table. */
+       mchash[crc >> 4] |= 1 << (crc & 0xf);
+
        ETHER_FIRST_MULTI(step, ec, enm);
        while (enm != NULL) {
                if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {



Home | Main Index | Thread Index | Old Index