diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-26 16:58:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-26 16:58:47 +0000 |
commit | 507a199df037c6f0928c55f8761c51c7935dba71 (patch) | |
tree | 2184fe709f23ee7fcf49306b244567a702bf905d /sys/dev/pci | |
parent | fc4c122129c4d2da0ff29b5f5ca69c6a324c13c6 (diff) |
Using information gleamed from the FreeBSD driver, change the MAC address
reading to use the eeprom instead of CIS, and then the Xircom Cardbus cards
can work in the expresscard adaptor, as pci devices.
ok jsg
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_dc_pci.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sys/dev/pci/if_dc_pci.c b/sys/dev/pci/if_dc_pci.c index d9558e090a8..d6e19ca72af 100644 --- a/sys/dev/pci/if_dc_pci.c +++ b/sys/dev/pci/if_dc_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dc_pci.c,v 1.63 2009/06/02 15:39:35 jsg Exp $ */ +/* $OpenBSD: if_dc_pci.c,v 1.64 2009/06/26 16:58:45 deraadt Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -111,6 +111,7 @@ struct dc_type dc_devs[] = { { PCI_VENDOR_MICROSOFT, PCI_PRODUCT_MICROSOFT_MN130 }, { PCI_VENDOR_XIRCOM, PCI_PRODUCT_XIRCOM_X3201_3_21143 }, { PCI_VENDOR_ADMTEK, PCI_PRODUCT_ADMTEK_AN985 }, + { PCI_VENDOR_ABOCOM, PCI_PRODUCT_ABOCOM_FE2500 }, { PCI_VENDOR_ABOCOM, PCI_PRODUCT_ABOCOM_FE2500MX }, { PCI_VENDOR_ABOCOM, PCI_PRODUCT_ABOCOM_PCM200 }, { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DRP32TXD }, @@ -274,9 +275,14 @@ dc_pci_attach(struct device *parent, struct device *self, void *aux) /* Need this info to decide on a chip type. */ sc->dc_revision = PCI_REVISION(pa->pa_class); - /* Get the eeprom width, but PNIC has no eeprom */ - if (!(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_LITEON && + /* Get the eeprom width, if possible */ + if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_LITEON && PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LITEON_PNIC)) + ; /* PNIC has non-standard eeprom */ + else if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_XIRCOM && + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_XIRCOM_X3201_3_21143)) + ; /* XIRCOM has non-standard eeprom */ + else dc_eeprom_width(sc); switch (PCI_VENDOR(pa->pa_id)) { @@ -433,6 +439,16 @@ dc_pci_attach(struct device *parent, struct device *self, void *aux) dc_read_srom(sc, sc->dc_romwidth); } break; + case PCI_VENDOR_XIRCOM: + if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_XIRCOM_X3201_3_21143) { + found = 1; + sc->dc_type = DC_TYPE_XIRCOM; + sc->dc_flags |= DC_TX_INTR_ALWAYS; + sc->dc_flags |= DC_TX_COALESCE; + sc->dc_flags |= DC_TX_ALIGN; + sc->dc_pmode = DC_PMODE_MII; + } + break; } if (found == 0) { /* This shouldn't happen if probe has done its job... */ @@ -452,7 +468,7 @@ dc_pci_attach(struct device *parent, struct device *self, void *aux) dc_reset(sc); /* Take 21143 out of snooze mode */ - if (DC_IS_INTEL(sc)) { + if (DC_IS_INTEL(sc) || DC_IS_XIRCOM(sc)) { command = pci_conf_read(pc, pa->pa_tag, DC_PCI_CFDD); command &= ~(DC_CFDD_SNOOZE_MODE|DC_CFDD_SLEEP_MODE); pci_conf_write(pc, pa->pa_tag, DC_PCI_CFDD, command); |