diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-08-16 16:51:21 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-08-16 16:51:21 +0000 |
commit | b7ba7e898ff6cfa0b51da085ba1aee9edb3e53cd (patch) | |
tree | 171041d0c60c9b32c6d9ca92aad50b76e959e0f8 | |
parent | c6b1e982eb47fa49f9c232e8874ecd0af01f1cf8 (diff) |
manufacturer and product are 16 bits, 0xffff is the special case
-rw-r--r-- | sys/dev/pcmcia/aic_pcmcia.c | 6 | ||||
-rw-r--r-- | sys/dev/pcmcia/com_pcmcia.c | 5 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_ep_pcmcia.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_ne_pcmcia.c | 10 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_rln_pcmcia.c | 6 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_sm_pcmcia.c | 6 | ||||
-rw-r--r-- | sys/dev/pcmcia/pcmcia.c | 15 | ||||
-rw-r--r-- | sys/dev/pcmcia/pcmciavar.h | 23 | ||||
-rw-r--r-- | sys/dev/pcmcia/wdc_pcmcia.c | 27 |
9 files changed, 47 insertions, 55 deletions
diff --git a/sys/dev/pcmcia/aic_pcmcia.c b/sys/dev/pcmcia/aic_pcmcia.c index 61b9a4e5f7c..b763bfc21ec 100644 --- a/sys/dev/pcmcia/aic_pcmcia.c +++ b/sys/dev/pcmcia/aic_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic_pcmcia.c,v 1.6 1999/08/16 06:49:29 fgsch Exp $ */ +/* $OpenBSD: aic_pcmcia.c,v 1.7 1999/08/16 16:51:19 deraadt Exp $ */ /* $NetBSD: aic_pcmcia.c,v 1.6 1998/07/19 17:28:15 christos Exp $ */ /* @@ -68,8 +68,8 @@ struct cfattach aic_pcmcia_ca = { }; struct aic_pcmcia_product { - u_int32_t app_vendor; /* PCMCIA vendor ID */ - u_int32_t app_product; /* PCMCIA product ID */ + u_int16_t app_vendor; /* PCMCIA vendor ID */ + u_int16_t app_product; /* PCMCIA product ID */ int app_expfunc; /* expected function number */ } aic_pcmcia_prod[] = { { PCMCIA_VENDOR_ADAPTEC, PCMCIA_PRODUCT_ADAPTEC_APA1460_1, diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c index db9a9a1fcaf..c61c6cb3953 100644 --- a/sys/dev/pcmcia/com_pcmcia.c +++ b/sys/dev/pcmcia/com_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_pcmcia.c,v 1.20 1999/08/16 07:41:29 fgsch Exp $ */ +/* $OpenBSD: com_pcmcia.c,v 1.21 1999/08/16 16:51:19 deraadt Exp $ */ /* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */ /*- @@ -117,10 +117,9 @@ /* Devices that we need to match by CIS strings */ struct com_pcmcia_product { - char *name; char *cis1_info[4]; } com_pcmcia_prod[] = { - { PCMCIA_STR_MEGAHERTZ_XJ2288, PCMCIA_CIS_MEGAHERTZ_XJ2288 }, + { PCMCIA_CIS_MEGAHERTZ_XJ2288 }, }; int com_pcmcia_match __P((struct device *, void *, void *)); diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c index 899e6575b59..cd32a477deb 100644 --- a/sys/dev/pcmcia/if_ep_pcmcia.c +++ b/sys/dev/pcmcia/if_ep_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_pcmcia.c,v 1.19 1999/08/16 07:41:29 fgsch Exp $ */ +/* $OpenBSD: if_ep_pcmcia.c,v 1.20 1999/08/16 16:51:19 deraadt Exp $ */ /* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */ /*- @@ -141,7 +141,7 @@ struct cfattach ep_pcmcia_ca = { }; struct ep_pcmcia_product { - u_int32_t epp_product; /* PCMCIA product ID */ + u_int16_t epp_product; /* PCMCIA product ID */ u_short epp_chipset; /* 3Com chipset used */ int epp_flags; /* initial softc flags */ int epp_expfunc; /* expected function */ diff --git a/sys/dev/pcmcia/if_ne_pcmcia.c b/sys/dev/pcmcia/if_ne_pcmcia.c index 1fd8f578b12..9427de6c376 100644 --- a/sys/dev/pcmcia/if_ne_pcmcia.c +++ b/sys/dev/pcmcia/if_ne_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ne_pcmcia.c,v 1.17 1999/08/16 08:58:45 fgsch Exp $ */ +/* $OpenBSD: if_ne_pcmcia.c,v 1.18 1999/08/16 16:51:19 deraadt Exp $ */ /* $NetBSD: if_ne_pcmcia.c,v 1.17 1998/08/15 19:00:04 thorpej Exp $ */ /* @@ -83,8 +83,8 @@ struct cfattach ne_pcmcia_ca = { }; struct ne2000dev { - int32_t manufacturer; - int32_t product; + u_int16_t manufacturer; + u_int16_t product; char *cis_info[4]; int function; int enet_maddr; @@ -347,7 +347,6 @@ ne_pcmcia_attach(parent, self, aux) void (*npp_init_media) __P((struct dp8390_softc *, int **, int *, int *)); int *media, nmedia, defmedia; - const char *typestr = ""; npp_init_media = NULL; media = NULL; @@ -500,7 +499,6 @@ ne_pcmcia_attach(parent, self, aux) == RTL0_8019ID0 && bus_space_read_1(dsc->sc_regt, dsc->sc_regh, NERTL_RTL0_8019ID1) == RTL0_8019ID1) { - typestr = " (RTL8019)"; npp_init_media = rtl80x9_init_media; dsc->sc_mediachange = rtl80x9_mediachange; dsc->sc_mediastatus = rtl80x9_mediastatus; @@ -513,7 +511,7 @@ ne_pcmcia_attach(parent, self, aux) if (psc->sc_ih == NULL) printf("no irq"); - printf(": <%s>\n", typestr); + printf("\n"); /* Initialize media, if we have it. */ if (npp_init_media != NULL) diff --git a/sys/dev/pcmcia/if_rln_pcmcia.c b/sys/dev/pcmcia/if_rln_pcmcia.c index 238867c1616..398f434b2f7 100644 --- a/sys/dev/pcmcia/if_rln_pcmcia.c +++ b/sys/dev/pcmcia/if_rln_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rln_pcmcia.c,v 1.2 1999/08/08 01:17:23 niklas Exp $ */ +/* $OpenBSD: if_rln_pcmcia.c,v 1.3 1999/08/16 16:51:19 deraadt Exp $ */ /* * David Leonard <d@openbsd.org>, 1999. Public domain. * @@ -61,8 +61,8 @@ struct cfattach rln_pcmcia_ca = { #define PCMCIA_CIS_SYMPHONY { "PROXIM", "LAN PC CARD", "SYMPHONY", NULL } static struct rln_pcmcia_product { - u_int32_t manufacturer; - u_int32_t product; + u_int16_t manufacturer; + u_int16_t product; const char *name; u_int8_t flags; } rln_pcmcia_products[] = { diff --git a/sys/dev/pcmcia/if_sm_pcmcia.c b/sys/dev/pcmcia/if_sm_pcmcia.c index 515fb042698..66a955c8db3 100644 --- a/sys/dev/pcmcia/if_sm_pcmcia.c +++ b/sys/dev/pcmcia/if_sm_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sm_pcmcia.c,v 1.8 1999/08/16 10:25:18 fgsch Exp $ */ +/* $OpenBSD: if_sm_pcmcia.c,v 1.9 1999/08/16 16:51:20 deraadt Exp $ */ /* $NetBSD: if_sm_pcmcia.c,v 1.11 1998/08/15 20:47:32 thorpej Exp $ */ /*- @@ -111,8 +111,8 @@ int sm_pcmcia_funce_enaddr __P((struct device *, u_int8_t *)); int sm_pcmcia_lannid_ciscallback __P((struct pcmcia_tuple *, void *)); struct sm_pcmcia_product { - u_int32_t spp_vendor; /* vendor ID */ - u_int32_t spp_product; /* product ID */ + u_int16_t spp_vendor; /* vendor ID */ + u_int16_t spp_product; /* product ID */ int spp_expfunc; /* expected function */ } sm_pcmcia_prod[] = { { PCMCIA_VENDOR_MEGAHERTZ2, PCMCIA_PRODUCT_MEGAHERTZ2_XJACK, diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c index afdc5c449af..c518153880c 100644 --- a/sys/dev/pcmcia/pcmcia.c +++ b/sys/dev/pcmcia/pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia.c,v 1.22 1999/08/16 07:45:22 fgsch Exp $ */ +/* $OpenBSD: pcmcia.c,v 1.23 1999/08/16 16:51:20 deraadt Exp $ */ /* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */ /* @@ -301,16 +301,17 @@ pcmcia_print(arg, pnp) printf("%s%s", i ? ", " : " \"", card->cis1_info[i]); printf("\""); - if (card->manufacturer != -1 && card->product != -1) { + if (card->manufacturer != PCMCIA_VENDOR_INVALID && + card->product != PCMCIA_PRODUCT_INVALID) { if (i) printf(" "); printf("("); - if (card->manufacturer != -1) - printf("manufacturer 0x%lx%s", + if (card->manufacturer != PCMCIA_VENDOR_INVALID) + printf("manufacturer 0x%x%s", card->manufacturer, - card->product == -1 ? "" : ", "); - if (card->product != -1) - printf("product 0x%lx", + card->product == PCMCIA_PRODUCT_INVALID ? "" : ", "); + if (card->product != PCMCIA_PRODUCT_INVALID) + printf("product 0x%x", card->product); printf(")"); } diff --git a/sys/dev/pcmcia/pcmciavar.h b/sys/dev/pcmcia/pcmciavar.h index 18748da441e..40b37514496 100644 --- a/sys/dev/pcmcia/pcmciavar.h +++ b/sys/dev/pcmcia/pcmciavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmciavar.h,v 1.11 1999/08/08 01:00:15 niklas Exp $ */ +/* $OpenBSD: pcmciavar.h,v 1.12 1999/08/16 16:51:20 deraadt Exp $ */ /* $NetBSD: pcmciavar.h,v 1.5 1998/07/19 17:28:17 christos Exp $ */ /* @@ -144,15 +144,10 @@ struct pcmcia_card { /* XXX waste of space? */ char cis1_info_buf[256]; char *cis1_info[4]; - /* - * Use int32_t for manufacturer and product so that they can - * hold the id value found in card CIS and special value that - * indicates no id was found. - */ - int32_t manufacturer; -#define PCMCIA_VENDOR_INVALID -1 - int32_t product; -#define PCMCIA_PRODUCT_INVALID -1 + u_int16_t manufacturer; +#define PCMCIA_VENDOR_INVALID 0xffff + u_int16_t product; +#define PCMCIA_PRODUCT_INVALID 0xffff u_int16_t error; #define PCMCIA_CIS_INVALID { NULL, NULL, NULL, NULL } SIMPLEQ_HEAD(, pcmcia_function) pf_head; @@ -181,16 +176,16 @@ struct pcmcia_softc { }; struct pcmcia_cis_quirk { - int32_t manufacturer; - int32_t product; + u_int16_t manufacturer; + u_int16_t product; char *cis1_info[4]; struct pcmcia_function *pf; struct pcmcia_config_entry *cfe; }; struct pcmcia_attach_args { - int32_t manufacturer; - int32_t product; + u_int16_t manufacturer; + u_int16_t product; struct pcmcia_card *card; struct pcmcia_function *pf; }; diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c index 289d2e102b4..80a870e056c 100644 --- a/sys/dev/pcmcia/wdc_pcmcia.c +++ b/sys/dev/pcmcia/wdc_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc_pcmcia.c,v 1.4 1999/07/26 05:43:16 deraadt Exp $ */ +/* $OpenBSD: wdc_pcmcia.c,v 1.5 1999/08/16 16:51:20 deraadt Exp $ */ /* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */ /*- @@ -90,39 +90,36 @@ struct cfattach wdc_pcmcia_ca = { }; struct wdc_pcmcia_product { - u_int32_t wpp_vendor; /* vendor ID */ - u_int32_t wpp_product; /* product ID */ + u_int16_t wpp_vendor; /* vendor ID */ + u_int16_t wpp_product; /* product ID */ int wpp_quirk_flag; /* Quirk flags */ #define WDC_PCMCIA_FORCE_16BIT_IO 0x01 /* Don't use PCMCIA_WIDTH_AUTO */ #define WDC_PCMCIA_NO_EXTRA_RESETS 0x02 /* Only reset ctrl once */ const char *wpp_cis_info[4]; /* XXX necessary? */ - const char *wpp_name; /* product name */ -} wdc_pcmcia_products[] = { +} wdc_pcmcia_pr[] = { { /* PCMCIA_VENDOR_DIGITAL XXX */ 0x0100, PCMCIA_PRODUCT_DIGITAL_MOBILE_MEDIA_CDROM, 0, { NULL, "Digital Mobile Media CD-ROM", NULL, NULL }, - PCMCIA_STR_DIGITAL_MOBILE_MEDIA_CDROM }, + }, { PCMCIA_VENDOR_IBM, PCMCIA_PRODUCT_IBM_PORTABLE_CDROM_DRIVE, 0, { NULL, "Portable CD-ROM Drive", NULL, NULL }, - PCMCIA_STR_IBM_PORTABLE_CDROM_DRIVE }, + }, { PCMCIA_VENDOR_HAGIWARASYSCOM, -1, /* XXX */ WDC_PCMCIA_FORCE_16BIT_IO, { NULL, NULL, NULL, NULL }, - "Hagiwara SYS-COM CompactFlash Card" }, + }, /* The TEAC IDE/Card II is used on the Sony Vaio */ { PCMCIA_VENDOR_TEAC, PCMCIA_PRODUCT_TEAC_IDECARDII, WDC_PCMCIA_NO_EXTRA_RESETS, PCMCIA_CIS_TEAC_IDECARDII, - PCMCIA_STR_TEAC_IDECARDII }, - - { 0, 0, 0, { NULL, NULL, NULL, NULL}, NULL } + }, }; struct wdc_pcmcia_disk_device_interface_args { @@ -192,10 +189,12 @@ wdc_pcmcia_lookup(pa) struct wdc_pcmcia_product *wpp; int i, cis_match; - for (wpp = wdc_pcmcia_products; wpp->wpp_name != NULL; wpp++) - if ((wpp->wpp_vendor == -1 || + for (wpp = wdc_pcmcia_pr; + wpp < &wdc_pcmcia_pr[sizeof(wdc_pcmcia_pr)/sizeof(wdc_pcmcia_pr[0])]; + wpp++) + if ((wpp->wpp_vendor == PCMCIA_VENDOR_INVALID || pa->manufacturer == wpp->wpp_vendor) && - (wpp->wpp_product == -1 || + (wpp->wpp_product == PCMCIA_PRODUCT_INVALID || pa->product == wpp->wpp_product)) { cis_match = 1; for (i = 0; i < 4; i++) { |