mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-15 15:06:42 +00:00
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
This commit is contained in:
parent
d87e118db2
commit
39faff5a4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127672
@ -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;
|
||||
|
@ -90,6 +90,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
|
||||
|
@ -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;
|
||||
|
@ -90,6 +90,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
|
||||
|
Loading…
Reference in New Issue
Block a user