summaryrefslogtreecommitdiff
path: root/sys/dev/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pcmcia')
-rw-r--r--sys/dev/pcmcia/com_pcmcia.c5
-rw-r--r--sys/dev/pcmcia/files.pcmcia19
-rw-r--r--sys/dev/pcmcia/if_ep_pcmcia.c10
-rw-r--r--sys/dev/pcmcia/if_ne_pcmcia.c66
-rw-r--r--sys/dev/pcmcia/pcmcia.c94
-rw-r--r--sys/dev/pcmcia/pcmcia_cis.c47
-rw-r--r--sys/dev/pcmcia/pcmcia_cis_quirks.c198
-rw-r--r--sys/dev/pcmcia/pcmciadevs30
-rw-r--r--sys/dev/pcmcia/pcmciadevs.h56
-rw-r--r--sys/dev/pcmcia/pcmciadevs_data.h122
-rw-r--r--sys/dev/pcmcia/pcmciareg.h4
-rw-r--r--sys/dev/pcmcia/pcmciavar.h13
12 files changed, 543 insertions, 121 deletions
diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c
index efabee132cc..0ca430a18d5 100644
--- a/sys/dev/pcmcia/com_pcmcia.c
+++ b/sys/dev/pcmcia/com_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_pcmcia.c,v 1.11 1999/01/21 08:55:08 niklas Exp $ */
+/* $OpenBSD: com_pcmcia.c,v 1.12 1999/01/28 04:58:29 fgsch Exp $ */
/* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */
/*-
@@ -345,7 +345,8 @@ com_pcmcia_enable1(sc)
if ((ret = pcmcia_function_enable(pf)))
return(ret);
- if (psc->sc_pf->sc->card.product == PCMCIA_PRODUCT_3COM_3C562) {
+ if ((psc->sc_pf->sc->card.product == PCMCIA_PRODUCT_3COM_3C562) ||
+ (psc->sc_pf->sc->card.product == PCMCIA_PRODUCT_3COM_3CXEM556)) {
int reg;
/* turn off the ethernet-disable bit */
diff --git a/sys/dev/pcmcia/files.pcmcia b/sys/dev/pcmcia/files.pcmcia
index 110d67d5f73..36663a92fa9 100644
--- a/sys/dev/pcmcia/files.pcmcia
+++ b/sys/dev/pcmcia/files.pcmcia
@@ -1,4 +1,4 @@
-# $OpenBSD: files.pcmcia,v 1.14 1999/01/21 08:26:47 niklas Exp $
+# $OpenBSD: files.pcmcia,v 1.15 1999/01/28 04:58:30 fgsch Exp $
# $NetBSD: files.pcmcia,v 1.9 1998/06/21 18:45:41 christos Exp $
#
# Config.new file and device description for machine-independent PCMCIA code.
@@ -7,11 +7,13 @@
device pcmcia {[function = -1], [irq = -1]}
file dev/pcmcia/pcmcia.c pcmcia
file dev/pcmcia/pcmcia_cis.c pcmcia
+file dev/pcmcia/pcmcia_cis_quirks.c pcmcia
# device declaration in sys/conf/files
attach pcmcia at pcic
-# 3Com 3c589 Ethernet and 3c562 multifunction Ethernet controllers
+# 3Com 3c589 Ethernet, 3c562 multifunction Ethernet, and 3CXEM556
+# multifunction Ethernet controllers
# device declaration in sys/conf/files
attach ep at pcmcia with ep_pcmcia
file dev/pcmcia/if_ep_pcmcia.c ep_pcmcia
@@ -29,7 +31,7 @@ attach com at pcmcia with com_pcmcia
file dev/pcmcia/com_pcmcia.c com_pcmcia | pccom_pcmcia
# Digital RoamAbout / Lucent WaveLAN PCMCIA card
-#device wl: arp, ether, ifnet
+#device wl: ether, ifnet
#attach wl at pcmcia with wl_pcmcia
#file dev/pcmcia/if_wl_pcmcia.c wl_pcmcia
@@ -48,3 +50,14 @@ file dev/pcmcia/if_sm_pcmcia.c sm_pcmcia
# PCMCIA Floppy controller
#attach fdc at pcmcia with fdc_pcmcia
#file dev/pcmcia/fdc_pcmcia.c fdc_pcmcia
+
+# PCMCIA multi-port serial cards
+#device pcmcom {[slave = -1]}
+#attach pcmcom at pcmcia
+#attach com at pcmcom with com_pcmcom
+#file dev/pcmcia/pcmcom.c pcmcom | com_pcmcom needs-flag
+
+# Xircom Netwave
+#device cnw: ether, ifnet
+#attach cnw at pcmcia
+#file dev/pcmcia/if_cnw.c cnw
diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c
index 3f66d0a22ff..d52dd340572 100644
--- a/sys/dev/pcmcia/if_ep_pcmcia.c
+++ b/sys/dev/pcmcia/if_ep_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ep_pcmcia.c,v 1.12 1998/12/17 20:14:35 fgsch Exp $ */
+/* $OpenBSD: if_ep_pcmcia.c,v 1.13 1999/01/28 04:58:30 fgsch Exp $ */
/* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */
/*-
@@ -147,10 +147,15 @@ struct ep_pcmcia_product {
{ PCMCIA_PRODUCT_3COM_3C562, EP_CHIPSET_3C509,
0, 0,
PCMCIA_STR_3COM_3C562 },
+
{ PCMCIA_PRODUCT_3COM_3C589, EP_CHIPSET_3C509,
0, 0,
PCMCIA_STR_3COM_3C589 },
+ { PCMCIA_PRODUCT_3COM_3CXEM556, EP_CHIPSET_3C509,
+ 0, 0,
+ PCMCIA_STR_3COM_3CXEM556 },
+
#ifdef notyet
{ PCMCIA_PRODUCT_3COM_3C574, EP_CHIPSET_BOOMERANG,
EP_FLAGS_MII, 0,
@@ -223,7 +228,8 @@ ep_pcmcia_enable1(sc)
if ((ret = pcmcia_function_enable(pf)))
return (ret);
- if (psc->sc_pf->sc->card.product == PCMCIA_PRODUCT_3COM_3C562) {
+ if ((psc->sc_pf->sc->card.product == PCMCIA_PRODUCT_3COM_3C562) ||
+ (psc->sc_pf->sc->card.product == PCMCIA_PRODUCT_3COM_3CXEM556)) {
int reg;
/* turn off the serial-disable bit */
diff --git a/sys/dev/pcmcia/if_ne_pcmcia.c b/sys/dev/pcmcia/if_ne_pcmcia.c
index 16311235b2e..3481863c449 100644
--- a/sys/dev/pcmcia/if_ne_pcmcia.c
+++ b/sys/dev/pcmcia/if_ne_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ne_pcmcia.c,v 1.5 1998/12/04 06:49:58 fgsch Exp $ */
+/* $OpenBSD: if_ne_pcmcia.c,v 1.6 1999/01/28 04:58:30 fgsch Exp $ */
/* $NetBSD: if_ne_pcmcia.c,v 1.17 1998/08/15 19:00:04 thorpej Exp $ */
/*
@@ -122,28 +122,15 @@ struct ne2000dev {
PCMCIA_CIS_ACCTON_EN2212,
0, 0x0ff0, { 0x00, 0x00, 0xe8 } },
- /*
- * D-Link DE-650 has many minor versions:
- *
- * CIS information Manufacturer Product Note
- * 1 "D-Link, DE-650" INVALID INVALID white card
- * 2 "D-Link, DE-650, Ver 01.00" INVALID INVALID became bare metal
- * 3 "D-Link, DE-650, Ver 01.00" 0x149 0x265 minor change in look
- * 4 "D-Link, DE-650, Ver 01.00" 0x149 0x265 collision LED added
- *
- * While the 1st and the 2nd types should use the "D-Link DE-650" entry,
- * the 3rd and the 4th types should use the "Linksys EtherCard" entry.
- * Therefore, the Linksys entry should be before the D-Link. --itohy
- */
- { PCMCIA_STR_LINKSYS_ECARD_1,
- PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_ECARD_1,
- PCMCIA_CIS_LINKSYS_ECARD_1,
- 0, -1, { 0x00, 0x80, 0xc8 } },
+ { PCMCIA_STR_SVEC_COMBOCARD,
+ PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
+ PCMCIA_CIS_SVEC_COMBOCARD,
+ 0, -1, { 0x00, 0xe0, 0x98 } },
- { PCMCIA_STR_DLINK_DE650,
+ { PCMCIA_STR_SVEC_LANCARD,
PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- PCMCIA_CIS_DLINK_DE650,
- 0, 0x0040, { 0x00, 0x80, 0xc8 } },
+ PCMCIA_CIS_SVEC_LANCARD,
+ 0, 0x7f0, { 0x00, 0xc0, 0x6c } },
/*
* You have to add new entries which contains
@@ -161,6 +148,11 @@ struct ne2000dev {
PCMCIA_CIS_IBM_INFOMOVER,
0, 0x0ff0, { 0x08, 0x00, 0x5a } },
+ { PCMCIA_STR_LINKSYS_ECARD_1,
+ PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_ECARD_1,
+ PCMCIA_CIS_LINKSYS_ECARD_1,
+ 0, -1, { 0x00, 0x80, 0xc8 } },
+
{ PCMCIA_STR_LINKSYS_COMBO_ECARD,
PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_COMBO_ECARD,
PCMCIA_CIS_LINKSYS_COMBO_ECARD,
@@ -180,6 +172,24 @@ struct ne2000dev {
PCMCIA_CIS_LINKSYS_ECARD_2,
0, -1, { 0x00, 0x80, 0xc8 } },
+ /*
+ * D-Link DE-650 has many minor versions:
+ *
+ * CIS information Manufacturer Product Note
+ * 1 "D-Link, DE-650" INVALID INVALID white card
+ * 2 "D-Link, DE-650, Ver 01.00" INVALID INVALID became bare metal
+ * 3 "D-Link, DE-650, Ver 01.00" 0x149 0x265 minor change in look
+ * 4 "D-Link, DE-650, Ver 01.00" 0x149 0x265 collision LED added
+ *
+ * While the 1st and the 2nd types should use the "D-Link DE-650" entry,
+ * the 3rd and the 4th types should use the "Linksys EtherCard" entry.
+ * Therefore, this enty must be below the LINKSYS_ECARD_1. --itohy
+ */
+ { PCMCIA_STR_DLINK_DE650,
+ PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
+ PCMCIA_CIS_DLINK_DE650,
+ 0, 0x0040, { 0x00, 0x80, 0xc8 } },
+
{ PCMCIA_STR_IODATA_PCLAT,
PCMCIA_VENDOR_IODATA, PCMCIA_PRODUCT_IODATA_PCLAT,
PCMCIA_CIS_IODATA_PCLAT,
@@ -196,10 +206,16 @@ struct ne2000dev {
PCMCIA_CIS_DAYNA_COMMUNICARD_E_2,
0, -1, { 0x00, 0x80, 0x19 } },
- { PCMCIA_STR_UNKNOWN_ECARD,
- PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_UNKNOWN_ECARD,
- PCMCIA_CIS_UNKNOWN_ECARD,
- 0, -1, { 0x00, 0xa0, 0x0c } },
+ { PCMCIA_STR_COREGA_PCC_2,
+ PCMCIA_VENDOR_COREGA, PCMCIA_PRODUCT_COREGA_PCC_2,
+ PCMCIA_CIS_COREGA_PCC_2,
+ 0, -1, { 0x00, 0x00, 0xf4 } },
+
+ { PCMCIA_STR_COMPEX_LINKPORT_ENET_B,
+ PCMCIA_VENDOR_COMPEX, PCMCIA_PRODUCT_COMPEX_LINKPORT_ENET_B,
+ PCMCIA_CIS_COMPEX_LINKPORT_ENET_B,
+ 0, 0xd400, { 0x01, 0x03, 0xdc } },
+
#if 0
/* the rest of these are stolen from the linux pcnet pcmcia device
driver. Since I don't know the manfid or cis info strings for
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c
index c7539c7a1f3..1274a60bd7e 100644
--- a/sys/dev/pcmcia/pcmcia.c
+++ b/sys/dev/pcmcia/pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia.c,v 1.11 1998/09/11 10:47:14 fgsch Exp $ */
+/* $OpenBSD: pcmcia.c,v 1.12 1999/01/28 04:58:31 fgsch Exp $ */
/* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */
/*
@@ -35,18 +35,16 @@
#include <sys/systm.h>
#include <sys/device.h>
-/* XXX only needed for intr debugging */
-#include <vm/vm.h>
-
#include <dev/pcmcia/pcmciareg.h>
#include <dev/pcmcia/pcmciachip.h>
#include <dev/pcmcia/pcmciavar.h>
#ifdef PCMCIADEBUG
-int pcmcia_debug = 1;
-#define DPRINTF(arg) if (pcmcia_debug) printf arg
+#define DPRINTF(arg) printf arg
+#define PCMCIA_CARD_INTR (pcmcia_card_intrdebug)
#else
#define DPRINTF(arg)
+#define PCMCIA_CARD_INTR (pcmcia_card_intr)
#endif
#ifdef PCMCIAVERBOSE
@@ -65,7 +63,11 @@ static inline void pcmcia_socket_enable __P((pcmcia_chipset_tag_t,
static inline void pcmcia_socket_disable __P((pcmcia_chipset_tag_t,
pcmcia_chipset_handle_t *));
+#ifdef PCMCIADEBUG
+int pcmcia_card_intrdebug __P((void *));
+#else
int pcmcia_card_intr __P((void *));
+#endif
struct cfdriver pcmcia_cd = {
NULL, "pcmcia", DV_DULL
@@ -145,6 +147,8 @@ pcmcia_card_attach(dev)
pcmcia_chip_socket_disable(sc->pct, sc->pch);
+ pcmcia_check_cis_quirks(sc);
+
/*
* bail now if the card has no functions, or if there was an error in
* the cis.
@@ -410,17 +414,26 @@ pcmcia_function_enable(pf)
pcmcia_ccr_write(pf, PCMCIA_CCR_IOSIZE, iosize);
}
- DPRINTF(("%s: function %d CCR at %d offset %lx: "
- "%x %x %x %x, %x %x %x %x, %x\n",
- pf->sc->dev.dv_xname, pf->number,
- pf->pf_ccr_window, pf->pf_ccr_offset,
- pcmcia_ccr_read(pf, 0x00), pcmcia_ccr_read(pf, 0x02),
- pcmcia_ccr_read(pf, 0x04), pcmcia_ccr_read(pf, 0x06),
-
- pcmcia_ccr_read(pf, 0x0A), pcmcia_ccr_read(pf, 0x0C),
- pcmcia_ccr_read(pf, 0x0E), pcmcia_ccr_read(pf, 0x10),
-
- pcmcia_ccr_read(pf, 0x12)));
+#ifdef PCMCIADEBUG
+ for (tmp = pf->sc->card.pf_head.sqh_first; tmp != NULL;
+ tmp = tmp->pf_list.sqe_next) {
+ printf("%s: function %d CCR at %d offset %lx: "
+ "%x %x %x %x, %x %x %x %x, %x\n",
+ tmp->sc->dev.dv_xname, tmp->number,
+ tmp->pf_ccr_window, tmp->pf_ccr_offset,
+ pcmcia_ccr_read(tmp, 0x00),
+ pcmcia_ccr_read(tmp, 0x02),
+ pcmcia_ccr_read(tmp, 0x04),
+ pcmcia_ccr_read(tmp, 0x06),
+
+ pcmcia_ccr_read(tmp, 0x0A),
+ pcmcia_ccr_read(tmp, 0x0C),
+ pcmcia_ccr_read(tmp, 0x0E),
+ pcmcia_ccr_read(tmp, 0x10),
+
+ pcmcia_ccr_read(tmp, 0x12));
+ }
+#endif
pf->pf_flags |= PFF_ENABLED;
return (0);
@@ -607,7 +620,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg)
pf->ih_ipl = ipl;
pf->sc->ih = pcmcia_chip_intr_establish(pf->sc->pct,
- pf->sc->pch, pf, ipl, pcmcia_card_intr, pf->sc);
+ pf->sc->pch, pf, ipl, PCMCIA_CARD_INTR, pf->sc);
splx(s);
} else if (ipl > hiipl) {
#ifdef DIAGNOSTIC
@@ -627,7 +640,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg)
pf->ih_ipl = ipl;
pf->sc->ih = pcmcia_chip_intr_establish(pf->sc->pct,
- pf->sc->pch, pf, ipl, pcmcia_card_intr, pf->sc);
+ pf->sc->pch, pf, ipl, PCMCIA_CARD_INTR, pf->sc);
splx(s);
} else {
@@ -737,7 +750,7 @@ pcmcia_intr_disestablish(pf, ih)
pcmcia_chip_intr_disestablish(pf->sc->pct, pf->sc->pch,
pf->sc->ih);
pf->sc->ih = pcmcia_chip_intr_establish(pf->sc->pct,
- pf->sc->pch, pf, hiipl, pcmcia_card_intr, pf->sc);
+ pf->sc->pch, pf, hiipl, PCMCIA_CARD_INTR, pf->sc);
/* null out the handler for this function */
@@ -770,15 +783,41 @@ pcmcia_card_intr(arg)
for (pf = sc->card.pf_head.sqh_first; pf != NULL;
pf = pf->pf_list.sqe_next) {
-#if 0
- printf("%s: intr flags=%x fct=%d physaddr=%lx cor=%02x csr=%02x pin=%02x",
+ if (pf->ih_fct != NULL &&
+ (pf->ccr_mask & (1 << (PCMCIA_CCR_STATUS / 2)))) {
+ reg = pcmcia_ccr_read(pf, PCMCIA_CCR_STATUS);
+ if (reg & PCMCIA_CCR_STATUS_INTR) {
+ ret2 = (*pf->ih_fct)(pf->ih_arg);
+ if (ret2 != 0 && ret == 0)
+ ret = ret2;
+ reg = pcmcia_ccr_read(pf, PCMCIA_CCR_STATUS);
+ pcmcia_ccr_write(pf, PCMCIA_CCR_STATUS,
+ reg & ~PCMCIA_CCR_STATUS_INTR);
+ }
+ }
+ }
+
+ return (ret);
+}
+
+#ifdef PCMCIADEBUG
+int
+pcmcia_card_intrdebug(arg)
+ void *arg;
+{
+ struct pcmcia_softc *sc = arg;
+ struct pcmcia_function *pf;
+ int reg, ret, ret2;
+
+ ret = 0;
+
+ for (pf = sc->card.pf_head.sqh_first; pf != NULL;
+ pf = pf->pf_list.sqe_next) {
+ printf("%s: intr flags=%x fct=%d cor=%02x csr=%02x pin=%02x",
sc->dev.dv_xname, pf->pf_flags, pf->number,
- pmap_extract(pmap_kernel(),
- (vaddr_t) pf->pf_ccrh) + pf->pf_ccr_offset,
pcmcia_ccr_read(pf, PCMCIA_CCR_OPTION),
pcmcia_ccr_read(pf, PCMCIA_CCR_STATUS),
pcmcia_ccr_read(pf, PCMCIA_CCR_PIN));
-#endif
if (pf->ih_fct != NULL &&
(pf->ccr_mask & (1 << (PCMCIA_CCR_STATUS / 2)))) {
reg = pcmcia_ccr_read(pf, PCMCIA_CCR_STATUS);
@@ -787,18 +826,15 @@ pcmcia_card_intr(arg)
if (ret2 != 0 && ret == 0)
ret = ret2;
reg = pcmcia_ccr_read(pf, PCMCIA_CCR_STATUS);
-#if 0
printf("; csr %02x->%02x",
reg, reg & ~PCMCIA_CCR_STATUS_INTR);
-#endif
pcmcia_ccr_write(pf, PCMCIA_CCR_STATUS,
reg & ~PCMCIA_CCR_STATUS_INTR);
}
}
-#if 0
printf("\n");
-#endif
}
return (ret);
}
+#endif
diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c
index 1653f1aea6d..772bd6a863d 100644
--- a/sys/dev/pcmcia/pcmcia_cis.c
+++ b/sys/dev/pcmcia/pcmcia_cis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia_cis.c,v 1.1 1998/09/11 10:47:15 fgsch Exp $ */
+/* $OpenBSD: pcmcia_cis.c,v 1.2 1999/01/28 04:58:31 fgsch Exp $ */
/* $NetBSD: pcmcia_cis.c,v 1.9 1998/08/22 23:41:48 msaitoh Exp $ */
/*
@@ -41,8 +41,7 @@
#include <dev/pcmcia/pcmciavar.h>
#ifdef PCMCIACISDEBUG
-int pcmciacis_debug = 1;
-#define DPRINTF(arg) if (pcmciacis_debug) printf arg
+#define DPRINTF(arg) printf arg
#else
#define DPRINTF(arg)
#endif
@@ -329,6 +328,7 @@ pcmcia_scan_cis(dev, fct, arg)
/* skip to the next tuple */
tuple.ptr += 2 + tuple.length;
}
+
/*
* the chain is done. Clean up and move onto the next one,
* if any. The loop is here in the case that there is an MFC
@@ -985,6 +985,12 @@ pcmcia_parse_cis_tuple(tuple, arg)
idx++;
}
if (iospace) {
+ if (tuple->length <= idx) {
+ DPRINTF(("ran out of space before TPCE_IO\n"));
+
+ goto abort_cfe;
+ }
+
reg = pcmcia_tuple_read_1(tuple, idx);
idx++;
@@ -1057,6 +1063,12 @@ pcmcia_parse_cis_tuple(tuple, arg)
}
}
if (irq) {
+ if (tuple->length <= idx) {
+ DPRINTF(("ran out of space before TPCE_IR\n"));
+
+ goto abort_cfe;
+ }
+
reg = pcmcia_tuple_read_1(tuple, idx);
idx++;
@@ -1082,7 +1094,14 @@ pcmcia_parse_cis_tuple(tuple, arg)
}
}
if (memspace) {
- if (memspace == PCMCIA_TPCE_FS_MEMSPACE_LENGTH) {
+ if (tuple->length <= idx) {
+ DPRINTF(("ran out of space before TPCE_MS\n"));
+ goto abort_cfe;
+ }
+
+ if (memspace == PCMCIA_TPCE_FS_MEMSPACE_NONE) {
+ cfe->num_memspace = 0;
+ } else if (memspace == PCMCIA_TPCE_FS_MEMSPACE_LENGTH) {
cfe->num_memspace = 1;
cfe->memspace[0].length = 256 *
pcmcia_tuple_read_2(tuple, idx);
@@ -1098,7 +1117,7 @@ pcmcia_parse_cis_tuple(tuple, arg)
cfe->memspace[0].cardaddr = 256 *
pcmcia_tuple_read_2(tuple, idx);
idx += 2;
- cfe->memspace[0].hostaddr = 0;
+ cfe->memspace[0].hostaddr = cfe->memspace[0].cardaddr;
} else {
int lengthsize;
int cardaddrsize;
@@ -1120,13 +1139,13 @@ pcmcia_parse_cis_tuple(tuple, arg)
break;
}
lengthsize =
- ((reg & PCMCIA_TPCE_MS_LENGTH_SIZE_MASK) >>
- PCMCIA_TPCE_MS_LENGTH_SIZE_SHIFT);
+ ((reg & PCMCIA_TPCE_MS_LENGTH_SIZE_MASK) >>
+ PCMCIA_TPCE_MS_LENGTH_SIZE_SHIFT);
cardaddrsize =
- ((reg & PCMCIA_TPCE_MS_CARDADDR_SIZE_MASK) >>
- PCMCIA_TPCE_MS_CARDADDR_SIZE_SHIFT);
+ ((reg & PCMCIA_TPCE_MS_CARDADDR_SIZE_MASK) >>
+ PCMCIA_TPCE_MS_CARDADDR_SIZE_SHIFT);
hostaddrsize =
- (reg & PCMCIA_TPCE_MS_HOSTADDR) ? cardaddrsize : 0;
+ (reg & PCMCIA_TPCE_MS_HOSTADDR) ? cardaddrsize : 0;
if (lengthsize == 0) {
DPRINTF(("cfe memspace "
@@ -1167,6 +1186,12 @@ pcmcia_parse_cis_tuple(tuple, arg)
}
}
if (misc) {
+ if (tuple->length <= idx) {
+ DPRINTF(("ran out of space before TPCE_MI\n"));
+
+ goto abort_cfe;
+ }
+
reg = pcmcia_tuple_read_1(tuple, idx);
idx++;
@@ -1185,6 +1210,8 @@ pcmcia_parse_cis_tuple(tuple, arg)
}
/* skip all the subtuples */
}
+
+ abort_cfe:
DPRINTF(("CISTPL_CFTABLE_ENTRY\n"));
break;
default:
diff --git a/sys/dev/pcmcia/pcmcia_cis_quirks.c b/sys/dev/pcmcia/pcmcia_cis_quirks.c
new file mode 100644
index 00000000000..3947632c74b
--- /dev/null
+++ b/sys/dev/pcmcia/pcmcia_cis_quirks.c
@@ -0,0 +1,198 @@
+/* $OpenBSD: pcmcia_cis_quirks.c,v 1.1 1999/01/28 04:58:31 fgsch Exp $ */
+/* $NetBSD: pcmcia_cis_quirks.c,v 1.3 1998/12/29 09:00:28 marc Exp $ */
+
+/*
+ * Copyright (c) 1998 Marc Horowitz. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Marc Horowitz.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/mbuf.h>
+
+#include <dev/pcmcia/pcmciadevs.h>
+#include <dev/pcmcia/pcmciareg.h>
+#include <dev/pcmcia/pcmciachip.h>
+#include <dev/pcmcia/pcmciavar.h>
+
+/* There are cards out there whose CIS flat-out lies. This file
+ contains struct pcmcia_function chains for those devices. */
+
+/* these structures are just static templates which are then copied
+ into "live" allocated structures */
+
+struct pcmcia_function pcmcia_3cxem556_func0 = {
+ 0, /* function number */
+ PCMCIA_FUNCTION_NETWORK,
+ 0x07, /* last cfe number */
+ 0x800, /* ccr_base */
+ 0x63, /* ccr_mask */
+};
+
+struct pcmcia_config_entry pcmcia_3cxem556_func0_cfe0 = {
+ 0x07, /* cfe number */
+ PCMCIA_CFE_IO8 | PCMCIA_CFE_IO16 | PCMCIA_CFE_IRQLEVEL,
+ PCMCIA_IFTYPE_IO,
+ 1, /* num_iospace */
+ 4, /* iomask */
+ { { 0x0010, 0 } }, /* iospace */
+ 0xffff, /* irqmask */
+ 0, /* num_memspace */
+ { }, /* memspace */
+ 0, /* maxtwins */
+};
+
+static struct pcmcia_function pcmcia_3cxem556_func1 = {
+ 1, /* function number */
+ PCMCIA_FUNCTION_SERIAL,
+ 0x27, /* last cfe number */
+ 0x900, /* ccr_base */
+ 0x63, /* ccr_mask */
+};
+
+static struct pcmcia_config_entry pcmcia_3cxem556_func1_cfe0 = {
+ 0x27, /* cfe number */
+ PCMCIA_CFE_IO8 | PCMCIA_CFE_IRQLEVEL,
+ PCMCIA_IFTYPE_IO,
+ 1, /* num_iospace */
+ 3, /* iomask */
+ { { 0x0008, 0 } }, /* iospace */
+ 0xffff, /* irqmask */
+ 0, /* num_memspace */
+ { }, /* memspace */
+ 0, /* maxtwins */
+};
+
+static struct pcmcia_function pcmcia_sveclancard_func0 = {
+ 0, /* function number */
+ PCMCIA_FUNCTION_NETWORK,
+ 0x1, /* last cfe number */
+ 0x100, /* ccr_base */
+ 0x1, /* ccr_mask */
+};
+
+static struct pcmcia_config_entry pcmcia_sveclancard_func0_cfe0 = {
+ 0x1, /* cfe number */
+ PCMCIA_CFE_MWAIT_REQUIRED | PCMCIA_CFE_RDYBSY_ACTIVE |
+ PCMCIA_CFE_WP_ACTIVE | PCMCIA_CFE_BVD_ACTIVE | PCMCIA_CFE_IO16,
+ PCMCIA_IFTYPE_IO,
+ 1, /* num_iospace */
+ 5, /* iomask */
+ { { 0x20, 0x300 } }, /* iospace */
+ 0xdeb8, /* irqmask */
+ 0, /* num_memspace */
+ { }, /* memspace */
+ 0, /* maxtwins */
+};
+
+static struct pcmcia_cis_quirk pcmcia_cis_quirks[] = {
+ { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID,
+ &pcmcia_3cxem556_func0, &pcmcia_3cxem556_func0_cfe0 },
+ { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID,
+ &pcmcia_3cxem556_func1, &pcmcia_3cxem556_func1_cfe0 },
+ { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID, PCMCIA_CIS_SVEC_LANCARD,
+ &pcmcia_sveclancard_func0, &pcmcia_sveclancard_func0_cfe0 },
+};
+
+static int n_pcmcia_cis_quirks =
+ sizeof(pcmcia_cis_quirks)/sizeof(pcmcia_cis_quirks[0]);
+
+void pcmcia_check_cis_quirks(sc)
+ struct pcmcia_softc *sc;
+{
+ int wiped = 0;
+ int i, j;
+ struct pcmcia_function *pf, *pf_next, *pf_last;
+ struct pcmcia_config_entry *cfe, *cfe_next;
+
+ pf = NULL;
+ pf_last = NULL;
+
+ for (i=0; i<n_pcmcia_cis_quirks; i++) {
+ if ((sc->card.manufacturer == pcmcia_cis_quirks[i].manufacturer) &&
+ (sc->card.product == pcmcia_cis_quirks[i].product) &&
+ (((sc->card.manufacturer != PCMCIA_VENDOR_INVALID) &&
+ (sc->card.product != PCMCIA_PRODUCT_INVALID)) ||
+ ((sc->card.manufacturer == PCMCIA_VENDOR_INVALID) &&
+ (sc->card.product == PCMCIA_PRODUCT_INVALID) &&
+ sc->card.cis1_info[0] &&
+ (strcmp(sc->card.cis1_info[0],
+ pcmcia_cis_quirks[i].cis1_info[0]) == 0) &&
+ sc->card.cis1_info[1] &&
+ (strcmp(sc->card.cis1_info[1],
+ pcmcia_cis_quirks[i].cis1_info[1]) == 0)))) {
+ if (!wiped) {
+ if (pcmcia_verbose) {
+ printf("%s: using CIS quirks for ", sc->dev.dv_xname);
+ for (j = 0; j < 4; j++) {
+ if (sc->card.cis1_info[j] == NULL)
+ break;
+ if (j)
+ printf(", ");
+ printf("%s", sc->card.cis1_info[j]);
+ }
+ printf("\n");
+ }
+
+ for (pf = SIMPLEQ_FIRST(&sc->card.pf_head); pf != NULL;
+ pf = pf_next) {
+ for (cfe = SIMPLEQ_FIRST(&pf->cfe_head); cfe != NULL;
+ cfe = cfe_next) {
+ cfe_next = SIMPLEQ_NEXT(cfe, cfe_list);
+ free(cfe, M_DEVBUF);
+ }
+ pf_next = SIMPLEQ_NEXT(pf, pf_list);
+ free(pf, M_DEVBUF);
+ }
+
+ SIMPLEQ_INIT(&sc->card.pf_head);
+ wiped = 1;
+ }
+
+ if (pf_last == pcmcia_cis_quirks[i].pf) {
+ cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
+ *cfe = *pcmcia_cis_quirks[i].cfe;
+
+ SIMPLEQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list);
+ } else {
+ pf = malloc(sizeof(*pf), M_DEVBUF, M_NOWAIT);
+ *pf = *pcmcia_cis_quirks[i].pf;
+ SIMPLEQ_INIT(&pf->cfe_head);
+
+ cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
+ *cfe = *pcmcia_cis_quirks[i].cfe;
+
+ SIMPLEQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list);
+ SIMPLEQ_INSERT_TAIL(&sc->card.pf_head, pf, pf_list);
+
+ pf_last = pcmcia_cis_quirks[i].pf;
+ }
+ }
+ }
+}
diff --git a/sys/dev/pcmcia/pcmciadevs b/sys/dev/pcmcia/pcmciadevs
index e9bb2029a01..f2e7226c1f4 100644
--- a/sys/dev/pcmcia/pcmciadevs
+++ b/sys/dev/pcmcia/pcmciadevs
@@ -1,4 +1,4 @@
- $OpenBSD: pcmciadevs,v 1.7 1998/12/22 02:43:55 niklas Exp $
+ $OpenBSD: pcmciadevs,v 1.8 1999/01/28 04:58:32 fgsch Exp $
/* $NetBSD: pcmciadevs,v 1.13 1998/08/17 23:10:12 thorpej Exp $ */
/*
@@ -44,7 +44,6 @@ vendor 3COM 0x0101 3Com
vendor MEGAHERTZ 0x0102 Megahertz
vendor SOCKET 0x0104 Socket Communications
vendor TDK 0x0105 TDK
-vendor XIRCOM 0x0105 Xircom
vendor SMC 0x0108 SMC
vendor MOTOROLA 0x0109 Motorola
vendor USROBOTICS 0x0115 US Robotics
@@ -57,8 +56,9 @@ vendor SIMPLETECH 0x014d Simple Technology
vendor COMPAQ2 0x0183 Compaq
vendor DAYNA 0x0194 Dayna
vendor IODATA 0x01bf I-O DATA
+vendor COMPEX 0x8a01 Compex Corporation
+vendor COREGA 0xc00f Corega K.K.
vendor HAGIWARASYSCOM 0xc012 Hagiwara SYS-COM
-vendor UNKNOWN 0x8a01 Unknown
/*
* List of known products. Grouped by vendor.
@@ -68,10 +68,14 @@ product ADAPTEC APA1460_1 0x0001 Adaptec APA-1460/A SCSI Host Adapter
product ADAPTEC APA1460_2 0x0002 Adaptec APA-1460/B SCSI Host Adapter
/* 3COM Products */
+product 3COM 3CXEM556 0x0035 3Com/Megahertz 3XEM556 Ethernet/Modem
product 3COM 3C562 0x0562 3Com 3c562 33.6 Modem/10Mbps Ethernet
product 3COM 3C589 0x0589 3Com 3c589 10Mbps Ethernet
product 3COM 3C574 0x0574 3Com 3c574-TX 10/100Mbps Ethernet
+/* Compex Products */
+product COMPEX LINKPORT_ENET_B 0x0100 Compex Linkport ENET-B Ethernet
+
/* Dayna Products */
product DAYNA COMMUNICARD_E_1 0x002d Dayna CommuniCard E
product DAYNA COMMUNICARD_E_2 0x002f Dayna CommuniCard E
@@ -87,10 +91,14 @@ product MOTOROLA MONTANA_336 0x0505 Motorola Montana 33.6 Fax/Modem
/* IBM Products */
product IBM INFOMOVER 0x0002 National Semiconductor InfoMover
product IBM HOME_AND_AWAY 0x002e IBM Home and Away Modem
+product IBM WIRELESS_LAN_ENTRY 0x0032 Wireless LAN Entry
/* I-O DATA */
product IODATA PCLAT 0x2216 I-O DATA PCLA/T
+/* Intel */
+product INTEL EEPRO100 0x010a Intel EtherExpress PRO/100
+
/* Linksys corporation */
product LINKSYS ECARD_1 0x0265 Linksys EthernetCard or D-Link DE-650
product LINKSYS COMBO_ECARD 0xc1ab Linksys Combo EthernetCard
@@ -122,18 +130,18 @@ product SOCKET DUAL_RS232 0x0006 Socket Communications Dual RS232
product TDK LAK_CD021BX 0x0200 TDK LAK-CD021BX Ethernet
product TDK DFL9610 0x0d0a TDK DFL9610 Ethernet & Digital Cellular
+/* TDK Vendor ID also used by Xircom! */
+product TDK XIR_CE_10 0x0108 Xircom CreditCard Ethernet
+product TDK XIR_PS_CE2_10 0x010b Xircom CreditCard CE2 Ethernet
+product TDK XIR_CNW 0x0802 Xircom CreditCard Netwave
+product TDK XIR_CEM_10 0x110a Xircom CreditCard Ethernet + Modem
+
/* NewMedia Products */
product NEWMEDIA BASICS 0x0019 NewMedia BASICS Ethernet
/* Standard Microsystems Corporation Products */
product SMC 8016 0x0105 SMC 8016 EtherCard
-/* Xircom Products */
-product XIRCOM REM56G_100 0x110a Xircom RealPort Ethernet 10/100 + 56K Modem
-
-/* Unknown Product */
-product UNKNOWN ECARD 0x0100 NE2000 Compatible
-
/* Cards we know only by their cis */
vendor PREMAX -1 Premax
vendor PLANET -1 Planet
@@ -143,6 +151,7 @@ vendor ACCTON -1 ACCTON
vendor YEDATA -1 Y-E DATA
vendor DIGITAL -1 Digital
vendor TEAC -1 TEAC
+vendor SVEC -1 SVEC/Hawking Technology
product MEGAHERTZ XJ2288 { "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem
product PREMAX PE200 { "PMX&sp&sp&sp", "PE-200", NULL, NULL } PreMax PE-200
@@ -155,3 +164,6 @@ product YEDATA EXTERNAL_FDD { "Y-E&spDATA", "External&spFDD", NULL, NULL } Y-E D
product DIGITAL DEPCMXX { "DIGITAL", "DEPCM-XX", NULL, NULL } DEC DEPCM-BA
product TEAC IDECARDII { NULL, "NinjaATA-", NULL, NULL } TEAC IDE Card/II
product LINKSYS ECARD_2 { "LINKSYS", "E-CARD", NULL, NULL } Linksys E-Card
+product COREGA PCC_2 { "corega&spK.K.", "corega&spEther&spPCC-T", NULL, NULL } Corega
+product SVEC COMBOCARD { "Ethernet", "Adapter", NULL, NULL } SVEC/Hawking Tech. Combo Card
+product SVEC LANCARD { "SVEC", "FD605&spPCMCIA&spEtherNet&spCard", "V1-1", NULL } SVEC PCMCIA Lan Card
diff --git a/sys/dev/pcmcia/pcmciadevs.h b/sys/dev/pcmcia/pcmciadevs.h
index 043f0cd3eca..70f7eac0aaf 100644
--- a/sys/dev/pcmcia/pcmciadevs.h
+++ b/sys/dev/pcmcia/pcmciadevs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmciadevs.h,v 1.8 1998/12/22 02:46:18 niklas Exp $ */
+/* $OpenBSD: pcmciadevs.h,v 1.9 1999/01/28 04:58:32 fgsch Exp $ */
/*
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
@@ -51,7 +51,6 @@
#define PCMCIA_VENDOR_MEGAHERTZ 0x0102 /* Megahertz */
#define PCMCIA_VENDOR_SOCKET 0x0104 /* Socket Communications */
#define PCMCIA_VENDOR_TDK 0x0105 /* TDK */
-#define PCMCIA_VENDOR_XIRCOM 0x0105 /* Xircom */
#define PCMCIA_VENDOR_SMC 0x0108 /* SMC */
#define PCMCIA_VENDOR_MOTOROLA 0x0109 /* Motorola */
#define PCMCIA_VENDOR_USROBOTICS 0x0115 /* US Robotics */
@@ -64,8 +63,9 @@
#define PCMCIA_VENDOR_COMPAQ2 0x0183 /* Compaq */
#define PCMCIA_VENDOR_DAYNA 0x0194 /* Dayna */
#define PCMCIA_VENDOR_IODATA 0x01bf /* I-O DATA */
+#define PCMCIA_VENDOR_COMPEX 0x8a01 /* Compex Corporation */
+#define PCMCIA_VENDOR_COREGA 0xc00f /* Corega K.K. */
#define PCMCIA_VENDOR_HAGIWARASYSCOM 0xc012 /* Hagiwara SYS-COM */
-#define PCMCIA_VENDOR_UNKNOWN 0x8a01 /* Unknown */
/*
* List of known products. Grouped by vendor.
@@ -79,6 +79,9 @@
#define PCMCIA_STR_ADAPTEC_APA1460_2 "Adaptec APA-1460/B SCSI Host Adapter"
/* 3COM Products */
+#define PCMCIA_CIS_3COM_3CXEM556 { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_3COM_3CXEM556 0x0035
+#define PCMCIA_STR_3COM_3CXEM556 "3Com/Megahertz 3XEM556 Ethernet/Modem"
#define PCMCIA_CIS_3COM_3C562 { NULL, NULL, NULL, NULL }
#define PCMCIA_PRODUCT_3COM_3C562 0x0562
#define PCMCIA_STR_3COM_3C562 "3Com 3c562 33.6 Modem/10Mbps Ethernet"
@@ -89,6 +92,11 @@
#define PCMCIA_PRODUCT_3COM_3C574 0x0574
#define PCMCIA_STR_3COM_3C574 "3Com 3c574-TX 10/100Mbps Ethernet"
+/* Compex Products */
+#define PCMCIA_CIS_COMPEX_LINKPORT_ENET_B { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_COMPEX_LINKPORT_ENET_B 0x0100
+#define PCMCIA_STR_COMPEX_LINKPORT_ENET_B "Compex Linkport ENET-B Ethernet"
+
/* Dayna Products */
#define PCMCIA_CIS_DAYNA_COMMUNICARD_E_1 { NULL, NULL, NULL, NULL }
#define PCMCIA_PRODUCT_DAYNA_COMMUNICARD_E_1 0x002d
@@ -120,12 +128,20 @@
#define PCMCIA_CIS_IBM_HOME_AND_AWAY { NULL, NULL, NULL, NULL }
#define PCMCIA_PRODUCT_IBM_HOME_AND_AWAY 0x002e
#define PCMCIA_STR_IBM_HOME_AND_AWAY "IBM Home and Away Modem"
+#define PCMCIA_CIS_IBM_WIRELESS_LAN_ENTRY { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_IBM_WIRELESS_LAN_ENTRY 0x0032
+#define PCMCIA_STR_IBM_WIRELESS_LAN_ENTRY "Wireless LAN Entry"
/* I-O DATA */
#define PCMCIA_CIS_IODATA_PCLAT { NULL, NULL, NULL, NULL }
#define PCMCIA_PRODUCT_IODATA_PCLAT 0x2216
#define PCMCIA_STR_IODATA_PCLAT "I-O DATA PCLA/T"
+/* Intel */
+#define PCMCIA_CIS_INTEL_EEPRO100 { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_INTEL_EEPRO100 0x010a
+#define PCMCIA_STR_INTEL_EEPRO100 "Intel EtherExpress PRO/100"
+
/* Linksys corporation */
#define PCMCIA_CIS_LINKSYS_ECARD_1 { NULL, NULL, NULL, NULL }
#define PCMCIA_PRODUCT_LINKSYS_ECARD_1 0x0265
@@ -187,6 +203,20 @@
#define PCMCIA_PRODUCT_TDK_DFL9610 0x0d0a
#define PCMCIA_STR_TDK_DFL9610 "TDK DFL9610 Ethernet & Digital Cellular"
+/* TDK Vendor ID also used by Xircom! */
+#define PCMCIA_CIS_TDK_XIR_CE_10 { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_TDK_XIR_CE_10 0x0108
+#define PCMCIA_STR_TDK_XIR_CE_10 "Xircom CreditCard Ethernet"
+#define PCMCIA_CIS_TDK_XIR_PS_CE2_10 { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_TDK_XIR_PS_CE2_10 0x010b
+#define PCMCIA_STR_TDK_XIR_PS_CE2_10 "Xircom CreditCard CE2 Ethernet"
+#define PCMCIA_CIS_TDK_XIR_CNW { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_TDK_XIR_CNW 0x0802
+#define PCMCIA_STR_TDK_XIR_CNW "Xircom CreditCard Netwave"
+#define PCMCIA_CIS_TDK_XIR_CEM_10 { NULL, NULL, NULL, NULL }
+#define PCMCIA_PRODUCT_TDK_XIR_CEM_10 0x110a
+#define PCMCIA_STR_TDK_XIR_CEM_10 "Xircom CreditCard Ethernet + Modem"
+
/* NewMedia Products */
#define PCMCIA_CIS_NEWMEDIA_BASICS { NULL, NULL, NULL, NULL }
#define PCMCIA_PRODUCT_NEWMEDIA_BASICS 0x0019
@@ -197,16 +227,6 @@
#define PCMCIA_PRODUCT_SMC_8016 0x0105
#define PCMCIA_STR_SMC_8016 "SMC 8016 EtherCard"
-/* Xircom Products */
-#define PCMCIA_CIS_XIRCOM_REM56G_100 { NULL, NULL, NULL, NULL }
-#define PCMCIA_PRODUCT_XIRCOM_REM56G_100 0x110a
-#define PCMCIA_STR_XIRCOM_REM56G_100 "Xircom RealPort Ethernet 10/100 + 56K Modem"
-
-/* Unknown Product */
-#define PCMCIA_CIS_UNKNOWN_ECARD { NULL, NULL, NULL, NULL }
-#define PCMCIA_PRODUCT_UNKNOWN_ECARD 0x0100
-#define PCMCIA_STR_UNKNOWN_ECARD "NE2000 Compatible"
-
/* Cards we know only by their cis */
#define PCMCIA_VENDOR_PREMAX -1 /* Premax */
#define PCMCIA_VENDOR_PLANET -1 /* Planet */
@@ -216,6 +236,7 @@
#define PCMCIA_VENDOR_YEDATA -1 /* Y-E DATA */
#define PCMCIA_VENDOR_DIGITAL -1 /* Digital */
#define PCMCIA_VENDOR_TEAC -1 /* TEAC */
+#define PCMCIA_VENDOR_SVEC -1 /* SVEC/Hawking Technology */
#define PCMCIA_CIS_MEGAHERTZ_XJ2288 { "MEGAHERTZ", "MODEM XJ2288", NULL, NULL }
#define PCMCIA_PRODUCT_MEGAHERTZ_XJ2288 -1
@@ -250,3 +271,12 @@
#define PCMCIA_CIS_LINKSYS_ECARD_2 { "LINKSYS", "E-CARD", NULL, NULL }
#define PCMCIA_PRODUCT_LINKSYS_ECARD_2 -1
#define PCMCIA_STR_LINKSYS_ECARD_2 "Linksys E-Card"
+#define PCMCIA_CIS_COREGA_PCC_2 { "corega K.K.", "corega Ether PCC-T", NULL, NULL }
+#define PCMCIA_PRODUCT_COREGA_PCC_2 -1
+#define PCMCIA_STR_COREGA_PCC_2 "Corega"
+#define PCMCIA_CIS_SVEC_COMBOCARD { "Ethernet", "Adapter", NULL, NULL }
+#define PCMCIA_PRODUCT_SVEC_COMBOCARD -1
+#define PCMCIA_STR_SVEC_COMBOCARD "SVEC/Hawking Tech. Combo Card"
+#define PCMCIA_CIS_SVEC_LANCARD { "SVEC", "FD605 PCMCIA EtherNet Card", "V1-1", NULL }
+#define PCMCIA_PRODUCT_SVEC_LANCARD -1
+#define PCMCIA_STR_SVEC_LANCARD "SVEC PCMCIA Lan Card"
diff --git a/sys/dev/pcmcia/pcmciadevs_data.h b/sys/dev/pcmcia/pcmciadevs_data.h
index 66fc5a3deae..7a4f61589c3 100644
--- a/sys/dev/pcmcia/pcmciadevs_data.h
+++ b/sys/dev/pcmcia/pcmciadevs_data.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmciadevs_data.h,v 1.8 1998/12/22 02:46:18 niklas Exp $ */
+/* $OpenBSD: pcmciadevs_data.h,v 1.9 1999/01/28 04:58:32 fgsch Exp $ */
/*
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
@@ -55,6 +55,13 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"Adaptec APA-1460/B SCSI Host Adapter" },
},
{
+ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556,
+ PCMCIA_CIS_3COM_3CXEM556,
+ 0,
+ "3Com",
+ "3Com/Megahertz 3XEM556 Ethernet/Modem" },
+ },
+ {
PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3C562,
PCMCIA_CIS_3COM_3C562,
0,
@@ -76,6 +83,13 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"3Com 3c574-TX 10/100Mbps Ethernet" },
},
{
+ PCMCIA_VENDOR_COMPEX, PCMCIA_PRODUCT_COMPEX_LINKPORT_ENET_B,
+ PCMCIA_CIS_COMPEX_LINKPORT_ENET_B,
+ 0,
+ "Compex Corporation",
+ "Compex Linkport ENET-B Ethernet" },
+ },
+ {
PCMCIA_VENDOR_DAYNA, PCMCIA_PRODUCT_DAYNA_COMMUNICARD_E_1,
PCMCIA_CIS_DAYNA_COMMUNICARD_E_1,
0,
@@ -132,6 +146,13 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"IBM Home and Away Modem" },
},
{
+ PCMCIA_VENDOR_IBM, PCMCIA_PRODUCT_IBM_WIRELESS_LAN_ENTRY,
+ PCMCIA_CIS_IBM_WIRELESS_LAN_ENTRY,
+ 0,
+ "IBM",
+ "Wireless LAN Entry" },
+ },
+ {
PCMCIA_VENDOR_IODATA, PCMCIA_PRODUCT_IODATA_PCLAT,
PCMCIA_CIS_IODATA_PCLAT,
0,
@@ -139,6 +160,13 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"I-O DATA PCLA/T" },
},
{
+ PCMCIA_VENDOR_INTEL, PCMCIA_PRODUCT_INTEL_EEPRO100,
+ PCMCIA_CIS_INTEL_EEPRO100,
+ 0,
+ "Intel",
+ "Intel EtherExpress PRO/100" },
+ },
+ {
PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_ECARD_1,
PCMCIA_CIS_LINKSYS_ECARD_1,
0,
@@ -244,6 +272,34 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"TDK DFL9610 Ethernet & Digital Cellular" },
},
{
+ PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_XIR_CE_10,
+ PCMCIA_CIS_TDK_XIR_CE_10,
+ 0,
+ "TDK",
+ "Xircom CreditCard Ethernet" },
+ },
+ {
+ PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_XIR_PS_CE2_10,
+ PCMCIA_CIS_TDK_XIR_PS_CE2_10,
+ 0,
+ "TDK",
+ "Xircom CreditCard CE2 Ethernet" },
+ },
+ {
+ PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_XIR_CNW,
+ PCMCIA_CIS_TDK_XIR_CNW,
+ 0,
+ "TDK",
+ "Xircom CreditCard Netwave" },
+ },
+ {
+ PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_XIR_CEM_10,
+ PCMCIA_CIS_TDK_XIR_CEM_10,
+ 0,
+ "TDK",
+ "Xircom CreditCard Ethernet + Modem" },
+ },
+ {
PCMCIA_VENDOR_NEWMEDIA, PCMCIA_PRODUCT_NEWMEDIA_BASICS,
PCMCIA_CIS_NEWMEDIA_BASICS,
0,
@@ -258,20 +314,6 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"SMC 8016 EtherCard" },
},
{
- PCMCIA_VENDOR_XIRCOM, PCMCIA_PRODUCT_XIRCOM_REM56G_100,
- PCMCIA_CIS_XIRCOM_REM56G_100,
- 0,
- "Xircom",
- "Xircom RealPort Ethernet 10/100 + 56K Modem" },
- },
- {
- PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_UNKNOWN_ECARD,
- PCMCIA_CIS_UNKNOWN_ECARD,
- 0,
- "Unknown",
- "NE2000 Compatible" },
- },
- {
PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_MEGAHERTZ_XJ2288,
PCMCIA_CIS_MEGAHERTZ_XJ2288,
0,
@@ -349,6 +391,27 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"Linksys E-Card" },
},
{
+ PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_COREGA_PCC_2,
+ PCMCIA_CIS_COREGA_PCC_2,
+ 0,
+ "Corega K.K.",
+ "Corega" },
+ },
+ {
+ PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_SVEC_COMBOCARD,
+ PCMCIA_CIS_SVEC_COMBOCARD,
+ 0,
+ "SVEC/Hawking Technology",
+ "SVEC/Hawking Tech. Combo Card" },
+ },
+ {
+ PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_SVEC_LANCARD,
+ PCMCIA_CIS_SVEC_LANCARD,
+ 0,
+ "SVEC/Hawking Technology",
+ "SVEC PCMCIA Lan Card" },
+ },
+ {
PCMCIA_VENDOR_SANDISK, 0,
PCMCIA_KNOWNDEV_NOPROD,
PCMCIA_CIS_INVALID,
@@ -405,13 +468,6 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
NULL,
},
{
- PCMCIA_VENDOR_XIRCOM, 0,
- PCMCIA_KNOWNDEV_NOPROD,
- PCMCIA_CIS_INVALID,
- "Xircom",
- NULL,
- },
- {
PCMCIA_VENDOR_SMC, 0,
PCMCIA_KNOWNDEV_NOPROD,
PCMCIA_CIS_INVALID,
@@ -496,17 +552,24 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
NULL,
},
{
- PCMCIA_VENDOR_HAGIWARASYSCOM, 0,
+ PCMCIA_VENDOR_COMPEX, 0,
PCMCIA_KNOWNDEV_NOPROD,
PCMCIA_CIS_INVALID,
- "Hagiwara SYS-COM",
+ "Compex Corporation",
+ NULL,
+ },
+ {
+ PCMCIA_VENDOR_COREGA, 0,
+ PCMCIA_KNOWNDEV_NOPROD,
+ PCMCIA_CIS_INVALID,
+ "Corega K.K.",
NULL,
},
{
- PCMCIA_VENDOR_UNKNOWN, 0,
+ PCMCIA_VENDOR_HAGIWARASYSCOM, 0,
PCMCIA_KNOWNDEV_NOPROD,
PCMCIA_CIS_INVALID,
- "Unknown",
+ "Hagiwara SYS-COM",
NULL,
},
{
@@ -565,5 +628,12 @@ struct pcmcia_knowndev pcmcia_knowndevs[] = {
"TEAC",
NULL,
},
+ {
+ PCMCIA_VENDOR_SVEC, 0,
+ PCMCIA_KNOWNDEV_NOPROD,
+ PCMCIA_CIS_INVALID,
+ "SVEC/Hawking Technology",
+ NULL,
+ },
{ 0, 0, { NULL, NULL, NULL, NULL }, 0, NULL, NULL, }
};
diff --git a/sys/dev/pcmcia/pcmciareg.h b/sys/dev/pcmcia/pcmciareg.h
index caa30615ac2..b43c3dd7851 100644
--- a/sys/dev/pcmcia/pcmciareg.h
+++ b/sys/dev/pcmcia/pcmciareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmciareg.h,v 1.3 1998/09/11 10:47:15 fgsch Exp $ */
+/* $OpenBSD: pcmciareg.h,v 1.4 1999/01/28 04:58:32 fgsch Exp $ */
/* $NetBSD: pcmciareg.h,v 1.6 1998/08/13 15:00:02 nathanw Exp $ */
/*
@@ -178,6 +178,8 @@
#define PCMCIA_TPLFE_TYPE_LAN_MEDIA 0x03
#define PCMCIA_TPLFE_TYPE_LAN_NID 0x04
#define PCMCIA_TPLFE_TYPE_LAN_CONN 0x05
+#define PCMCIA_TPLFE_TYPE_DISK_DEVICE_INTERFACE 0x01
+#define PCMCIA_TPLFE_DDI_PCCARD_ATA 0x01
#define PCMCIA_CISTPL_END 0xFF
/* Layer 2 Data Recording Format Tuples */
diff --git a/sys/dev/pcmcia/pcmciavar.h b/sys/dev/pcmcia/pcmciavar.h
index 203fb3ab0b5..43ee1501036 100644
--- a/sys/dev/pcmcia/pcmciavar.h
+++ b/sys/dev/pcmcia/pcmciavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmciavar.h,v 1.6 1998/09/11 10:47:15 fgsch Exp $ */
+/* $OpenBSD: pcmciavar.h,v 1.7 1999/01/28 04:58:32 fgsch Exp $ */
/* $NetBSD: pcmciavar.h,v 1.5 1998/07/19 17:28:17 christos Exp $ */
/*
@@ -37,6 +37,8 @@
#include <dev/pcmcia/pcmciachip.h>
+extern int pcmcia_verbose;
+
/*
* Contains information about mapped/allocated i/o spaces.
*/
@@ -176,6 +178,14 @@ struct pcmcia_softc {
bus_size_t iosize; /* size of the i/o space range */
};
+struct pcmcia_cis_quirk {
+ int32_t manufacturer;
+ int32_t product;
+ char *cis1_info[4];
+ struct pcmcia_function *pf;
+ struct pcmcia_config_entry *cfe;
+};
+
struct pcmcia_attach_args {
int32_t manufacturer;
int32_t product;
@@ -193,6 +203,7 @@ struct pcmcia_tuple {
};
void pcmcia_read_cis __P((struct pcmcia_softc *));
+void pcmcia_check_cis_quirks __P((struct pcmcia_softc *));
void pcmcia_print_cis __P((struct pcmcia_softc *));
int pcmcia_scan_cis __P((struct device * dev,
int (*) (struct pcmcia_tuple *, void *), void *));