Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/next68k Don't blindly receive all multicast packets...



details:   https://anonhg.NetBSD.org/src/rev/be53ffeb624d
branches:  trunk
changeset: 536217:be53ffeb624d
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Sep 11 13:15:58 2002 +0000

description:
Don't blindly receive all multicast packets just because we're on a turbo.
Pay lip service to making promiscuous mode work.

diffstat:

 sys/arch/next68k/dev/mb8795.c    |  26 ++++++++++++--------------
 sys/arch/next68k/stand/boot/en.c |  16 +++++++---------
 2 files changed, 19 insertions(+), 23 deletions(-)

diffs (93 lines):

diff -r 98ba89bab4c8 -r be53ffeb624d sys/arch/next68k/dev/mb8795.c
--- a/sys/arch/next68k/dev/mb8795.c     Wed Sep 11 11:08:45 2002 +0000
+++ b/sys/arch/next68k/dev/mb8795.c     Wed Sep 11 13:15:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mb8795.c,v 1.29 2002/09/11 07:17:33 mycroft Exp $      */
+/*     $NetBSD: mb8795.c,v 1.30 2002/09/11 13:15:58 mycroft Exp $      */
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -552,24 +552,24 @@
        if (ifp->if_flags & IFF_UP) {
                int rxmode;
 
-               s = spldma ();
-               if ((ifp->if_flags & IFF_RUNNING) == 0) {
+               s = spldma();
+               if ((ifp->if_flags & IFF_RUNNING) == 0)
                        mb8795_reset(sc);
-               }
-               if (ifp->if_flags & IFF_PROMISC) {
+
+               if (ifp->if_flags & IFF_PROMISC)
                        rxmode = MB8795_RXMODE_PROMISCUOUS;
-                       panic ("promisc");
-               } else {
-                       /* XXX add support for multicast */
-                       rxmode = turbo ? MB8795_RXMODE_TEST | MB8795_RXMODE_MULTICAST : MB8795_RXMODE_NORMAL;
-               }
+               else
+                       rxmode = MB8795_RXMODE_NORMAL;
+               /* XXX add support for multicast */
+               if (turbo)
+                       rxmode |= MB8795_RXMODE_TEST;
                
-               if ((ifp->if_flags & IFF_RUNNING) == 0) {
-                       /* switching mode probably borken now with turbo */
+               /* switching mode probably borken now with turbo */
                MB_WRITE_REG(sc, MB8795_TXMODE,
                             turbo ? MB8795_TXMODE_TURBO1 : MB8795_TXMODE_LB_DISABLE);
                MB_WRITE_REG(sc, MB8795_RXMODE, rxmode);
                
+               if ((ifp->if_flags & IFF_RUNNING) == 0) {
                        MBDMA_RX_SETUP(sc);
                        MBDMA_TX_SETUP(sc);
 
@@ -578,8 +578,6 @@
                        ifp->if_timer = 0;
                        
                        MBDMA_RX_GO(sc);
-                       if (turbo)
-                               MB_WRITE_REG(sc, MB8795_RXMODE, rxmode | MB8795_RXMODE_MULTICAST);
                }
                splx(s);
 #if 0
diff -r 98ba89bab4c8 -r be53ffeb624d sys/arch/next68k/stand/boot/en.c
--- a/sys/arch/next68k/stand/boot/en.c  Wed Sep 11 11:08:45 2002 +0000
+++ b/sys/arch/next68k/stand/boot/en.c  Wed Sep 11 13:15:58 2002 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: en.c,v 1.7 2002/09/11 06:32:07 mycroft Exp $        */
+/*      $NetBSD: en.c,v 1.8 2002/09/11 13:15:59 mycroft Exp $        */
 /*
  * Copyright (c) 1996 Rolf Grossmann
  * All rights reserved.
@@ -154,11 +154,10 @@
 
        er->rxmask = 0;
        er->rxstat = 0xff;
-       if (turbo) {
-               er->rxmode = EN_RMD_TEST;
-       } else {
+       if (turbo)
+               er->rxmode = EN_RMD_TEST | EN_RMD_RECV_NORMAL;
+       else
                er->rxmode = EN_RMD_RECV_NORMAL;
-       }
        for (i=0; i<6; i++)
          er->addr[i] = desc->myea[i] = MON(char *,MG_clientetheraddr)[i];
           
@@ -321,11 +320,10 @@
        rxdma->dd_start = 0;
        rxdma->dd_stop = 0;
        rxdma->dd_csr = DMACSR_SETENABLE | DMACSR_READ;
-       if (turbo) {
-               er->rxmode = EN_RMD_TEST | EN_RMD_RECV_MULTI;
-       } else {
+       if (turbo)
+               er->rxmode = EN_RMD_TEST | EN_RMD_RECV_NORMAL;
+       else
                er->rxmode = EN_RMD_RECV_NORMAL;
-       }
 
 #if 01
        DPRINTF(("en_get: blocking on rcv dma\n"));



Home | Main Index | Thread Index | Old Index