summaryrefslogtreecommitdiffstats
path: root/sys/dev/sk
diff options
context:
space:
mode:
authormckay <mckay@FreeBSD.org>2004-03-31 12:35:51 +0000
committermckay <mckay@FreeBSD.org>2004-03-31 12:35:51 +0000
commit75184952d3500e61c2a9c6e39a4b4c9b84aec7d5 (patch)
tree50e4204f3f0b491727646e9bd239486ed248a812 /sys/dev/sk
parenta362cdba471378b35f143e33a5a6b0b2625f7c80 (diff)
downloadFreeBSD-src-75184952d3500e61c2a9c6e39a4b4c9b84aec7d5.zip
FreeBSD-src-75184952d3500e61c2a9c6e39a4b4c9b84aec7d5.tar.gz
Support the D-Link DGE-530T. Mine appears to have a blank eeprom, so assume
they all do and handle that without alarming the user. Also pull in a bit of defensive code from OpenBSD that triggers when a card is recognised but not properly classified as either Genesis or Yukon. Not that I could ever have needed this. :-) Obtained from: OpenBSD/NetBSD (partially) MFC after: 2 weeks
Diffstat (limited to 'sys/dev/sk')
-rw-r--r--sys/dev/sk/if_sk.c19
-rw-r--r--sys/dev/sk/if_skreg.h10
2 files changed, 28 insertions, 1 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index b4ce2d8..91b09eb 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -164,6 +164,11 @@ static struct sk_type sk_devs[] = {
DEVICEID_LINKSYS_EG1032,
"Linksys EG1032 Gigabit Ethernet"
},
+ {
+ VENDORID_DLINK,
+ DEVICEID_DLINK_DGE530T,
+ "D-Link DGE-530T Gigabit Ethernet"
+ },
{ 0, 0, NULL }
};
@@ -465,6 +470,12 @@ sk_vpd_read(sc)
sk_vpd_read_res(sc, &res, pos);
+ /*
+ * Bail out quietly if the eeprom appears to be missing or empty.
+ */
+ if (res.vr_id == 0xff && res.vr_len == 0xff && res.vr_pad == 0xff)
+ return;
+
if (res.vr_id != VPD_RES_ID) {
printf("skc%d: bad VPD resource id: expected %x got %x\n",
sc->sk_unit, VPD_RES_ID, res.vr_id);
@@ -1580,8 +1591,13 @@ skc_attach(dev)
case DEVICEID_SK_V2:
case DEVICEID_3COM_3C940:
case DEVICEID_LINKSYS_EG1032:
+ case DEVICEID_DLINK_DGE530T:
sc->sk_type = SK_YUKON;
break;
+ default:
+ printf("skc%d: unknown device!\n", unit);
+ error = ENXIO;
+ goto fail;
}
/* Reset the adapter. */
@@ -1644,7 +1660,8 @@ skc_attach(dev)
}
/* Announce the product name. */
- printf("skc%d: %s\n", sc->sk_unit, sc->sk_vpd_prodname);
+ if (sc->sk_vpd_prodname != NULL)
+ printf("skc%d: %s\n", sc->sk_unit, sc->sk_vpd_prodname);
sc->sk_devs[SK_PORT_A] = device_add_child(dev, "sk", -1);
port = malloc(sizeof(int), M_DEVBUF, M_NOWAIT);
*port = SK_PORT_A;
diff --git a/sys/dev/sk/if_skreg.h b/sys/dev/sk/if_skreg.h
index 8e2eb53..25027a1 100644
--- a/sys/dev/sk/if_skreg.h
+++ b/sys/dev/sk/if_skreg.h
@@ -91,6 +91,16 @@
#define DEVICEID_LINKSYS_EG1032 0x1032
/*
+ * D-Link PCI vendor ID
+ */
+#define VENDORID_DLINK 0x1186
+
+/*
+ * D-Link gigabit ethernet device ID
+ */
+#define DEVICEID_DLINK_DGE530T 0x4c00
+
+/*
* GEnesis registers. The GEnesis chip has a 256-byte I/O window
* but internally it has a 16K register space. This 16K space is
* divided into 128-byte blocks. The first 128 bytes of the I/O
OpenPOWER on IntegriCloud