Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev/pci Pull up following revision(s) (requested by r...



details:   https://anonhg.NetBSD.org/src/rev/0c70e48f88fb
branches:  netbsd-3
changeset: 577554:0c70e48f88fb
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Nov 24 22:19:11 2005 +0000

description:
Pull up following revision(s) (requested by riz in ticket #993):
        sys/dev/pci/if_sk.c: revision 1.18
        sys/dev/pci/if_re_pci.c: revision 1.11
Special-case the Linksys EG1032 cards using PCI subsystem ID;  rev. 2 uses
the sk(4) driver, while rev. 3 needs re(4).
Mostly from brad@openbsd.

diffstat:

 sys/dev/pci/if_re_pci.c |  15 ++++++++++++++-
 sys/dev/pci/if_sk.c     |  14 ++++++++++++--
 2 files changed, 26 insertions(+), 3 deletions(-)

diffs (85 lines):

diff -r 2e79d961f7cc -r 0c70e48f88fb sys/dev/pci/if_re_pci.c
--- a/sys/dev/pci/if_re_pci.c   Thu Nov 24 22:16:48 2005 +0000
+++ b/sys/dev/pci/if_re_pci.c   Thu Nov 24 22:19:11 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_re_pci.c,v 1.8.2.2 2005/11/24 22:06:38 tron Exp $   */
+/*     $NetBSD: if_re_pci.c,v 1.8.2.3 2005/11/24 22:19:11 tron Exp $   */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -114,6 +114,8 @@
                "D-Link DGE-528T Gigabit Ethernet" },
        { PCI_VENDOR_USR2, PCI_PRODUCT_USR2_USR997902, RTK_HWREV_8169S,
                "US Robotics (3Com) USR997902 Gigabit Ethernet" },
+       { PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1032, RTK_HWREV_8169S,
+               "Linksys EG1032 rev. 3 Gigabit Ethernet" },
        { 0, 0, 0, NULL }
 };
 
@@ -134,6 +136,8 @@
        { 0, 0, NULL }
 };
 
+#define RE_LINKSYS_EG1032_SUBID        0x00241737
+
 CFATTACH_DECL(re_pci, sizeof(struct re_pci_softc), re_pci_probe, re_pci_attach,
              NULL, NULL);
 
@@ -150,6 +154,15 @@
        bus_space_handle_t      rtk_bhandle;
        bus_size_t              bsize;
        u_int32_t               hwrev;
+       pcireg_t subid;
+
+       subid = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+
+       /* special-case Linksys EG1032, since rev 2 uses sk(4) */
+       if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_LINKSYS &&
+           PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LINKSYS_EG1032 &&
+           subid == RE_LINKSYS_EG1032_SUBID)
+               return 1;
 
        t = re_devs;
 
diff -r 2e79d961f7cc -r 0c70e48f88fb sys/dev/pci/if_sk.c
--- a/sys/dev/pci/if_sk.c       Thu Nov 24 22:16:48 2005 +0000
+++ b/sys/dev/pci/if_sk.c       Thu Nov 24 22:19:11 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sk.c,v 1.14.2.2 2005/11/21 20:48:40 tron Exp $      */
+/*     $NetBSD: if_sk.c,v 1.14.2.3 2005/11/24 22:19:11 tron Exp $      */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -250,7 +250,6 @@
 } sk_products[] = {
        { PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C940, },
        { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE530T, },
-       { PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1032, },
        { PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1064, },
        { PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SKNET_GE, },
        { PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SK9821v2, },
@@ -259,6 +258,8 @@
        { 0, 0, }
 };
 
+#define SK_LINKSYS_EG1032_SUBID        0x00151737
+
 static inline u_int32_t
 sk_win_read_4(struct sk_softc *sc, u_int32_t reg)
 {
@@ -974,6 +975,15 @@
 {
        struct pci_attach_args *pa = (struct pci_attach_args *)aux;
        const struct sk_product *psk;
+       pcireg_t subid;
+
+       subid = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+
+       /* special-case Linksys EG1032, since rev 3 uses re(4) */
+       if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_LINKSYS &&
+           PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LINKSYS_EG1032 &&
+           subid == SK_LINKSYS_EG1032_SUBID)
+               return(1);
 
        if ((psk = sk_lookup(pa))) {
                return(1);



Home | Main Index | Thread Index | Old Index