Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci From OpenBSD:



details:   https://anonhg.NetBSD.org/src/rev/0d89d06ea493
branches:  trunk
changeset: 464731:0d89d06ea493
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Oct 18 23:08:29 2019 +0000

description:
>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.

diffstat:

 sys/dev/pci/if_bce.c    |  15 +++++++++++----
 sys/dev/pci/if_bcereg.h |   7 +++++--
 2 files changed, 16 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r 187983de7205 -r 0d89d06ea493 sys/dev/pci/if_bce.c
--- a/sys/dev/pci/if_bce.c      Fri Oct 18 23:06:57 2019 +0000
+++ b/sys/dev/pci/if_bce.c      Fri Oct 18 23:08:29 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.55 2019/10/18 23:06:57 msaitoh Exp $   */
+/* $NetBSD: if_bce.c,v 1.56 2019/10/18 23:08:29 msaitoh Exp $   */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.55 2019/10/18 23:06:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.56 2019/10/18 23:08:29 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -421,6 +421,8 @@
        ifp->if_stop = bce_stop;
        IFQ_SET_READY(&ifp->if_snd);
 
+       sc->ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
+
        /* Initialize our media structures and probe the MII. */
 
        mii->mii_ifp = ifp;
@@ -918,10 +920,15 @@
        sc->bce_txsnext = 0;
        sc->bce_txin = 0;
 
-       /* enable crc32 generation */
+       /* enable crc32 generation and set proper LED modes */
        bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
            bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) |
-           BCE_EMC_CG);
+           BCE_EMC_CRC32_ENAB | BCE_EMC_LED);
+
+       /* reset or clear powerdown control bit  */
+       bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
+           bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) &
+           ~BCE_EMC_PDOWN);
 
        /* setup DMA interrupt control */
        bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_DMAI_CTL, 1 << 24);        /* MAGIC */
diff -r 187983de7205 -r 0d89d06ea493 sys/dev/pci/if_bcereg.h
--- a/sys/dev/pci/if_bcereg.h   Fri Oct 18 23:06:57 2019 +0000
+++ b/sys/dev/pci/if_bcereg.h   Fri Oct 18 23:08:29 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bcereg.h,v 1.4 2005/12/11 12:22:49 christos Exp $        */
+/* $NetBSD: if_bcereg.h,v 1.5 2019/10/18 23:08:29 msaitoh Exp $         */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -71,7 +71,10 @@
 /* Ethernet MAC Control */
 #define BCE_MACCTL                     0x00A8  /* ethernet mac control */
 /* mac control bits */
-#define BCE_EMC_CG                     0x00000001      /* crc32 generation */
+#define BCE_EMC_CRC32_ENAB             0x00000001      /* crc32 generation */
+#define BCE_EMC_PDOWN                  0x00000004      /* PHY powerdown */
+#define BCE_EMC_EDET                   0x00000008      /* PHY energy detect */
+#define BCE_EMC_LED                    0x000000e0      /* PHY LED control */
 
 /* DMA Interrupt control */
 #define BCE_DMAI_CTL                   0x0100



Home | Main Index | Thread Index | Old Index