Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2]: src/sys/dev/pci Pull up following revision(s) (requested by r...
details: https://anonhg.NetBSD.org/src/rev/cde3094b4cdc
branches: netbsd-2
changeset: 564354:cde3094b4cdc
user: tron <tron%NetBSD.org@localhost>
date: Thu Dec 01 22:13:55 2005 +0000
description:
Pull up following revision(s) (requested by riz in ticket #10156):
sys/dev/pci/if_sk.c: revision 1.18 via patch
sys/dev/pci/if_re.c: patch
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.c | 15 ++++++++++++++-
sys/dev/pci/if_sk.c | 14 ++++++++++++--
2 files changed, 26 insertions(+), 3 deletions(-)
diffs (85 lines):
diff -r 695660557922 -r cde3094b4cdc sys/dev/pci/if_re.c
--- a/sys/dev/pci/if_re.c Thu Dec 01 22:08:29 2005 +0000
+++ b/sys/dev/pci/if_re.c Thu Dec 01 22:13:55 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_re.c,v 1.4.2.5 2004/06/21 17:20:08 tron Exp $ */
+/* $NetBSD: if_re.c,v 1.4.2.5.2.1 2005/12/01 22:13:55 tron Exp $ */
/*
* Copyright (c) 1997, 1998-2003
* Bill Paul <wpaul%windriver.com@localhost>. All rights reserved.
@@ -170,6 +170,8 @@
"RealTek 8169S Single-chip Gigabit Ethernet" },
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169, RTK_HWREV_8110S,
"RealTek 8110S Single-chip Gigabit Ethernet" },
+ { PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1032, RTK_HWREV_8169S,
+ "Linksys EG1032 rev. 3 Gigabit Ethernet" },
{ 0, 0, 0, NULL }
};
@@ -190,6 +192,8 @@
{ 0, 0, NULL }
};
+#define RE_LINKSYS_EG1032_SUBID 0x00241737
+
int re_probe(struct device *, struct cfdata *, void *);
void re_attach(struct device *, struct device *, void *);
#if 0
@@ -621,6 +625,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 695660557922 -r cde3094b4cdc sys/dev/pci/if_sk.c
--- a/sys/dev/pci/if_sk.c Thu Dec 01 22:08:29 2005 +0000
+++ b/sys/dev/pci/if_sk.c Thu Dec 01 22:13:55 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sk.c,v 1.7.2.3.2.5 2005/12/01 22:08:29 tron Exp $ */
+/* $NetBSD: if_sk.c,v 1.7.2.3.2.6 2005/12/01 22:13:55 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