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