Home | History | Annotate | Line # | Download | only in pcmcia
pcmcia_cis_quirks.c revision 1.25.4.3
      1  1.25.4.3      yamt /*	$NetBSD: pcmcia_cis_quirks.c,v 1.25.4.3 2007/02/26 09:10:38 yamt Exp $	*/
      2       1.1      marc 
      3       1.1      marc /*
      4       1.1      marc  * Copyright (c) 1998 Marc Horowitz.  All rights reserved.
      5       1.1      marc  *
      6       1.1      marc  * Redistribution and use in source and binary forms, with or without
      7       1.1      marc  * modification, are permitted provided that the following conditions
      8       1.1      marc  * are met:
      9       1.1      marc  * 1. Redistributions of source code must retain the above copyright
     10       1.1      marc  *    notice, this list of conditions and the following disclaimer.
     11       1.1      marc  * 2. Redistributions in binary form must reproduce the above copyright
     12       1.1      marc  *    notice, this list of conditions and the following disclaimer in the
     13       1.1      marc  *    documentation and/or other materials provided with the distribution.
     14       1.1      marc  * 3. All advertising materials mentioning features or use of this software
     15       1.1      marc  *    must display the following acknowledgement:
     16       1.1      marc  *	This product includes software developed by Marc Horowitz.
     17       1.1      marc  * 4. The name of the author may not be used to endorse or promote products
     18       1.1      marc  *    derived from this software without specific prior written permission.
     19       1.1      marc  *
     20       1.1      marc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21       1.1      marc  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22       1.1      marc  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23       1.1      marc  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24       1.1      marc  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25       1.1      marc  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26       1.1      marc  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27       1.1      marc  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28       1.1      marc  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29       1.1      marc  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30       1.1      marc  */
     31      1.13     lukem 
     32      1.13     lukem #include <sys/cdefs.h>
     33  1.25.4.3      yamt __KERNEL_RCSID(0, "$NetBSD: pcmcia_cis_quirks.c,v 1.25.4.3 2007/02/26 09:10:38 yamt Exp $");
     34       1.1      marc 
     35       1.1      marc #include <sys/param.h>
     36       1.1      marc #include <sys/systm.h>
     37       1.1      marc #include <sys/device.h>
     38      1.23     enami #include <sys/kernel.h>
     39       1.1      marc #include <sys/mbuf.h>
     40       1.1      marc 
     41       1.1      marc #include <dev/pcmcia/pcmciadevs.h>
     42       1.1      marc #include <dev/pcmcia/pcmciareg.h>
     43       1.1      marc #include <dev/pcmcia/pcmciachip.h>
     44       1.1      marc #include <dev/pcmcia/pcmciavar.h>
     45       1.1      marc 
     46       1.1      marc /* There are cards out there whose CIS flat-out lies.  This file
     47       1.1      marc    contains struct pcmcia_function chains for those devices. */
     48       1.1      marc 
     49       1.1      marc /* these structures are just static templates which are then copied
     50       1.1      marc    into "live" allocated structures */
     51       1.1      marc 
     52       1.8  jdolecek static const struct pcmcia_function pcmcia_3cxem556_func0 = {
     53  1.25.4.2      yamt 	.number = 0,				/* function number */
     54  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_NETWORK,
     55  1.25.4.2      yamt 	.last_config_index = 0x07,		/* last cfe number */
     56  1.25.4.2      yamt 	.ccr_base = 0x800,			/* ccr_base */
     57  1.25.4.2      yamt 	.ccr_mask = 0x63,			/* ccr_mask */
     58       1.1      marc };
     59       1.1      marc 
     60       1.8  jdolecek static const struct pcmcia_config_entry pcmcia_3cxem556_func0_cfe0 = {
     61  1.25.4.2      yamt 	.number = 0x07,			/* cfe number */
     62  1.25.4.2      yamt 	.flags = PCMCIA_CFE_IO8 | PCMCIA_CFE_IO16 | PCMCIA_CFE_IRQLEVEL,
     63  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
     64  1.25.4.2      yamt 	.num_iospace = 1,		/* num_iospace */
     65  1.25.4.2      yamt 	.iomask = 4,			/* iomask */
     66  1.25.4.2      yamt 	.iospace = { { .length = 0x0010, .start = 0 } },	/* iospace */
     67  1.25.4.2      yamt 	.irqmask = 0xffff,		/* irqmask */
     68       1.1      marc };
     69       1.1      marc 
     70       1.8  jdolecek static const struct pcmcia_function pcmcia_3cxem556_func1 = {
     71  1.25.4.2      yamt 	.number = 1,			/* function number */
     72  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_SERIAL,
     73  1.25.4.2      yamt 	.last_config_index = 0x27,	/* last cfe number */
     74  1.25.4.2      yamt 	.ccr_base = 0x900,		/* ccr_base */
     75  1.25.4.2      yamt 	.ccr_mask = 0x63,		/* ccr_mask */
     76       1.1      marc };
     77       1.1      marc 
     78       1.8  jdolecek static const struct pcmcia_config_entry pcmcia_3cxem556_func1_cfe0 = {
     79  1.25.4.2      yamt 	.number = 0x27,			/* cfe number */
     80  1.25.4.2      yamt 	.flags = PCMCIA_CFE_IO8 | PCMCIA_CFE_IRQLEVEL,
     81  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
     82  1.25.4.2      yamt 	.num_iospace = 1,		/* num_iospace */
     83  1.25.4.2      yamt 	.iomask = 3,			/* iomask */
     84  1.25.4.2      yamt 	.iospace = { { .length = 0x0008, .start = 0 } },	/* iospace */
     85  1.25.4.2      yamt 	.irqmask = 0xffff,		/* irqmask */
     86       1.1      marc };
     87       1.1      marc 
     88       1.8  jdolecek static const struct pcmcia_function pcmcia_3ccfem556bi_func0 = {
     89  1.25.4.2      yamt 	.number = 0,			/* function number */
     90  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_NETWORK,
     91  1.25.4.2      yamt 	.last_config_index = 0x07,	/* last cfe number */
     92  1.25.4.2      yamt 	.ccr_base = 0x1000,		/* ccr_base */
     93  1.25.4.2      yamt 	.ccr_mask = 0x267,		/* ccr_mask */
     94       1.5   thorpej };
     95       1.5   thorpej 
     96       1.8  jdolecek static const struct pcmcia_config_entry pcmcia_3ccfem556bi_func0_cfe0 = {
     97  1.25.4.2      yamt 	.number = 0x07,		/* cfe number */
     98  1.25.4.2      yamt 	.flags = PCMCIA_CFE_IO8 | PCMCIA_CFE_IO16 | PCMCIA_CFE_IRQLEVEL,
     99  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    100  1.25.4.2      yamt 	.num_iospace = 1,	/* num_iospace */
    101  1.25.4.2      yamt 	.iomask = 5,			/* iomask */
    102  1.25.4.2      yamt 	.iospace = { { .length = 0x0020, .start = 0 } },	/* iospace */
    103       1.5   thorpej };
    104       1.5   thorpej 
    105       1.8  jdolecek static const struct pcmcia_function pcmcia_3ccfem556bi_func1 = {
    106  1.25.4.2      yamt 	.number = 1,			/* function number */
    107  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_SERIAL,
    108  1.25.4.2      yamt 	.last_config_index = 0x27,	/* last cfe number */
    109  1.25.4.2      yamt 	.ccr_base = 0x1100,		/* ccr_base */
    110  1.25.4.2      yamt 	.ccr_mask = 0x277,		/* ccr_mask */
    111       1.5   thorpej };
    112       1.5   thorpej 
    113       1.8  jdolecek static const struct pcmcia_config_entry pcmcia_3ccfem556bi_func1_cfe0 = {
    114  1.25.4.2      yamt 	.number = 0x27,		/* cfe number */
    115  1.25.4.2      yamt 	.flags = PCMCIA_CFE_IO8 | PCMCIA_CFE_IRQLEVEL,
    116  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    117  1.25.4.2      yamt 	.num_iospace = 1,	/* num_iospace */
    118  1.25.4.2      yamt 	.iomask = 3,		/* iomask */
    119  1.25.4.2      yamt 	.iospace = { { .length = 0x0008, .start = 0 } },	/* iospace */
    120  1.25.4.2      yamt 	.irqmask = 0xffff,	/* irqmask */
    121       1.5   thorpej };
    122       1.5   thorpej 
    123       1.8  jdolecek static const struct pcmcia_function pcmcia_sveclancard_func0 = {
    124  1.25.4.2      yamt 	.number = 0,			/* function number */
    125  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_NETWORK,
    126  1.25.4.2      yamt 	.last_config_index = 0x1,	/* last cfe number */
    127  1.25.4.2      yamt 	.ccr_base = 0x100,		/* ccr_base */
    128  1.25.4.2      yamt 	.ccr_mask = 0x1,		/* ccr_mask */
    129       1.3      marc };
    130       1.3      marc 
    131       1.8  jdolecek static const struct pcmcia_config_entry pcmcia_sveclancard_func0_cfe0 = {
    132  1.25.4.2      yamt 	.number = 0x1,		/* cfe number */
    133  1.25.4.2      yamt 	.flags = PCMCIA_CFE_MWAIT_REQUIRED | PCMCIA_CFE_RDYBSY_ACTIVE |
    134  1.25.4.2      yamt 	    PCMCIA_CFE_WP_ACTIVE | PCMCIA_CFE_BVD_ACTIVE | PCMCIA_CFE_IO16,
    135  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    136  1.25.4.2      yamt 	.num_iospace = 1,	/* num_iospace */
    137  1.25.4.2      yamt 	.iomask = 5,		/* iomask */
    138  1.25.4.2      yamt 	.iospace = { { .length = 0x20, .start = 0x300 } },	/* iospace */
    139  1.25.4.2      yamt 	.irqmask = 0xdeb8,	/* irqmask */
    140       1.3      marc };
    141       1.3      marc 
    142       1.8  jdolecek static const struct pcmcia_function pcmcia_ndc_nd5100_func0 = {
    143  1.25.4.2      yamt 	.number = 0,			/* function number */
    144  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_NETWORK,
    145  1.25.4.2      yamt 	.last_config_index = 0x23,	/* last cfe number */
    146  1.25.4.2      yamt 	.ccr_base = 0x3f8,		/* ccr_base */
    147  1.25.4.2      yamt 	.ccr_mask = 0x3,		/* ccr_mask */
    148       1.6       scw };
    149       1.6       scw 
    150       1.8  jdolecek static const struct pcmcia_config_entry pcmcia_ndc_nd5100_func0_cfe0 = {
    151  1.25.4.2      yamt 	.number = 0x20,			/* cfe number */
    152  1.25.4.2      yamt 	.flags = PCMCIA_CFE_MWAIT_REQUIRED | PCMCIA_CFE_IO16 |
    153  1.25.4.2      yamt 	    PCMCIA_CFE_IRQLEVEL,
    154  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    155  1.25.4.2      yamt 	.num_iospace = 1,		/* num_iospace */
    156  1.25.4.2      yamt 	.iomask = 5,			/* iomask */
    157  1.25.4.2      yamt 	.iospace = { { .length = 0x20, .start = 0x300 } },	/* iospace */
    158  1.25.4.2      yamt 	.irqmask = 0xdeb8,		/* irqmask */
    159       1.6       scw };
    160       1.6       scw 
    161      1.12    ichiro static const struct pcmcia_function pcmcia_emtac_a2424i_func0 = {
    162  1.25.4.2      yamt 	.number = 0,			/* function number */
    163  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_NETWORK,
    164  1.25.4.2      yamt 	.last_config_index = 0x21,	/* last cfe number */
    165  1.25.4.2      yamt 	.ccr_base = 0x3e0,		/* ccr_base */
    166  1.25.4.2      yamt 	.ccr_mask = 0x1,		/* ccr_mask */
    167      1.12    ichiro };
    168      1.12    ichiro 
    169      1.12    ichiro static const struct pcmcia_config_entry pcmcia_emtac_a2424i_func0_cfe0 = {
    170  1.25.4.2      yamt 	.number = 0x21,		/* cfe number */
    171  1.25.4.2      yamt 	.flags = PCMCIA_CFE_IO16 | PCMCIA_CFE_IRQLEVEL | PCMCIA_CFE_IRQPULSE,
    172  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    173  1.25.4.2      yamt 	.num_iospace = 1,	/* num_iospace */
    174  1.25.4.2      yamt 	.iomask = 6,		/* iomask */
    175  1.25.4.2      yamt 	.iospace = { { .length = 0x40, .start = 0x100 } },	/* iospace */
    176  1.25.4.2      yamt 	.irqmask = 0xffff,	/* irqmask */
    177      1.12    ichiro };
    178      1.12    ichiro 
    179      1.17    ichiro static const struct pcmcia_function pcmcia_fujitsu_j181_func0 = {
    180  1.25.4.2      yamt 	.number = 0,			/* function number */
    181  1.25.4.2      yamt 	.function = PCMCIA_FUNCTION_NETWORK,
    182  1.25.4.2      yamt 	.last_config_index = 0x21,	/* last cfe number */
    183  1.25.4.2      yamt 	.ccr_base = 0xfe0,		/* ccr_base */
    184  1.25.4.2      yamt 	.ccr_mask = 0xf,		/* ccr_mask */
    185      1.17    ichiro };
    186      1.15    ichiro 
    187      1.17    ichiro static const struct pcmcia_config_entry pcmcia_fujitsu_j181_func0_cfe0 = {
    188  1.25.4.2      yamt 	.number = 0xc,			/* cfe number */
    189  1.25.4.2      yamt 	.flags = PCMCIA_CFE_MWAIT_REQUIRED | PCMCIA_CFE_WP_ACTIVE |
    190  1.25.4.2      yamt 	    PCMCIA_CFE_IO8 | PCMCIA_CFE_IO16 | PCMCIA_CFE_IRQLEVEL |
    191  1.25.4.2      yamt 	    PCMCIA_CFE_IRQPULSE,
    192  1.25.4.2      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    193  1.25.4.2      yamt 	.num_iospace = 1,		/* num_iospace */
    194  1.25.4.2      yamt 	.iomask = 10,			/* iomask */
    195  1.25.4.2      yamt 	.iospace = { { .length = 0x20, .start = 0x140 } },	/* iospace */
    196  1.25.4.2      yamt 	.irqmask = 0xffff,		/* irqmask */
    197      1.15    ichiro };
    198      1.15    ichiro 
    199  1.25.4.3      yamt static const struct pcmcia_function pcmcia_necinfrontia_ax420n_func0 = {
    200  1.25.4.3      yamt 	.number = 0,			/* function number */
    201  1.25.4.3      yamt 	.function = PCMCIA_FUNCTION_SERIAL,
    202  1.25.4.3      yamt 	.last_config_index = 0x38,	/* last cfe number */
    203  1.25.4.3      yamt 	.ccr_base = 0x200,		/* ccr_base */
    204  1.25.4.3      yamt 	.ccr_mask = 0x1f,		/* ccr_mask */
    205  1.25.4.3      yamt };
    206  1.25.4.3      yamt 
    207  1.25.4.3      yamt static const struct pcmcia_config_entry pcmcia_necinfrontia_ax420n_func0_cfe0 = {
    208  1.25.4.3      yamt 	.number = 0x25,			/* cfe number */
    209  1.25.4.3      yamt 	.flags = PCMCIA_CFE_RDYBSY_ACTIVE | PCMCIA_CFE_IO8 |
    210  1.25.4.3      yamt 		 PCMCIA_CFE_IRQLEVEL | PCMCIA_CFE_POWERDOWN |
    211  1.25.4.3      yamt 		 PCMCIA_CFE_AUDIO,
    212  1.25.4.3      yamt 	.iftype = PCMCIA_IFTYPE_IO,
    213  1.25.4.3      yamt 	.num_iospace = 1,		/* num_iospace */
    214  1.25.4.3      yamt 	.iomask = 10,			/* iomask */
    215  1.25.4.3      yamt 	.iospace = { { .length = 0x8, .start = 0x3f8 } },	/* iospace */
    216  1.25.4.3      yamt 	.irqmask = 0x86bc,		/* irqmask */
    217  1.25.4.3      yamt };
    218  1.25.4.3      yamt 
    219       1.8  jdolecek static const struct pcmcia_cis_quirk pcmcia_cis_quirks[] = {
    220  1.25.4.3      yamt 	{ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556,
    221  1.25.4.3      yamt 	  PCMCIA_CIS_INVALID,
    222       1.1      marc 	  &pcmcia_3cxem556_func0, &pcmcia_3cxem556_func0_cfe0 },
    223  1.25.4.3      yamt 	{ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556,
    224  1.25.4.3      yamt 	  PCMCIA_CIS_INVALID,
    225       1.4      tron 	  &pcmcia_3cxem556_func1, &pcmcia_3cxem556_func1_cfe0 },
    226  1.25.4.3      yamt 	{ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556INT,
    227  1.25.4.3      yamt 	  PCMCIA_CIS_INVALID,
    228       1.4      tron 	  &pcmcia_3cxem556_func0, &pcmcia_3cxem556_func0_cfe0 },
    229  1.25.4.3      yamt 	{ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556INT,
    230  1.25.4.3      yamt 	  PCMCIA_CIS_INVALID,
    231       1.1      marc 	  &pcmcia_3cxem556_func1, &pcmcia_3cxem556_func1_cfe0 },
    232       1.5   thorpej 	{ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CCFEM556BI,
    233       1.5   thorpej 	  PCMCIA_CIS_INVALID,
    234       1.5   thorpej 	  &pcmcia_3ccfem556bi_func0, &pcmcia_3ccfem556bi_func0_cfe0 },
    235       1.5   thorpej 	{ PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CCFEM556BI,
    236       1.5   thorpej 	  PCMCIA_CIS_INVALID,
    237       1.5   thorpej 	  &pcmcia_3ccfem556bi_func1, &pcmcia_3ccfem556bi_func1_cfe0 },
    238  1.25.4.3      yamt 	{ PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
    239  1.25.4.3      yamt 	  PCMCIA_CIS_SVEC_LANCARD,
    240       1.3      marc 	  &pcmcia_sveclancard_func0, &pcmcia_sveclancard_func0_cfe0 },
    241  1.25.4.3      yamt 	{ PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
    242  1.25.4.3      yamt 	  PCMCIA_CIS_NDC_ND5100_E,
    243       1.6       scw 	  &pcmcia_ndc_nd5100_func0, &pcmcia_ndc_nd5100_func0_cfe0 },
    244  1.25.4.3      yamt 	{ PCMCIA_VENDOR_EMTAC, PCMCIA_PRODUCT_EMTAC_WLAN,
    245  1.25.4.3      yamt 	  PCMCIA_CIS_INVALID,
    246      1.12    ichiro 	  &pcmcia_emtac_a2424i_func0, &pcmcia_emtac_a2424i_func0_cfe0 },
    247      1.17    ichiro 	{ PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
    248      1.17    ichiro 	  PCMCIA_CIS_FUJITSU_FMV_J181,
    249      1.17    ichiro 	  &pcmcia_fujitsu_j181_func0, &pcmcia_fujitsu_j181_func0_cfe0 },
    250  1.25.4.3      yamt 	{ PCMCIA_VENDOR_NECINFRONTIA, PCMCIA_PRODUCT_NECINFRONTIA_AX420N,
    251  1.25.4.3      yamt 	  PCMCIA_CIS_INVALID,
    252  1.25.4.3      yamt 	  &pcmcia_necinfrontia_ax420n_func0,
    253  1.25.4.3      yamt 	  &pcmcia_necinfrontia_ax420n_func0_cfe0 },
    254       1.1      marc };
    255      1.25     perry 
    256      1.21   mycroft static const int pcmcia_cis_nquirks =
    257      1.21   mycroft    sizeof(pcmcia_cis_quirks) / sizeof(pcmcia_cis_quirks[0]);
    258       1.1      marc 
    259      1.23     enami void
    260      1.23     enami pcmcia_check_cis_quirks(sc)
    261       1.1      marc 	struct pcmcia_softc *sc;
    262       1.1      marc {
    263       1.1      marc 	int wiped = 0;
    264      1.22  christos 	size_t i, j;
    265      1.19     lukem 	struct pcmcia_function *pf;
    266       1.8  jdolecek 	const struct pcmcia_function *pf_last;
    267      1.19     lukem 	struct pcmcia_config_entry *cfe;
    268      1.22  christos 	struct pcmcia_card *card = &sc->card;
    269      1.23     enami 	const struct pcmcia_cis_quirk *quirk;
    270       1.1      marc 
    271       1.2      marc 	pf = NULL;
    272       1.1      marc 	pf_last = NULL;
    273       1.1      marc 
    274      1.22  christos 	for (i = 0; i < pcmcia_cis_nquirks; i++) {
    275      1.23     enami 		quirk = &pcmcia_cis_quirks[i];
    276      1.22  christos 
    277      1.23     enami 		if (card->manufacturer == quirk->manufacturer &&
    278      1.23     enami 		    card->manufacturer != PCMCIA_VENDOR_INVALID &&
    279      1.23     enami 		    card->product == quirk->product &&
    280      1.22  christos 		    card->product != PCMCIA_PRODUCT_INVALID)
    281      1.23     enami 			goto match;
    282      1.22  christos 
    283      1.22  christos 		for (j = 0; j < 2; j++)
    284      1.24     enami 			if (card->cis1_info[j] == NULL ||
    285      1.24     enami 			    quirk->cis1_info[j] == NULL ||
    286      1.24     enami 			    strcmp(card->cis1_info[j],
    287      1.24     enami 			    quirk->cis1_info[j]) != 0)
    288      1.24     enami 				goto nomatch;
    289      1.22  christos 
    290      1.23     enami match:
    291      1.22  christos 		if (!wiped) {
    292      1.22  christos 			if (pcmcia_verbose) {
    293      1.22  christos 				printf("%s: using CIS quirks for ",
    294      1.22  christos 				    sc->dev.dv_xname);
    295      1.22  christos 				for (j = 0; j < 4; j++) {
    296      1.22  christos 					if (card->cis1_info[j] == NULL)
    297      1.22  christos 						break;
    298      1.22  christos 					if (j)
    299      1.22  christos 						printf(", ");
    300      1.22  christos 					printf("%s", card->cis1_info[j]);
    301       1.1      marc 				}
    302      1.22  christos 				printf("\n");
    303       1.1      marc 			}
    304      1.22  christos 			pcmcia_free_pf(&card->pf_head);
    305      1.22  christos 			wiped = 1;
    306      1.22  christos 		}
    307       1.1      marc 
    308      1.23     enami 		if (pf_last != quirk->pf) {
    309      1.23     enami 			/*
    310      1.23     enami 			 * XXX: a driver which still calls pcmcia_card_attach
    311      1.23     enami 			 * very early attach stage should be fixed instead.
    312      1.23     enami 			 */
    313      1.23     enami 			pf = malloc(sizeof(*pf), M_DEVBUF,
    314      1.23     enami 			    cold ? M_NOWAIT : M_WAITOK);
    315      1.23     enami 			if (pf == NULL)
    316      1.23     enami 				panic("pcmcia_check_cis_quirks: malloc pf");
    317      1.23     enami 			*pf = *quirk->pf;
    318      1.22  christos 			SIMPLEQ_INIT(&pf->cfe_head);
    319      1.23     enami 			SIMPLEQ_INSERT_TAIL(&card->pf_head, pf, pf_list);
    320      1.23     enami 			pf_last = quirk->pf;
    321      1.23     enami 		}
    322       1.1      marc 
    323      1.23     enami 		/*
    324      1.23     enami 		 * XXX: see above.
    325      1.23     enami 		 */
    326      1.23     enami 		cfe = malloc(sizeof(*cfe), M_DEVBUF,
    327      1.23     enami 		    cold ? M_NOWAIT : M_WAITOK);
    328      1.23     enami 		if (cfe == NULL)
    329      1.23     enami 			panic("pcmcia_check_cis_quirks: malloc cfe");
    330      1.23     enami 		*cfe = *quirk->cfe;
    331  1.25.4.1      yamt 		KASSERT(pf != NULL);
    332      1.23     enami 		SIMPLEQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list);
    333       1.1      marc 
    334      1.23     enami nomatch:;
    335       1.1      marc 	}
    336       1.1      marc }
    337