diff --git a/sys/conf/files b/sys/conf/files index 155015978177..fbb888db2757 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -48,11 +48,6 @@ miidevs.h optional miibus | mii \ compile-with "${AWK} -f $S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ no-obj no-implicit-rule before-depend \ clean "miidevs.h" -pccarddevs.h standard \ - dependency "$S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ - compile-with "${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ - no-obj no-implicit-rule before-depend \ - clean "pccarddevs.h" kbdmuxmap.h optional kbdmux_dflt_keymap \ compile-with "${KEYMAP} -L ${KBDMUX_DFLT_KEYMAP} | ${KEYMAP_FIX} > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ @@ -2607,10 +2602,6 @@ dev/ow/own_if.m optional ow dev/ow/ow_temp.c optional ow_temp dev/ow/owc_gpiobus.c optional owc gpio dev/pbio/pbio.c optional pbio isa -dev/pccard/pccard.c optional pccard -dev/pccard/pccard_cis.c optional pccard -dev/pccard/pccard_cis_quirks.c optional pccard -dev/pccard/pccard_device.c optional pccard dev/pccbb/pccbb.c optional cbb dev/pccbb/pccbb_pci.c optional cbb pci dev/pcf/pcf.c optional pcf diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c deleted file mode 100644 index 8b1c437a8c27..000000000000 --- a/sys/dev/pccard/pccard.c +++ /dev/null @@ -1,1480 +0,0 @@ -/* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1997 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 -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include "power_if.h" -#include "card_if.h" - -#define PCCARDDEBUG - -/* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, - "PCCARD parameters"); - -int pccard_debug = 0; -SYSCTL_INT(_hw_pccard, OID_AUTO, debug, CTLFLAG_RWTUN, - &pccard_debug, 0, - "pccard debug"); - -int pccard_cis_debug = 0; -SYSCTL_INT(_hw_pccard, OID_AUTO, cis_debug, CTLFLAG_RWTUN, - &pccard_cis_debug, 0, "pccard CIS debug"); - -#ifdef PCCARDDEBUG -#define DPRINTF(arg) if (pccard_debug) printf arg -#define DEVPRINTF(arg) if (pccard_debug) device_printf arg -#define PRVERBOSE(arg) printf arg -#define DEVPRVERBOSE(arg) device_printf arg -#else -#define DPRINTF(arg) -#define DEVPRINTF(arg) -#define PRVERBOSE(arg) if (bootverbose) printf arg -#define DEVPRVERBOSE(arg) if (bootverbose) device_printf arg -#endif - -static int pccard_ccr_read(struct pccard_function *pf, int ccr); -static void pccard_ccr_write(struct pccard_function *pf, int ccr, int val); -static int pccard_attach_card(device_t dev); -static int pccard_detach_card(device_t dev); -static void pccard_function_init(struct pccard_function *pf, int entry); -static void pccard_function_free(struct pccard_function *pf); -static int pccard_function_enable(struct pccard_function *pf); -static void pccard_function_disable(struct pccard_function *pf); -static int pccard_probe(device_t dev); -static int pccard_attach(device_t dev); -static int pccard_detach(device_t dev); -static void pccard_print_resources(struct resource_list *rl, - const char *name, int type, int count, const char *format); -static int pccard_print_child(device_t dev, device_t child); -static int pccard_set_resource(device_t dev, device_t child, int type, - int rid, rman_res_t start, rman_res_t count); -static int pccard_get_resource(device_t dev, device_t child, int type, - int rid, rman_res_t *startp, rman_res_t *countp); -static void pccard_delete_resource(device_t dev, device_t child, int type, - int rid); -static int pccard_set_res_flags(device_t dev, device_t child, int type, - int rid, u_long flags); -static int pccard_set_memory_offset(device_t dev, device_t child, int rid, - uint32_t offset, uint32_t *deltap); -static int pccard_probe_and_attach_child(device_t dev, device_t child, - struct pccard_function *pf); -static void pccard_probe_nomatch(device_t cbdev, device_t child); -static int pccard_read_ivar(device_t bus, device_t child, int which, - uintptr_t *result); -static void pccard_driver_added(device_t dev, driver_t *driver); -static struct resource *pccard_alloc_resource(device_t dev, - device_t child, int type, int *rid, rman_res_t start, - rman_res_t end, rman_res_t count, u_int flags); -static int pccard_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -static void pccard_child_detached(device_t parent, device_t dev); -static int pccard_filter(void *arg); -static void pccard_intr(void *arg); -static int pccard_setup_intr(device_t dev, device_t child, - struct resource *irq, int flags, driver_filter_t *filt, - driver_intr_t *intr, void *arg, void **cookiep); -static int pccard_teardown_intr(device_t dev, device_t child, - struct resource *r, void *cookie); - -static const struct pccard_product * -pccard_do_product_lookup(device_t bus, device_t dev, - const struct pccard_product *tab, size_t ent_size, - pccard_product_match_fn matchfn); - -static int -pccard_ccr_read(struct pccard_function *pf, int ccr) -{ - return (bus_space_read_1(pf->pf_ccrt, pf->pf_ccrh, - pf->pf_ccr_offset + ccr)); -} - -static void -pccard_ccr_write(struct pccard_function *pf, int ccr, int val) -{ - if ((pf->ccr_mask) & (1 << (ccr / 2))) { - bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh, - pf->pf_ccr_offset + ccr, val); - } -} - -static int -pccard_set_default_descr(device_t dev) -{ - const char *vendorstr, *prodstr; - uint32_t vendor, prod; - char *str; - - if (pccard_get_vendor_str(dev, &vendorstr)) - return (0); - if (pccard_get_product_str(dev, &prodstr)) - return (0); - if (vendorstr != NULL && prodstr != NULL) { - str = malloc(strlen(vendorstr) + strlen(prodstr) + 2, M_DEVBUF, - M_WAITOK); - sprintf(str, "%s %s", vendorstr, prodstr); - device_set_desc_copy(dev, str); - free(str, M_DEVBUF); - } else { - if (pccard_get_vendor(dev, &vendor)) - return (0); - if (pccard_get_product(dev, &prod)) - return (0); - str = malloc(100, M_DEVBUF, M_WAITOK); - snprintf(str, 100, "vendor=%#x product=%#x", vendor, prod); - device_set_desc_copy(dev, str); - free(str, M_DEVBUF); - } - return (0); -} - -static int -pccard_attach_card(device_t dev) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - struct pccard_function *pf; - struct pccard_ivar *ivar; - device_t child; - int i; - - if (!STAILQ_EMPTY(&sc->card.pf_head)) { - if (bootverbose || pccard_debug) - device_printf(dev, "Card already inserted.\n"); - } - - DEVPRINTF((dev, "chip_socket_enable\n")); - POWER_ENABLE_SOCKET(device_get_parent(dev), dev); - - DEVPRINTF((dev, "read_cis\n")); - pccard_read_cis(sc); - - DEVPRINTF((dev, "check_cis_quirks\n")); - pccard_check_cis_quirks(dev); - - /* - * bail now if the card has no functions, or if there was an error in - * the cis. - */ - - if (sc->card.error) { - device_printf(dev, "CARD ERROR!\n"); - return (1); - } - if (STAILQ_EMPTY(&sc->card.pf_head)) { - device_printf(dev, "Card has no functions!\n"); - return (1); - } - - if (bootverbose || pccard_debug) - pccard_print_cis(dev); - - DEVPRINTF((dev, "functions scanning\n")); - i = -1; - STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { - i++; - if (STAILQ_EMPTY(&pf->cfe_head)) { - device_printf(dev, - "Function %d has no config entries.!\n", i); - continue; - } - pf->sc = sc; - pf->cfe = NULL; - pf->dev = NULL; - } - DEVPRINTF((dev, "Card has %d functions. pccard_mfc is %d\n", i + 1, - pccard_mfc(sc))); - - bus_topo_lock(); - STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { - if (STAILQ_EMPTY(&pf->cfe_head)) - continue; - ivar = malloc(sizeof(struct pccard_ivar), M_DEVBUF, - M_WAITOK | M_ZERO); - resource_list_init(&ivar->resources); - child = device_add_child(dev, NULL, -1); - device_set_ivars(child, ivar); - ivar->pf = pf; - pf->dev = child; - pccard_probe_and_attach_child(dev, child, pf); - } - bus_topo_unlock(); - return (0); -} - -static int -pccard_probe_and_attach_child(device_t dev, device_t child, - struct pccard_function *pf) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - int error; - - /* - * In NetBSD, the drivers are responsible for activating each - * function of a card and selecting the config to use. In - * FreeBSD, all that's done automatically in the typical lazy - * way we do device resource allocation (except we pick the - * cfe up front). This is the biggest depature from the - * inherited NetBSD model, apart from the FreeBSD resource code. - * - * This seems to work well in practice for most cards. - * However, there are two cases that are problematic. If a - * driver wishes to pick and chose which config entry to use, - * then this method falls down. These are usually older - * cards. In addition, there are some cards that have - * multiple hardware units on the cards, but presents only one - * CIS chain. These cards are combination cards, but only one - * of these units can be on at a time. - * - * To overcome this limitation, while preserving the basic - * model, the probe routine can select a cfe and try to - * activate it. If that succeeds, then we'll keep track of - * and let that information persist until we attach the card. - * Probe routines that do this MUST return 0, and cannot - * participate in the bidding process for a device. This - * seems harsh until you realize that if a probe routine knows - * enough to override the cfe we pick, then chances are very - * very good that it is the only driver that could hope to - * cope with the card. Bidding is for generic drivers, and - * while some of them may also match, none of them will do - * configuration override. - */ - error = device_probe(child); - if (error != 0) - goto out; - pccard_function_init(pf, -1); - if (sc->sc_enabled_count == 0) - POWER_ENABLE_SOCKET(device_get_parent(dev), dev); - if (pccard_function_enable(pf) == 0 && - pccard_set_default_descr(child) == 0 && - device_attach(child) == 0) { - DEVPRINTF((sc->dev, "function %d CCR at %d offset %#x " - "mask %#x: %#x %#x %#x %#x, %#x %#x %#x %#x, %#x\n", - pf->number, pf->pf_ccr_window, pf->pf_ccr_offset, - pf->ccr_mask, pccard_ccr_read(pf, 0x00), - pccard_ccr_read(pf, 0x02), pccard_ccr_read(pf, 0x04), - pccard_ccr_read(pf, 0x06), pccard_ccr_read(pf, 0x0A), - pccard_ccr_read(pf, 0x0C), pccard_ccr_read(pf, 0x0E), - pccard_ccr_read(pf, 0x10), pccard_ccr_read(pf, 0x12))); - return (0); - } - error = ENXIO; -out:; - /* - * Probe may fail AND also try to select a cfe, if so, free - * it. This is how we do cfe override. Or the attach fails. - * Either way, we have to clean up. - */ - if (pf->cfe != NULL) - pccard_function_disable(pf); - pf->cfe = NULL; - pccard_function_free(pf); - return error; -} - -static int -pccard_detach_card(device_t dev) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - struct pccard_function *pf; - struct pccard_config_entry *cfe; - struct pccard_ivar *devi; - int state; - - /* - * We are running on either the PCCARD socket's event thread - * or in user context detaching a device by user request. - */ - STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { - if (pf->dev == NULL) - continue; - state = device_get_state(pf->dev); - if (state == DS_ATTACHED) - device_detach(pf->dev); - if (pf->cfe != NULL) - pccard_function_disable(pf); - pccard_function_free(pf); - devi = PCCARD_IVAR(pf->dev); - device_delete_child(dev, pf->dev); - free(devi, M_DEVBUF); - } - if (sc->sc_enabled_count == 0) - POWER_DISABLE_SOCKET(device_get_parent(dev), dev); - - while (NULL != (pf = STAILQ_FIRST(&sc->card.pf_head))) { - while (NULL != (cfe = STAILQ_FIRST(&pf->cfe_head))) { - STAILQ_REMOVE_HEAD(&pf->cfe_head, cfe_list); - free(cfe, M_DEVBUF); - } - STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list); - free(pf, M_DEVBUF); - } - STAILQ_INIT(&sc->card.pf_head); - return (0); -} - -static const struct pccard_product * -pccard_do_product_lookup(device_t bus, device_t dev, - const struct pccard_product *tab, size_t ent_size, - pccard_product_match_fn matchfn) -{ - const struct pccard_product *ent; - int matches; - uint32_t vendor; - uint32_t prod; - const char *vendorstr; - const char *prodstr; - const char *cis3str; - const char *cis4str; - -#ifdef DIAGNOSTIC - if (sizeof *ent > ent_size) - panic("pccard_product_lookup: bogus ent_size %jd", - (intmax_t) ent_size); -#endif - if (pccard_get_vendor(dev, &vendor)) - return (NULL); - if (pccard_get_product(dev, &prod)) - return (NULL); - if (pccard_get_vendor_str(dev, &vendorstr)) - return (NULL); - if (pccard_get_product_str(dev, &prodstr)) - return (NULL); - if (pccard_get_cis3_str(dev, &cis3str)) - return (NULL); - if (pccard_get_cis4_str(dev, &cis4str)) - return (NULL); - for (ent = tab; ent->pp_vendor != 0; ent = - (const struct pccard_product *) ((const char *) ent + ent_size)) { - matches = 1; - if (ent->pp_vendor == PCCARD_VENDOR_ANY && - ent->pp_product == PCCARD_PRODUCT_ANY && - ent->pp_cis[0] == NULL && - ent->pp_cis[1] == NULL) { - if (ent->pp_name) - device_printf(dev, - "Total wildcard entry ignored for %s\n", - ent->pp_name); - continue; - } - if (matches && ent->pp_vendor != PCCARD_VENDOR_ANY && - vendor != ent->pp_vendor) - matches = 0; - if (matches && ent->pp_product != PCCARD_PRODUCT_ANY && - prod != ent->pp_product) - matches = 0; - if (matches && ent->pp_cis[0] && - (vendorstr == NULL || - strcmp(ent->pp_cis[0], vendorstr) != 0)) - matches = 0; - if (matches && ent->pp_cis[1] && - (prodstr == NULL || - strcmp(ent->pp_cis[1], prodstr) != 0)) - matches = 0; - if (matches && ent->pp_cis[2] && - (cis3str == NULL || - strcmp(ent->pp_cis[2], cis3str) != 0)) - matches = 0; - if (matches && ent->pp_cis[3] && - (cis4str == NULL || - strcmp(ent->pp_cis[3], cis4str) != 0)) - matches = 0; - if (matchfn != NULL) - matches = (*matchfn)(dev, ent, matches); - if (matches) - return (ent); - } - return (NULL); -} - -/** - * @brief pccard_select_cfe - * - * Select a cfe entry to use. Should be called from the pccard's probe - * routine after it knows for sure that it wants this card. - * - * XXX I think we need to make this symbol be static, ala the kobj stuff - * we do for everything else. This is a quick hack. - */ -int -pccard_select_cfe(device_t dev, int entry) -{ - struct pccard_ivar *devi = PCCARD_IVAR(dev); - struct pccard_function *pf = devi->pf; - - pccard_function_init(pf, entry); - return (pf->cfe ? 0 : ENOMEM); -} - -/* - * Initialize a PCCARD function. May be called as long as the function is - * disabled. - * - * Note: pccard_function_init should not keep resources allocated. It should - * only set them up ala isa pnp, set the values in the rl lists, and return. - * Any resource held after pccard_function_init is called is a bug. However, - * the bus routines to get the resources also assume that pccard_function_init - * does this, so they need to be fixed too. - */ -static void -pccard_function_init(struct pccard_function *pf, int entry) -{ - struct pccard_config_entry *cfe; - struct pccard_ivar *devi = PCCARD_IVAR(pf->dev); - struct resource_list *rl = &devi->resources; - struct resource_list_entry *rle; - struct resource *r = NULL; - struct pccard_ce_iospace *ios; - struct pccard_ce_memspace *mems; - device_t bus; - rman_res_t start, end, len; - int i, rid, spaces; - - if (pf->pf_flags & PFF_ENABLED) { - printf("pccard_function_init: function is enabled"); - return; - } - - /* - * Driver probe routine requested a specific entry already - * that succeeded. - */ - if (pf->cfe != NULL) - return; - - /* - * walk the list of configuration entries until we find one that - * we can allocate all the resources to. - */ - bus = device_get_parent(pf->dev); - STAILQ_FOREACH(cfe, &pf->cfe_head, cfe_list) { - if (cfe->iftype != PCCARD_IFTYPE_IO) - continue; - if (entry != -1 && cfe->number != entry) - continue; - spaces = 0; - for (i = 0; i < cfe->num_iospace; i++) { - ios = cfe->iospace + i; - start = ios->start; - if (start) - end = start + ios->length - 1; - else - end = ~0; - DEVPRINTF((bus, "I/O rid %d start %#jx end %#jx\n", - i, start, end)); - rid = i; - len = ios->length; - r = bus_alloc_resource(bus, SYS_RES_IOPORT, &rid, - start, end, len, rman_make_alignment_flags(len)); - if (r == NULL) { - DEVPRINTF((bus, "I/O rid %d failed\n", i)); - goto not_this_one; - } - rle = resource_list_add(rl, SYS_RES_IOPORT, - rid, rman_get_start(r), rman_get_end(r), len); - if (rle == NULL) - panic("Cannot add resource rid %d IOPORT", rid); - rle->res = r; - spaces++; - } - for (i = 0; i < cfe->num_memspace; i++) { - mems = cfe->memspace + i; - start = mems->cardaddr + mems->hostaddr; - if (start) - end = start + mems->length - 1; - else - end = ~0; - DEVPRINTF((bus, "Memory rid %d start %#jx end %#jx\ncardaddr %#jx hostaddr %#jx length %#jx\n", - i, start, end, mems->cardaddr, mems->hostaddr, - mems->length)); - rid = i; - len = mems->length; - r = bus_alloc_resource(bus, SYS_RES_MEMORY, &rid, - start, end, len, rman_make_alignment_flags(len)); - if (r == NULL) { - DEVPRINTF((bus, "Memory rid %d failed\n", i)); -// goto not_this_one; - continue; - } - rle = resource_list_add(rl, SYS_RES_MEMORY, - rid, rman_get_start(r), rman_get_end(r), len); - if (rle == NULL) - panic("Cannot add resource rid %d MEM", rid); - rle->res = r; - spaces++; - } - if (spaces == 0) { - DEVPRINTF((bus, "Neither memory nor I/O mapped\n")); - goto not_this_one; - } - if (cfe->irqmask) { - rid = 0; - r = bus_alloc_resource_any(bus, SYS_RES_IRQ, &rid, - RF_SHAREABLE); - if (r == NULL) { - DEVPRINTF((bus, "IRQ rid %d failed\n", rid)); - goto not_this_one; - } - rle = resource_list_add(rl, SYS_RES_IRQ, rid, - rman_get_start(r), rman_get_end(r), 1); - if (rle == NULL) - panic("Cannot add resource rid %d IRQ", rid); - rle->res = r; - } - /* If we get to here, we've allocated all we need */ - pf->cfe = cfe; - break; - not_this_one:; - DEVPRVERBOSE((bus, "Allocation failed for cfe %d\n", - cfe->number)); - resource_list_purge(rl); - } -} - -/* - * Free resources allocated by pccard_function_init(), May be called as long - * as the function is disabled. - * - * NOTE: This function should be unnecessary. pccard_function_init should - * never keep resources initialized. - */ -static void -pccard_function_free(struct pccard_function *pf) -{ - struct pccard_ivar *devi = PCCARD_IVAR(pf->dev); - struct resource_list_entry *rle; - - if (pf->pf_flags & PFF_ENABLED) { - printf("pccard_function_free: function is enabled"); - return; - } - - STAILQ_FOREACH(rle, &devi->resources, link) { - if (rle->res) { - if (rman_get_device(rle->res) != pf->sc->dev) - device_printf(pf->sc->dev, - "function_free: Resource still owned by " - "child, oops. " - "(type=%d, rid=%d, addr=%#jx)\n", - rle->type, rle->rid, - rman_get_start(rle->res)); - BUS_RELEASE_RESOURCE(device_get_parent(pf->sc->dev), - pf->sc->dev, rle->type, rle->rid, rle->res); - rle->res = NULL; - } - } - resource_list_free(&devi->resources); -} - -static void -pccard_mfc_adjust_iobase(struct pccard_function *pf, rman_res_t addr, - rman_res_t offset, rman_res_t size) -{ - bus_size_t iosize, tmp; - - if (addr != 0) { - if (pf->pf_mfc_iomax == 0) { - pf->pf_mfc_iobase = addr + offset; - pf->pf_mfc_iomax = pf->pf_mfc_iobase + size; - } else { - /* this makes the assumption that nothing overlaps */ - if (pf->pf_mfc_iobase > addr + offset) - pf->pf_mfc_iobase = addr + offset; - if (pf->pf_mfc_iomax < addr + offset + size) - pf->pf_mfc_iomax = addr + offset + size; - } - } - - tmp = pf->pf_mfc_iomax - pf->pf_mfc_iobase; - /* round up to nearest (2^n)-1 */ - for (iosize = 1; iosize < tmp; iosize <<= 1) - ; - iosize--; - - DEVPRINTF((pf->dev, "MFC: I/O base %#jx IOSIZE %#jx\n", - (uintmax_t)pf->pf_mfc_iobase, (uintmax_t)(iosize + 1))); - pccard_ccr_write(pf, PCCARD_CCR_IOBASE0, - pf->pf_mfc_iobase & 0xff); - pccard_ccr_write(pf, PCCARD_CCR_IOBASE1, - (pf->pf_mfc_iobase >> 8) & 0xff); - pccard_ccr_write(pf, PCCARD_CCR_IOBASE2, 0); - pccard_ccr_write(pf, PCCARD_CCR_IOBASE3, 0); - pccard_ccr_write(pf, PCCARD_CCR_IOSIZE, iosize); -} - -/* Enable a PCCARD function */ -static int -pccard_function_enable(struct pccard_function *pf) -{ - struct pccard_function *tmp; - int reg; - device_t dev = pf->sc->dev; - - if (pf->cfe == NULL) { - DEVPRVERBOSE((dev, "No config entry could be allocated.\n")); - return (ENOMEM); - } - - if (pf->pf_flags & PFF_ENABLED) - return (0); - pf->sc->sc_enabled_count++; - - /* - * it's possible for different functions' CCRs to be in the same - * underlying page. Check for that. - */ - STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) { - if ((tmp->pf_flags & PFF_ENABLED) && - (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) && - ((pf->ccr_base + PCCARD_CCR_SIZE) <= - (tmp->ccr_base - tmp->pf_ccr_offset + - tmp->pf_ccr_realsize))) { - pf->pf_ccrt = tmp->pf_ccrt; - pf->pf_ccrh = tmp->pf_ccrh; - pf->pf_ccr_realsize = tmp->pf_ccr_realsize; - - /* - * pf->pf_ccr_offset = (tmp->pf_ccr_offset - - * tmp->ccr_base) + pf->ccr_base; - */ - /* pf->pf_ccr_offset = - (tmp->pf_ccr_offset + pf->ccr_base) - - tmp->ccr_base; */ - pf->pf_ccr_window = tmp->pf_ccr_window; - break; - } - } - if (tmp == NULL) { - pf->ccr_rid = 0; - pf->ccr_res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, - &pf->ccr_rid, PCCARD_MEM_PAGE_SIZE, RF_ACTIVE); - if (!pf->ccr_res) - goto bad; - DEVPRINTF((dev, "ccr_res == %#jx-%#jx, base=%#x\n", - rman_get_start(pf->ccr_res), rman_get_end(pf->ccr_res), - pf->ccr_base)); - CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY, - pf->ccr_rid, PCCARD_A_MEM_ATTR); - CARD_SET_MEMORY_OFFSET(device_get_parent(dev), dev, - pf->ccr_rid, pf->ccr_base, &pf->pf_ccr_offset); - pf->pf_ccrt = rman_get_bustag(pf->ccr_res); - pf->pf_ccrh = rman_get_bushandle(pf->ccr_res); - pf->pf_ccr_realsize = 1; - } - - reg = (pf->cfe->number & PCCARD_CCR_OPTION_CFINDEX); - reg |= PCCARD_CCR_OPTION_LEVIREQ; - if (pccard_mfc(pf->sc)) { - reg |= (PCCARD_CCR_OPTION_FUNC_ENABLE | - PCCARD_CCR_OPTION_ADDR_DECODE); - /* PCCARD_CCR_OPTION_IRQ_ENABLE set elsewhere as needed */ - } - pccard_ccr_write(pf, PCCARD_CCR_OPTION, reg); - - reg = 0; - if ((pf->cfe->flags & PCCARD_CFE_IO16) == 0) - reg |= PCCARD_CCR_STATUS_IOIS8; - if (pf->cfe->flags & PCCARD_CFE_AUDIO) - reg |= PCCARD_CCR_STATUS_AUDIO; - pccard_ccr_write(pf, PCCARD_CCR_STATUS, reg); - - pccard_ccr_write(pf, PCCARD_CCR_SOCKETCOPY, 0); - - if (pccard_mfc(pf->sc)) - pccard_mfc_adjust_iobase(pf, 0, 0, 0); - -#ifdef PCCARDDEBUG - if (pccard_debug) { - STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) { - device_printf(tmp->sc->dev, - "function %d CCR at %d offset %#x: " - "%#x %#x %#x %#x, %#x %#x %#x %#x, %#x\n", - tmp->number, tmp->pf_ccr_window, - tmp->pf_ccr_offset, - pccard_ccr_read(tmp, 0x00), - pccard_ccr_read(tmp, 0x02), - pccard_ccr_read(tmp, 0x04), - pccard_ccr_read(tmp, 0x06), - pccard_ccr_read(tmp, 0x0A), - pccard_ccr_read(tmp, 0x0C), - pccard_ccr_read(tmp, 0x0E), - pccard_ccr_read(tmp, 0x10), - pccard_ccr_read(tmp, 0x12)); - } - } -#endif - pf->pf_flags |= PFF_ENABLED; - return (0); - - bad: - /* - * Decrement the reference count, and power down the socket, if - * necessary. - */ - pf->sc->sc_enabled_count--; - DEVPRINTF((dev, "bad --enabled_count = %d\n", pf->sc->sc_enabled_count)); - - return (1); -} - -/* Disable PCCARD function. */ -static void -pccard_function_disable(struct pccard_function *pf) -{ - struct pccard_function *tmp; - device_t dev = pf->sc->dev; - - if (pf->cfe == NULL) - panic("pccard_function_disable: function not initialized"); - - if ((pf->pf_flags & PFF_ENABLED) == 0) - return; - if (pf->intr_handler != NULL) { - struct pccard_ivar *devi = PCCARD_IVAR(pf->dev); - struct resource_list_entry *rle = - resource_list_find(&devi->resources, SYS_RES_IRQ, 0); - if (rle == NULL) - panic("Can't disable an interrupt with no IRQ res\n"); - BUS_TEARDOWN_INTR(dev, pf->dev, rle->res, - pf->intr_handler_cookie); - } - - /* - * it's possible for different functions' CCRs to be in the same - * underlying page. Check for that. Note we mark us as disabled - * first to avoid matching ourself. - */ - - pf->pf_flags &= ~PFF_ENABLED; - STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) { - if ((tmp->pf_flags & PFF_ENABLED) && - (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) && - ((pf->ccr_base + PCCARD_CCR_SIZE) <= - (tmp->ccr_base - tmp->pf_ccr_offset + - tmp->pf_ccr_realsize))) - break; - } - - /* Not used by anyone else; unmap the CCR. */ - if (tmp == NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, pf->ccr_rid, - pf->ccr_res); - pf->ccr_res = NULL; - } - - /* - * Decrement the reference count, and power down the socket, if - * necessary. - */ - pf->sc->sc_enabled_count--; -} - -#define PCCARD_NPORT 2 -#define PCCARD_NMEM 5 -#define PCCARD_NIRQ 1 -#define PCCARD_NDRQ 0 - -static int -pccard_probe(device_t dev) -{ - device_set_desc(dev, "16-bit PCCard bus"); - return (0); -} - -static int -pccard_attach(device_t dev) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - int err; - - sc->dev = dev; - sc->sc_enabled_count = 0; - if ((err = pccard_device_create(sc)) != 0) - return (err); - gone_in_dev(dev, 13, "PC Card to be removed."); - STAILQ_INIT(&sc->card.pf_head); - return (bus_generic_attach(dev)); -} - -static int -pccard_detach(device_t dev) -{ - pccard_detach_card(dev); - pccard_device_destroy(device_get_softc(dev)); - return (0); -} - -static int -pccard_suspend(device_t self) -{ - pccard_detach_card(self); - return (0); -} - -static -int -pccard_resume(device_t self) -{ - return (0); -} - -static void -pccard_print_resources(struct resource_list *rl, const char *name, int type, - int count, const char *format) -{ - struct resource_list_entry *rle; - int printed; - int i; - - printed = 0; - for (i = 0; i < count; i++) { - rle = resource_list_find(rl, type, i); - if (rle != NULL) { - if (printed == 0) - printf(" %s ", name); - else if (printed > 0) - printf(","); - printed++; - printf(format, rle->start); - if (rle->count > 1) { - printf("-"); - printf(format, rle->start + rle->count - 1); - } - } else if (i > 3) { - /* check the first few regardless */ - break; - } - } -} - -static int -pccard_print_child(device_t dev, device_t child) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct resource_list *rl = &devi->resources; - int retval = 0; - - retval += bus_print_child_header(dev, child); - retval += printf(" at"); - - if (devi != NULL) { - pccard_print_resources(rl, "port", SYS_RES_IOPORT, - PCCARD_NPORT, "%#lx"); - pccard_print_resources(rl, "iomem", SYS_RES_MEMORY, - PCCARD_NMEM, "%#lx"); - pccard_print_resources(rl, "irq", SYS_RES_IRQ, PCCARD_NIRQ, - "%ld"); - pccard_print_resources(rl, "drq", SYS_RES_DRQ, PCCARD_NDRQ, - "%ld"); - retval += printf(" function %d config %d", devi->pf->number, - devi->pf->cfe->number); - } - - retval += bus_print_child_footer(dev, child); - - return (retval); -} - -static int -pccard_set_resource(device_t dev, device_t child, int type, int rid, - rman_res_t start, rman_res_t count) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct resource_list *rl = &devi->resources; - - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY - && type != SYS_RES_IRQ && type != SYS_RES_DRQ) - return (EINVAL); - if (rid < 0) - return (EINVAL); - if (type == SYS_RES_IOPORT && rid >= PCCARD_NPORT) - return (EINVAL); - if (type == SYS_RES_MEMORY && rid >= PCCARD_NMEM) - return (EINVAL); - if (type == SYS_RES_IRQ && rid >= PCCARD_NIRQ) - return (EINVAL); - if (type == SYS_RES_DRQ && rid >= PCCARD_NDRQ) - return (EINVAL); - - resource_list_add(rl, type, rid, start, start + count - 1, count); - if (NULL != resource_list_alloc(rl, device_get_parent(dev), dev, - type, &rid, start, start + count - 1, count, 0)) - return 0; - else - return ENOMEM; -} - -static int -pccard_get_resource(device_t dev, device_t child, int type, int rid, - rman_res_t *startp, rman_res_t *countp) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct resource_list *rl = &devi->resources; - struct resource_list_entry *rle; - - rle = resource_list_find(rl, type, rid); - if (rle == NULL) - return (ENOENT); - - if (startp != NULL) - *startp = rle->start; - if (countp != NULL) - *countp = rle->count; - - return (0); -} - -static void -pccard_delete_resource(device_t dev, device_t child, int type, int rid) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct resource_list *rl = &devi->resources; - resource_list_delete(rl, type, rid); -} - -static int -pccard_set_res_flags(device_t dev, device_t child, int type, int rid, - u_long flags) -{ - return (CARD_SET_RES_FLAGS(device_get_parent(dev), child, type, - rid, flags)); -} - -static int -pccard_set_memory_offset(device_t dev, device_t child, int rid, - uint32_t offset, uint32_t *deltap) - -{ - return (CARD_SET_MEMORY_OFFSET(device_get_parent(dev), child, rid, - offset, deltap)); -} - -static void -pccard_probe_nomatch(device_t bus, device_t child) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - struct pccard_softc *sc = PCCARD_SOFTC(bus); - int i; - - device_printf(bus, ""); - printf(" (manufacturer=0x%04x, product=0x%04x, function_type=%d) " - "at function %d\n", sc->card.manufacturer, sc->card.product, - pf->function, pf->number); - device_printf(bus, " CIS info: "); - for (i = 0; sc->card.cis1_info[i] != NULL && i < 4; i++) - printf("%s%s", i > 0 ? ", " : "", sc->card.cis1_info[i]); - printf("\n"); - return; -} - -static int -pccard_child_location(device_t bus, device_t child, struct sbuf *sb) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - - sbuf_printf(sb, "function=%d", pf->number); - return (0); -} - -static int -pccard_child_pnpinfo(device_t bus, device_t child, struct sbuf *sb) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - struct pccard_softc *sc = PCCARD_SOFTC(bus); - - sbuf_printf(sb, "manufacturer=0x%04x product=0x%04x " - "cisvendor=\"", sc->card.manufacturer, sc->card.product); - devctl_safe_quote_sb(sb, sc->card.cis1_info[0]); - sbuf_printf(sb, "\" cisproduct=\""); - devctl_safe_quote_sb(sb, sc->card.cis1_info[1]); - sbuf_printf(sb, "\" function_type=%d", pf->function); - - return (0); -} - -static int -pccard_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - struct pccard_softc *sc = PCCARD_SOFTC(bus); - - if (!pf) - panic("No pccard function pointer"); - switch (which) { - default: - return (EINVAL); - case PCCARD_IVAR_FUNCE_DISK: - *(uint16_t *)result = pf->pf_funce_disk_interface | - (pf->pf_funce_disk_power << 8); - break; - case PCCARD_IVAR_ETHADDR: - bcopy(pf->pf_funce_lan_nid, result, ETHER_ADDR_LEN); - break; - case PCCARD_IVAR_VENDOR: - *(uint32_t *)result = sc->card.manufacturer; - break; - case PCCARD_IVAR_PRODUCT: - *(uint32_t *)result = sc->card.product; - break; - case PCCARD_IVAR_PRODEXT: - *(uint16_t *)result = sc->card.prodext; - break; - case PCCARD_IVAR_FUNCTION: - *(uint32_t *)result = pf->function; - break; - case PCCARD_IVAR_FUNCTION_NUMBER: - *(uint32_t *)result = pf->number; - break; - case PCCARD_IVAR_VENDOR_STR: - *(const char **)result = sc->card.cis1_info[0]; - break; - case PCCARD_IVAR_PRODUCT_STR: - *(const char **)result = sc->card.cis1_info[1]; - break; - case PCCARD_IVAR_CIS3_STR: - *(const char **)result = sc->card.cis1_info[2]; - break; - case PCCARD_IVAR_CIS4_STR: - *(const char **)result = sc->card.cis1_info[3]; - break; - } - return (0); -} - -static void -pccard_driver_added(device_t dev, driver_t *driver) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - struct pccard_function *pf; - device_t child; - - STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { - if (STAILQ_EMPTY(&pf->cfe_head)) - continue; - child = pf->dev; - if (device_get_state(child) != DS_NOTPRESENT) - continue; - pccard_probe_and_attach_child(dev, child, pf); - } - return; -} - -static struct resource * -pccard_alloc_resource(device_t dev, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct pccard_ivar *dinfo; - struct resource_list_entry *rle = NULL; - int passthrough = (device_get_parent(child) != dev); - int isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); - struct resource *r = NULL; - - /* XXX I'm no longer sure this is right */ - if (passthrough) { - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - type, rid, start, end, count, flags)); - } - - dinfo = device_get_ivars(child); - rle = resource_list_find(&dinfo->resources, type, *rid); - - if (rle == NULL && isdefault) - return (NULL); /* no resource of that type/rid */ - if (rle == NULL || rle->res == NULL) { - /* XXX Need to adjust flags */ - r = bus_alloc_resource(dev, type, rid, start, end, - count, flags); - if (r == NULL) - goto bad; - resource_list_add(&dinfo->resources, type, *rid, - rman_get_start(r), rman_get_end(r), count); - rle = resource_list_find(&dinfo->resources, type, *rid); - if (!rle) - goto bad; - rle->res = r; - } - /* - * If dev doesn't own the device, then we can't give this device - * out. - */ - if (rman_get_device(rle->res) != dev) - return (NULL); - rman_set_device(rle->res, child); - if (flags & RF_ACTIVE) - BUS_ACTIVATE_RESOURCE(dev, child, type, *rid, rle->res); - return (rle->res); -bad:; - device_printf(dev, "WARNING: Resource not reserved by pccard\n"); - return (NULL); -} - -static int -pccard_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - struct pccard_ivar *dinfo; - int passthrough = (device_get_parent(child) != dev); - struct resource_list_entry *rle = NULL; - - if (passthrough) - return BUS_RELEASE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - - dinfo = device_get_ivars(child); - - rle = resource_list_find(&dinfo->resources, type, rid); - - if (!rle) { - device_printf(dev, "Allocated resource not found, " - "%d %#x %#jx %#jx\n", - type, rid, rman_get_start(r), rman_get_size(r)); - return ENOENT; - } - if (!rle->res) { - device_printf(dev, "Allocated resource not recorded\n"); - return ENOENT; - } - /* - * Deactivate the resource (since it is being released), and - * assign it to the bus. - */ - BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, rle->res); - rman_set_device(rle->res, dev); - return (0); -} - -static void -pccard_child_detached(device_t parent, device_t dev) -{ - struct pccard_ivar *ivar = PCCARD_IVAR(dev); - struct pccard_function *pf = ivar->pf; - - pccard_function_disable(pf); -} - -static int -pccard_filter(void *arg) -{ - struct pccard_function *pf = (struct pccard_function*) arg; - int reg; - int doisr = 1; - - /* - * MFC cards know if they interrupted, so we have to ack the - * interrupt and call the ISR. Non-MFC cards don't have these - * bits, so they always get called. Many non-MFC cards have - * this bit set always upon read, but some do not. - * - * We always ack the interrupt, even if there's no ISR - * for the card. This is done on the theory that acking - * the interrupt will pacify the card enough to keep an - * interrupt storm from happening. Of course this won't - * help in the non-MFC case. - * - * This has no impact for MPSAFEness of the client drivers. - * We register this with whatever flags the intr_handler - * was registered with. All these functions are MPSAFE. - */ - if (pccard_mfc(pf->sc)) { - reg = pccard_ccr_read(pf, PCCARD_CCR_STATUS); - if (reg & PCCARD_CCR_STATUS_INTR) - pccard_ccr_write(pf, PCCARD_CCR_STATUS, - reg & ~PCCARD_CCR_STATUS_INTR); - else - doisr = 0; - } - if (doisr) { - if (pf->intr_filter != NULL) - return (pf->intr_filter(pf->intr_handler_arg)); - return (FILTER_SCHEDULE_THREAD); - } - return (FILTER_STRAY); -} - -static void -pccard_intr(void *arg) -{ - struct pccard_function *pf = (struct pccard_function*) arg; - - pf->intr_handler(pf->intr_handler_arg); -} - -static int -pccard_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, - void **cookiep) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - struct pccard_ivar *ivar = PCCARD_IVAR(child); - struct pccard_function *pf = ivar->pf; - int err; - - if (pf->intr_filter != NULL || pf->intr_handler != NULL) - panic("Only one interrupt handler per function allowed"); - pf->intr_filter = filt; - pf->intr_handler = intr; - pf->intr_handler_arg = arg; - err = bus_generic_setup_intr(dev, child, irq, flags, pccard_filter, - intr ? pccard_intr : NULL, pf, cookiep); - if (err != 0) { - pf->intr_filter = NULL; - pf->intr_handler = NULL; - return (err); - } - pf->intr_handler_cookie = *cookiep; - if (pccard_mfc(sc)) { - pccard_ccr_write(pf, PCCARD_CCR_OPTION, - pccard_ccr_read(pf, PCCARD_CCR_OPTION) | - PCCARD_CCR_OPTION_IREQ_ENABLE); - } - return (0); -} - -static int -pccard_teardown_intr(device_t dev, device_t child, struct resource *r, - void *cookie) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - struct pccard_ivar *ivar = PCCARD_IVAR(child); - struct pccard_function *pf = ivar->pf; - int ret; - - if (pccard_mfc(sc)) { - pccard_ccr_write(pf, PCCARD_CCR_OPTION, - pccard_ccr_read(pf, PCCARD_CCR_OPTION) & - ~PCCARD_CCR_OPTION_IREQ_ENABLE); - } - ret = bus_generic_teardown_intr(dev, child, r, cookie); - if (ret == 0) { - pf->intr_handler = NULL; - pf->intr_handler_arg = NULL; - pf->intr_handler_cookie = NULL; - } - - return (ret); -} - -static int -pccard_activate_resource(device_t brdev, device_t child, int type, int rid, - struct resource *r) -{ - struct pccard_ivar *ivar = PCCARD_IVAR(child); - struct pccard_function *pf = ivar->pf; - - switch(type) { - case SYS_RES_IOPORT: - /* - * We need to adjust IOBASE[01] and IOSIZE if we're an MFC - * card. - */ - if (pccard_mfc(pf->sc)) - pccard_mfc_adjust_iobase(pf, rman_get_start(r), 0, - rman_get_size(r)); - break; - default: - break; - } - return (bus_generic_activate_resource(brdev, child, type, rid, r)); -} - -static int -pccard_deactivate_resource(device_t brdev, device_t child, int type, - int rid, struct resource *r) -{ - /* XXX undo pccard_activate_resource? XXX */ - return (bus_generic_deactivate_resource(brdev, child, type, rid, r)); -} - -static int -pccard_attr_read_impl(device_t brdev, device_t child, uint32_t offset, - uint8_t *val) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - - /* - * Optimization. Most of the time, devices want to access - * the same page of the attribute memory that the CCR is in. - * We take advantage of this fact here. - */ - if (offset / PCCARD_MEM_PAGE_SIZE == - pf->ccr_base / PCCARD_MEM_PAGE_SIZE) - *val = bus_space_read_1(pf->pf_ccrt, pf->pf_ccrh, - offset % PCCARD_MEM_PAGE_SIZE); - else { - CARD_SET_MEMORY_OFFSET(brdev, child, pf->ccr_rid, offset, - &offset); - *val = bus_space_read_1(pf->pf_ccrt, pf->pf_ccrh, offset); - CARD_SET_MEMORY_OFFSET(brdev, child, pf->ccr_rid, pf->ccr_base, - &offset); - } - return 0; -} - -static int -pccard_attr_write_impl(device_t brdev, device_t child, uint32_t offset, - uint8_t val) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - - /* - * Optimization. Most of the time, devices want to access - * the same page of the attribute memory that the CCR is in. - * We take advantage of this fact here. - */ - if (offset / PCCARD_MEM_PAGE_SIZE == - pf->ccr_base / PCCARD_MEM_PAGE_SIZE) - bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh, - offset % PCCARD_MEM_PAGE_SIZE, val); - else { - CARD_SET_MEMORY_OFFSET(brdev, child, pf->ccr_rid, offset, - &offset); - bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh, offset, val); - CARD_SET_MEMORY_OFFSET(brdev, child, pf->ccr_rid, pf->ccr_base, - &offset); - } - - return 0; -} - -static int -pccard_ccr_read_impl(device_t brdev, device_t child, uint32_t offset, - uint8_t *val) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - - *val = pccard_ccr_read(devi->pf, offset); - DEVPRINTF((child, "ccr_read of %#x (%#x) is %#x\n", offset, - devi->pf->pf_ccr_offset, *val)); - return 0; -} - -static int -pccard_ccr_write_impl(device_t brdev, device_t child, uint32_t offset, - uint8_t val) -{ - struct pccard_ivar *devi = PCCARD_IVAR(child); - struct pccard_function *pf = devi->pf; - - /* - * Can't use pccard_ccr_write since client drivers may access - * registers not contained in the 'mask' if they are non-standard. - */ - DEVPRINTF((child, "ccr_write of %#x to %#x (%#x)\n", val, offset, - devi->pf->pf_ccr_offset)); - bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh, pf->pf_ccr_offset + offset, - val); - return 0; -} - -static device_method_t pccard_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, pccard_probe), - DEVMETHOD(device_attach, pccard_attach), - DEVMETHOD(device_detach, pccard_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, pccard_suspend), - DEVMETHOD(device_resume, pccard_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, pccard_print_child), - DEVMETHOD(bus_driver_added, pccard_driver_added), - DEVMETHOD(bus_child_detached, pccard_child_detached), - DEVMETHOD(bus_alloc_resource, pccard_alloc_resource), - DEVMETHOD(bus_release_resource, pccard_release_resource), - DEVMETHOD(bus_activate_resource, pccard_activate_resource), - DEVMETHOD(bus_deactivate_resource, pccard_deactivate_resource), - DEVMETHOD(bus_setup_intr, pccard_setup_intr), - DEVMETHOD(bus_teardown_intr, pccard_teardown_intr), - DEVMETHOD(bus_set_resource, pccard_set_resource), - DEVMETHOD(bus_get_resource, pccard_get_resource), - DEVMETHOD(bus_delete_resource, pccard_delete_resource), - DEVMETHOD(bus_probe_nomatch, pccard_probe_nomatch), - DEVMETHOD(bus_read_ivar, pccard_read_ivar), - DEVMETHOD(bus_child_pnpinfo, pccard_child_pnpinfo), - DEVMETHOD(bus_child_location, pccard_child_location), - - /* Card Interface */ - DEVMETHOD(card_set_res_flags, pccard_set_res_flags), - DEVMETHOD(card_set_memory_offset, pccard_set_memory_offset), - DEVMETHOD(card_attach_card, pccard_attach_card), - DEVMETHOD(card_detach_card, pccard_detach_card), - DEVMETHOD(card_do_product_lookup, pccard_do_product_lookup), - DEVMETHOD(card_cis_scan, pccard_scan_cis), - DEVMETHOD(card_attr_read, pccard_attr_read_impl), - DEVMETHOD(card_attr_write, pccard_attr_write_impl), - DEVMETHOD(card_ccr_read, pccard_ccr_read_impl), - DEVMETHOD(card_ccr_write, pccard_ccr_write_impl), - { 0, 0 } -}; - -static driver_t pccard_driver = { - "pccard", - pccard_methods, - sizeof(struct pccard_softc) -}; - -devclass_t pccard_devclass; - -/* Maybe we need to have a slot device? */ -DRIVER_MODULE(pccard, pcic, pccard_driver, pccard_devclass, 0, 0); -DRIVER_MODULE(pccard, cbb, pccard_driver, pccard_devclass, 0, 0); -MODULE_VERSION(pccard, 1); diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c deleted file mode 100644 index a221d9377ba4..000000000000 --- a/sys/dev/pccard/pccard_cis.c +++ /dev/null @@ -1,1308 +0,0 @@ -/* $NetBSD: pcmcia_cis.c,v 1.17 2000/02/10 09:01:52 chopps Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1997 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 -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "card_if.h" - -extern int pccard_cis_debug; - -#define PCCARDCISDEBUG -#ifdef PCCARDCISDEBUG -#define DPRINTF(arg) do { if (pccard_cis_debug) printf arg; } while (0) -#define DEVPRINTF(arg) do { if (pccard_cis_debug) device_printf arg; } while (0) -#else -#define DPRINTF(arg) -#define DEVPRINTF(arg) -#endif - -#define PCCARD_CIS_SIZE 4096 - -struct cis_state { - int count; - int gotmfc; - struct pccard_config_entry temp_cfe; - struct pccard_config_entry *default_cfe; - struct pccard_card *card; - struct pccard_function *pf; -}; - -static int pccard_parse_cis_tuple(const struct pccard_tuple *, void *); -static int decode_funce(const struct pccard_tuple *, struct pccard_function *); - -void -pccard_read_cis(struct pccard_softc *sc) -{ - struct cis_state state; - - bzero(&state, sizeof state); - state.card = &sc->card; - state.card->error = 0; - state.card->cis1_major = -1; - state.card->cis1_minor = -1; - state.card->cis1_info[0] = NULL; - state.card->cis1_info[1] = NULL; - state.card->cis1_info[2] = NULL; - state.card->cis1_info[3] = NULL; - state.card->manufacturer = PCMCIA_VENDOR_INVALID; - state.card->product = PCMCIA_PRODUCT_INVALID; - STAILQ_INIT(&state.card->pf_head); - state.pf = NULL; - - /* - * XXX The following shouldn't be needed, but some slow cards - * XXX seem to need it still. Need to investigate if there's - * XXX a way to tell if the card is 'ready' or not rather than - * XXX sleeping like this. We're called just after the power - * XXX up of the socket. The standard timing diagrams don't - * XXX seem to indicate that a delay is required. The old - * XXX delay was 1s. This delay is .1s. - */ - pause("pccard", hz / 10); - if (pccard_scan_cis(device_get_parent(sc->dev), sc->dev, - pccard_parse_cis_tuple, &state) == -1) - state.card->error++; -} - -int -pccard_scan_cis(device_t bus, device_t dev, pccard_scan_t fct, void *arg) -{ - struct resource *res; - int rid; - struct pccard_tuple tuple; - int longlink_present; - int longlink_common; - u_long longlink_addr; /* Type suspect */ - int mfc_count; - int mfc_index; -#ifdef PCCARDCISDEBUG - int cis_none_cnt = 10; /* Only report 10 CIS_NONEs */ -#endif - struct { - int common; - u_long addr; - } mfc[256 / 5]; - int ret; - - ret = 0; - - /* allocate some memory */ - - /* - * Some reports from the field suggest that a 64k memory boundary - * helps card CIS being able to be read. Try it here and see what - * the results actually are. I'm not sure I understand why this - * would make cards work better, but it is easy enough to test. - */ - rid = 0; - res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &rid, - PCCARD_CIS_SIZE, RF_ACTIVE | rman_make_alignment_flags(64*1024)); - if (res == NULL) { - device_printf(dev, "can't alloc memory to read attributes\n"); - return -1; - } - CARD_SET_RES_FLAGS(bus, dev, SYS_RES_MEMORY, rid, PCCARD_A_MEM_ATTR); - tuple.memt = rman_get_bustag(res); - tuple.memh = rman_get_bushandle(res); - tuple.ptr = 0; - - DPRINTF(("cis mem map %#x (resource: %#jx)\n", - (unsigned int) tuple.memh, rman_get_start(res))); - - tuple.mult = 2; - - longlink_present = 1; - longlink_common = 1; - longlink_addr = 0; - - mfc_count = 0; - mfc_index = 0; - - DEVPRINTF((dev, "CIS tuple chain:\n")); - - while (1) { - while (1) { - /* - * Perform boundary check for insane cards. - * If CIS is too long, simulate CIS end. - * (This check may not be sufficient for - * malicious cards.) - */ - if (tuple.mult * tuple.ptr >= PCCARD_CIS_SIZE - 1 - - 32 /* ad hoc value */ ) { - printf("CIS is too long -- truncating\n"); - tuple.code = CISTPL_END; - } else { - /* get the tuple code */ - tuple.code = pccard_cis_read_1(&tuple, tuple.ptr); - } - - /* two special-case tuples */ - - if (tuple.code == CISTPL_NULL) { -#ifdef PCCARDCISDEBUG - if (cis_none_cnt > 0) - DPRINTF(("CISTPL_NONE\n 00\n")); - else if (cis_none_cnt == 0) - DPRINTF(("TOO MANY CIS_NONE\n")); - cis_none_cnt--; -#endif - if ((*fct)(&tuple, arg)) { - ret = 1; - goto done; - } - tuple.ptr++; - continue; - } else if (tuple.code == CISTPL_END) { - DPRINTF(("CISTPL_END\n ff\n")); - /* Call the function for the END tuple, since - the CIS semantics depend on it */ - if ((*fct)(&tuple, arg)) { - ret = 1; - goto done; - } - tuple.ptr++; - break; - } - /* now all the normal tuples */ - - tuple.length = pccard_cis_read_1(&tuple, tuple.ptr + 1); - switch (tuple.code) { - case CISTPL_LONGLINK_A: - case CISTPL_LONGLINK_C: - if ((*fct)(&tuple, arg)) { - ret = 1; - goto done; - } - if (tuple.length < 4) { - DPRINTF(("CISTPL_LONGLINK_%s too " - "short %d\n", - longlink_common ? "C" : "A", - tuple.length)); - break; - } - longlink_present = 1; - longlink_common = (tuple.code == - CISTPL_LONGLINK_C) ? 1 : 0; - longlink_addr = pccard_tuple_read_4(&tuple, 0); - DPRINTF(("CISTPL_LONGLINK_%s %#lx\n", - longlink_common ? "C" : "A", - longlink_addr)); - break; - case CISTPL_NO_LINK: - if ((*fct)(&tuple, arg)) { - ret = 1; - goto done; - } - longlink_present = 0; - DPRINTF(("CISTPL_NO_LINK\n")); - break; - case CISTPL_CHECKSUM: - if ((*fct)(&tuple, arg)) { - ret = 1; - goto done; - } - if (tuple.length < 5) { - DPRINTF(("CISTPL_CHECKSUM too " - "short %d\n", tuple.length)); - break; - } { - int16_t offset; - u_long addr, length; - u_int cksum, sum; - int i; - - offset = (uint16_t) - pccard_tuple_read_2(&tuple, 0); - length = pccard_tuple_read_2(&tuple, 2); - cksum = pccard_tuple_read_1(&tuple, 4); - - addr = tuple.ptr + offset; - - DPRINTF(("CISTPL_CHECKSUM addr=%#lx " - "len=%#lx cksum=%#x", - addr, length, cksum)); - - /* - * XXX do more work to deal with - * distant regions - */ - if ((addr >= PCCARD_CIS_SIZE) || - ((addr + length) >= - PCCARD_CIS_SIZE)) { - DPRINTF((" skipped, " - "too distant\n")); - break; - } - sum = 0; - for (i = 0; i < length; i++) - sum += - bus_space_read_1(tuple.memt, - tuple.memh, - addr + tuple.mult * i); - if (cksum != (sum & 0xff)) { - DPRINTF((" failed sum=%#x\n", - sum)); - device_printf(dev, - "CIS checksum failed\n"); -#if 0 - /* - * XXX Some working cards have - * XXX bad checksums!! - */ - ret = -1; -#endif - } else { - DPRINTF((" ok\n")); - } - } - break; - case CISTPL_LONGLINK_MFC: - if (tuple.length < 1) { - DPRINTF(("CISTPL_LONGLINK_MFC too " - "short %d\n", tuple.length)); - break; - } - if (((tuple.length - 1) % 5) != 0) { - DPRINTF(("CISTPL_LONGLINK_MFC bogus " - "length %d\n", tuple.length)); - break; - } - /* - * this is kind of ad hoc, as I don't have - * any real documentation - */ - { - int i, tmp_count; - - /* - * put count into tmp var so that - * if we have to bail (because it's - * a bogus count) it won't be - * remembered for later use. - */ - tmp_count = - pccard_tuple_read_1(&tuple, 0); - - DPRINTF(("CISTPL_LONGLINK_MFC %d", - tmp_count)); - - /* - * make _sure_ it's the right size; - * if too short, it may be a weird - * (unknown/undefined) format - */ - if (tuple.length != (tmp_count*5 + 1)) { - DPRINTF((" bogus length %d\n", - tuple.length)); - break; - } - /* - * sanity check for a programming - * error which is difficult to find - * when debugging. - */ - if (tmp_count > - howmany(sizeof mfc, sizeof mfc[0])) - panic("CISTPL_LONGLINK_MFC mfc " - "count would blow stack"); - mfc_count = tmp_count; - for (i = 0; i < mfc_count; i++) { - mfc[i].common = - (pccard_tuple_read_1(&tuple, - 1 + 5 * i) == - PCCARD_MFC_MEM_COMMON) ? - 1 : 0; - mfc[i].addr = - pccard_tuple_read_4(&tuple, - 1 + 5 * i + 1); - DPRINTF((" %s:%#lx", - mfc[i].common ? "common" : - "attr", mfc[i].addr)); - } - DPRINTF(("\n")); - } - /* - * for LONGLINK_MFC, fall through to the - * function. This tuple has structural and - * semantic content. - */ - default: - { - if ((*fct)(&tuple, arg)) { - ret = 1; - goto done; - } - } - break; - } /* switch */ -#ifdef PCCARDCISDEBUG - /* print the tuple */ - { - int i; - - DPRINTF((" %#02x %#02x", tuple.code, - tuple.length)); - - for (i = 0; i < tuple.length; i++) { - DPRINTF((" %#02x", - pccard_tuple_read_1(&tuple, i))); - if ((i % 16) == 13) - DPRINTF(("\n")); - } - - if ((i % 16) != 14) - DPRINTF(("\n")); - } -#endif - /* 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 - * card with no longlink (which defaults to existing, == 0). - * In general, this means that if one pointer fails, it will - * try the next one, instead of just bailing. - */ - while (1) { - if (longlink_present) { - CARD_SET_RES_FLAGS(bus, dev, SYS_RES_MEMORY, - rid, longlink_common ? - PCCARD_A_MEM_COM : PCCARD_A_MEM_ATTR); - DPRINTF(("cis mem map %#x\n", - (unsigned int) tuple.memh)); - tuple.mult = longlink_common ? 1 : 2; - tuple.ptr = longlink_addr; - longlink_present = 0; - longlink_common = 1; - longlink_addr = 0; - } else if (mfc_count && (mfc_index < mfc_count)) { - CARD_SET_RES_FLAGS(bus, dev, SYS_RES_MEMORY, - rid, mfc[mfc_index].common ? - PCCARD_A_MEM_COM : PCCARD_A_MEM_ATTR); - DPRINTF(("cis mem map %#x\n", - (unsigned int) tuple.memh)); - /* set parse state, and point at the next one */ - tuple.mult = mfc[mfc_index].common ? 1 : 2; - tuple.ptr = mfc[mfc_index].addr; - mfc_index++; - } else { - goto done; - } - - /* make sure that the link is valid */ - tuple.code = pccard_cis_read_1(&tuple, tuple.ptr); - if (tuple.code != CISTPL_LINKTARGET) { - DPRINTF(("CISTPL_LINKTARGET expected, " - "code %#02x observed\n", tuple.code)); - continue; - } - tuple.length = pccard_cis_read_1(&tuple, tuple.ptr + 1); - if (tuple.length < 3) { - DPRINTF(("CISTPL_LINKTARGET too short %d\n", - tuple.length)); - continue; - } - if ((pccard_tuple_read_1(&tuple, 0) != 'C') || - (pccard_tuple_read_1(&tuple, 1) != 'I') || - (pccard_tuple_read_1(&tuple, 2) != 'S')) { - DPRINTF(("CISTPL_LINKTARGET magic " - "%02x%02x%02x incorrect\n", - pccard_tuple_read_1(&tuple, 0), - pccard_tuple_read_1(&tuple, 1), - pccard_tuple_read_1(&tuple, 2))); - continue; - } - tuple.ptr += 2 + tuple.length; - break; - } - } - -done: - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); - - return (ret); -} - -/* XXX this is incredibly verbose. Not sure what trt is */ - -void -pccard_print_cis(device_t dev) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - struct pccard_card *card = &sc->card; - struct pccard_function *pf; - struct pccard_config_entry *cfe; - int i; - - device_printf(dev, "CIS version "); - if (card->cis1_major == 4) { - if (card->cis1_minor == 0) - printf("PCCARD 1.0\n"); - else if (card->cis1_minor == 1) - printf("PCCARD 2.0 or 2.1\n"); - } else if (card->cis1_major >= 5) - printf("PC Card Standard %d.%d\n", card->cis1_major, card->cis1_minor); - else - printf("unknown (major=%d, minor=%d)\n", - card->cis1_major, card->cis1_minor); - - device_printf(dev, "CIS info: "); - for (i = 0; i < 4; i++) { - if (card->cis1_info[i] == NULL) - break; - if (i) - printf(", "); - printf("%s", card->cis1_info[i]); - } - printf("\n"); - - device_printf(dev, "Manufacturer code %#x, product %#x\n", - card->manufacturer, card->product); - - STAILQ_FOREACH(pf, &card->pf_head, pf_list) { - device_printf(dev, "function %d: ", pf->number); - - switch (pf->function) { - case PCCARD_FUNCTION_UNSPEC: - printf("unspecified"); - break; - case PCCARD_FUNCTION_MULTIFUNCTION: - printf("multi-function"); - break; - case PCCARD_FUNCTION_MEMORY: - printf("memory"); - break; - case PCCARD_FUNCTION_SERIAL: - printf("serial port"); - break; - case PCCARD_FUNCTION_PARALLEL: - printf("parallel port"); - break; - case PCCARD_FUNCTION_DISK: - printf("fixed disk"); - break; - case PCCARD_FUNCTION_VIDEO: - printf("video adapter"); - break; - case PCCARD_FUNCTION_NETWORK: - printf("network adapter"); - break; - case PCCARD_FUNCTION_AIMS: - printf("auto incrementing mass storage"); - break; - case PCCARD_FUNCTION_SCSI: - printf("SCSI bridge"); - break; - case PCCARD_FUNCTION_SECURITY: - printf("Security services"); - break; - case PCCARD_FUNCTION_INSTRUMENT: - printf("Instrument"); - break; - default: - printf("unknown (%d)", pf->function); - break; - } - - printf(", ccr addr %#x mask %#x\n", pf->ccr_base, pf->ccr_mask); - - STAILQ_FOREACH(cfe, &pf->cfe_head, cfe_list) { - device_printf(dev, "function %d, config table entry " - "%d: ", pf->number, cfe->number); - - switch (cfe->iftype) { - case PCCARD_IFTYPE_MEMORY: - printf("memory card"); - break; - case PCCARD_IFTYPE_IO: - printf("I/O card"); - break; - default: - printf("card type unknown"); - break; - } - - printf("; irq mask %#x", cfe->irqmask); - - if (cfe->num_iospace) { - printf("; iomask %#lx, iospace", cfe->iomask); - - for (i = 0; i < cfe->num_iospace; i++) { - printf(" %#jx", cfe->iospace[i].start); - if (cfe->iospace[i].length) - printf("-%#jx", - cfe->iospace[i].start + - cfe->iospace[i].length - 1); - } - } - if (cfe->num_memspace) { - printf("; memspace"); - - for (i = 0; i < cfe->num_memspace; i++) { - printf(" %#jx", - cfe->memspace[i].cardaddr); - if (cfe->memspace[i].length) - printf("-%#jx", - cfe->memspace[i].cardaddr + - cfe->memspace[i].length - 1); - if (cfe->memspace[i].hostaddr) - printf("@%#jx", - cfe->memspace[i].hostaddr); - } - } - if (cfe->maxtwins) - printf("; maxtwins %d", cfe->maxtwins); - - printf(";"); - - if (cfe->flags & PCCARD_CFE_MWAIT_REQUIRED) - printf(" mwait_required"); - if (cfe->flags & PCCARD_CFE_RDYBSY_ACTIVE) - printf(" rdybsy_active"); - if (cfe->flags & PCCARD_CFE_WP_ACTIVE) - printf(" wp_active"); - if (cfe->flags & PCCARD_CFE_BVD_ACTIVE) - printf(" bvd_active"); - if (cfe->flags & PCCARD_CFE_IO8) - printf(" io8"); - if (cfe->flags & PCCARD_CFE_IO16) - printf(" io16"); - if (cfe->flags & PCCARD_CFE_IRQSHARE) - printf(" irqshare"); - if (cfe->flags & PCCARD_CFE_IRQPULSE) - printf(" irqpulse"); - if (cfe->flags & PCCARD_CFE_IRQLEVEL) - printf(" irqlevel"); - if (cfe->flags & PCCARD_CFE_POWERDOWN) - printf(" powerdown"); - if (cfe->flags & PCCARD_CFE_READONLY) - printf(" readonly"); - if (cfe->flags & PCCARD_CFE_AUDIO) - printf(" audio"); - - printf("\n"); - } - } - - if (card->error) - device_printf(dev, "%d errors found while parsing CIS\n", - card->error); -} - -static int -pccard_parse_cis_tuple(const struct pccard_tuple *tuple, void *arg) -{ - /* most of these are educated guesses */ - static struct pccard_config_entry init_cfe = { - -1, PCCARD_CFE_RDYBSY_ACTIVE | PCCARD_CFE_WP_ACTIVE | - PCCARD_CFE_BVD_ACTIVE, PCCARD_IFTYPE_MEMORY, - }; - - struct cis_state *state = arg; - - switch (tuple->code) { - case CISTPL_END: - /* if we've seen a LONGLINK_MFC, and this is the first - * END after it, reset the function list. - * - * XXX This might also be the right place to start a - * new function, but that assumes that a function - * definition never crosses any longlink, and I'm not - * sure about that. This is probably safe for MFC - * cards, but what we have now isn't broken, so I'd - * rather not change it. - */ - if (state->gotmfc == 1) { - struct pccard_function *pf, *pfnext; - - for (pf = STAILQ_FIRST(&state->card->pf_head); - pf != NULL; pf = pfnext) { - pfnext = STAILQ_NEXT(pf, pf_list); - free(pf, M_DEVBUF); - } - - STAILQ_INIT(&state->card->pf_head); - - state->count = 0; - state->gotmfc = 2; - state->pf = NULL; - } - break; - case CISTPL_LONGLINK_MFC: - /* - * this tuple's structure was dealt with in scan_cis. here, - * record the fact that the MFC tuple was seen, so that - * functions declared before the MFC link can be cleaned - * up. - */ - state->gotmfc = 1; - break; -#ifdef PCCARDCISDEBUG - case CISTPL_DEVICE: - case CISTPL_DEVICE_A: - { - u_int reg, dtype, dspeed; - - reg = pccard_tuple_read_1(tuple, 0); - dtype = reg & PCCARD_DTYPE_MASK; - dspeed = reg & PCCARD_DSPEED_MASK; - - DPRINTF(("CISTPL_DEVICE%s type=", - (tuple->code == CISTPL_DEVICE) ? "" : "_A")); - switch (dtype) { - case PCCARD_DTYPE_NULL: - DPRINTF(("null")); - break; - case PCCARD_DTYPE_ROM: - DPRINTF(("rom")); - break; - case PCCARD_DTYPE_OTPROM: - DPRINTF(("otprom")); - break; - case PCCARD_DTYPE_EPROM: - DPRINTF(("eprom")); - break; - case PCCARD_DTYPE_EEPROM: - DPRINTF(("eeprom")); - break; - case PCCARD_DTYPE_FLASH: - DPRINTF(("flash")); - break; - case PCCARD_DTYPE_SRAM: - DPRINTF(("sram")); - break; - case PCCARD_DTYPE_DRAM: - DPRINTF(("dram")); - break; - case PCCARD_DTYPE_FUNCSPEC: - DPRINTF(("funcspec")); - break; - case PCCARD_DTYPE_EXTEND: - DPRINTF(("extend")); - break; - default: - DPRINTF(("reserved")); - break; - } - DPRINTF((" speed=")); - switch (dspeed) { - case PCCARD_DSPEED_NULL: - DPRINTF(("null")); - break; - case PCCARD_DSPEED_250NS: - DPRINTF(("250ns")); - break; - case PCCARD_DSPEED_200NS: - DPRINTF(("200ns")); - break; - case PCCARD_DSPEED_150NS: - DPRINTF(("150ns")); - break; - case PCCARD_DSPEED_100NS: - DPRINTF(("100ns")); - break; - case PCCARD_DSPEED_EXT: - DPRINTF(("ext")); - break; - default: - DPRINTF(("reserved")); - break; - } - } - DPRINTF(("\n")); - break; -#endif - case CISTPL_VERS_1: - if (tuple->length < 6) { - DPRINTF(("CISTPL_VERS_1 too short %d\n", - tuple->length)); - break; - } { - int start, i, ch, count; - - state->card->cis1_major = pccard_tuple_read_1(tuple, 0); - state->card->cis1_minor = pccard_tuple_read_1(tuple, 1); - - for (count = 0, start = 0, i = 0; - (count < 4) && ((i + 4) < 256); i++) { - ch = pccard_tuple_read_1(tuple, 2 + i); - if (ch == 0xff) - break; - state->card->cis1_info_buf[i] = ch; - if (ch == 0) { - state->card->cis1_info[count] = - state->card->cis1_info_buf + start; - start = i + 1; - count++; - } - } - DPRINTF(("CISTPL_VERS_1\n")); - } - break; - case CISTPL_MANFID: - if (tuple->length < 4) { - DPRINTF(("CISTPL_MANFID too short %d\n", - tuple->length)); - break; - } - state->card->manufacturer = pccard_tuple_read_2(tuple, 0); - state->card->product = pccard_tuple_read_2(tuple, 2); - /* - * This is for xe driver. But not limited to that driver. - * In PC Card Standard, - * Manufacturer ID: 2byte. - * Product ID: typically 2bytes, but there's no limit on its - * size. prodext is a two byte field, so maybe we should - * also handle the '6' case. So far no cards have surfaced - * with a length of '6'. - */ - if (tuple->length == 5 ) - state->card->prodext = pccard_tuple_read_1(tuple, 4); - DPRINTF(("CISTPL_MANFID\n")); - break; - case CISTPL_FUNCID: - if (tuple->length < 1) { - DPRINTF(("CISTPL_FUNCID too short %d\n", - tuple->length)); - break; - } - if ((state->pf == NULL) || (state->gotmfc == 2)) { - state->pf = malloc(sizeof(*state->pf), M_DEVBUF, - M_NOWAIT | M_ZERO); - state->pf->number = state->count++; - state->pf->last_config_index = -1; - STAILQ_INIT(&state->pf->cfe_head); - - STAILQ_INSERT_TAIL(&state->card->pf_head, state->pf, - pf_list); - } - state->pf->function = pccard_tuple_read_1(tuple, 0); - - DPRINTF(("CISTPL_FUNCID\n")); - break; - case CISTPL_FUNCE: - if (state->pf == NULL || state->pf->function <= 0) { - DPRINTF(("CISTPL_FUNCE is not followed by " - "valid CISTPL_FUNCID\n")); - break; - } - if (tuple->length >= 2) - decode_funce(tuple, state->pf); - DPRINTF(("CISTPL_FUNCE\n")); - break; - case CISTPL_CONFIG: - if (tuple->length < 3) { - DPRINTF(("CISTPL_CONFIG too short %d\n", - tuple->length)); - break; - } { - u_int reg, rasz, rmsz, rfsz; - int i; - - reg = pccard_tuple_read_1(tuple, 0); - rasz = 1 + ((reg & PCCARD_TPCC_RASZ_MASK) >> - PCCARD_TPCC_RASZ_SHIFT); - rmsz = 1 + ((reg & PCCARD_TPCC_RMSZ_MASK) >> - PCCARD_TPCC_RMSZ_SHIFT); - rfsz = ((reg & PCCARD_TPCC_RFSZ_MASK) >> - PCCARD_TPCC_RFSZ_SHIFT); - - if (tuple->length < (rasz + rmsz + rfsz)) { - DPRINTF(("CISTPL_CONFIG (%d,%d,%d) too " - "short %d\n", rasz, rmsz, rfsz, - tuple->length)); - break; - } - if (state->pf == NULL) { - state->pf = malloc(sizeof(*state->pf), - M_DEVBUF, M_NOWAIT | M_ZERO); - state->pf->number = state->count++; - state->pf->last_config_index = -1; - STAILQ_INIT(&state->pf->cfe_head); - - STAILQ_INSERT_TAIL(&state->card->pf_head, - state->pf, pf_list); - - state->pf->function = PCCARD_FUNCTION_UNSPEC; - } - state->pf->last_config_index = - pccard_tuple_read_1(tuple, 1); - - state->pf->ccr_base = 0; - for (i = 0; i < rasz; i++) - state->pf->ccr_base |= - ((pccard_tuple_read_1(tuple, 2 + i)) << - (i * 8)); - - state->pf->ccr_mask = 0; - for (i = 0; i < rmsz; i++) - state->pf->ccr_mask |= - ((pccard_tuple_read_1(tuple, - 2 + rasz + i)) << (i * 8)); - - /* skip the reserved area and subtuples */ - - /* reset the default cfe for each cfe list */ - state->temp_cfe = init_cfe; - state->default_cfe = &state->temp_cfe; - } - DPRINTF(("CISTPL_CONFIG\n")); - break; - case CISTPL_CFTABLE_ENTRY: - { - int idx, i; - u_int reg, reg2; - u_int intface, def, num; - u_int power, timing, iospace, irq, memspace, misc; - struct pccard_config_entry *cfe; - - idx = 0; - - reg = pccard_tuple_read_1(tuple, idx++); - intface = reg & PCCARD_TPCE_INDX_INTFACE; - def = reg & PCCARD_TPCE_INDX_DEFAULT; - num = reg & PCCARD_TPCE_INDX_NUM_MASK; - - /* - * this is a little messy. Some cards have only a - * cfentry with the default bit set. So, as we go - * through the list, we add new indexes to the queue, - * and keep a pointer to the last one with the - * default bit set. if we see a record with the same - * index, as the default, we stash the default and - * replace the queue entry. otherwise, we just add - * new entries to the queue, pointing the default ptr - * at them if the default bit is set. if we get to - * the end with the default pointer pointing at a - * record which hasn't had a matching index, that's - * ok; it just becomes a cfentry like any other. - */ - - /* - * if the index in the cis differs from the default - * cis, create new entry in the queue and start it - * with the current default - */ - if (num != state->default_cfe->number) { - cfe = (struct pccard_config_entry *) - malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT); - if (cfe == NULL) { - DPRINTF(("no memory for config entry\n")); - goto abort_cfe; - } - *cfe = *state->default_cfe; - - STAILQ_INSERT_TAIL(&state->pf->cfe_head, - cfe, cfe_list); - - cfe->number = num; - - /* - * if the default bit is set in the cis, then - * point the new default at whatever is being - * filled in - */ - if (def) - state->default_cfe = cfe; - } else { - /* - * the cis index matches the default index, - * fill in the default cfentry. It is - * assumed that the cfdefault index is in the - * queue. For it to be otherwise, the cis - * index would have to be -1 (initial - * condition) which is not possible, or there - * would have to be a preceding cis entry - * which had the same cis index and had the - * default bit unset. Neither condition - * should happen. If it does, this cfentry - * is lost (written into temp space), which - * is an acceptable failure mode. - */ - - cfe = state->default_cfe; - - /* - * if the cis entry does not have the default - * bit set, copy the default out of the way - * first. - */ - if (!def) { - state->temp_cfe = *state->default_cfe; - state->default_cfe = &state->temp_cfe; - } - } - - if (intface) { - reg = pccard_tuple_read_1(tuple, idx++); - cfe->flags &= ~(PCCARD_CFE_MWAIT_REQUIRED - | PCCARD_CFE_RDYBSY_ACTIVE - | PCCARD_CFE_WP_ACTIVE - | PCCARD_CFE_BVD_ACTIVE); - if (reg & PCCARD_TPCE_IF_MWAIT) - cfe->flags |= PCCARD_CFE_MWAIT_REQUIRED; - if (reg & PCCARD_TPCE_IF_RDYBSY) - cfe->flags |= PCCARD_CFE_RDYBSY_ACTIVE; - if (reg & PCCARD_TPCE_IF_WP) - cfe->flags |= PCCARD_CFE_WP_ACTIVE; - if (reg & PCCARD_TPCE_IF_BVD) - cfe->flags |= PCCARD_CFE_BVD_ACTIVE; - cfe->iftype = reg & PCCARD_TPCE_IF_IFTYPE; - } - reg = pccard_tuple_read_1(tuple, idx++); - - power = reg & PCCARD_TPCE_FS_POWER_MASK; - timing = reg & PCCARD_TPCE_FS_TIMING; - iospace = reg & PCCARD_TPCE_FS_IOSPACE; - irq = reg & PCCARD_TPCE_FS_IRQ; - memspace = reg & PCCARD_TPCE_FS_MEMSPACE_MASK; - misc = reg & PCCARD_TPCE_FS_MISC; - - if (power) { - /* skip over power, don't save */ - /* for each parameter selection byte */ - for (i = 0; i < power; i++) { - reg = pccard_tuple_read_1(tuple, idx++); - for (; reg; reg >>= 1) - { - /* set bit -> read */ - if ((reg & 1) == 0) - continue; - /* skip over bytes */ - do { - reg2 = pccard_tuple_read_1(tuple, idx++); - /* - * until non-extension - * byte - */ - } while (reg2 & 0x80); - } - } - } - if (timing) { - /* skip over timing, don't save */ - reg = pccard_tuple_read_1(tuple, idx++); - - if ((reg & PCCARD_TPCE_TD_RESERVED_MASK) != - PCCARD_TPCE_TD_RESERVED_MASK) - idx++; - if ((reg & PCCARD_TPCE_TD_RDYBSY_MASK) != - PCCARD_TPCE_TD_RDYBSY_MASK) - idx++; - if ((reg & PCCARD_TPCE_TD_WAIT_MASK) != - PCCARD_TPCE_TD_WAIT_MASK) - idx++; - } - if (iospace) { - if (tuple->length <= idx) { - DPRINTF(("ran out of space before TCPE_IO\n")); - goto abort_cfe; - } - - reg = pccard_tuple_read_1(tuple, idx++); - cfe->flags &= - ~(PCCARD_CFE_IO8 | PCCARD_CFE_IO16); - if (reg & PCCARD_TPCE_IO_BUSWIDTH_8BIT) - cfe->flags |= PCCARD_CFE_IO8; - if (reg & PCCARD_TPCE_IO_BUSWIDTH_16BIT) - cfe->flags |= PCCARD_CFE_IO16; - cfe->iomask = - reg & PCCARD_TPCE_IO_IOADDRLINES_MASK; - - if (reg & PCCARD_TPCE_IO_HASRANGE) { - reg = pccard_tuple_read_1(tuple, idx++); - cfe->num_iospace = 1 + (reg & - PCCARD_TPCE_IO_RANGE_COUNT); - - if (cfe->num_iospace > - (sizeof(cfe->iospace) / - sizeof(cfe->iospace[0]))) { - DPRINTF(("too many io " - "spaces %d", - cfe->num_iospace)); - state->card->error++; - break; - } - for (i = 0; i < cfe->num_iospace; i++) { - switch (reg & PCCARD_TPCE_IO_RANGE_ADDRSIZE_MASK) { - case PCCARD_TPCE_IO_RANGE_ADDRSIZE_ONE: - cfe->iospace[i].start = - pccard_tuple_read_1(tuple, idx++); - break; - case PCCARD_TPCE_IO_RANGE_ADDRSIZE_TWO: - cfe->iospace[i].start = - pccard_tuple_read_2(tuple, idx); - idx += 2; - break; - case PCCARD_TPCE_IO_RANGE_ADDRSIZE_FOUR: - cfe->iospace[i].start = - pccard_tuple_read_4(tuple, idx); - idx += 4; - break; - } - switch (reg & - PCCARD_TPCE_IO_RANGE_LENGTHSIZE_MASK) { - case PCCARD_TPCE_IO_RANGE_LENGTHSIZE_ONE: - cfe->iospace[i].length = - pccard_tuple_read_1(tuple, idx++); - break; - case PCCARD_TPCE_IO_RANGE_LENGTHSIZE_TWO: - cfe->iospace[i].length = - pccard_tuple_read_2(tuple, idx); - idx += 2; - break; - case PCCARD_TPCE_IO_RANGE_LENGTHSIZE_FOUR: - cfe->iospace[i].length = - pccard_tuple_read_4(tuple, idx); - idx += 4; - break; - } - cfe->iospace[i].length++; - } - } else { - cfe->num_iospace = 1; - cfe->iospace[0].start = 0; - cfe->iospace[0].length = - (1 << cfe->iomask); - } - } - if (irq) { - if (tuple->length <= idx) { - DPRINTF(("ran out of space before TCPE_IR\n")); - goto abort_cfe; - } - - reg = pccard_tuple_read_1(tuple, idx++); - cfe->flags &= ~(PCCARD_CFE_IRQSHARE - | PCCARD_CFE_IRQPULSE - | PCCARD_CFE_IRQLEVEL); - if (reg & PCCARD_TPCE_IR_SHARE) - cfe->flags |= PCCARD_CFE_IRQSHARE; - if (reg & PCCARD_TPCE_IR_PULSE) - cfe->flags |= PCCARD_CFE_IRQPULSE; - if (reg & PCCARD_TPCE_IR_LEVEL) - cfe->flags |= PCCARD_CFE_IRQLEVEL; - - if (reg & PCCARD_TPCE_IR_HASMASK) { - /* - * it's legal to ignore the - * special-interrupt bits, so I will - */ - - cfe->irqmask = - pccard_tuple_read_2(tuple, idx); - idx += 2; - } else { - cfe->irqmask = - (1 << (reg & PCCARD_TPCE_IR_IRQ)); - } - } else { - cfe->irqmask = 0xffff; - } - if (memspace) { - if (tuple->length <= idx) { - DPRINTF(("ran out of space before TCPE_MS\n")); - goto abort_cfe; - } - - if (memspace == PCCARD_TPCE_FS_MEMSPACE_LENGTH) { - cfe->num_memspace = 1; - cfe->memspace[0].length = 256 * - pccard_tuple_read_2(tuple, idx); - idx += 2; - cfe->memspace[0].cardaddr = 0; - cfe->memspace[0].hostaddr = 0; - } else if (memspace == - PCCARD_TPCE_FS_MEMSPACE_LENGTHADDR) { - cfe->num_memspace = 1; - cfe->memspace[0].length = 256 * - pccard_tuple_read_2(tuple, idx); - idx += 2; - cfe->memspace[0].cardaddr = 256 * - pccard_tuple_read_2(tuple, idx); - idx += 2; - cfe->memspace[0].hostaddr = cfe->memspace[0].cardaddr; - } else { - int lengthsize; - int cardaddrsize; - int hostaddrsize; - - reg = pccard_tuple_read_1(tuple, idx++); - cfe->num_memspace = (reg & - PCCARD_TPCE_MS_COUNT) + 1; - if (cfe->num_memspace > - (sizeof(cfe->memspace) / - sizeof(cfe->memspace[0]))) { - DPRINTF(("too many mem " - "spaces %d", - cfe->num_memspace)); - state->card->error++; - break; - } - lengthsize = - ((reg & PCCARD_TPCE_MS_LENGTH_SIZE_MASK) >> - PCCARD_TPCE_MS_LENGTH_SIZE_SHIFT); - cardaddrsize = - ((reg & PCCARD_TPCE_MS_CARDADDR_SIZE_MASK) >> - PCCARD_TPCE_MS_CARDADDR_SIZE_SHIFT); - hostaddrsize = - (reg & PCCARD_TPCE_MS_HOSTADDR) ? cardaddrsize : 0; - - if (lengthsize == 0) { - DPRINTF(("cfe memspace " - "lengthsize == 0\n")); - } - for (i = 0; i < cfe->num_memspace; i++) { - if (lengthsize) { - cfe->memspace[i].length = - 256 * pccard_tuple_read_n(tuple, lengthsize, - idx); - idx += lengthsize; - } else { - cfe->memspace[i].length = 0; - } - if (cfe->memspace[i].length == 0) { - DPRINTF(("cfe->memspace[%d].length == 0\n", - i)); - } - if (cardaddrsize) { - cfe->memspace[i].cardaddr = - 256 * pccard_tuple_read_n(tuple, cardaddrsize, - idx); - idx += cardaddrsize; - } else { - cfe->memspace[i].cardaddr = 0; - } - if (hostaddrsize) { - cfe->memspace[i].hostaddr = - 256 * pccard_tuple_read_n(tuple, hostaddrsize, - idx); - idx += hostaddrsize; - } else { - cfe->memspace[i].hostaddr = 0; - } - } - } - } else - cfe->num_memspace = 0; - if (misc) { - if (tuple->length <= idx) { - DPRINTF(("ran out of space before TCPE_MI\n")); - goto abort_cfe; - } - - reg = pccard_tuple_read_1(tuple, idx++); - cfe->flags &= ~(PCCARD_CFE_POWERDOWN - | PCCARD_CFE_READONLY - | PCCARD_CFE_AUDIO); - if (reg & PCCARD_TPCE_MI_PWRDOWN) - cfe->flags |= PCCARD_CFE_POWERDOWN; - if (reg & PCCARD_TPCE_MI_READONLY) - cfe->flags |= PCCARD_CFE_READONLY; - if (reg & PCCARD_TPCE_MI_AUDIO) - cfe->flags |= PCCARD_CFE_AUDIO; - cfe->maxtwins = reg & PCCARD_TPCE_MI_MAXTWINS; - - while (reg & PCCARD_TPCE_MI_EXT) { - reg = pccard_tuple_read_1(tuple, idx++); - } - } - /* skip all the subtuples */ - } - - abort_cfe: - DPRINTF(("CISTPL_CFTABLE_ENTRY\n")); - break; - default: - DPRINTF(("unhandled CISTPL %#x\n", tuple->code)); - break; - } - - return (0); -} - -static int -decode_funce(const struct pccard_tuple *tuple, struct pccard_function *pf) -{ - int i; - int len; - int type = pccard_tuple_read_1(tuple, 0); - - switch (pf->function) { - case PCCARD_FUNCTION_DISK: - if (type == PCCARD_TPLFE_TYPE_DISK_DEVICE_INTERFACE) { - pf->pf_funce_disk_interface - = pccard_tuple_read_1(tuple, 1); - pf->pf_funce_disk_power - = pccard_tuple_read_1(tuple, 2); - } - break; - case PCCARD_FUNCTION_NETWORK: - if (type == PCCARD_TPLFE_TYPE_LAN_NID) { - len = pccard_tuple_read_1(tuple, 1); - if (tuple->length < 2 + len || len > 8) { - /* tuple length not enough or nid too long */ - break; - } - for (i = 0; i < len; i++) { - pf->pf_funce_lan_nid[i] - = pccard_tuple_read_1(tuple, i + 2); - } - pf->pf_funce_lan_nidlen = len; - } - break; - default: - break; - } - return 0; -} diff --git a/sys/dev/pccard/pccard_cis_quirks.c b/sys/dev/pccard/pccard_cis_quirks.c deleted file mode 100644 index cbfcbb80a8d1..000000000000 --- a/sys/dev/pccard/pccard_cis_quirks.c +++ /dev/null @@ -1,352 +0,0 @@ -/* $NetBSD: pcmcia_cis_quirks.c,v 1.6 2000/04/12 21:07:55 scw Exp $ */ - -#include -__FBSDID("$FreeBSD$"); - -#define PCCARDDEBUG - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * 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 -#include -#include -#include - -#include - -#include -#include -#include - -#include "pccarddevs.h" - -/* There are cards out there whose CIS flat-out lies. This file - contains struct pccard_function chains for those devices. */ - -/* these structures are just static templates which are then copied - into "live" allocated structures */ - -struct pccard_function pccard_3cxem556_func0 = { - 0, /* function number */ - PCCARD_FUNCTION_NETWORK, - 0x07, /* last cfe number */ - 0x800, /* ccr_base */ - 0x63, /* ccr_mask */ -}; - -struct pccard_config_entry pccard_3cxem556_func0_cfe0 = { - 0x07, /* cfe number */ - PCCARD_CFE_IO8 | PCCARD_CFE_IO16 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 4, /* iomask */ - { { 0x0010, 0 } }, /* iospace */ - 0xffff, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_3cxem556_func1 = { - 1, /* function number */ - PCCARD_FUNCTION_SERIAL, - 0x27, /* last cfe number */ - 0x900, /* ccr_base */ - 0x63, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_3cxem556_func1_cfe0 = { - 0x27, /* cfe number */ - PCCARD_CFE_IO8 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 3, /* iomask */ - { { 0x0008, 0 } }, /* iospace */ - 0xffff, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_3ccfem556bi_func0 = { - 0, /* function number */ - PCCARD_FUNCTION_NETWORK, - 0x07, /* last cfe number */ - 0x1000, /* ccr_base */ - 0x267, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_3ccfem556bi_func0_cfe0 = { - 0x07, /* cfe number */ - PCCARD_CFE_IO8 | PCCARD_CFE_IO16 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 5, /* iomask */ - { { 0x0020, 0 } }, /* iospace */ - 0xffff, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_3ccfem556bi_func1 = { - 1, /* function number */ - PCCARD_FUNCTION_SERIAL, - 0x27, /* last cfe number */ - 0x1100, /* ccr_base */ - 0x277, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_3ccfem556bi_func1_cfe0 = { - 0x27, /* cfe number */ - PCCARD_CFE_IO8 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 3, /* iomask */ - { { 0x0008, 0 } }, /* iospace */ - 0xffff, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_3c1_func0 = { - 0, /* function number */ - PCCARD_FUNCTION_NETWORK, - 0x05, /* last cfe number */ - 0x400, /* ccr_base */ - 0x267, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_3c1_func0_cfe0 = { - 0x05, /* cfe number */ - PCCARD_CFE_IO8 | PCCARD_CFE_IO16 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 5, /* iomask */ - { { 0x0010, 0 } }, /* iospace */ - 0xffff, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_sveclancard_func0 = { - 0, /* function number */ - PCCARD_FUNCTION_NETWORK, - 0x1, /* last cfe number */ - 0x100, /* ccr_base */ - 0x1, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_sveclancard_func0_cfe0 = { - 0x1, /* cfe number */ - PCCARD_CFE_MWAIT_REQUIRED | PCCARD_CFE_RDYBSY_ACTIVE | - PCCARD_CFE_WP_ACTIVE | PCCARD_CFE_BVD_ACTIVE | PCCARD_CFE_IO16, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 5, /* iomask */ - { { 0x20, 0x300 } }, /* iospace */ - 0xdeb8, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_ndc_nd5100_func0 = { - 0, /* function number */ - PCCARD_FUNCTION_NETWORK, - 0x23, /* last cfe number */ - 0x3f8, /* ccr_base */ - 0x3, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_ndc_nd5100_func0_cfe0 = { - 0x20, /* cfe number */ - PCCARD_CFE_MWAIT_REQUIRED | PCCARD_CFE_IO16 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 5, /* iomask */ - { { 0x20, 0x300 } }, /* iospace */ - 0xdeb8, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_function pccard_sierra_a555_func1 = { - 1, /* function number */ - PCCARD_FUNCTION_SERIAL, - 0x24, /* last cfe number */ - 0x700, /* ccr_base */ - 0x73, /* ccr_mask */ -}; - -static struct pccard_config_entry pccard_sierra_a555_func1_cfe0 = { - 0x22, /* cfe number */ - PCCARD_CFE_IO8 | PCCARD_CFE_IRQLEVEL, - PCCARD_IFTYPE_IO, - 1, /* num_iospace */ - 0, /* iomask */ - { { 0x0008, 0x3e8 } }, /* iospace */ - 0x3fbc, /* irqmask */ - 0, /* num_memspace */ - { }, /* memspace */ - 0, /* maxtwins */ -}; - -static struct pccard_cis_quirk pccard_cis_quirks[] = { - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID, - &pccard_3cxem556_func0, &pccard_3cxem556_func0_cfe0 }, - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID, - &pccard_3cxem556_func1, &pccard_3cxem556_func1_cfe0 }, - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556INT, PCMCIA_CIS_INVALID, - &pccard_3cxem556_func0, &pccard_3cxem556_func0_cfe0 }, - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556INT, PCMCIA_CIS_INVALID, - &pccard_3cxem556_func1, &pccard_3cxem556_func1_cfe0 }, - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CCFEM556BI, - PCMCIA_CIS_INVALID, - &pccard_3ccfem556bi_func0, &pccard_3ccfem556bi_func0_cfe0 }, - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CCFEM556BI, - PCMCIA_CIS_INVALID, - &pccard_3ccfem556bi_func1, &pccard_3ccfem556bi_func1_cfe0 }, - { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_A550, - PCMCIA_CIS_INVALID, - &pccard_sierra_a555_func1, &pccard_sierra_a555_func1_cfe0 }, - { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_A555, - PCMCIA_CIS_INVALID, - &pccard_sierra_a555_func1, &pccard_sierra_a555_func1_cfe0 }, - { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_A710, - PCMCIA_CIS_INVALID, - &pccard_sierra_a555_func1, &pccard_sierra_a555_func1_cfe0 }, - { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_AC710, - PCMCIA_CIS_INVALID, - &pccard_sierra_a555_func1, &pccard_sierra_a555_func1_cfe0 }, - { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3C1, PCMCIA_CIS_INVALID, - &pccard_3c1_func0, &pccard_3c1_func0_cfe0 }, - { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID, PCMCIA_CIS_SVEC_LANCARD, - &pccard_sveclancard_func0, &pccard_sveclancard_func0_cfe0 }, - { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID, PCMCIA_CIS_NDC_ND5100_E, - &pccard_ndc_nd5100_func0, &pccard_ndc_nd5100_func0_cfe0 }, -}; - -static int -pccard_cis_quirk_match(struct pccard_softc *sc, struct pccard_cis_quirk *q) -{ - if ((sc->card.manufacturer == q->manufacturer) && - (sc->card.product == q->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], q->cis1_info[0]) == 0) && - sc->card.cis1_info[1] && - (strcmp(sc->card.cis1_info[1], q->cis1_info[1]) == 0)))) - return (1); - return (0); -} - -void pccard_check_cis_quirks(device_t dev) -{ - struct pccard_softc *sc = PCCARD_SOFTC(dev); - int wiped = 0; - int i, j; - struct pccard_function *pf, *pf_next, *pf_last; - struct pccard_config_entry *cfe, *cfe_next; - struct pccard_cis_quirk *q; - - pf = NULL; - pf_last = NULL; - - for (i = 0; i < nitems(pccard_cis_quirks); i++) { - q = &pccard_cis_quirks[i]; - if (!pccard_cis_quirk_match(sc, q)) - continue; - if (!wiped) { - if (bootverbose) { - device_printf(dev, "using CIS quirks for "); - 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 = STAILQ_FIRST(&sc->card.pf_head); pf != NULL; - pf = pf_next) { - for (cfe = STAILQ_FIRST(&pf->cfe_head); cfe != NULL; - cfe = cfe_next) { - cfe_next = STAILQ_NEXT(cfe, cfe_list); - free(cfe, M_DEVBUF); - } - pf_next = STAILQ_NEXT(pf, pf_list); - free(pf, M_DEVBUF); - } - - STAILQ_INIT(&sc->card.pf_head); - wiped = 1; - } - - if (pf_last == q->pf) { - cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT); - if (cfe == NULL) { - device_printf(dev, "no memory for quirk (1)\n"); - continue; - } - *cfe = *q->cfe; - STAILQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list); - } else { - pf = malloc(sizeof(*pf), M_DEVBUF, M_NOWAIT); - if (pf == NULL) { - device_printf(dev, - "no memory for pccard function\n"); - continue; - } - *pf = *q->pf; - STAILQ_INIT(&pf->cfe_head); - cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT); - if (cfe == NULL) { - free(pf, M_DEVBUF); - device_printf(dev, "no memory for quirk (2)\n"); - continue; - } - *cfe = *q->cfe; - STAILQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list); - STAILQ_INSERT_TAIL(&sc->card.pf_head, pf, pf_list); - pf_last = q->pf; - } - } -} diff --git a/sys/dev/pccard/pccard_device.c b/sys/dev/pccard/pccard_device.c deleted file mode 100644 index 8b476a4074f4..000000000000 --- a/sys/dev/pccard/pccard_device.c +++ /dev/null @@ -1,174 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2005 M. Warner Losh - * - * 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 unmodified, 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -static d_open_t pccard_open; -static d_close_t pccard_close; -static d_read_t pccard_read; -static d_ioctl_t pccard_ioctl; - -static struct cdevsw pccard_cdevsw = { - .d_version = D_VERSION, - .d_open = pccard_open, - .d_close = pccard_close, - .d_read = pccard_read, - .d_ioctl = pccard_ioctl, - .d_name = "pccard" -}; - -int -pccard_device_create(struct pccard_softc *sc) -{ - uint32_t minor; - - minor = device_get_unit(sc->dev) << 16; - sc->cisdev = make_dev(&pccard_cdevsw, minor, 0, 0, 0666, - "pccard%u.cis", device_get_unit(sc->dev)); - sc->cisdev->si_drv1 = sc; - return (0); -} - -int -pccard_device_destroy(struct pccard_softc *sc) -{ - if (sc->cisdev) - destroy_dev(sc->cisdev); - return (0); -} - -static int -pccard_build_cis(const struct pccard_tuple *tuple, void *argp) -{ - struct cis_buffer *cis; - int i; - uint8_t ch; - - cis = (struct cis_buffer *)argp; - /* - * CISTPL_END is a special case, it has no length field. - */ - if (tuple->code == CISTPL_END) { - if (cis->len + 1 > sizeof(cis->buffer)) - return (ENOSPC); - cis->buffer[cis->len++] = tuple->code; - return (0); - } - if (cis->len + 2 + tuple->length > sizeof(cis->buffer)) - return (ENOSPC); - cis->buffer[cis->len++] = tuple->code; - cis->buffer[cis->len++] = tuple->length; - for (i = 0; i < tuple->length; i++) { - ch = pccard_tuple_read_1(tuple, i); - cis->buffer[cis->len++] = ch; - } - return (0); -} - -static int -pccard_open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - device_t parent, child; - device_t *kids; - int cnt, err; - struct pccard_softc *sc; - - sc = dev->si_drv1; - if (sc->cis_open) - return (EBUSY); - parent = sc->dev; - err = device_get_children(parent, &kids, &cnt); - if (err) - return err; - if (cnt == 0) { - free(kids, M_TEMP); - sc->cis_open++; - sc->cis = NULL; - return (0); - } - child = kids[0]; - free(kids, M_TEMP); - sc->cis = malloc(sizeof(*sc->cis), M_TEMP, M_ZERO | M_WAITOK); - err = pccard_scan_cis(parent, child, pccard_build_cis, sc->cis); - if (err) { - free(sc->cis, M_TEMP); - sc->cis = NULL; - return (err); - } - sc->cis_open++; - return (0); -} - -static int -pccard_close(struct cdev *dev, int fflags, int devtype, struct thread *td) -{ - struct pccard_softc *sc; - - sc = dev->si_drv1; - free(sc->cis, M_TEMP); - sc->cis = NULL; - sc->cis_open = 0; - return (0); -} - -static int -pccard_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, - struct thread *td) -{ - return (ENOTTY); -} - -static int -pccard_read(struct cdev *dev, struct uio *uio, int ioflag) -{ - struct pccard_softc *sc; - - sc = dev->si_drv1; - /* EOF */ - if (sc->cis == NULL || uio->uio_offset > sc->cis->len) - return (0); - return (uiomove(sc->cis->buffer + uio->uio_offset, - MIN(uio->uio_resid, sc->cis->len - uio->uio_offset), uio)); -} diff --git a/sys/dev/pccard/pccarddevs b/sys/dev/pccard/pccarddevs deleted file mode 100644 index 13b647a8f23c..000000000000 --- a/sys/dev/pccard/pccarddevs +++ /dev/null @@ -1,803 +0,0 @@ -$FreeBSD$ -/* $NetBSD: pcmciadevs,v 1.226 2008/06/19 18:20:33 imp Exp $ */ -/* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ - -/*- - * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -/*- - * Copyright (c) 1999-2004 The FreeBSD Project. - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -/* - * Tuple registration list can be found at: - * http://web.archive.org/web/20051029005139/http://www.pcmcia.org/tupleidlist.htm - */ - -/* - * "The first 256 identifiers are reserved for manufacturers who have - * JEDEC IDs assigned to them by JEDEC publication 106." - * - * The latest rev of JEDEC Publication 106 is revision S and can be - * downloaded from: - * http://www.jedec.org/download/search/JEP106s.pdf - * - * There's really only 128 of these available, since the first bank of - * publication 106 reserves the top bit for parity. - */ -vendor FUJITSU 0x0004 Fujitsu Corporation -vendor HITACHI 0x0007 Hitachi -vendor INTERSIL 0x000b Intersil -vendor PANASONIC 0x0032 Matsushita Electric Industrial Co. -vendor SANDISK 0x0045 Sandisk Corporation -vendor NEWMEDIA 0x0057 New Media Corporation -vendor INTEL 0x0089 Intel -vendor TOSHIBA2 0x0098 Toshiba -vendor IBM 0x00a4 IBM Corporation -vendor SHARP 0x00b0 Sharp Corporation - -/* - * List of known PCMCIA vendors, sorted by numeric ID, as registered with the - * PCMCIA consortium. - * - * Exceptions: - * 0x018c Global Village uses this w/o it appearing in the official list. - */ - -vendor DIGITAL 0x0100 Digital Equipment Corporation -vendor 3COM 0x0101 3Com Corporation -vendor MEGAHERTZ 0x0102 Megahertz Corporation -vendor SOCKET 0x0104 Socket Communications -vendor TDK 0x0105 TDK Corporation -vendor XIRCOM 0x0105 Xircom -vendor SMC 0x0108 Standard Microsystems Corporation -vendor MOTOROLA 0x0109 Motorola Corporation -vendor NI 0x010b National Instruments -vendor QLOGIC 0x0114 QLogic -vendor USROBOTICS 0x0115 US Robotics Corporation -vendor OLICOM 0x0121 Olicom -vendor PROXIM 0x0126 Proxim -vendor DSPSI 0x0128 DSP Solutions, Inc -vendor ADAPTEC 0x012f Adaptec Corporation -vendor MAGICRAM 0x0135 Magic Ram, Inc -vendor QUATECH 0x0137 Quatech -vendor COMPAQ 0x0138 Compaq -vendor OSITECH 0x0140 Ositech -vendor GREY_CELL 0x0143 Grey Cell Systems, Ltd -vendor LINKSYS 0x0149 Linksys Corporation -vendor NETGEAR 0x0149 Netgear -vendor SIMPLETECH 0x014d Simple Technology -vendor SYMBOL2 0x014d Symbol -vendor LUCENT 0x0156 Lucent Technologies -vendor AGERE 0x0156 Agere Systems -vendor GEMPLUS 0x0157 Gemplus -vendor AIRONET 0x015f Aironet Wireless Communications -vendor ERICSSON 0x016b Ericsson -vendor PSION 0x016c Psion -vendor PMC 0x0175 Premax Microelectronics Corp -vendor COMPAQ2 0x0183 Compaq -vendor PARALON 0x0183 Paralon Technologies Inc -vendor KINGSTON 0x0186 Kingston -vendor MELCO 0x018a Melco Corporation -vendor GLOBALVILLAGE 0x018c Global Village -vendor SIERRA 0x0192 Sierra -vendor DAYNA 0x0194 Dayna Corporation -vendor RAYTHEON 0x01a6 Raytheon -vendor RACORE 0x01bf Racore Computer Products -vendor BAY 0x01eb Bay Networks -vendor FARALLON 0x0200 Farallon Communications -vendor RELIA 0x0215 RELIA Technologies Corporation -vendor TELECOMDEVICE 0x021b Telecom Device -vendor OMNIKEY 0x0223 OMNIKEY GmbH -vendor NOKIA 0x023d Nokia Communications -vendor SAMSUNG 0x0250 Samsung -vendor HWN 0x0261 Home Wireless Networks -vendor ANYCOM 0x0264 Anycom -vendor ARTEM 0x0268 ARtem -vendor SYMBOL 0x026c Symbol -vendor BUFFALO 0x026f BUFFALO (Melco Corporation) -vendor BROMAX 0x0274 Bromax communications, Inc -vendor NECINFORTIA 0x0288 NEC Inforntia -vendor IODATA2 0x028a I-O DATA -vendor ASUS 0x02aa ASUS -vendor SIEMENS 0x02ac Siemens -vendor UNGERMANN 0x02c0 Ungermann Bass -vendor MICROSOFT 0x02d2 Microsoft Corporation - -/* - * The following vendor IDs are byte-swapped from what the company is assigned. - */ -vendor NWN 0x0602 No Wires Needed -vendor BREEZECOM 0x0a02 BreezeCOM -vendor LASAT 0x3401 Lasat Communications A/S -vendor BONDWELL 0x3b01 Bondwell -vendor LEXARMEDIA 0x4e01 Lexar Media -vendor COMPEX 0x8a01 Compex Corporation -vendor ZONET 0x8a01 Zonet Technology Inc. -vendor ELSA 0xd601 Elsa - -/* - * The following vendor IDs are the vendor's PCI ID, not their PCMCIA - * IDs. NEWMEDIA2 should likely be 'Advansys' since that's who owns - * the PCI ID. - */ -vendor NEWMEDIA2 0x10cd NewMedia -vendor PLANEX 0x14ea PLANEX -vendor ACTIONTEC 0x1668 ACTIONTEC -vendor RALINK 0x1814 Ralink Technology - -/* - * The following vendor IDs are not, as far as I can tell, actually - * assigned to these people by the pcmcia. However, all the ones starting - * with '0xc' look coherent enough that maybe somebody other than PCMCIA is - * assigning numbers in that range. Maybe JEITA? - */ -vendor RIOS 0x492f RIOS Systems Co -vendor AIRVAST 0x50c2 AirVast Technology -vendor ARCHOS 0x5241 Archos -vendor DUAL 0x890f Dual -vendor EDIMAX 0x890f Edimax Technology Inc. -vendor ADAPTEC2 0x9005 Adaptec -vendor CONTEC 0xc001 Contec -vendor TJ 0xc00a TJ -vendor MACNICA 0xc00b MACNICA -vendor ROLAND 0xc00c Roland -vendor COREGA2 0xc00f Corega K.K. -vendor ALLIEDTELESIS 0xc00f Allied Telesis K.K. -vendor HAGIWARASYSCOM 0xc012 Hagiwara SYS-COM -vendor RATOC 0xc015 RATOC System Inc. -vendor NEXTCOM 0xc020 NextCom K.K. -vendor WORKBIT 0xc024 WORKBIT -vendor EMTAC 0xc250 EMTAC Technology Corporation - -/* - * List of known products. Grouped by vendor, sorted by number within the - * group. - */ - -/* 3COM Products */ -product 3COM 3CRWE737A 0x0001 3Com AirConnect Wireless LAN -product 3COM 3CXM056BNW 0x002f 3Com/NoteWorthy 3CXM056-BNW 56K Modem -product 3COM 3CXEM556 0x0035 3Com/Megahertz 3CXEM556 Ethernet/Modem -product 3COM 3CXEM556INT 0x003d 3Com/Megahertz 3CXEM556-INT Ethernet/Modem -product 3COM 3CRWB609 0x0040 3Com Bluetooth PC Card 3CRWB60-A -product 3COM 3CCFEM556BI 0x0556 3Com/Megahertz 3CCFEM556BI 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 -product 3COM 3CRWE777A 0x0777 3Com 3CRWE777A Airconnect -product 3COM 3C1 0x0cf1 3Com Megahertz 3C1 10Mbps LAN CF+ Card -product 3COM 3CRWE62092A 0x2092 3Com 3CRWE62092A Wireless LAN - -/* ACTIONTEC Products */ -product ACTIONTEC PRISM 0x0101 PRISM Wireless LAN PC Card - -/* Adaptec Products */ -product ADAPTEC APA1460 0x0001 Adaptec APA-1460 SlimSCSI -product ADAPTEC APA1460A 0x0002 Adaptec APA-1460A SlimSCSI -product ADAPTEC2 ANW8030 0x0021 Adaptec ANW-8030 - -/* Aironet */ -product AIRONET PC4500 0x0005 Aironet PC4500 Wireless LAN Adapter -product AIRONET PC4800 0x0007 Aironet PC4800 Wireless LAN Adapter -product AIRONET 350 0x000a Aironet 350 Wireless LAN Adapter - -/* AirVast */ -product AIRVAST WN_100B 0x0001 AirVast WN-100 (alt) -product AIRVAST WN_100 0x7300 AirVast WN-100 - -/* Allied Telesis K.K. */ -product ALLIEDTELESIS LA_PCM 0x0002 Allied Telesis LA-PCM - -/* Anycom */ -product ANYCOM LSE041 0x0004 AnyCom BlueCard LSE041 R1B -product ANYCOM LSE039 0x0008 Anycom Bluetooth CF Card LSE039 -product ANYCOM LSE139 0x000b Anycom Bluetooth CF Card LSE139 - -/* Archos */ -product ARCHOS ARC_ATAPI 0x0043 MiniCD - -/* ARtem */ -product ARTEM ONAIR 0x0001 ARtem OnAir - -/* ASUS WL-100 */ -product ASUS WL100 0x0002 ASUS SpaceLink WL-100 Wireless LAN - -/* Bay Networks */ -product BAY STACK_650 0x0804 BayStack 650 Wireless LAN -product BAY SURFER_PRO 0x0806 AirSurfer Pro Wireless LAN -product BAY STACK_660 0x0807 BayStack 660 Wireless LAN -product BAY EMOBILITY_11B 0x080a e-Mobility 11Mb Wireless LAN - -/* Bondwell */ -product BONDWELL B236 0x0000 Game Card Joystick - -/* BreezeCOM */ -product BREEZECOM BREEZENET 0x0102 BreezeCOM BreezeNET - -/* Bromax Communications, Inc (Linksys OEM) */ -product BROMAX IPORT 0x1103 iPort 10/100 Ethernet -product BROMAX AXNET 0x1106 AXNET based 10/100 Ethernet -product BROMAX IPORT2 0x1121 iPort 10Mbps Ethernet -product BROMAX IWN 0x1612 Instant Wireless Network PC Card -product BROMAX IWN3 0x1613 Instant Wireless Network PC Card, V3 -product BROMAX WCF11 0x3301 Instant Wireless Network CF Card - -/* BUFFALO */ -product BUFFALO LPC2_CLT 0x0300 BUFFALO LPC2-CLT Ethernet -product BUFFALO LPC3_CLX 0x0301 BUFFALO LPC3-CLX Ethernet Adapter -product BUFFALO LPC4_TX 0x0303 BUFFALO LPC4-TX Fast Ethernet -product BUFFALO WLI_PCM_S11 0x0305 BUFFALO AirStation 11Mbps WLAN -product BUFFALO LPC_CF_CLT 0x0307 BUFFALO LPC-CF-CLT -product BUFFALO LPC4_CLX 0x0309 BUFFALO LPC4-CLX -product BUFFALO LPC3_CLT 0x030a BUFFALO LPC3-CLT Ethernet Adapter -product BUFFALO WLI_CF_S11G 0x030b BUFFALO AirStation 11Mbps CF WLAN - -/* Compaq Products */ -product COMPAQ NC5004 0x0002 Compaq Agency NC5004 Wireless Card -product COMPAQ CPQ550 0x110a Compaq Microcom CPQ550 Ethernet/Modem -product COMPAQ2 CPQ_10_100 0x010a Compaq Netelligent 10/100 Ethernet - -/* Compex Products */ -product COMPEX AMP_WIRELESS 0x0066 AMP -product COMPEX LINKPORT_ENET_B 0x0100 Compex Linkport ENET-B Ethernet -product COMPEX LANMODEM 0xc0ab New Media LANSurfer 10+56 Ethernet/Modem -product COMPEX AX88190 0xc1ab AX88190 Fast Ethernet - -/* Contec C-NET(PC) */ -product CONTEC CNETPC 0x0000 Contec C-NET(PC)C -product CONTEC FX_DS110_PCC 0x0008 Contec FLEXLAN/FX-DS110-PCC - -/* Dayna Products */ -product DAYNA COMMUNICARD_E_1 0x002d Dayna CommuniCard E -product DAYNA COMMUNICARD_E_2 0x002f Dayna CommuniCard E - -/* DIGITAL Products */ -product DIGITAL MOBILE_MEDIA_CDROM 0x0d00 Digital Mobile Media CD-ROM - -/* DSP Solutions, Inc. (Megahertz OEM) */ -product DSPSI XJEM1144 0x0101 Megahertz X-JACK -product DSPSI XJACK 0x0103 Megahertz X-JACK Ethernet - -/* Dual */ -product DUAL NE2000 0x0100 Dual NE2000 - -/* Edimax Products */ -product EDIMAX EP4000A 0x0100 Edimax EP4000A -product EDIMAX EP4101 0x1090 Edimax EP4101 - -/* ELSA Products */ -product ELSA MC2_IEEE 0x0001 AirLancer MC-2 IEEE -product ELSA XI300_IEEE 0x0002 XI300 Wireless LAN -product ELSA XI800_IEEE 0x0004 XI800 CF Wireless LAN -product ELSA XI325_IEEE 0x0005 XI325 Wireless LAN -product ELSA APDL325_IEEE 0x0006 ADPL325 Wireless LAN -product ELSA XI330_IEEE 0x0010 XI330 Wireless LAN -product ELSA WIFI_FLASH 0x0101 802.11b plus 128MB Flash - -/* EMTAC */ -product EMTAC WLAN 0x0002 EMTAC A2424i 11Mbps WLAN Card - -/* Ericsson */ -product ERICSSON WIRELESSLAN 0x0001 DSSS Wireless LAN PC Card - -/* Farallon */ -product FARALLON SKYLINE 0x0a01 SkyLINE Wireless - -/* Fujutsu Products */ -product FUJITSU NE200T 0x0004 Eagle Tech NE200T -product FUJITSU SCSI600 0x0401 Fujitsu SCSI 600 Interface -product FUJITSU LA10S 0x1003 Fujitsu Compact Flash Ethernet -product FUJITSU LA501 0x2000 Fujitsu Towa LA501 Ethernet -product FUJITSU WL110 0x2003 PEGA-WL110 Wireless LAN - -/* Gemplus */ -product GEMPLUS GPR400 0x3004 GPR400 Smartcard Reader - -/* GlobalVillage */ -product GLOBALVILLAGE POWERPORT 0x0103 GlobalVillage PowerPort PlatinumPro -product GLOBALVILLAGE LANMODEM 0x0105 GlobalVillage Ethernet + Modem - -/* Grey Cell Systems, Ltd */ -product GREY_CELL TDK3000 0x3341 TDK 3000/3400/5670 Fast Ethernet/Modem -product GREY_CELL DMF650TX 0xc0ab D-Link DMF-650TX - -/* Hitachi */ -product HITACHI HT_4840 0x000b Hitachi HT-4840-11 Ethernet Card - -/* Home Wireless Networks */ -product HWN AIRWAY80211 0x0002 HWN Airway Wireless PCMCIA Card - -/* IBM Products */ -product IBM MICRODRIVE 0x0000 IBM Microdrive -product IBM 3270 0x0001 IBM 3270 Emulation -product IBM INFOMOVER 0x0002 IBM InfoMover -product IBM 5250 0x000b IBM 5250 Emulation -product IBM TROPIC 0x001e IBM Token Ring 4/16 -product IBM SCSI 0x0026 IBM SCSI PCMCIA -product IBM PORTABLE_CDROM 0x002d IBM PCMCIA Portable CD-ROM Drive -product IBM HOME_AND_AWAY 0x002e IBM Home and Away Modem -product IBM WIRELESS_LAN_ENTRY 0x0032 IBM Wireless LAN Entry -product IBM SMART_CAPTURE_II 0x003c IBM Smart Capture Card II -product IBM ETHERJET 0x003f IBM EtherJet Ethernet - -/* Intel Products */ -product INTEL PRO_WLAN_2011 0x0001 Intel PRO/Wireless 2011 LAN PC Card -product INTEL EEPRO100 0x010a Intel EtherExpress PRO/100 -product INTEL ETHEREXPPRO 0x0301 Intel EtherExpress Pro PCMCIA Card -product INTEL PRO100LAN56 0x110a Intel EtherExpress PRO/100 LAN Modem - -/* Intersil */ -/* OEMs sell these things under different marketing names */ -product INTERSIL ISL37100P 0x7100 ISL37100P -product INTERSIL ISL37110P 0x7110 ISL37110P -product INTERSIL ISL37300P 0x7300 ISL37300P - -/* I-O DATA */ -product IODATA2 WNB11PCM 0x0002 I-O DATA WN-B11/PCM -product IODATA2 WCF12 0x0673 Wireless CF Card - -/* Kingston Products */ -product KINGSTON KNE2 0x0100 Kingston KNE-PC2 Ethernet -product KINGSTON CIO10T 0x0110 Kingston CIO10T Ethernet - -/* Lasat Products */ -product LASAT CREDIT_288 0x2811 Lasat Credit 288 Modem - -/* Lexar Media */ -product LEXARMEDIA COMPACTFLASH 0x0100 Lexar Media CompactFlash - -/* Linksys corporation */ -product LINKSYS TRUST_COMBO_ECARD 0x021b Trust (Linksys) Combo EthernetCard -product LINKSYS ETHERFAST 0x0230 Linksys Etherfast 10/100 Ethernet -product LINKSYS ECARD_1 0x0265 Linksys EthernetCard or D-Link DE-650 -product LINKSYS COMBO_ECARD 0xc1ab Linksys Combo EthernetCard - -/* Lucent WaveLAN/IEEE */ -product LUCENT WAVELAN_IEEE 0x0002 WaveLAN/IEEE -product AGERE HERMES_II 0x0003 Agere Systems Hermes-II Wireless -product AGERE HERMES_II_5 0x0004 Agere Systems Hermes-II.5 Wireless - -/* MACNICA */ -product MACNICA ME1_JEIDA 0x3300 MACNICA ME1 for JEIDA -product MACNICA MPS110 0xa041 MACNICA Miracle SCSI-II mPS110 - -/* MagicRam, Inc */ -product MAGICRAM ETHER 0x0000 MagicRAM Ethernet PC Card 933926 - -/* Megahertz Products */ -product MEGAHERTZ VARIOUS 0x0000 Megahertz X-jack Ethernet -product MEGAHERTZ XJEM3336 0x0006 Megahertz X-JACK Ethernet Modem -product MEGAHERTZ XJ4288 0x0023 Megahertz XJ4288 Modem -product MEGAHERTZ XJ4336 0x0027 Megahertz XJ4336 Modem -product MEGAHERTZ XJ5560 0x0034 Megahertz X-JACK 56kbps Modem - -/* Melco Products */ -product MELCO LPC3_CLX 0x0301 Melco LPC3-CLX Ethernet Adapter -product MELCO LPC3_TX 0xc1ab Melco LPC3-TX - -/* Microsoft Products */ -product MICROSOFT MN_520 0x0001 Microsoft MN-520 WLAN Card - -/* Motorola Products */ -product MOTOROLA POWER144 0x0105 Motorola Power 14.4 Modem -product MOTOROLA PM100C 0x0302 Motorola Personal Messenger 100C CDPD Modem -product MOTOROLA MARINER 0x0501 Motorola Mariner Ethernet/Modem -product MOTOROLA MONTANA_336 0x0505 Motorola Montana 33.6 - -/* NEC Inforntia Products */ -product NECINFRONTIA AX420N 0x1b01 NEC Infrontia AX420N AirH Modem - -/* New Media Products */ -product NEWMEDIA BASICS 0x0019 New Media BASICS Ethernet -product NEWMEDIA LANSURFER 0x0021 New Media LANSurfer -product NEWMEDIA LIVEWIRE 0x1004 New Media LiveWire Ethernet LAN Adapter -product NEWMEDIA MULTIMEDIA 0x100b New Media Multimedia -product NEWMEDIA BUSTOASTER2 0xa002 New Media SCSI Bus Toaster -product NEWMEDIA BUSTOASTER 0xc102 New Media SCSI Bus Toaster -product NEWMEDIA BUSTOASTER3 0xd302 New Media SCSI Bus Toaster -product NEWMEDIA WAVJAMMER 0xe005 New Media .WAVjammer -product NEWMEDIA WAVJAMMER2 0xf005 New Media .WAVjammer -product NEWMEDIA2 BUSTOASTER 0x0001 New Media BusToaster - -/* Netgear */ -product NETGEAR FA410TXC 0x4530 Netgear FA410TXC -product NETGEAR FA411 0x0411 Netgear FA411 - -/* National Instruments */ -product NI PCMCIA_232 0x0d50 National Instruments PCMCIA-232 -product NI PCMCIA_232_2 0x0d51 National Instruments PCMCIA-232/2 -product NI PCMCIA_485 0x0d51 National Instruments PCMCIA-485 -product NI PCMCIA_485_2 0x0d52 National Instruments PCMCIA-485/2 -product NI PCMCIA_GPIB 0x4882 National Instruments PCMCIA-GPIB -product NI PCMCIA_232_4 0xd180 National Instruments PCMCIA-232/4 - -/* NextCom K.K. */ -product NEXTCOM NEXTHAWK 0x0001 Next Hawk Ethernet - -/* Nokia Products */ -product NOKIA C110_WLAN 0x1110 Nokia C110/C111 -product NOKIA C020_WLAN 0x20c0 Nokia C020 WLAN Card - -/* No Wires Needed */ -product NWN WLAN_550 0x0002 NWN 550 WLAN -product NWN WLAN_1148 0x0003 NWN 1148 WLAN - -/* Olicom Products */ -product OLICOM OC2220 0x0101 GoCard Ethernet -product OLICOM OC3221 0x2132 GoCard Token Ring 16/4 -product OLICOM OC2231 0x3122 GoCard Combo Eth/Modem 288 -product OLICOM OC3231 0x3132 GoCard Token Ring 16/4/Modem 288 -product OLICOM OC2232 0x3222 GoCard Combo Eth/Modem 336 -product OLICOM OC3232 0x3232 GoCard Token Ring 16/4/Modem 336 - -/* OMNIKEY Products */ -product OMNIKEY CM4040 0x0200 OMNIKEY CardMan 4040 - -/* Ositech Products */ -product OSITECH JACK_144 0x0001 Jack of Diamonds Ethernet/Modem 14.4 -product OSITECH JACK_288 0x0002 Jack of Diamonds Ethernet/Modem 28.8 -product OSITECH JACK_336 0x0007 Jack of Diamonds Ethernet/Modem 33.6 -product OSITECH TRUMP_SOD 0x0008 Seven of Diamonds Ethernet Card -product OSITECH TRUMP_JOH 0x000a Jack of Hearts Ethernet/Modem - -/* Panasonic Products */ -product PANASONIC KXLC002 0x0304 Panasonic 4X CD-ROM Interface Card -product PANASONIC KXLC003 0x0504 Panasonic 8X CD-ROM Interface Card -product PANASONIC KXLC004 0x0604 Panasonic KXL-810AN Interface Card -product PANASONIC KXLC005_2 0x0704 Panasonic 16X CD-ROM Interface Card -product PANASONIC KME 0x2604 Panasonic CD-R/RW Interface -product PANASONIC KXLC005 0x2704 Panasonic 16X CD-ROM Interface Card -product PANASONIC KXLC005_1 0x2904 Panasonic 16X CD-ROM Interface Card - -/* Planex */ -product PLANEX GWNS11H 0xb001 Planex GW-NS11H - -/* Premax Microelectronics Corp. */ -product PMC LANMODEM 0x0000 LAN 33.6 Modem card - -/* Proxim */ -product PROXIM HARMONY 0x0002 Proxim HARMONY 80211B -product PROXIM ROAMABOUT_2400FH 0x1058 Digital RoamAbout 2400FH -product PROXIM RANGELAN2_7401 0x1158 Proxim RangeLAN2 7401 -product PROXIM RANGELANDS_8430 0x8000 Proxim RangeLAN-DS 8430 - -/* Psion */ -product PSION GOLDCARD 0x0020 Psion Gold Card -product PSION NETGLOBAL 0x0023 Psion Gold Card NetGlobal 10/100 -product PSION NETGLOBAL2 0x0026 Psion Gold Card NetGlobal 10/100 -product PSION LANGLOBAL 0x0081 Psion LANGLOBAL - -/* QLogic */ -product QLOGIC PC05 0x0104 Qlogic Fast SCSI - -/* Quatech */ -product QUATECH SPP_100 0x0003 Quatech Enhanced Parallel Port -product QUATECH DSP_225 0x0008 Quatech Dual Serial Port -product QUATECH DUAL 0x000e Quatech Dual Serial Port -product QUATECH QUAD_RS232 0x001b Quatech Quad RS-232 -product QUATECH QSP_100 0x0025 Quatech Quad serial Port -product QUATECH QUAD_422 0x0045 Quatech Quad serial Port -product QUATECH DUAL_RS232 0x0052 Quatech Dual RS-232 - -/* RATOC System Inc. Products */ -/* Don't use because both cards have same product id */ -product RATOC REX_R280_9530 0x0001 RATOC REX-R280/REX-9530/CFU01 - -/* Racore Computer Products */ -product RACORE ACCTON_EN2226 0x010a Accton Fast EtherCard -product RACORE ETHERNET 0x2216 Racore PC Card Ethernet -product RACORE FASTENET 0x2328 Racore PC Card Fast Ethernet -product RACORE 8041TX 0x8041 SMC8041-TX - -/* Ralink Technology products */ -product RALINK RT2560 0x0201 RT2500 wireless adapter - -/* Raylink/WebGear */ -product RAYTHEON WLAN 0x0000 WLAN Adapter - -/* RELIA Technologies Corporation */ -product RELIA COMBO 0x2452 Reliable Combo-L/M-56K - -/* RIOS Systems Co */ -product RIOS PCCARD3 0x0000 PC Card Ethernet - -/* Roland */ -product ROLAND SCP55 0x0001 Roland SCP-55 - -/* Samsung */ -product SAMSUNG SWL_2000N 0x0002 Samsung MagicLAN SWL-2000N - -/* Sandisk Products */ -product SANDISK SDCFB 0x0401 Sandisk CompactFlash Card - -/* Sharp Products */ -product SHARP PALDIO611S 0x0000 PALDIO 611S PC CARD - -/* Siemens */ -product SIEMENS SS1021 0x0002 Siemens SpeedStream 1021 -product SIEMENS SS1021A 0x3021 Siemens SpeedStream SS1021 - -/* Sierra */ -product SIERRA AC710 0x0710 AC710/AC750/AC850 -product SIERRA A550 0xa550 A550 -product SIERRA A555 0xa555 A555 -product SIERRA A710 0xa710 A710/A750 - -/* Simple Technology Products */ -product SIMPLETECH COMMUNICATOR288 0x0100 Simple Technology 28.8 Communicator -/* Simpletech ID also used by Symbol */ -product SIMPLETECH SPECTRUM24 0x801 Symbol Spectrum24 WLAN Adapter - -/* Standard Microsystems Corporation Products */ -product SMC SMC91C96 0x0001 SMC 91C96 Farallon EtherMac -product SMC 8016 0x0105 SMC 8016 EtherCard -product SMC EZCARD 0x8022 SMC EZCard 10 PCMCIA - -/* Socket Communications Products */ -product SOCKET EA_ETHER 0x0000 Socket Communications EA -product SOCKET LP_WLAN_CF 0x0001 Socket Communications Low Power WLAN Card -product SOCKET PAGECARD 0x0003 Socket Communications PageCard -product SOCKET DUAL_RS232 0x0006 Socket Communications Dual RS232 -product SOCKET ES_1000 0x000a Socket Communications Ethernet/RS-232 -product SOCKET LP_ETHER 0x000d Socket Communications LP-E -product SOCKET DUAL_IO 0x0070 Socket Communications DUAL IO -product SOCKET LP_ETHER_CF 0x0075 Socket Communications LP-E CF -product SOCKET DUAL_RS232_A 0x00a1 Socket Communications Dual RS232_A -product SOCKET LP_ETH_10_100_CF 0x0145 Socket Communications 10/100 Ethernet - -/* Symbol */ -product SYMBOL LA4100 0x0001 Symbol Spectrum24 LA4100 Series WLAN - -/* TDK Products */ -product TDK LAK_CD011WL 0x0000 TDK LAK-CD011WL -product TDK LAK_CD011 0x0100 TDK LAK-CD011 -product TDK CFE_10 0x010a Xircom CompactCard CFE-10 -product TDK LAK_CD021BX 0x0200 TDK LAK-CD021BX Ethernet -product TDK LAK_CF010 0x0900 TDK LAC-CF010 -product TDK DFL9610 0x0d0a TDK DFL9610 Ethernet & Digital Cellular -product TDK C6500012 0x410a TDK ELSA MicroLink MC all -product TDK BLUETOOTH 0x4254 TDK Bluetooth PC Card -product TDK GN3410 0x4815 TDK GlobalNetworker 3410 -product TDK LAK_CD031 0xc1ab TDK LAK-CD031 Ethernet -product TDK DFL5610WS 0xea15 TDK DFL5610WS Ethernet/Modem - -/* Telecom Device */ -product TELECOMDEVICE LM5LT 0x0101 Billionton LM5LT-10B Ethernet/Modem -product TELECOMDEVICE TCD_HPC100 0x0202 Telecom Device TCD-HPC100 - -/* TJ Products */ -product TJ PTJ_LAN_T 0x0001 TJ Ethernet PTJ-LAN/T PC-NIC ENCC 990010759-001A - -/* Toshiba products */ -product TOSHIBA2 LANCT00A 0x0042 Toshiba LANCT00A Ethernet - -/* US Robotics Products */ -product USROBOTICS WORLDPORT144 0x3330 US Robotics WorldPort 14.4 Modem - -/* WORKBIT Products */ -product WORKBIT ULTRA_NINJA_16 0x8006 WORKBIT Ultra Ninja-16 (16bit mode) - -/* Xircom Products */ -product XIRCOM CWE1130 0x0007 Xircom Wireless Ethernet Adapter -product XIRCOM CE 0x0108 Xircom CreditCard Ethernet -product XIRCOM CE2 0x010a Xircom CreditCard Ethernet II -product XIRCOM CE3 0x010a Xircom CreditCard Ethernet 10/100 -product XIRCOM CE2_2 0x010b Xircom CreditCard Ethernet II -product XIRCOM XE2000 0x0153 Xircom XE2000 10/100 Ethernet -product XIRCOM CNW_801 0x0801 Xircom CreditCard Netwave (Canada) -product XIRCOM CNW_802 0x0802 Xircom CreditCard Netwave (US) -product XIRCOM CT2 0x1101 Xircom CreditCard Token Ring II -product XIRCOM CEM 0x110a Xircom CreditCard Ethernet + Modem -product XIRCOM CEM2 0x110a Xircom CreditCard Ethernet + Modem -product XIRCOM CEM56 0x110a Xircom CreditCard Ethernet + Modem 56 -product XIRCOM REM10 0x110a Xircom CreditCard Ethernet 10 + Modem 56 -product XIRCOM REM56 0x110a Xircom RealPort Ethernet 10/100 + Modem 56 -product XIRCOM XEM5600 0x110a Xircom 10/100 Network + 56K Modem PC Card -product XIRCOM CEM28 0x110b Xircom CreditCard Ethernet + Modem 28.8 -product XIRCOM CEM56_2 0x110b Xircom CreditCard Ethernet + Modem 56 -product XIRCOM CEM33 0x110c Xircom CreditCard Ethernet + Modem 33.6 -product XIRCOM CEM33_2 0x110d Xircom CreditCard Ethernet + Modem 33.6 - -/* ZONET */ -product ZONET ZEN 0x0100 Zonet Zen 10/10 - -/* - * Cards we know only by their cis, sorted by name. - */ -vendor AMBICOM -1 AmbiCom Inc -vendor ACCTON -1 ACCTON -vendor ADDTRON -1 Addtron -vendor ARGOSY -1 ARGOSY -vendor AMD -1 AMD -vendor BILLIONTON -1 Billionton Systems Inc. -vendor CNET -1 CNet -vendor COREGA -1 Corega K.K. -vendor DLINK -1 D-Link -vendor DYNALINK -1 DynaLink -vendor EIGERLABS -1 Eiger labs,Inc. -vendor EPSON -1 Seiko Epson Corporation -vendor EXP -1 EXP Computer Inc -vendor FUJITSU2 -1 Fujitsu -vendor FUTUREDOMAIN -1 FutureDomain -vendor FREECOM -1 Freecom -vendor GEMTEK -1 Gem Tek -vendor GVC -1 GVC -vendor ICOM -1 ICOM Inc -vendor INTERSIL2 -1 Intersil -vendor IODATA3 -1 I-O DATA -vendor LANTECH -1 Lantech Computer Company -vendor MELCO2 -1 Melco Corporation -vendor MICRORESEARCH -1 Micro Research -vendor MITSUBISHI -1 Mitsubishi Electronics Corp -vendor NDC -1 NDC -vendor NEC -1 NEC -vendor OEM2 -1 Generic OEM -vendor PHISON -1 PHISON -vendor PLANET -1 Planet -vendor PREMAX -1 Premax -vendor RPTI -1 RPTI -vendor SVEC -1 SVEC/Hawking Technology -vendor TAMARACK -1 Tamarack -vendor TEAC -1 TEAC -vendor TOSHIBA -1 TOSHIBA -vendor WORKBIT2 -1 WORKBIT -vendor YEDATA -1 Y-E DATA -vendor YIS -1 YIS Corporation -vendor ZOOM -1 ZOOM - -product ACCTON EN2212 { "ACCTON", "EN2212", NULL, NULL } Accton EN2212 -product ACCTON EN2216 { "ACCTON", "EN2216-PCMCIA-ETHERNET", "EN2216R01", NULL } Accton EN2216 -product ADDTRON AWP100 { "Addtron", "AWP-100&spWireless&spPCMCIA", "Version&sp01.02", NULL } -product ALLIEDTELESIS WR211PCM { "Allied&spTelesis&spK.K.", "WR211PCM", NULL, NULL } Allied Telesis WR211PCM -product AMBICOM AMB8002 { "AmbiCom&spInc", "AMB8002", NULL, NULL } AmbiCom AMB8002 -product AMBICOM AMB8002T { "AmbiCom&spInc", "AMB8002T", NULL, NULL } AmbiCom AMB8002T -product AMBICOM AMB8010 { "AmbiCom&spInc", "AMB8010", NULL, NULL } AmbiCom AMB8010 -product AMBICOM AMB8010_ALT { "AmbiCom", "AMB8010", NULL, NULL } AmbiCom AMB8010 -product AMBICOM AMB8610 { "AmbiCom", "AMB8610", NULL, NULL } AmbiCom AMB8010 -product AMD AM79C930 { "AMD", "Am79C930", NULL, NULL } AMD Am79C930 -product ARGOSY SP320 { "PCMCIA", "RS-COM 2P", NULL, NULL } ARGOSY SP320 Dual port serial PCMCIA -product BILLIONTON CFLT10N { "CF", "10Base-Ethernet", "1.0", NULL } Billionton CFLT10N -product BILLIONTON LNA100B { "Billionton", "LNA-100B", NULL, NULL } Billionton LNA-100B -product BILLIONTON LNT10TB { "PCMCIA", "LNT-10TB", NULL, NULL } Billionton LNT-10TB -product BILLIONTON LNT10TN { "PCMCIA", "LNT-10TN", NULL, NULL } Billionton LNT-10TN -product CNET NE2000 { "CNet", "CN40BC&spEthernet", "D", "NE2000" } CNet CN40BC NE2000 Compatible -product COREGA ETHER_PCC_T { "corega&spK.K.", "corega&spEther&spPCC-T", NULL, NULL } Corega Ether PCC-T -product COREGA ETHER_PCC_TD { "corega&spK.K.", "corega&spEther&spPCC-TD", NULL, NULL } Corega Ether PCC-TD -product COREGA ETHER_II_PCC_T { "corega&spK.K.", "corega&spEtherII&spPCC-T", NULL, NULL } Corega EtherII PCC-T -product COREGA ETHER_II_PCC_TD { "corega&spK.K.", "corega&spEtherII&spPCC-TD", NULL, NULL } Corega EtherII PCC-TD -product COREGA FAST_ETHER_PCC_TX { "corega&spK.K.", "corega&spFastEther&spPCC-TX", NULL, NULL } Corega FastEther PCC-TX -product COREGA FETHER_PCC_TXD { "corega&spK.K.", "corega&spFEther&spPCC-TXD", NULL, NULL } Corega FEther PCC-TXD -product COREGA FETHER_PCC_TXF { "corega", "FEther&spPCC-TXF", NULL, NULL } Corega FEther PCC-TXF -product COREGA FETHER_II_PCC_TXD { "corega&spK.K.", "corega&spFEtherII&spPCC-TXD", NULL, NULL } Corega FEtherII PCC-TXD -product COREGA LAPCCTXD { "corega&spK.K.", "(CG-LAPCCTXD)", "(HardwareFirmwareVer.)", NULL } Corega LAPCCTXD -product COREGA WIRELESS_LAN_PCC_11 { "corega&spK.K.", "Wireless&spLAN&spPCC-11", NULL, NULL } Corega Wireless LAN PCC-11 -product COREGA WIRELESS_LAN_PCCA_11 { "corega&spK.K.", "Wireless&spLAN&spPCCA-11", NULL, NULL } Corega Wireless LAN PCCA-11 -product COREGA WIRELESS_LAN_PCCB_11 { "corega_K.K.", "Wireless_LAN_PCCB-11", NULL, NULL } Corega Wireless LAN PCCB-11 -product COREGA WIRELESS_LAN_PCCL_11 { "corega", "WL&spPCCL-11", NULL, NULL } Corega Wireless LAN PCCL-11 - -product DLINK DE650 { "D-Link", "DE-650", NULL, NULL } D-Link DE-650 -product DLINK DE660 { "D-Link", "DE-660", NULL, NULL } D-Link DE-660 -product DLINK DE660PLUS { "D-Link", "DE-660+", NULL, NULL } D-Link DE-660+ -product DLINK DWL650H { "D-Link&spCorporation", "D-Link&spDWL-650H&sp11Mbps&spWLAN&spAdapter", NULL, NULL } D-Link DWL-650H -product DYNALINK L10C { "DYNALINK", "L10C", NULL, NULL } Dynalink L10C -/* - * vendor ID of EPX_AA2000 is Fujitsu (0x0004) and product ID is 0x2000, but - * it conflicts with Fujitsu Towa LA501 Ethernet. - */ -product EIGERLABS EPX_AA2000 { "Eiger&splabs,Inc.", "EPX-AA2000&spPC&spSound&spCard", NULL, NULL } EPX-AA2000 PC Sound Card -product EPSON EEN10B { "Seiko&spEpson&spCorp.", "Ethernet", "P/N:&spEEN10B&spRev.&sp00", NULL } Epson EEN10B -product EPSON SC200 { "EPSON", "SCSI-2&spPC&spCard&spSC200", NULL, NULL } Media Intelligent SCSI-2 PC Card MSC-200 -product EXP EXPMULTIMEDIA { "EXP&sp&sp&sp", "PnPIDE", "F1", NULL } EXP IDE/ATAPI DVD Card -product EXP THINLANCOMBO { "PCMCIA&spLAN", "Ethernet", NULL, NULL } EXP ThinLan Combo -product FREECOM PCCARDIDE { "FREECOM", "PCCARD-IDE", NULL, NULL } FREECOM PCCARD-IDE -product FUJITSU2 FMV_J181 { "PCMCIA&spMBH10302", "01", NULL, NULL } FUJITSU FMV-J181 PCMCIA Card -product FUJITSU2 FMV_J182 { "FUJITSU", "LAN&spCard(FMV-J182)", "Ver.01", NULL } FUJITSU FMV-J182 PCMCIA Card -product FUJITSU2 FMV_J182A { "FUJITSU", "LAN&spCard(FMV-J182)", "Ver.02", NULL } FUJITSU FMV-J182A PCMCIA Card -product FUJITSU2 ITCFJ182A { "FUJITSU", "LAN&spCard(ITCFJ182)", "Ver.01", NULL } FUJITSU ITCFJ182A CompactCard -product FUTUREDOMAIN SCSI2GO { "Future&spDomain&spCorporation", "SCSI&spPCMCIA&spCredit&spCard&spController", NULL, NULL } Future Domain SCSI2GO -product GEMTEK WLAN { "Intersil", "PRISM&sp2_5&spPCMCIA&spADAPTER", "ISL37300P", "Eval-RevA" } GEMTEK Prism2_5 WaveLAN Card -product GVC NIC_2000P { "GVC", "NIC-2000p", "ETHERNET", NULL } GVC PCMCIA Ethernet Adapeter -product IBM SCSICARD { "IBM&spCorp.", "SCSI&spPCMCIA&spCard", NULL, NULL } IBM SCSI PCMCIA Card -product ICOM SL200 { "Icom", "SL-200", NULL, NULL } Icom SL-200 -product INTERSIL2 PRISM2 { "INTERSIL", "HFA384x/IEEE", "Version&sp01.02", NULL } Intersil Prism II -product IODATA3 CBIDE2 { "IO&spDATA", "CBIDE2&sp&sp&sp&sp&sp&sp", NULL, NULL } IO-DATA CBIDE2/16-bit mode -product IODATA3 CBSC16 { "IO&spDATA", "CBSC16&sp&sp&sp&sp&sp&sp&sp", NULL, NULL } IO-DATA CBSC16 -product IODATA3 PCLAT { "I-O&spDATA", "PCLA", "ETHERNET", NULL } IO-DATA PCLA/T -product LANTECH FASTNETTX { "ASIX", "AX88190", NULL, NULL } Lantech Fastnet/TX -product LINKSYS ECARD_2 { "LINKSYS", "E-CARD", NULL, NULL } Linksys E-Card -product MACNICA MPS100 { "MACNICA", "MIRACLE&spSCSI", "mPS100", "D.0" } Macnica Miracle SCSI mPS100 -product MEGAHERTZ XJ2288 { "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem -product MELCO2 LPC2_T { "MELCO", "LPC2-T", NULL, NULL } Melco LPC2-T -product MELCO2 LPC2_TX { "MELCO", "LPC2-TX", NULL, NULL } Melco LPC2-TX -product MICRORESEARCH MR10TPC { "MICRO-RESEARCH-MR10TPC", "Ethernet", NULL, NULL } Micro Research MR10TPC -product MITSUBISHI B8895 { "MITSUBISHI&spELECTRIC&spCORPORATION", "B8895", NULL, NULL } Mitsubishi Electronics Corporation B8895 -product NANOSPEED PRISM2 { "NANOSPEED", "HFA384x/IEEE", "Version&sp01.02", NULL } NANOSPEED ROOT-RZ2000 WLAN Card -product NDC ND5100_E { "NDC", "Ethernet", "A", NULL } Sohoware ND5100E NE2000 Compatible Card -product NEC CMZ_RT_WP { "NEC", "Wireless&spCard&spCMZ-RT-WP", "Version&sp01.01", NULL } NEC Wireless Card CMZ-RT-WP -product NEC PC9801N_J02 { "NEC", "\021\001\001PC-9801N-J02", NULL, NULL } NEC PC-9801N-J02 -product NEC PC9801N_J02R { "NEC", "PC-9801N-J02R", NULL, NULL } NEC PC-9801N-J02R -product NEC PC9801N_J03R { "NEC", "PC-9801N-J03R", NULL, NULL } NEC PC-9801N-J03R -product NEWMEDIA BASICS_SCSI { "BASICS&spby&spNew&spMedia&spCorporation", "SCSI&spSym53C500", NULL, NULL } New Media Corporation BASICS SCSI -product NTT_ME WLAN { "NTT-ME", "11Mbps&spWireless&spLAN&spPC&spCard", NULL, NULL } NTT-ME 11Mbps Wireless LAN PC Card -product OEM2 CDROM1 { "PCMCIA", "CD-ROM", NULL, NULL } Generic PCMCIA CD-ROM -product OEM2 IDE { "PCMCIA", "IDE&spCARD", NULL, NULL } Generic PCMCIA IDE CARD -product OEM2 ETHERNET { "PCMCIA", "Ethernet", NULL, NULL } NE2000 PC Card -product OEM2 100BASE { "PCMCIA", "100BASE", NULL, NULL } NE2000 PC Card -product OEM2 FAST_ETHERNET { "PCMCIA", "FAST&spETHERNET&spCARD", NULL, NULL } NE2000 PC Card -product OEM2 NE2000 { "NE2000&spCompatible&spPC&spCard", "PCMCIA", NULL, NULL } Generic NE2000 PC Card -product PHISON CF_CARD { "PHISON", "CF&spCard", NULL, NULL } Generic CF or SD/MMC/SmartMedia Reader -product PLANET SMARTCOM2000 { "PCMCIA", "UE2212", NULL, NULL } Planet SmartCOM 2000 -product RPTI EP400 { "RPTI&spLTD.", "EP400", "CISV100", NULL } RPTI EP400 -product RPTI EP401 { "RPTI", "EP401&spEthernet&spNE2000&spCompatible", NULL, NULL } RPTI EP401 -product PREMAX PE200 { "PMX&sp&sp&sp", "PE-200", NULL, NULL } PreMax PE-200 -product RATOC REX_R280 { "RATOC&spSystem&spInc.", "10BASE_T&spCARD&spR280", NULL, NULL } RATOC REX-R280 -product RATOC REX5536 { "1195&spRATOC&spSystem&spInc.", "REX5536&spSCSI2&spCARD", NULL, NULL } RATOC REX-5536 -product RATOC REX5536AM { "PCMCIA&spSCSI&spMBH10404", "01", NULL, NULL } RATOC REX-5536AM -product RATOC REX5536M { "PCMCIA&spSCSI2&spCARD", "01", NULL, NULL } RATOC REX-5536M -product RATOC REX5572 { "RATOC&spSystem&spInc.", "SOUND/SCSI2&spCARD", NULL, NULL } RATOC REX-5572 -product RATOC REX9530 { "RATOC&spSystem&spInc.", "SCSI2&spCARD&sp37", NULL, NULL } RATOC REX-9530 -product RATOC REX_CFU1 { "RATOC", "USB&spHOST&spCF+&spCard", NULL, NULL } RATOC REX-CFU1 -product SIMPLETECH SPECTRUM24_ALT { "Symbol&spTechnologies", "LA4111&spSpectrum24&spWireless&spLAN&spPC&spCard", NULL, NULL } LA4111 Spectrum24 Wireless LAN PC Card -product SMC 2632W { "SMC", "SMC2632W", "Version&sp01.02", NULL } SMC 2632 EZ Connect Wireless PC Card -product SMC 8000 { "SMC8000", "DEV1", NULL, NULL } -product SMC 8020BT { "SMC", "EtherEZ&spEthernet&sp8020", NULL, NULL } -product SMC 8020BTM { "SMC", "EtherEZ&spEthernet/Modem", "8020", NULL } -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 -product TAMARACK ETHERNET { "TAMARACK", "Ethernet", NULL, NULL } TAMARACK NE2000 PC Card -product TEAC IDECARDII { "&sp", "NinjaATA-", NULL, NULL } TEAC IDE Card/II -product TOSHIBA CBIDE2 { "LOOKMEET", "CBIDE2&sp&sp&sp&sp&sp&sp", NULL, NULL } TOSHIBA PA2673U CBIDE2/16-bit mode (IO-DATA OEM) -product WORKBIT2 NINJA_SCSI3 { "WBT", "NinjaSCSI-3", NULL, NULL } WORKBIT Ninja SCSI series -product YEDATA EXTERNAL_FDD { "Y-E&spDATA", "External&spFDD", NULL, NULL } Y-E DATA External FDD -product YIS YWL11B { "YIS&spCorp.", "YWL-11b", NULL, NULL } YIS Corp. YWL-11b -product ZOOM AIR_4000 { "Zoom", "Air-4000", NULL, NULL } Zoom Air-4000 diff --git a/sys/modules/exca/Makefile b/sys/modules/exca/Makefile index 3b51f87b2827..0d302c14dc4e 100644 --- a/sys/modules/exca/Makefile +++ b/sys/modules/exca/Makefile @@ -3,7 +3,7 @@ .PATH: ${SRCTOP}/sys/dev/exca KMOD= exca -SRCS= exca.c device_if.h bus_if.h power_if.h card_if.h pccarddevs.h +SRCS= exca.c device_if.h bus_if.h power_if.h card_if.h EXPORT_SYMS= YES