Source-Changes-HG archive

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

[src/trunk]: src Add support for Killer E2400 and E2500.



details:   https://anonhg.NetBSD.org/src/rev/2b1e54aa2351
branches:  trunk
changeset: 1004213:2b1e54aa2351
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Oct 17 09:13:48 2019 +0000

description:
Add support for Killer E2400 and E2500.

diffstat:

 share/man/man4/alc.4    |   9 +++++----
 sys/dev/pci/if_alc.c    |  22 +++++++++++++++++++---
 sys/dev/pci/if_alcreg.h |   5 +++--
 3 files changed, 27 insertions(+), 9 deletions(-)

diffs (116 lines):

diff -r fcf99d330082 -r 2b1e54aa2351 share/man/man4/alc.4
--- a/share/man/man4/alc.4      Thu Oct 17 09:12:12 2019 +0000
+++ b/share/man/man4/alc.4      Thu Oct 17 09:13:48 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: alc.4,v 1.5 2015/01/19 11:53:59 wiz Exp $
+.\"    $NetBSD: alc.4,v 1.6 2019/10/17 09:13:48 msaitoh Exp $
 .\"
 .\" Copyright (c) 2009 Kevin Lo <kevlo%openbsd.org@localhost>
 .\"
@@ -14,12 +14,12 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd January 18, 2015
+.Dd October 16, 2019
 .Dt ALC 4
 .Os
 .Sh NAME
 .Nm alc
-.Nd Atheros AR813x/AR815x/AR816x/AR817x Ethernet device
+.Nd Atheros AR813x/AR815x/AR816x/AR817x Killer E2200/2400/2500 Ethernet device
 .Sh SYNOPSIS
 .Cd "alc* at pci?"
 .Cd "atphy* at mii?"
@@ -27,7 +27,8 @@
 The
 .Nm
 driver provides support for Ethernet interfaces based on the
-Atheros AR813x/AR815x/AR816x/AR817x Gigabit/Fast Ethernet chipsets.
+Atheros AR813x/AR815x/AR816x/AR817x Gigabit/Fast Ethernet chipsets and
+Killer E2200/2400/2500 Ethernet chipsets.
 .Pp
 The following
 .Ar media
diff -r fcf99d330082 -r 2b1e54aa2351 sys/dev/pci/if_alc.c
--- a/sys/dev/pci/if_alc.c      Thu Oct 17 09:12:12 2019 +0000
+++ b/sys/dev/pci/if_alc.c      Thu Oct 17 09:13:48 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_alc.c,v 1.41 2019/10/17 09:12:12 msaitoh Exp $      */
+/*     $NetBSD: if_alc.c,v 1.42 2019/10/17 09:13:48 msaitoh Exp $      */
 /*     $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $        */
 /*-
  * Copyright (c) 2009, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -101,6 +101,10 @@
                "Atheros AR8172 PCIe Fast Ethernet" },
        { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2200, 9 * 1024,
                "Killer E2200 Gigabit Ethernet" },
+       { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2400, 9 * 1024,
+               "Killer E2400 Gigabit Ethernet" },
+       { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2500, 9 * 1024,
+               "Killer E2500 Gigabit Ethernet" },
        { 0, 0, 0, NULL },
 };
 
@@ -1002,6 +1006,8 @@
        switch (sc->alc_ident->deviceid) {
        case PCI_PRODUCT_ATTANSIC_AR8161:
        case PCI_PRODUCT_ATTANSIC_E2200:
+       case PCI_PRODUCT_ATTANSIC_E2400:
+       case PCI_PRODUCT_ATTANSIC_E2500:
        case PCI_PRODUCT_ATTANSIC_AR8162:
        case PCI_PRODUCT_ATTANSIC_AR8171:
        case PCI_PRODUCT_ATTANSIC_AR8172:
@@ -1342,7 +1348,13 @@
                        sc->alc_dma_rd_burst = 3;
                if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024)
                        sc->alc_dma_wr_burst = 3;
-
+               /*
+                * Force maximum payload size to 128 bytes for
+                * E2200/E2400/E2500.
+                * Otherwise it triggers DMA write error.
+                */
+               if ((sc->alc_flags & ALC_FLAG_E2X00) != 0)
+                       sc->alc_dma_wr_burst = 0;
                alc_init_pcie(sc);
        }
 
@@ -1361,13 +1373,17 @@
         * shows the same PHY model/revision number of AR8131.
         */
        switch (sc->alc_ident->deviceid) {
+       case PCI_PRODUCT_ATTANSIC_E2200:
+       case PCI_PRODUCT_ATTANSIC_E2400:
+       case PCI_PRODUCT_ATTANSIC_E2500:
+               sc->alc_flags |= ALC_FLAG_E2X00;
+               /* FALLTHROUGH */
        case PCI_PRODUCT_ATTANSIC_AR8161:
                if (PCI_SUBSYS_ID(pci_conf_read(
                   sc->sc_pct, sc->sc_pcitag, PCI_SUBSYS_ID_REG)) == 0x0091 &&
                   sc->alc_rev == 0)
                        sc->alc_flags |= ALC_FLAG_LINK_WAR;
                /* FALLTHROUGH */
-       case PCI_PRODUCT_ATTANSIC_E2200:
        case PCI_PRODUCT_ATTANSIC_AR8171:
                sc->alc_flags |= ALC_FLAG_AR816X_FAMILY;
                break;
diff -r fcf99d330082 -r 2b1e54aa2351 sys/dev/pci/if_alcreg.h
--- a/sys/dev/pci/if_alcreg.h   Thu Oct 17 09:12:12 2019 +0000
+++ b/sys/dev/pci/if_alcreg.h   Thu Oct 17 09:13:48 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_alcreg.h,v 1.7 2019/09/03 14:29:26 msaitoh Exp $    */
+/*     $NetBSD: if_alcreg.h,v 1.8 2019/10/17 09:13:48 msaitoh Exp $    */
 /*     $OpenBSD: if_alcreg.h,v 1.1 2009/08/08 09:31:13 kevlo Exp $     */
 /*-
  * Copyright (c) 2009, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -1475,7 +1475,8 @@
 #define        ALC_FLAG_APS            0x1000
 #define        ALC_FLAG_AR816X_FAMILY  0x2000
 #define        ALC_FLAG_LINK_WAR       0x4000
-#define        ALC_FLAG_LINK           0x8000
+#define        ALC_FLAG_E2X00          0x8000
+#define        ALC_FLAG_LINK           0x10000
 
        callout_t               sc_tick_ch;
        struct alc_hw_stats     alc_stats;



Home | Main Index | Thread Index | Old Index