code:
/*
 * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
 *
 * generated from:
 *	OpenBSD: eisadevs,v 1.20 2004/05/05 05:33:56 mickey Exp
 */

/*
 * Copyright (c) 1995, 1996 Christopher G. Demetriou
 * 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 Christopher G. Demetriou
 *	for the NetBSD Project.
 * 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.
 */

static const struct eisa_knowndev eisa_knowndevs[] = {
	{
	    0,
	    "ABP0510",
	    EISA_PRODUCT_ABP0510,
	},
	{
	    0,
	    "ABP0540",
	    EISA_PRODUCT_ABP0540,
	},
	{
	    0,
	    "ABP7401",
	    EISA_PRODUCT_ABP7401,
	},
	{
	    0,
	    "ABP7501",
	    EISA_PRODUCT_ABP7501,
	},
	{
	    0,
	    "ACC1200",
	    EISA_PRODUCT_ACC1200,
	},
	{
	    0,
	    "ACC120A",
	    EISA_PRODUCT_ACC120A,
	},
	{
	    0,
	    "ACC1650",
	    EISA_PRODUCT_ACC1650,
	},
	{
	    0,
	    "ACC1660",
	    EISA_PRODUCT_ACC1660,
	},
	{
	    0,
	    "ACE1010",
	    EISA_PRODUCT_ACE1010,
	},
	{
	    0,
	    "ACE2010",
	    EISA_PRODUCT_ACE2010,
	},
	{
	    0,
	    "ACE3010",
	    EISA_PRODUCT_ACE3010,
	},
	{
	    0,
	    "ACE3030",
	    EISA_PRODUCT_ACE3030,
	},
	{
	    0,
	    "ACE4010",
	    EISA_PRODUCT_ACE4010,
	},
	{
	    0,
	    "ACE5010",
	    EISA_PRODUCT_ACE5010,
	},
	{
	    0,
	    "ACE6010",
	    EISA_PRODUCT_ACE6010,
	},
	{
	    0,
	    "ACE7010",
	    EISA_PRODUCT_ACE7010,
	},
	{
	    0,
	    "ACR1201",
	    EISA_PRODUCT_ACR1201,
	},
	{
	    0,
	    "ACR1211",
	    EISA_PRODUCT_ACR1211,
	},
	{
	    0,
	    "ACR1341",
	    EISA_PRODUCT_ACR1341,
	},
	{
	    0,
	    "ACR1351",
	    EISA_PRODUCT_ACR1351,
	},
	{
	    0,
	    "ACR1361",
	    EISA_PRODUCT_ACR1361,
	},
	{
	    0,
	    "ACR1371",
	    EISA_PRODUCT_ACR1371,
	},
	{
	    0,
	    "ACR1381",
	    EISA_PRODUCT_ACR1381,
	},
	{
	    0,
	    "ACR1391",
	    EISA_PRODUCT_ACR1391,
	},
	{
	    0,
	    "ACR1581",
	    EISA_PRODUCT_ACR1581,
	},
	{
	    0,
	    "ACR1591",
	    EISA_PRODUCT_ACR1591,
	},
	{
	    0,
	    "ACR15A1",
	    EISA_PRODUCT_ACR15A1,
	},
	{
	    0,
	    "ACR15B1",
	    EISA_PRODUCT_ACR15B1,
	},
	{
	    0,
	    "ACR1701",
	    EISA_PRODUCT_ACR1701,
	},
	{
	    0,
	    "ACR1711",
	    EISA_PRODUCT_ACR1711,
	},
	{
	    0,
	    "ACR1801",
	    EISA_PRODUCT_ACR1801,
	},
	{
	    0,
	    "ACR3211",
	    EISA_PRODUCT_ACR3211,
	},
	{
	    0,
	    "ACR3221",
	    EISA_PRODUCT_ACR3221,
	},
	{
	    0,
	    "ACR3231",
	    EISA_PRODUCT_ACR3231,
	},
	{
	    0,
	    "ACR3241",
	    EISA_PRODUCT_ACR3241,
	},
	{
	    0,
	    "ACR3261",
	    EISA_PRODUCT_ACR3261,
	},
	{
	    0,
	    "ACR3271",
	    EISA_PRODUCT_ACR3271,
	},
	{
	    0,
	    "ACR3281",
	    EISA_PRODUCT_ACR3281,
	},
	{
	    0,
	    "ACR3291",
	    EISA_PRODUCT_ACR3291,
	},
	{
	    0,
	    "ACR4509",
	    EISA_PRODUCT_ACR4509,
	},
	{
	    0,
	    "ADI0001",
	    EISA_PRODUCT_ADI0001,
	},
	{
	    0,
	    "ADP0000",
	    EISA_PRODUCT_ADP0000,
	},
	{
	    0,
	    "ADP0001",
	    EISA_PRODUCT_ADP0001,
	},
	{
	    0,
	    "ADP0002",
	    EISA_PRODUCT_ADP0002,
	},
	{
	    0,
	    "ADP0100",
	    EISA_PRODUCT_ADP0100,
	},
	{
	    0,
	    "ADP0200",
	    EISA_PRODUCT_ADP0200,
	},
	{
	    0,
	    "ADP0400",
	    EISA_PRODUCT_ADP0400,
	},
	{
	    0,
	    "ADP7770",
	    EISA_PRODUCT_ADP7770,
	},
	{
	    0,
	    "ADP7771",
	    EISA_PRODUCT_ADP7771,
	},
	{
	    0,
	    "ADP7756",
	    EISA_PRODUCT_ADP7756,
	},
	{
	    0,
	    "ADP7757",
	    EISA_PRODUCT_ADP7757,
	},
	{
	    0,
	    "AEI0401",
	    EISA_PRODUCT_AEI0401,
	},
	{
	    0,
	    "AEO0301",
	    EISA_PRODUCT_AEO0301,
	},
	{
	    0,
	    "AIM0002",
	    EISA_PRODUCT_AIM0002,
	},
	{
	    0,
	    "AIR0101",
	    EISA_PRODUCT_AIR0101,
	},
	{
	    0,
	    "AIR0103",
	    EISA_PRODUCT_AIR0103,
	},
	{
	    0,
	    "AIR0201",
	    EISA_PRODUCT_AIR0201,
	},
	{
	    0,
	    "AIR0301",
	    EISA_PRODUCT_AIR0301,
	},
	{
	    0,
	    "AIR0401",
	    EISA_PRODUCT_AIR0401,
	},
	{
	    0,
	    "AIR0501",
	    EISA_PRODUCT_AIR0501,
	},
	{
	    0,
	    "AIR0601",
	    EISA_PRODUCT_AIR0601,
	},
	{
	    0,
	    "AIR0701",
	    EISA_PRODUCT_AIR0701,
	},
	{
	    0,
	    "AIR0702",
	    EISA_PRODUCT_AIR0702,
	},
	{
	    0,
	    "AIR0901",
	    EISA_PRODUCT_AIR0901,
	},
	{
	    0,
	    "AIR1001",
	    EISA_PRODUCT_AIR1001,
	},
	{
	    0,
	    "AIR2001",
	    EISA_PRODUCT_AIR2001,
	},
	{
	    0,
	    "AIR2101",
	    EISA_PRODUCT_AIR2101,
	},
	{
	    0,
	    "AIR3001",
	    EISA_PRODUCT_AIR3001,
	},
	{
	    0,
	    "AIR3101",
	    EISA_PRODUCT_AIR3101,
	},
	{
	    0,
	    "ALR0001",
	    EISA_PRODUCT_ALR0001,
	},
	{
	    0,
	    "ALR0041",
	    EISA_PRODUCT_ALR0041,
	},
	{
	    0,
	    "ALR0181",
	    EISA_PRODUCT_ALR0181,
	},
	{
	    0,
	    "ALR0241",
	    EISA_PRODUCT_ALR0241,
	},
	{
	    0,
	    "ALR0341",
	    EISA_PRODUCT_ALR0341,
	},
	{
	    0,
	    "ALR3000",
	    EISA_PRODUCT_ALR3000,
	},
	{
	    0,
	    "ALR3010",
	    EISA_PRODUCT_ALR3010,
	},
	{
	    0,
	    "ALR3023",
	    EISA_PRODUCT_ALR3023,
	},
	{
	    0,
	    "ALR8580",
	    EISA_PRODUCT_ALR8580,
	},
	{
	    0,
	    "ALRA0C1",
	    EISA_PRODUCT_ALRA0C1,
	},
	{
	    0,
	    "ALRA301",
	    EISA_PRODUCT_ALRA301,
	},
	{
	    0,
	    "ALRA311",
	    EISA_PRODUCT_ALRA311,
	},
	{
	    0,
	    "ALRB0A0",
	    EISA_PRODUCT_ALRB0A0,
	},
	{
	    0,
	    "ALRB0B0",
	    EISA_PRODUCT_ALRB0B0,
	},
	{
	    0,
	    "AMI15C1",
	    EISA_PRODUCT_AMI15C1,
	},
	{
	    0,
	    "AMI15D1",
	    EISA_PRODUCT_AMI15D1,
	},
	{
	    0,
	    "AMI15E1",
	    EISA_PRODUCT_AMI15E1,
	},
	{
	    0,
	    "AMI16B1",
	    EISA_PRODUCT_AMI16B1,
	},
	{
	    0,
	    "AMI2509",
	    EISA_PRODUCT_AMI2509,
	},
	{
	    0,
	    "AMI25B1",
	    EISA_PRODUCT_AMI25B1,
	},
	{
	    0,
	    "AMI28A1",
	    EISA_PRODUCT_AMI28A1,
	},
	{
	    0,
	    "AMI44C1",
	    EISA_PRODUCT_AMI44C1,
	},
	{
	    0,
	    "AMI44D2",
	    EISA_PRODUCT_AMI44D2,
	},
	{
	    0,
	    "AMI4801",
	    EISA_PRODUCT_AMI4801,
	},
	{
	    0,
	    "AMI68B1",
	    EISA_PRODUCT_AMI68B1,
	},
	{
	    0,
	    "APS0101",
	    EISA_PRODUCT_APS0101,
	},
	{
	    0,
	    "APS0102",
	    EISA_PRODUCT_APS0102,
	},
	{
	    0,
	    "APS0103",
	    EISA_PRODUCT_APS0103,
	},
	{
	    0,
	    "ARC0010",
	    EISA_PRODUCT_ARC0010,
	},
	{
	    0,
	    "ARC0020",
	    EISA_PRODUCT_ARC0020,
	},
	{
	    0,
	    "ASU0100",
	    EISA_PRODUCT_ASU0100,
	},
	{
	    0,
	    "ASU0500",
	    EISA_PRODUCT_ASU0500,
	},
	{
	    0,
	    "ASU4001",
	    EISA_PRODUCT_ASU4001,
	},
	{
	    0,
	    "ASU4101",
	    EISA_PRODUCT_ASU4101,
	},
	{
	    0,
	    "ASU4201",
	    EISA_PRODUCT_ASU4201,
	},
	{
	    0,
	    "ASU4301",
	    EISA_PRODUCT_ASU4301,
	},
	{
	    0,
	    "ASU4501",
	    EISA_PRODUCT_ASU4501,
	},
	{
	    0,
	    "ASU4701",
	    EISA_PRODUCT_ASU4701,
	},
	{
	    0,
	    "ASU4901",
	    EISA_PRODUCT_ASU4901,
	},
	{
	    0,
	    "ASU5101",
	    EISA_PRODUCT_ASU5101,
	},
	{
	    0,
	    "ASU5201",
	    EISA_PRODUCT_ASU5201,
	},
	{
	    0,
	    "ATI1500",
	    EISA_PRODUCT_ATI1500,
	},
	{
	    0,
	    "ATI1700",
	    EISA_PRODUCT_ATI1700,
	},
	{
	    0,
	    "ATI4400",
	    EISA_PRODUCT_ATI4400,
	},
	{
	    0,
	    "ATI4402",
	    EISA_PRODUCT_ATI4402,
	},
	{
	    0,
	    "ATI4410",
	    EISA_PRODUCT_ATI4410,
	},
	{
	    0,
	    "ATI4420",
	    EISA_PRODUCT_ATI4420,
	},
	{
	    0,
	    "ATI4430",
	    EISA_PRODUCT_ATI4430,
	},
	{
	    0,
	    "ATT2402",
	    EISA_PRODUCT_ATT2402,
	},
	{
	    0,
	    "ATT2404",
	    EISA_PRODUCT_ATT2404,
	},
	{
	    0,
	    "AVI2E01",
	    EISA_PRODUCT_AVI2E01,
	},
	{
	    0,
	    "AVM0001",
	    EISA_PRODUCT_AVM0001,
	},
	{
	    0,
	    "BAN0440",
	    EISA_PRODUCT_BAN0440,
	},
	{
	    0,
	    "BAN0670",
	    EISA_PRODUCT_BAN0670,
	},
	{
	    0,
	    "BAN0680",
	    EISA_PRODUCT_BAN0680,
	},
	{
	    0,
	    "BUS4201",
	    EISA_PRODUCT_BUS4201,
	},
	{
	    0,
	    "BUS4202",
	    EISA_PRODUCT_BUS4202,
	},
	{
	    0,
	    "BUS6001",
	    EISA_PRODUCT_BUS6001,
	},
	{
	    0,
	    "BUS6301",
	    EISA_PRODUCT_BUS6301,
	},
	{
	    0,
	    "CCI0000",
	    EISA_PRODUCT_CCI0000,
	},
	{
	    0,
	    "CCI1001",
	    EISA_PRODUCT_CCI1001,
	},
	{
	    0,
	    "CCI2001",
	    EISA_PRODUCT_CCI2001,
	},
	{
	    0,
	    "CCI3001",
	    EISA_PRODUCT_CCI3001,
	},
	{
	    0,
	    "CCI3009",
	    EISA_PRODUCT_CCI3009,
	},
	{
	    0,
	    "CCI4000",
	    EISA_PRODUCT_CCI4000,
	},
	{
	    0,
	    "CCI4001",
	    EISA_PRODUCT_CCI4001,
	},
	{
	    0,
	    "CCI5001",
	    EISA_PRODUCT_CCI5001,
	},
	{
	    0,
	    "CCI6001",
	    EISA_PRODUCT_CCI6001,
	},
	{
	    0,
	    "CCI7001",
	    EISA_PRODUCT_CCI7001,
	},
	{
	    0,
	    "CCI8001",
	    EISA_PRODUCT_CCI8001,
	},
	{
	    0,
	    "CHAA041",
	    EISA_PRODUCT_CHAA041,
	},
	{
	    0,
	    "CHAA081",
	    EISA_PRODUCT_CHAA081,
	},
	{
	    0,
	    "CHAA091",
	    EISA_PRODUCT_CHAA091,
	},
	{
	    0,
	    "CHAA161",
	    EISA_PRODUCT_CHAA161,
	},
	{
	    0,
	    "CHAA171",
	    EISA_PRODUCT_CHAA171,
	},
	{
	    0,
	    "CMD0003",
	    EISA_PRODUCT_CMD0003,
	},
	{
	    0,
	    "CNT2000",
	    EISA_PRODUCT_CNT2000,
	},
	{
	    0,
	    "COG5000",
	    EISA_PRODUCT_COG5000,
	},
	{
	    0,
	    "COG7002",
	    EISA_PRODUCT_COG7002,
	},
	{
	    0,
	    "COG9002",
	    EISA_PRODUCT_COG9002,
	},
	{
	    0,
	    "CPQ0101",
	    EISA_PRODUCT_CPQ0101,
	},
	{
	    0,
	    "CPQ0109",
	    EISA_PRODUCT_CPQ0109,
	},
	{
	    0,
	    "CPQ0401",
	    EISA_PRODUCT_CPQ0401,
	},
	{
	    0,
	    "CPQ0501",
	    EISA_PRODUCT_CPQ0501,
	},
	{
	    0,
	    "CPQ0509",
	    EISA_PRODUCT_CPQ0509,
	},
	{
	    0,
	    "CPQ0511",
	    EISA_PRODUCT_CPQ0511,
	},
	{
	    0,
	    "CPQ0601",
	    EISA_PRODUCT_CPQ0601,
	},
	{
	    0,
	    "CPQ0609",
	    EISA_PRODUCT_CPQ0609,
	},
	{
	    0,
	    "CPQ0611",
	    EISA_PRODUCT_CPQ0611,
	},
	{
	    0,
	    "CPQ0621",
	    EISA_PRODUCT_CPQ0621,
	},
	{
	    0,
	    "CPQ0629",
	    EISA_PRODUCT_CPQ0629,
	},
	{
	    0,
	    "CPQ0631",
	    EISA_PRODUCT_CPQ0631,
	},
	{
	    0,
	    "CPQ0639",
	    EISA_PRODUCT_CPQ0639,
	},
	{
	    0,
	    "CPQ1001",
	    EISA_PRODUCT_CPQ1001,
	},
	{
	    0,
	    "CPQ1009",
	    EISA_PRODUCT_CPQ1009,
	},
	{
	    0,
	    "CPQ1201",
	    EISA_PRODUCT_CPQ1201,
	},
	{
	    0,
	    "CPQ1301",
	    EISA_PRODUCT_CPQ1301,
	},
	{
	    0,
	    "CPQ1401",
	    EISA_PRODUCT_CPQ1401,
	},
	{
	    0,
	    "CPQ1409",
	    EISA_PRODUCT_CPQ1409,
	},
	{
	    0,
	    "CPQ1501",
	    EISA_PRODUCT_CPQ1501,
	},
	{
	    0,
	    "CPQ1509",
	    EISA_PRODUCT_CPQ1509,
	},
	{
	    0,
	    "CPQ1519",
	    EISA_PRODUCT_CPQ1519,
	},
	{
	    0,
	    "CPQ3001",
	    EISA_PRODUCT_CPQ3001,
	},
	{
	    0,
	    "CPQ3011",
	    EISA_PRODUCT_CPQ3011,
	},
	{
	    0,
	    "CPQ3021",
	    EISA_PRODUCT_CPQ3021,
	},
	{
	    0,
	    "CPQ3111",
	    EISA_PRODUCT_CPQ3111,
	},
	{
	    0,
	    "CPQ3112",
	    EISA_PRODUCT_CPQ3112,
	},
	{
	    0,
	    "CPQ3121",
	    EISA_PRODUCT_CPQ3121,
	},
	{
	    0,
	    "CPQ3122",
	    EISA_PRODUCT_CPQ3122,
	},
	{
	    0,
	    "CPQ4001",
	    EISA_PRODUCT_CPQ4001,
	},
	{
	    0,
	    "CPQ4002",
	    EISA_PRODUCT_CPQ4002,
	},
	{
	    0,
	    "CPQ4010",
	    EISA_PRODUCT_CPQ4010,
	},
	{
	    0,
	    "CPQ4020",
	    EISA_PRODUCT_CPQ4020,
	},
	{
	    0,
	    "CPQ4300",
	    EISA_PRODUCT_CPQ4300,
	},
	{
	    0,
	    "CPQ4401",
	    EISA_PRODUCT_CPQ4401,
	},
	{
	    0,
	    "CPQ4410",
	    EISA_PRODUCT_CPQ4410,
	},
	{
	    0,
	    "CPQ4411",
	    EISA_PRODUCT_CPQ4411,
	},
	{
	    0,
	    "CPQ4420",
	    EISA_PRODUCT_CPQ4420,
	},
	{
	    0,
	    "CPQ5000",
	    EISA_PRODUCT_CPQ5000,
	},
	{
	    0,
	    "CPQ5281",
	    EISA_PRODUCT_CPQ5281,
	},
	{
	    0,
	    "CPQ5282",
	    EISA_PRODUCT_CPQ5282,
	},
	{
	    0,
	    "CPQ5287",
	    EISA_PRODUCT_CPQ5287,
	},
	{
	    0,
	    "CPQ528F",
	    EISA_PRODUCT_CPQ528F,
	},
	{
	    0,
	    "CPQ5900",
	    EISA_PRODUCT_CPQ5900,
	},
	{
	    0,
	    "CPQ5A00",
	    EISA_PRODUCT_CPQ5A00,
	},
	{
	    0,
	    "CPQ5B00",
	    EISA_PRODUCT_CPQ5B00,
	},
	{
	    0,
	    "CPQ5C00",
	    EISA_PRODUCT_CPQ5C00,
	},
	{
	    0,
	    "CPQ6000",
	    EISA_PRODUCT_CPQ6000,
	},
	{
	    0,
	    "CPQ6001",
	    EISA_PRODUCT_CPQ6001,
	},
	{
	    0,
	    "CPQ6100",
	    EISA_PRODUCT_CPQ6100,
	},
	{
	    0,
	    "CPQ6101",
	    EISA_PRODUCT_CPQ6101,
	},
	{
	    0,
	    "CPQ6200",
	    EISA_PRODUCT_CPQ6200,
	},
	{
	    0,
	    "CPQ7000",
	    EISA_PRODUCT_CPQ7000,
	},
	{
	    0,
	    "CPQ7001",
	    EISA_PRODUCT_CPQ7001,
	},
	{
	    0,
	    "CPQ9004",
	    EISA_PRODUCT_CPQ9004,
	},
	{
	    0,
	    "CPQ9005",
	    EISA_PRODUCT_CPQ9005,
	},
	{
	    0,
	    "CPQ9013",
	    EISA_PRODUCT_CPQ9013,
	},
	{
	    0,
	    "CPQ9014",
	    EISA_PRODUCT_CPQ9014,
	},
	{
	    0,
	    "CPQ9015",
	    EISA_PRODUCT_CPQ9015,
	},
	{
	    0,
	    "CPQ9016",
	    EISA_PRODUCT_CPQ9016,
	},
	{
	    0,
	    "CPQ9017",
	    EISA_PRODUCT_CPQ9017,
	},
	{
	    0,
	    "CPQ9018",
	    EISA_PRODUCT_CPQ9018,
	},
	{
	    0,
	    "CPQ9034",
	    EISA_PRODUCT_CPQ9034,
	},
	{
	    0,
	    "CPQ9035",
	    EISA_PRODUCT_CPQ9035,
	},
	{
	    0,
	    "CPQ9036",
	    EISA_PRODUCT_CPQ9036,
	},
	{
	    0,
	    "CPQ9037",
	    EISA_PRODUCT_CPQ9037,
	},
	{
	    0,
	    "CPQ9038",
	    EISA_PRODUCT_CPQ9038,
	},
	{
	    0,
	    "CPQ903C",
	    EISA_PRODUCT_CPQ903C,
	},
	{
	    0,
	    "CPQ9040",
	    EISA_PRODUCT_CPQ9040,
	},
	{
	    0,
	    "CPQ9041",
	    EISA_PRODUCT_CPQ9041,
	},
	{
	    0,
	    "CPQ9042",
	    EISA_PRODUCT_CPQ9042,
	},
	{
	    0,
	    "CPQ9043",
	    EISA_PRODUCT_CPQ9043,
	},
	{
	    0,
	    "CPQ9044",
	    EISA_PRODUCT_CPQ9044,
	},
	{
	    0,
	    "CPQ9045",
	    EISA_PRODUCT_CPQ9045,
	},
	{
	    0,
	    "CPQ9046",
	    EISA_PRODUCT_CPQ9046,
	},
	{
	    0,
	    "CPQ9047",
	    EISA_PRODUCT_CPQ9047,
	},
	{
	    0,
	    "CPQ9281",
	    EISA_PRODUCT_CPQ9281,
	},
	{
	    0,
	    "CPQ9282",
	    EISA_PRODUCT_CPQ9282,
	},
	{
	    0,
	    "CPQ9287",
	    EISA_PRODUCT_CPQ9287,
	},
	{
	    0,
	    "CPQ928F",
	    EISA_PRODUCT_CPQ928F,
	},
	{
	    0,
	    "CPQ9381",
	    EISA_PRODUCT_CPQ9381,
	},
	{
	    0,
	    "CPQ9382",
	    EISA_PRODUCT_CPQ9382,
	},
	{
	    0,
	    "CPQ9387",
	    EISA_PRODUCT_CPQ9387,
	},
	{
	    0,
	    "CPQ9481",
	    EISA_PRODUCT_CPQ9481,
	},
	{
	    0,
	    "CPQ9482",
	    EISA_PRODUCT_CPQ9482,
	},
	{
	    0,
	    "CPQ9487",
	    EISA_PRODUCT_CPQ9487,
	},
	{
	    0,
	    "CPQ9901",
	    EISA_PRODUCT_CPQ9901,
	},
	{
	    0,
	    "CPQ9902",
	    EISA_PRODUCT_CPQ9902,
	},
	{
	    0,
	    "CPQ9903",
	    EISA_PRODUCT_CPQ9903,
	},
	{
	    0,
	    "CPQ9904",
	    EISA_PRODUCT_CPQ9904,
	},
	{
	    0,
	    "CPQ9905",
	    EISA_PRODUCT_CPQ9905,
	},
	{
	    0,
	    "CPQ9906",
	    EISA_PRODUCT_CPQ9906,
	},
	{
	    0,
	    "CPQ9907",
	    EISA_PRODUCT_CPQ9907,
	},
	{
	    0,
	    "CPQ9908",
	    EISA_PRODUCT_CPQ9908,
	},
	{
	    0,
	    "CPQ9909",
	    EISA_PRODUCT_CPQ9909,
	},
	{
	    0,
	    "CPQ990A",
	    EISA_PRODUCT_CPQ990A,
	},
	{
	    0,
	    "CPQ990B",
	    EISA_PRODUCT_CPQ990B,
	},
	{
	    0,
	    "CPQ990C",
	    EISA_PRODUCT_CPQ990C,
	},
	{
	    0,
	    "CPQ990D",
	    EISA_PRODUCT_CPQ990D,
	},
	{
	    0,
	    "CPQ990E",
	    EISA_PRODUCT_CPQ990E,
	},
	{
	    0,
	    "CPQ990F",
	    EISA_PRODUCT_CPQ990F,
	},
	{
	    0,
	    "CPQ9990",
	    EISA_PRODUCT_CPQ9990,
	},
	{
	    0,
	    "CPQ9991",
	    EISA_PRODUCT_CPQ9991,
	},
	{
	    0,
	    "CPQ9999",
	    EISA_PRODUCT_CPQ9999,
	},
	{
	    0,
	    "CPQ999A",
	    EISA_PRODUCT_CPQ999A,
	},
	{
	    0,
	    "CPQA000",
	    EISA_PRODUCT_CPQA000,
	},
	{
	    0,
	    "CPQA010",
	    EISA_PRODUCT_CPQA010,
	},
	{
	    0,
	    "CPQA020",
	    EISA_PRODUCT_CPQA020,
	},
	{
	    0,
	    "CPQA030",
	    EISA_PRODUCT_CPQA030,
	},
	{
	    0,
	    "CPQF000",
	    EISA_PRODUCT_CPQF000,
	},
	{
	    0,
	    "CPQF100",
	    EISA_PRODUCT_CPQF100,
	},
	{
	    0,
	    "CPQFA0D",
	    EISA_PRODUCT_CPQFA0D,
	},
	{
	    0,
	    "CPQFA0E",
	    EISA_PRODUCT_CPQFA0E,
	},
	{
	    0,
	    "CPQFA0F",
	    EISA_PRODUCT_CPQFA0F,
	},
	{
	    0,
	    "CPQFA1A",
	    EISA_PRODUCT_CPQFA1A,
	},
	{
	    0,
	    "CPQFA1B",
	    EISA_PRODUCT_CPQFA1B,
	},
	{
	    0,
	    "CPQFA1C",
	    EISA_PRODUCT_CPQFA1C,
	},
	{
	    0,
	    "CPQFA1D",
	    EISA_PRODUCT_CPQFA1D,
	},
	{
	    0,
	    "CPQFB03",
	    EISA_PRODUCT_CPQFB03,
	},
	{
	    0,
	    "CPQFB07",
	    EISA_PRODUCT_CPQFB07,
	},
	{
	    0,
	    "CPQFC0B",
	    EISA_PRODUCT_CPQFC0B,
	},
	{
	    0,
	    "CPQFD08",
	    EISA_PRODUCT_CPQFD08,
	},
	{
	    0,
	    "CPQFD13",
	    EISA_PRODUCT_CPQFD13,
	},
	{
	    0,
	    "CPQFD17",
	    EISA_PRODUCT_CPQFD17,
	},
	{
	    0,
	    "CPX0301",
	    EISA_PRODUCT_CPX0301,
	},
	{
	    0,
	    "CRS3203",
	    EISA_PRODUCT_CRS3203,
	},
	{
	    0,
	    "CRS3204",
	    EISA_PRODUCT_CRS3204,
	},
	{
	    0,
	    "CSI0690",
	    EISA_PRODUCT_CSI0690,
	},
	{
	    0,
	    "CUI0000",
	    EISA_PRODUCT_CUI0000,
	},
	{
	    0,
	    "DBI0101",
	    EISA_PRODUCT_DBI0101,
	},
	{
	    0,
	    "DBI0102",
	    EISA_PRODUCT_DBI0102,
	},
	{
	    0,
	    "DBI0201",
	    EISA_PRODUCT_DBI0201,
	},
	{
	    0,
	    "DBI0301",
	    EISA_PRODUCT_DBI0301,
	},
	{
	    0,
	    "DBI0501",
	    EISA_PRODUCT_DBI0501,
	},
	{
	    0,
	    "DBI0601",
	    EISA_PRODUCT_DBI0601,
	},
	{
	    0,
	    "DBI0701",
	    EISA_PRODUCT_DBI0701,
	},
	{
	    0,
	    "DBI0801",
	    EISA_PRODUCT_DBI0801,
	},
	{
	    0,
	    "DBI0901",
	    EISA_PRODUCT_DBI0901,
	},
	{
	    0,
	    "DBI0C01",
	    EISA_PRODUCT_DBI0C01,
	},
	{
	    0,
	    "DBI0D01",
	    EISA_PRODUCT_DBI0D01,
	},
	{
	    0,
	    "DBI0E01",
	    EISA_PRODUCT_DBI0E01,
	},
	{
	    0,
	    "DBI0F01",
	    EISA_PRODUCT_DBI0F01,
	},
	{
	    0,
	    "DBI1001",
	    EISA_PRODUCT_DBI1001,
	},
	{
	    0,
	    "DBI1101",
	    EISA_PRODUCT_DBI1101,
	},
	{
	    0,
	    "DBI1201",
	    EISA_PRODUCT_DBI1201,
	},
	{
	    0,
	    "DEC1011",
	    EISA_PRODUCT_DEC1011,
	},
	{
	    0,
	    "DEC1021",
	    EISA_PRODUCT_DEC1021,
	},
	{
	    0,
	    "DEC1031",
	    EISA_PRODUCT_DEC1031,
	},
	{
	    0,
	    "DEC2030",
	    EISA_PRODUCT_DEC2030,
	},
	{
	    0,
	    "DEC2040",
	    EISA_PRODUCT_DEC2040,
	},
	{
	    0,
	    "DEC2050",
	    EISA_PRODUCT_DEC2050,
	},
	{
	    0,
	    "DEC2400",
	    EISA_PRODUCT_DEC2400,
	},
	{
	    0,
	    "DEC2500",
	    EISA_PRODUCT_DEC2500,
	},
	{
	    0,
	    "DEC2A01",
	    EISA_PRODUCT_DEC2A01,
	},
	{
	    0,
	    "DEC2E00",
	    EISA_PRODUCT_DEC2E00,
	},
	{
	    0,
	    "DEC2F00",
	    EISA_PRODUCT_DEC2F00,
	},
	{
	    0,
	    "DEC3001",
	    EISA_PRODUCT_DEC3001,
	},
	{
	    0,
	    "DEC3002",
	    EISA_PRODUCT_DEC3002,
	},
	{
	    0,
	    "DEC3003",
	    EISA_PRODUCT_DEC3003,
	},
	{
	    0,
	    "DEC3004",
	    EISA_PRODUCT_DEC3004,
	},
	{
	    0,
	    "DEC4220",
	    EISA_PRODUCT_DEC4220,
	},
	{
	    0,
	    "DEC4250",
	    EISA_PRODUCT_DEC4250,
	},
	{
	    0,
	    "DEC5000",
	    EISA_PRODUCT_DEC5000,
	},
	{
	    0,
	    "DEC5100",
	    EISA_PRODUCT_DEC5100,
	},
	{
	    0,
	    "DEC5301",
	    EISA_PRODUCT_DEC5301,
	},
	{
	    0,
	    "DEC6000",
	    EISA_PRODUCT_DEC6000,
	},
	{
	    0,
	    "DEC6400",
	    EISA_PRODUCT_DEC6400,
	},
	{
	    0,
	    "DEC8101",
	    EISA_PRODUCT_DEC8101,
	},
	{
	    0,
	    "DEC8102",
	    EISA_PRODUCT_DEC8102,
	},
	{
	    0,
	    "DEC8103",
	    EISA_PRODUCT_DEC8103,
	},
	{
	    0,
	    "DEC8300",
	    EISA_PRODUCT_DEC8300,
	},
	{
	    0,
	    "DEC8301",
	    EISA_PRODUCT_DEC8301,
	},
	{
	    0,
	    "DEL0000",
	    EISA_PRODUCT_DEL0000,
	},
	{
	    0,
	    "DEL0001",
	    EISA_PRODUCT_DEL0001,
	},
	{
	    0,
	    "DEL0002",
	    EISA_PRODUCT_DEL0002,
	},
	{
	    0,
	    "DEL0003",
	    EISA_PRODUCT_DEL0003,
	},
	{
	    0,
	    "DEL0004",
	    EISA_PRODUCT_DEL0004,
	},
	{
	    0,
	    "DEL0005",
	    EISA_PRODUCT_DEL0005,
	},
	{
	    0,
	    "DEL0006",
	    EISA_PRODUCT_DEL0006,
	},
	{
	    0,
	    "DEL0007",
	    EISA_PRODUCT_DEL0007,
	},
	{
	    0,
	    "DEL0008",
	    EISA_PRODUCT_DEL0008,
	},
	{
	    0,
	    "DEL0009",
	    EISA_PRODUCT_DEL0009,
	},
	{
	    0,
	    "DEL000A",
	    EISA_PRODUCT_DEL000A,
	},
	{
	    0,
	    "DEL000B",
	    EISA_PRODUCT_DEL000B,
	},
	{
	    0,
	    "DEL000C",
	    EISA_PRODUCT_DEL000C,
	},
	{
	    0,
	    "DEL0011",
	    EISA_PRODUCT_DEL0011,
	},
	{
	    0,
	    "DEL0019",
	    EISA_PRODUCT_DEL0019,
	},
	{
	    0,
	    "DEL0021",
	    EISA_PRODUCT_DEL0021,
	},
	{
	    0,
	    "DEL0029",
	    EISA_PRODUCT_DEL0029,
	},
	{
	    0,
	    "DEL002A",
	    EISA_PRODUCT_DEL002A,
	},
	{
	    0,
	    "DEL002B",
	    EISA_PRODUCT_DEL002B,
	},
	{
	    0,
	    "DEL002C",
	    EISA_PRODUCT_DEL002C,
	},
	{
	    0,
	    "DEL002D",
	    EISA_PRODUCT_DEL002D,
	},
	{
	    0,
	    "DEL0031",
	    EISA_PRODUCT_DEL0031,
	},
	{
	    0,
	    "DEL0036",
	    EISA_PRODUCT_DEL0036,
	},
	{
	    0,
	    "DEL0038",
	    EISA_PRODUCT_DEL0038,
	},
	{
	    0,
	    "DEL0054",
	    EISA_PRODUCT_DEL0054,
	},
	{
	    0,
	    "DEL0058",
	    EISA_PRODUCT_DEL0058,
	},
	{
	    0,
	    "DEL005A",
	    EISA_PRODUCT_DEL005A,
	},
	{
	    0,
	    "DEL005C",
	    EISA_PRODUCT_DEL005C,
	},
	{
	    0,
	    "DEL2100",
	    EISA_PRODUCT_DEL2100,
	},
	{
	    0,
	    "DEL4001",
	    EISA_PRODUCT_DEL4001,
	},
	{
	    0,
	    "DEL4002",
	    EISA_PRODUCT_DEL4002,
	},
	{
	    0,
	    "DEL6001",
	    EISA_PRODUCT_DEL6001,
	},
	{
	    0,
	    "DELFC00",
	    EISA_PRODUCT_DELFC00,
	},
	{
	    0,
	    "DELFC01",
	    EISA_PRODUCT_DELFC01,
	},
	{
	    0,
	    "DELFC02",
	    EISA_PRODUCT_DELFC02,
	},
	{
	    0,
	    "DELFC03",
	    EISA_PRODUCT_DELFC03,
	},
	{
	    0,
	    "DELFD00",
	    EISA_PRODUCT_DELFD00,
	},
	{
	    0,
	    "DELFD02",
	    EISA_PRODUCT_DELFD02,
	},
	{
	    0,
	    "DELFD03",
	    EISA_PRODUCT_DELFD03,
	},
	{
	    0,
	    "DELFD05",
	    EISA_PRODUCT_DELFD05,
	},
	{
	    0,
	    "DIS0000",
	    EISA_PRODUCT_DIS0000,
	},
	{
	    0,
	    "DPT2402",
	    EISA_PRODUCT_DPT2402,
	},
	{
	    0,
	    "DPT2403",
	    EISA_PRODUCT_DPT2403,
	},
	{
	    0,
	    "DPTA401",
	    EISA_PRODUCT_DPTA401,
	},
	{
	    0,
	    "DPTA402",
	    EISA_PRODUCT_DPTA402,
	},
	{
	    0,
	    "DPTA410",
	    EISA_PRODUCT_DPTA410,
	},
	{
	    0,
	    "DPTA501",
	    EISA_PRODUCT_DPTA501,
	},
	{
	    0,
	    "DPTA502",
	    EISA_PRODUCT_DPTA502,
	},
	{
	    0,
	    "DPTA701",
	    EISA_PRODUCT_DPTA701,
	},
	{
	    0,
	    "DPTBC01",
	    EISA_PRODUCT_DPTBC01,
	},
	{
	    0,
	    "DTC1101",
	    EISA_PRODUCT_DTC1101,
	},
	{
	    0,
	    "DTC3101",
	    EISA_PRODUCT_DTC3101,
	},
	{
	    0,
	    "DTI0000",
	    EISA_PRODUCT_DTI0000,
	},
	{
	    0,
	    "DTI2000",
	    EISA_PRODUCT_DTI2000,
	},
	{
	    0,
	    "DTI2002",
	    EISA_PRODUCT_DTI2002,
	},
	{
	    0,
	    "DTK0001",
	    EISA_PRODUCT_DTK0001,
	},
	{
	    0,
	    "DTK0003",
	    EISA_PRODUCT_DTK0003,
	},
	{
	    0,
	    "ECS0580",
	    EISA_PRODUCT_ECS0580,
	},
	{
	    0,
	    "ECS0590",
	    EISA_PRODUCT_ECS0590,
	},
	{
	    0,
	    "ELS8041",
	    EISA_PRODUCT_ELS8041,
	},
	{
	    0,
	    "ETI1001",
	    EISA_PRODUCT_ETI1001,
	},
	{
	    0,
	    "EVX0002",
	    EISA_PRODUCT_EVX0002,
	},
	{
	    0,
	    "FCT0001",
	    EISA_PRODUCT_FCT0001,
	},
	{
	    0,
	    "FCT0002",
	    EISA_PRODUCT_FCT0002,
	},
	{
	    0,
	    "FCT0003",
	    EISA_PRODUCT_FCT0003,
	},
	{
	    0,
	    "FIC0000",
	    EISA_PRODUCT_FIC0000,
	},
	{
	    0,
	    "FIX1516",
	    EISA_PRODUCT_FIX1516,
	},
	{
	    0,
	    "FSI2001",
	    EISA_PRODUCT_FSI2001,
	},
	{
	    0,
	    "FSI2002",
	    EISA_PRODUCT_FSI2002,
	},
	{
	    0,
	    "FSI2003",
	    EISA_PRODUCT_FSI2003,
	},
	{
	    0,
	    "GDT2001",
	    EISA_PRODUCT_GDT2001,
	},
	{
	    0,
	    "GDT3001",
	    EISA_PRODUCT_GDT3001,
	},
	{
	    0,
	    "GDT3002",
	    EISA_PRODUCT_GDT3002,
	},
	{
	    0,
	    "GDT3003",
	    EISA_PRODUCT_GDT3003,
	},
	{
	    0,
	    "GIT0000",
	    EISA_PRODUCT_GIT0000,
	},
	{
	    0,
	    "GIT0001",
	    EISA_PRODUCT_GIT0001,
	},
	{
	    0,
	    "HCL0801",
	    EISA_PRODUCT_HCL0801,
	},
	{
	    0,
	    "HIT0001",
	    EISA_PRODUCT_HIT0001,
	},
	{
	    0,
	    "HKG0011",
	    EISA_PRODUCT_HKG0011,
	},
	{
	    0,
	    "HMS0000",
	    EISA_PRODUCT_HMS0000,
	},
	{
	    0,
	    "HWP0000",
	    EISA_PRODUCT_HWP0000,
	},
	{
	    0,
	    "HWP0010",
	    EISA_PRODUCT_HWP0010,
	},
	{
	    0,
	    "HWP0020",
	    EISA_PRODUCT_HWP0020,
	},
	{
	    0,
	    "HWP0030",
	    EISA_PRODUCT_HWP0030,
	},
	{
	    0,
	    "HWP0070",
	    EISA_PRODUCT_HWP0070,
	},
	{
	    0,
	    "HWP0C70",
	    EISA_PRODUCT_HWP0C70,
	},
	{
	    0,
	    "HWP0C80",
	    EISA_PRODUCT_HWP0C80,
	},
	{
	    0,
	    "HWP1400",
	    EISA_PRODUCT_HWP1400,
	},
	{
	    0,
	    "HWP1410",
	    EISA_PRODUCT_HWP1410,
	},
	{
	    0,
	    "HWP1420",
	    EISA_PRODUCT_HWP1420,
	},
	{
	    0,
	    "HWP1440",
	    EISA_PRODUCT_HWP1440,
	},
	{
	    0,
	    "HWP1450",
	    EISA_PRODUCT_HWP1450,
	},
	{
	    0,
	    "HWP1460",
	    EISA_PRODUCT_HWP1460,
	},
	{
	    0,
	    "HWP1461",
	    EISA_PRODUCT_HWP1461,
	},
	{
	    0,
	    "HWP1510",
	    EISA_PRODUCT_HWP1510,
	},
	{
	    0,
	    "HWP1801",
	    EISA_PRODUCT_HWP1801,
	},
	{
	    0,
	    "HWP1810",
	    EISA_PRODUCT_HWP1810,
	},
	{
	    0,
	    "HWP1811",
	    EISA_PRODUCT_HWP1811,
	},
	{
	    0,
	    "HWP1820",
	    EISA_PRODUCT_HWP1820,
	},
	{
	    0,
	    "HWP1832",
	    EISA_PRODUCT_HWP1832,
	},
	{
	    0,
	    "HWP1840",
	    EISA_PRODUCT_HWP1840,
	},
	{
	    0,
	    "HWP1850",
	    EISA_PRODUCT_HWP1850,
	},
	{
	    0,
	    "HWP1870",
	    EISA_PRODUCT_HWP1870,
	},
	{
	    0,
	    "HWP18A0",
	    EISA_PRODUCT_HWP18A0,
	},
	{
	    0,
	    "HWP18C0",
	    EISA_PRODUCT_HWP18C0,
	},
	{
	    0,
	    "HWP18E0",
	    EISA_PRODUCT_HWP18E0,
	},
	{
	    0,
	    "HWP1940",
	    EISA_PRODUCT_HWP1940,
	},
	{
	    0,
	    "HWP1980",
	    EISA_PRODUCT_HWP1980,
	},
	{
	    0,
	    "HWP1990",
	    EISA_PRODUCT_HWP1990,
	},
	{
	    0,
	    "HWP19A0",
	    EISA_PRODUCT_HWP19A0,
	},
	{
	    0,
	    "HWP1C00",
	    EISA_PRODUCT_HWP1C00,
	},
	{
	    0,
	    "HWP2002",
	    EISA_PRODUCT_HWP2002,
	},
	{
	    0,
	    "HWP2051",
	    EISA_PRODUCT_HWP2051,
	},
	{
	    0,
	    "HWP2080",
	    EISA_PRODUCT_HWP2080,
	},
	{
	    0,
	    "HWPC000",
	    EISA_PRODUCT_HWPC000,
	},
	{
	    0,
	    "HWPC010",
	    EISA_PRODUCT_HWPC010,
	},
	{
	    0,
	    "HWPC051",
	    EISA_PRODUCT_HWPC051,
	},
	{
	    0,
	    "HWPC091",
	    EISA_PRODUCT_HWPC091,
	},
	{
	    0,
	    "HWPC0D1",
	    EISA_PRODUCT_HWPC0D1,
	},
	{
	    0,
	    "HWPC0E1",
	    EISA_PRODUCT_HWPC0E1,
	},
	{
	    0,
	    "IBM0001",
	    EISA_PRODUCT_IBM0001,
	},
	{
	    0,
	    "IBM1000",
	    EISA_PRODUCT_IBM1000,
	},
	{
	    0,
	    "IBM1060",
	    EISA_PRODUCT_IBM1060,
	},
	{
	    0,
	    "IBM1061",
	    EISA_PRODUCT_IBM1061,
	},
	{
	    0,
	    "ICLA080",
	    EISA_PRODUCT_ICLA080,
	},
	{
	    0,
	    "IDS0100",
	    EISA_PRODUCT_IDS0100,
	},
	{
	    0,
	    "IIN0B01",
	    EISA_PRODUCT_IIN0B01,
	},
	{
	    0,
	    "IKN1110",
	    EISA_PRODUCT_IKN1110,
	},
	{
	    0,
	    "IMS1001",
	    EISA_PRODUCT_IMS1001,
	},
	{
	    0,
	    "ING2040",
	    EISA_PRODUCT_ING2040,
	},
	{
	    0,
	    "INP0010",
	    EISA_PRODUCT_INP0010,
	},
	{
	    0,
	    "INP25D0",
	    EISA_PRODUCT_INP25D0,
	},
	{
	    0,
	    "INP5000",
	    EISA_PRODUCT_INP5000,
	},
	{
	    0,
	    "INT0000",
	    EISA_PRODUCT_INT0000,
	},
	{
	    0,
	    "INT0081",
	    EISA_PRODUCT_INT0081,
	},
	{
	    0,
	    "INT0701",
	    EISA_PRODUCT_INT0701,
	},
	{
	    0,
	    "INT0703",
	    EISA_PRODUCT_INT0703,
	},
	{
	    0,
	    "INT0902",
	    EISA_PRODUCT_INT0902,
	},
	{
	    0,
	    "INT0B01",
	    EISA_PRODUCT_INT0B01,
	},
	{
	    0,
	    "INT1000",
	    EISA_PRODUCT_INT1000,
	},
	{
	    0,
	    "INT1010",
	    EISA_PRODUCT_INT1010,
	},
	{
	    0,
	    "INT1030",
	    EISA_PRODUCT_INT1030,
	},
	{
	    0,
	    "INT1031",
	    EISA_PRODUCT_INT1031,
	},
	{
	    0,
	    "INT1060",
	    EISA_PRODUCT_INT1060,
	},
	{
	    0,
	    "INT1201",
	    EISA_PRODUCT_INT1201,
	},
	{
	    0,
	    "INT3061",
	    EISA_PRODUCT_INT3061,
	},
	{
	    0,
	    "INT3079",
	    EISA_PRODUCT_INT3079,
	},
	{
	    0,
	    "INT3089",
	    EISA_PRODUCT_INT3089,
	},
	{
	    0,
	    "INT30A1",
	    EISA_PRODUCT_INT30A1,
	},
	{
	    0,
	    "INT30A9",
	    EISA_PRODUCT_INT30A9,
	},
	{
	    0,
	    "INT30D1",
	    EISA_PRODUCT_INT30D1,
	},
	{
	    0,
	    "INT30F1",
	    EISA_PRODUCT_INT30F1,
	},
	{
	    0,
	    "INT3132",
	    EISA_PRODUCT_INT3132,
	},
	{
	    0,
	    "INT31A0",
	    EISA_PRODUCT_INT31A0,
	},
	{
	    0,
	    "ISY0010",
	    EISA_PRODUCT_ISY0010,
	},
	{
	    0,
	    "ISY0020",
	    EISA_PRODUCT_ISY0020,
	},
	{
	    0,
	    "ISY0030",
	    EISA_PRODUCT_ISY0030,
	},
	{
	    0,
	    "ISY0040",
	    EISA_PRODUCT_ISY0040,
	},
	{
	    0,
	    "ISY0050",
	    EISA_PRODUCT_ISY0050,
	},
	{
	    0,
	    "ISY0060",
	    EISA_PRODUCT_ISY0060,
	},
	{
	    0,
	    "ISY0070",
	    EISA_PRODUCT_ISY0070,
	},
	{
	    0,
	    "ITC0001",
	    EISA_PRODUCT_ITC0001,
	},
	{
	    0,
	    "ITK0011",
	    EISA_PRODUCT_ITK0011,
	},
	{
	    0,
	    "ITK0012",
	    EISA_PRODUCT_ITK0012,
	},
	{
	    0,
	    "KCI3201",
	    EISA_PRODUCT_KCI3201,
	},
	{
	    0,
	    "KCI3202",
	    EISA_PRODUCT_KCI3202,
	},
	{
	    0,
	    "LEF8000",
	    EISA_PRODUCT_LEF8000,
	},
	{
	    0,
	    "MDG0002",
	    EISA_PRODUCT_MDG0002,
	},
	{
	    0,
	    "MDG0010",
	    EISA_PRODUCT_MDG0010,
	},
	{
	    0,
	    "MDG0020",
	    EISA_PRODUCT_MDG0020,
	},
	{
	    0,
	    "MDG2000",
	    EISA_PRODUCT_MDG2000,
	},
	{
	    0,
	    "MDG2010",
	    EISA_PRODUCT_MDG2010,
	},
	{
	    0,
	    "MCC0000",
	    EISA_PRODUCT_MCC0000,
	},
	{
	    0,
	    "MCC0001",
	    EISA_PRODUCT_MCC0001,
	},
	{
	    0,
	    "MCY2501",
	    EISA_PRODUCT_MCY2501,
	},
	{
	    0,
	    "MET1104",
	    EISA_PRODUCT_MET1104,
	},
	{
	    0,
	    "MET1128",
	    EISA_PRODUCT_MET1128,
	},
	{
	    0,
	    "MIC0001",
	    EISA_PRODUCT_MIC0001,
	},
	{
	    0,
	    "MIC0004",
	    EISA_PRODUCT_MIC0004,
	},
	{
	    0,
	    "MIC0005",
	    EISA_PRODUCT_MIC0005,
	},
	{
	    0,
	    "MIC0021",
	    EISA_PRODUCT_MIC0021,
	},
	{
	    0,
	    "MIC0054",
	    EISA_PRODUCT_MIC0054,
	},
	{
	    0,
	    "MIC3001",
	    EISA_PRODUCT_MIC3001,
	},
	{
	    0,
	    "MIC5402",
	    EISA_PRODUCT_MIC5402,
	},
	{
	    0,
	    "MIR0928",
	    EISA_PRODUCT_MIR0928,
	},
	{
	    0,
	    "MLX0010",
	    EISA_PRODUCT_MLX0010,
	},
	{
	    0,
	    "MLX0011",
	    EISA_PRODUCT_MLX0011,
	},
	{
	    0,
	    "MLX0020",
	    EISA_PRODUCT_MLX0020,
	},
	{
	    0,
	    "MLX0021",
	    EISA_PRODUCT_MLX0021,
	},
	{
	    0,
	    "MLX0022",
	    EISA_PRODUCT_MLX0022,
	},
	{
	    0,
	    "MLX0030",
	    EISA_PRODUCT_MLX0030,
	},
	{
	    0,
	    "MLX0040",
	    EISA_PRODUCT_MLX0040,
	},
	{
	    0,
	    "MLX0050",
	    EISA_PRODUCT_MLX0050,
	},
	{
	    0,
	    "MLX0070",
	    EISA_PRODUCT_MLX0070,
	},
	{
	    0,
	    "MLX0071",
	    EISA_PRODUCT_MLX0071,
	},
	{
	    0,
	    "MLX0072",
	    EISA_PRODUCT_MLX0072,
	},
	{
	    0,
	    "MLX0073",
	    EISA_PRODUCT_MLX0073,
	},
	{
	    0,
	    "MLX0074",
	    EISA_PRODUCT_MLX0074,
	},
	{
	    0,
	    "MLX0075",
	    EISA_PRODUCT_MLX0075,
	},
	{
	    0,
	    "MLX0076",
	    EISA_PRODUCT_MLX0076,
	},
	{
	    0,
	    "MLX0077",
	    EISA_PRODUCT_MLX0077,
	},
	{
	    0,
	    "MLX0101",
	    EISA_PRODUCT_MLX0101,
	},
	{
	    0,
	    "MLXFD01",
	    EISA_PRODUCT_MLXFD01,
	},
	{
	    0,
	    "MLXFE01",
	    EISA_PRODUCT_MLXFE01,
	},
	{
	    0,
	    "MLXFF01",
	    EISA_PRODUCT_MLXFF01,
	},
	{
	    0,
	    "MLXFF02",
	    EISA_PRODUCT_MLXFF02,
	},
	{
	    0,
	    "MTX2040",
	    EISA_PRODUCT_MTX2040,
	},
	{
	    0,
	    "NEC8201",
	    EISA_PRODUCT_NEC8201,
	},
	{
	    0,
	    "NIC0202",
	    EISA_PRODUCT_NIC0202,
	},
	{
	    0,
	    "NIC0301",
	    EISA_PRODUCT_NIC0301,
	},
	{
	    0,
	    "NIC0400",
	    EISA_PRODUCT_NIC0400,
	},
	{
	    0,
	    "NIC0501",
	    EISA_PRODUCT_NIC0501,
	},
	{
	    0,
	    "NIC0602",
	    EISA_PRODUCT_NIC0602,
	},
	{
	    0,
	    "NIC0700",
	    EISA_PRODUCT_NIC0700,
	},
	{
	    0,
	    "NIC0800",
	    EISA_PRODUCT_NIC0800,
	},
	{
	    0,
	    "NIC0900",
	    EISA_PRODUCT_NIC0900,
	},
	{
	    0,
	    "NIC1000",
	    EISA_PRODUCT_NIC1000,
	},
	{
	    0,
	    "NIC1100",
	    EISA_PRODUCT_NIC1100,
	},
	{
	    0,
	    "NIC1200",
	    EISA_PRODUCT_NIC1200,
	},
	{
	    0,
	    "NIC1300",
	    EISA_PRODUCT_NIC1300,
	},
	{
	    0,
	    "NIC1400",
	    EISA_PRODUCT_NIC1400,
	},
	{
	    0,
	    "NIC1500",
	    EISA_PRODUCT_NIC1500,
	},
	{
	    0,
	    "NICC005",
	    EISA_PRODUCT_NICC005,
	},
	{
	    0,
	    "NICC105",
	    EISA_PRODUCT_NICC105,
	},
	{
	    0,
	    "NICC205",
	    EISA_PRODUCT_NICC205,
	},
	{
	    0,
	    "NICC304",
	    EISA_PRODUCT_NICC304,
	},
	{
	    0,
	    "NICC502",
	    EISA_PRODUCT_NICC502,
	},
	{
	    0,
	    "NON0101",
	    EISA_PRODUCT_NON0101,
	},
	{
	    0,
	    "NON0102",
	    EISA_PRODUCT_NON0102,
	},
	{
	    0,
	    "NON0201",
	    EISA_PRODUCT_NON0201,
	},
	{
	    0,
	    "NON0301",
	    EISA_PRODUCT_NON0301,
	},
	{
	    0,
	    "NON0401",
	    EISA_PRODUCT_NON0401,
	},
	{
	    0,
	    "NON0501",
	    EISA_PRODUCT_NON0501,
	},
	{
	    0,
	    "NON0601",
	    EISA_PRODUCT_NON0601,
	},
	{
	    0,
	    "NSS0011",
	    EISA_PRODUCT_NSS0011,
	},
	{
	    0,
	    "NVL0701",
	    EISA_PRODUCT_NVL0701,
	},
	{
	    0,
	    "NVL0901",
	    EISA_PRODUCT_NVL0901,
	},
	{
	    0,
	    "NVL1001",
	    EISA_PRODUCT_NVL1001,
	},
	{
	    0,
	    "NVL1201",
	    EISA_PRODUCT_NVL1201,
	},
	{
	    0,
	    "NVL1301",
	    EISA_PRODUCT_NVL1301,
	},
	{
	    0,
	    "NVL1401",
	    EISA_PRODUCT_NVL1401,
	},
	{
	    0,
	    "NVL1501",
	    EISA_PRODUCT_NVL1501,
	},
	{
	    0,
	    "OLC0701",
	    EISA_PRODUCT_OLC0701,
	},
	{
	    0,
	    "OLC0702",
	    EISA_PRODUCT_OLC0702,
	},
	{
	    0,
	    "OLC0801",
	    EISA_PRODUCT_OLC0801,
	},
	{
	    0,
	    "OLC0901",
	    EISA_PRODUCT_OLC0901,
	},
	{
	    0,
	    "OLC0902",
	    EISA_PRODUCT_OLC0902,
	},
	{
	    0,
	    "OLC0B01",
	    EISA_PRODUCT_OLC0B01,
	},
	{
	    0,
	    "OLC1201",
	    EISA_PRODUCT_OLC1201,
	},
	{
	    0,
	    "OPT0000",
	    EISA_PRODUCT_OPT0000,
	},
	{
	    0,
	    "OPT0200",
	    EISA_PRODUCT_OPT0200,
	},
	{
	    0,
	    "OTI0011",
	    EISA_PRODUCT_OTI0011,
	},
	{
	    0,
	    "PCI0080",
	    EISA_PRODUCT_PCI0080,
	},
	{
	    0,
	    "PCI0120",
	    EISA_PRODUCT_PCI0120,
	},
	{
	    0,
	    "PCI2080",
	    EISA_PRODUCT_PCI2080,
	},
	{
	    0,
	    "PHI8041",
	    EISA_PRODUCT_PHI8041,
	},
	{
	    0,
	    "PLX1001",
	    EISA_PRODUCT_PLX1001,
	},
	{
	    0,
	    "PRO6000",
	    EISA_PRODUCT_PRO6000,
	},
	{
	    0,
	    "PRO6001",
	    EISA_PRODUCT_PRO6001,
	},
	{
	    0,
	    "PRO6002",
	    EISA_PRODUCT_PRO6002,
	},
	{
	    0,
	    "PTI5401",
	    EISA_PRODUCT_PTI5401,
	},
	{
	    0,
	    "RII0101",
	    EISA_PRODUCT_RII0101,
	},
	{
	    0,
	    "SEC0010",
	    EISA_PRODUCT_SEC0010,
	},
	{
	    0,
	    "SEC0020",
	    EISA_PRODUCT_SEC0020,
	},
	{
	    0,
	    "SEC0021",
	    EISA_PRODUCT_SEC0021,
	},
	{
	    0,
	    "SECFF01",
	    EISA_PRODUCT_SECFF01,
	},
	{
	    0,
	    "SECFF02",
	    EISA_PRODUCT_SECFF02,
	},
	{
	    0,
	    "SGT0101",
	    EISA_PRODUCT_SGT0101,
	},
	{
	    0,
	    "SIS0000",
	    EISA_PRODUCT_SIS0000,
	},
	{
	    0,
	    "SIS0001",
	    EISA_PRODUCT_SIS0001,
	},
	{
	    0,
	    "SKD0100",
	    EISA_PRODUCT_SKD0100,
	},
	{
	    0,
	    "SMC0110",
	    EISA_PRODUCT_SMC0110,
	},
	{
	    0,
	    "SMC03E0",
	    EISA_PRODUCT_SMC03E0,
	},
	{
	    0,
	    "SMC13E0",
	    EISA_PRODUCT_SMC13E0,
	},
	{
	    0,
	    "SMC8003",
	    EISA_PRODUCT_SMC8003,
	},
	{
	    0,
	    "SMC8010",
	    EISA_PRODUCT_SMC8010,
	},
	{
	    0,
	    "SMC8013",
	    EISA_PRODUCT_SMC8013,
	},
	{
	    0,
	    "SMC8216",
	    EISA_PRODUCT_SMC8216,
	},
	{
	    0,
	    "SMCA010",
	    EISA_PRODUCT_SMCA010,
	},
	{
	    0,
	    "SNIAAA0",
	    EISA_PRODUCT_SNIAAA0,
	},
	{
	    0,
	    "SNIAAB0",
	    EISA_PRODUCT_SNIAAB0,
	},
	{
	    0,
	    "SNIABF0",
	    EISA_PRODUCT_SNIABF0,
	},
	{
	    0,
	    "SNIACA0",
	    EISA_PRODUCT_SNIACA0,
	},
	{
	    0,
	    "STL0100",
	    EISA_PRODUCT_STL0100,
	},
	{
	    0,
	    "STL0120",
	    EISA_PRODUCT_STL0120,
	},
	{
	    0,
	    "STL0130",
	    EISA_PRODUCT_STL0130,
	},
	{
	    0,
	    "STL0200",
	    EISA_PRODUCT_STL0200,
	},
	{
	    0,
	    "STL0400",
	    EISA_PRODUCT_STL0400,
	},
	{
	    0,
	    "STL0410",
	    EISA_PRODUCT_STL0410,
	},
	{
	    0,
	    "STL0420",
	    EISA_PRODUCT_STL0420,
	},
	{
	    0,
	    "SUK1022",
	    EISA_PRODUCT_SUK1022,
	},
	{
	    0,
	    "SUK1059",
	    EISA_PRODUCT_SUK1059,
	},
	{
	    0,
	    "SUK1072",
	    EISA_PRODUCT_SUK1072,
	},
	{
	    0,
	    "TCC010C",
	    EISA_PRODUCT_TCC010C,
	},
	{
	    0,
	    "TCC030D",
	    EISA_PRODUCT_TCC030D,
	},
	{
	    0,
	    "TCC040B",
	    EISA_PRODUCT_TCC040B,
	},
	{
	    0,
	    "TCC3047",
	    EISA_PRODUCT_TCC3047,
	},
	{
	    0,
	    "TCM3190",
	    EISA_PRODUCT_TCM3190,
	},
	{
	    0,
	    "TCM5030",
	    EISA_PRODUCT_TCM5030,
	},
	{
	    0,
	    "TCM5070",
	    EISA_PRODUCT_TCM5070,
	},
	{
	    0,
	    "TCM5090",
	    EISA_PRODUCT_TCM5090,
	},
	{
	    0,
	    "TCM5091",
	    EISA_PRODUCT_TCM5091,
	},
	{
	    0,
	    "TCM5092",
	    EISA_PRODUCT_TCM5092,
	},
	{
	    0,
	    "TCM5093",
	    EISA_PRODUCT_TCM5093,
	},
	{
	    0,
	    "TCM5094",
	    EISA_PRODUCT_TCM5094,
	},
	{
	    0,
	    "TCM5095",
	    EISA_PRODUCT_TCM5095,
	},
	{
	    0,
	    "TCM5098",
	    EISA_PRODUCT_TCM5098,
	},
	{
	    0,
	    "TCM5920",
	    EISA_PRODUCT_TCM5920,
	},
	{
	    0,
	    "TCM5970",
	    EISA_PRODUCT_TCM5970,
	},
	{
	    0,
	    "TCM5971",
	    EISA_PRODUCT_TCM5971,
	},
	{
	    0,
	    "TCM5972",
	    EISA_PRODUCT_TCM5972,
	},
	{
	    0,
	    "TCM7700",
	    EISA_PRODUCT_TCM7700,
	},
	{
	    0,
	    "TCO010C",
	    EISA_PRODUCT_TCO010C,
	},
	{
	    0,
	    "TCO030D",
	    EISA_PRODUCT_TCO030D,
	},
	{
	    0,
	    "TCO040B",
	    EISA_PRODUCT_TCO040B,
	},
	{
	    0,
	    "TCO050D",
	    EISA_PRODUCT_TCO050D,
	},
	{
	    0,
	    "TCO3147",
	    EISA_PRODUCT_TCO3147,
	},
	{
	    0,
	    "TCO345A",
	    EISA_PRODUCT_TCO345A,
	},
	{
	    0,
	    "TCO345B",
	    EISA_PRODUCT_TCO345B,
	},
	{
	    0,
	    "TEC8000",
	    EISA_PRODUCT_TEC8000,
	},
	{
	    0,
	    "TEC8001",
	    EISA_PRODUCT_TEC8001,
	},
	{
	    0,
	    "TEC8002",
	    EISA_PRODUCT_TEC8002,
	},
	{
	    0,
	    "TEC8003",
	    EISA_PRODUCT_TEC8003,
	},
	{
	    0,
	    "TRM0001",
	    EISA_PRODUCT_TRM0001,
	},
	{
	    0,
	    "TRM0320",
	    EISA_PRODUCT_TRM0320,
	},
	{
	    0,
	    "TRM0620",
	    EISA_PRODUCT_TRM0620,
	},
	{
	    0,
	    "TRM0820",
	    EISA_PRODUCT_TRM0820,
	},
	{
	    0,
	    "TRM320E",
	    EISA_PRODUCT_TRM320E,
	},
	{
	    0,
	    "TRM820B",
	    EISA_PRODUCT_TRM820B,
	},
	{
	    0,
	    "TRU0210",
	    EISA_PRODUCT_TRU0210,
	},
	{
	    0,
	    "TRU0520",
	    EISA_PRODUCT_TRU0520,
	},
	{
	    0,
	    "TRU1100",
	    EISA_PRODUCT_TRU1100,
	},
	{
	    0,
	    "TXN0011",
	    EISA_PRODUCT_TXN0011,
	},
	{
	    0,
	    "TYN0000",
	    EISA_PRODUCT_TYN0000,
	},
	{
	    0,
	    "TYN0001",
	    EISA_PRODUCT_TYN0001,
	},
	{
	    0,
	    "TYN0003",
	    EISA_PRODUCT_TYN0003,
	},
	{
	    0,
	    "UBIA100",
	    EISA_PRODUCT_UBIA100,
	},
	{
	    0,
	    "UBIA200",
	    EISA_PRODUCT_UBIA200,
	},
	{
	    0,
	    "UBIB100",
	    EISA_PRODUCT_UBIB100,
	},
	{
	    0,
	    "UBIB200",
	    EISA_PRODUCT_UBIB200,
	},
	{
	    0,
	    "UBIC100",
	    EISA_PRODUCT_UBIC100,
	},
	{
	    0,
	    "UBID100",
	    EISA_PRODUCT_UBID100,
	},
	{
	    0,
	    "USC0120",
	    EISA_PRODUCT_USC0120,
	},
	{
	    0,
	    "USC0125",
	    EISA_PRODUCT_USC0125,
	},
	{
	    0,
	    "USC0140",
	    EISA_PRODUCT_USC0140,
	},
	{
	    0,
	    "USC0220",
	    EISA_PRODUCT_USC0220,
	},
	{
	    0,
	    "USC0225",
	    EISA_PRODUCT_USC0225,
	},
	{
	    0,
	    "USC0240",
	    EISA_PRODUCT_USC0240,
	},
	{
	    0,
	    "USC0340",
	    EISA_PRODUCT_USC0340,
	},
	{
	    0,
	    "USR0011",
	    EISA_PRODUCT_USR0011,
	},
	{
	    0,
	    "USR3401",
	    EISA_PRODUCT_USR3401,
	},
	{
	    0,
	    "VMI0201",
	    EISA_PRODUCT_VMI0201,
	},
	{
	    0,
	    "VMI0211",
	    EISA_PRODUCT_VMI0211,
	},
	{
	    0,
	    "VMI0601",
	    EISA_PRODUCT_VMI0601,
	},
	{
	    0,
	    "VMI0E01",
	    EISA_PRODUCT_VMI0E01,
	},
	{
	    0,
	    "WDC0101",
	    EISA_PRODUCT_WDC0101,
	},
	{
	    0,
	    "WDC0102",
	    EISA_PRODUCT_WDC0102,
	},
	{
	    0,
	    "WDC0300",
	    EISA_PRODUCT_WDC0300,
	},
	{
	    0,
	    "WDC0301",
	    EISA_PRODUCT_WDC0301,
	},
	{
	    0,
	    "WDC03E0",
	    EISA_PRODUCT_WDC03E0,
	},
	{
	    0,
	    "WDC03E1",
	    EISA_PRODUCT_WDC03E1,
	},
	{
	    0,
	    "WDC03E2",
	    EISA_PRODUCT_WDC03E2,
	},
	{
	    0,
	    "WDC03E3",
	    EISA_PRODUCT_WDC03E3,
	},
	{
	    0,
	    "WDC03E4",
	    EISA_PRODUCT_WDC03E4,
	},
	{
	    0,
	    "WDC0510",
	    EISA_PRODUCT_WDC0510,
	},
	{
	    0,
	    "WDC1009",
	    EISA_PRODUCT_WDC1009,
	},
	{
	    0,
	    "WDC13E0",
	    EISA_PRODUCT_WDC13E0,
	},
	{
	    0,
	    "XTI02B1",
	    EISA_PRODUCT_XTI02B1,
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ABP",
	    "Advansys",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ACC",
	    "Accton",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ACE",
	    "ACME",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ACR",
	    "Acer",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ADI",
	    "Lightning Networks",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ADP",
	    "Adaptec",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "AIR",
	    "AIR",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "AMI",
	    "AMI",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ASU",
	    "Asus",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ATI",
	    "ATI",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "BAN",
	    "Banyan Vines",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "BUS",
	    "BusLogic",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "CCI",
	    "Cache Computers, Inc.",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "CHA",
	    "Chase",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "CMD",
	    "CMD Technology, Inc.",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "COG",
	    "Cogent",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "CPQ",
	    "Compaq",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "DBI",
	    "Digi",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "DEC",
	    "Digital Equipment",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "DEL",
	    "Dell",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "DPT",
	    "DPT",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "DTI",
	    "DeskStation Technology, Inc.",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "DTK",
	    "DTK",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ELS",
	    "ELSA",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ETI",
	    "ETI",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "FSI",
	    "FORE Systems",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "GDT",
	    "GDT",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "HWP",
	    "Hewlett-Packard",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "IKN",
	    "IKON",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "IMS",
	    "Integrated Micro Solution Inc.",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "INP",
	    "Interphase",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "INT",
	    "Intel",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "ISY",
	    "(SYSTEM)",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "LEF",
	    "LeafNET",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "MCY",
	    "Microdyne",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "MET",
	    "Metheus",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "MIC",
	    "Micronics",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "MLX",
	    "Mylex",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "MDG",
	    "Madge Networks",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "MTX",
	    "Matrox",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "NEC",
	    "NEC",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "NIC",
	    "National Instruments Corp.",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "NON",
	    "c't Universal",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "NSS",
	    "Newport Systems Solutions",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "NVL",
	    "Novell",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "OLC",
	    "Olicom",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "OPT",
	    "OPTi",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "PCI",
	    "Pioneer",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "PRO",
	    "Proteon",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "PTI",
	    "Poseidon",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "SMC",
	    "Standard Microsystems Corp.",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "SNI",
	    "Siemens Nixdorf",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "STL",
	    "Stallion Technologies",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TCC",
	    "Thomas-Conrad",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TCM",
	    "3Com",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TCO",
	    "Thomas-Conrad",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TEC",
	    "Tecmar",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TRU",
	    "Truevision",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TXN",
	    "Texas Instruments",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "TYN",
	    "Tyan",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "UBI",
	    "Ungermann-Bass",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "USC",
	    "UltraStor",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "USR",
	    "US Robotics",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "VMI",
	    "Vermont",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "WDC",
	    "Western Digital",
	},
	{
	    EISA_KNOWNDEV_NOPROD,
	    "XTI",
	    "XTI",
	},
	{ 0, "", NULL, }
};


code:
/*	$OpenBSD: eisareg.h,v 1.4 1996/05/05 12:42:24 deraadt Exp $	*/
/*	$NetBSD: eisareg.h,v 1.3 1996/04/09 22:46:13 cgd Exp $	*/

/*
 * Copyright (c) 1995, 1996 Christopher G. Demetriou
 * 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 Christopher G. Demetriou
 *      for the NetBSD Project.
 * 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.
 */

#ifndef __DEV_EISA_EISAREG_H__
#define	__DEV_EISA_EISAREG_H__

/*
 * Register (etc.) descriptions for the EISA bus.

 * Mostly culled from EISA chipset descriptions in:
 *	Intel Peripheral Components Databook (1992)
 */

/*
 * Slot I/O space size, and I/O address of a given slot.
 */
#define	EISA_SLOT_SIZE		0x1000
#define	EISA_SLOT_ADDR(s)	((s) * EISA_SLOT_SIZE)

/*
 * Slot offsets for important/standard registers.
 */
#define	EISA_SLOTOFF_VID	0xc80		/* offset of vendor id regs */
#define	EISA_NVIDREGS		2
#define	EISA_SLOTOFF_PID	0xc82		/* offset of product id regs */
#define	EISA_NPIDREGS		2

#ifdef AHA284X_HACK
/*
 * AHA-284x (VL bus) requires priming a register with the following values.
 */
#define	EISA_SLOTOFF_PRIMING	EISA_SLOTOFF_VID	/* offset */
#define	EISA_PRIMING_VID(index)	(0x80 + (index))	/* value for vendor */
#define	EISA_PRIMING_PID(index)	(0x82 + (index))	/* value for product */
#endif

/*
 * EISA ID functions, used to manipulate and decode EISA ID registers.
 * ``Somebody was let out without adult supervision.''
 */

#define	EISA_IDSTRINGLEN	8	/* length of ID string, incl. NUL */

/*
 * Vendor ID: three characters, encoded in 16 bits.
 *
 * EISA_VENDID_NODEV returns true if there's no device in the slot.
 * EISA_VENDID_IDDELAY returns true if there's a device in the slot,
 *	but that device hasn't been configured by system firmware.
 * EISA_VENDID_n returns the "n"th character of the vendor ID.
 */
#define	EISA_VENDID_NODEV(vid)						\
	    (((vid)[0] & 0x80) != 0)
#define	EISA_VENDID_IDDELAY(vid)					\
	    (((vid)[0] & 0xf0) == 0x70)
#define	EISA_VENDID_0(vid)						\
	    ((((vid)[0] & 0x7c) >> 2) + '@')
#define	EISA_VENDID_1(vid)						\
	    (((((vid)[0] & 0x03) << 3) | (((vid)[1] & 0xe0) >> 5)) + '@')
#define	EISA_VENDID_2(vid)						\
	    (((vid)[1] & 0x1f) + '@')

/*
 * Product ID: four hex digits, encoded in 16 bits (normal, sort of).
 *
 * EISA_PRIDID_n returns the "n"th hex digit of the product ID.
 */
#define	__EISA_HEX_MAP	"0123456789ABCDEF"
#define	EISA_PRODID_0(pid)						\
	    (__EISA_HEX_MAP[(((pid)[0] >> 4) & 0xf)])
#define	EISA_PRODID_1(pid)						\
	    (__EISA_HEX_MAP[(((pid)[0] >> 0) & 0xf)])
#define	EISA_PRODID_2(pid)						\
	    (__EISA_HEX_MAP[(((pid)[1] >> 4) & 0xf)])
#define	EISA_PRODID_3(pid)						\
	    (__EISA_HEX_MAP[(((pid)[1] >> 0) & 0xf)])

#endif /* !__DEV_EISA_EISAREG_H__ */

license: unknown


code:
/*	$OpenBSD: eisavar.h,v 1.14 2012/03/28 20:44:23 miod Exp $	*/
/*	$NetBSD: eisavar.h,v 1.11 1997/06/06 23:30:07 thorpej Exp $	*/

/*
 * Copyright (c) 1995, 1996 Christopher G. Demetriou
 * 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 Christopher G. Demetriou
 *      for the NetBSD Project.
 * 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.
 */

#ifndef _DEV_EISA_EISAVAR_H_
#define	_DEV_EISA_EISAVAR_H_

/*
 * Definitions for EISA autoconfiguration.
 *
 * This file describes types and functions which are used for EISA
 * configuration.  Some of this information is machine-specific, and is
 * separated into eisa_machdep.h.
 */

#include <machine/bus.h>
#include <dev/eisa/eisareg.h>		/* For ID register & string info. */

/*
 * Structures and definitions needed by the machine-dependent header.
 */
struct eisabus_attach_args;

/*
 * Machine-dependent definitions.
 */
#if defined(__alpha__)
#include <alpha/eisa/eisa_machdep.h>
#elif defined(__i386__)
#include <i386/eisa/eisa_machdep.h>
#else
#include <machine/eisa_machdep.h>
#endif

typedef int	eisa_slot_t;		/* really only needs to be 4 bits */

/*
 * EISA bus attach arguments.
 */
struct eisabus_attach_args {
	char	*eba_busname;		/* XXX should be common */
	bus_space_tag_t eba_iot;	/* eisa i/o space tag */
	bus_space_tag_t eba_memt;	/* eisa mem space tag */
	bus_dma_tag_t eba_dmat;		/* DMA tag */
	eisa_chipset_tag_t eba_ec;
};

/*
 * EISA device attach arguments.
 */
struct eisa_attach_args {
	bus_space_tag_t ea_iot;		/* eisa i/o space tag */
	bus_space_tag_t ea_memt;	/* eisa mem space tag */
	bus_dma_tag_t ea_dmat;		/* DMA tag */
	eisa_chipset_tag_t ea_ec;

	eisa_slot_t	ea_slot;
	u_int8_t	ea_vid[EISA_NVIDREGS];
	u_int8_t	ea_pid[EISA_NPIDREGS];
	char		ea_idstring[EISA_IDSTRINGLEN];
};

/*
 * Locators for EISA devices, as specified to config.
 */
#define	eisacf_slot		cf_loc[0]
#define	EISA_UNKNOWN_SLOT	-1		/* wildcarded 'slot' */

#endif /* _DEV_EISA_EISAVAR_H_ */


code:
#	$OpenBSD: files.eisa,v 1.11 2013/10/28 12:33:32 mpi Exp $
#	$NetBSD: files.eisa,v 1.12 1996/09/01 00:10:55 mycroft Exp $
#
# Config.new file and device description for machine-independent EISA code.
# Included by ports that need it.  Requires that the SCSI files be
# defined first.

device	eisa {[slot = -1]}
attach	eisa at eisabus
file	dev/eisa/eisa.c			eisa	needs-flag

# Adaptec AHA-174x EISA SCSI Host Adapter family
device	ahb: scsi
attach	ahb at eisa
file	dev/eisa/aha1742.c		ahb

# Adaptec AHA-274X and aic7770 motherboard SCSI controllers
# device declaration in sys/conf/files
attach	ahc at eisa with ahc_eisa
file	dev/eisa/ahc_eisa.c		ahc_eisa

# BusLogic BT-7xx EISA family
# device declaration in sys/conf/files
attach	bha at eisa with bha_eisa
file	dev/eisa/bha_eisa.c		bha_eisa

# DPT EATA SCSI controllers
# device declaration in sys/conf/files
attach	dpt at eisa with dpt_eisa
file	dev/eisa/dpt_eisa.c		dpt_eisa

# UltraStor UHA-24f boards
# device declaration in sys/conf/files
attach	uha at eisa with uha_eisa
file	dev/eisa/uha_eisa.c		uha_eisa

# Compaq Array Controllers
attach	cac at eisa with cac_eisa
file	dev/eisa/cac_eisa.c		cac_eisa

# 3Com 3c579 and 3c509 masquerading as EISA Ethernet Controllers
# device declaration in sys/conf/files
attach	ep at eisa with ep_eisa
file	dev/eisa/if_ep_eisa.c		ep_eisa


code:
/*	$OpenBSD: if_ep_eisa.c,v 1.24 2014/08/11 12:45:45 mpi Exp $	*/
/*	$NetBSD: if_ep_eisa.c,v 1.13 1997/04/18 00:50:33 cgd Exp $	*/

/*
 * Copyright (c) 1997 Jonathan Stone <jonathan@NetBSD.org>
 * Copyright (c) 1994 Herb Peyerl <hpeyerl@beer.org>
 * 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 Herb Peyerl.
 * 4. The name of Herb Peyerl 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 "bpfilter.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <sys/syslog.h>
#include <sys/selinfo.h>
#include <sys/timeout.h>
#include <sys/device.h>

#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/netisr.h>
#include <net/if_media.h>

#include <netinet/in.h>
#include <netinet/if_ether.h>

#if NBPFILTER > 0
#include <net/bpf.h>
#endif

#include <machine/cpu.h>
#include <machine/bus.h>
#include <machine/intr.h>

#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>

#include <dev/ic/elink3var.h>
#include <dev/ic/elink3reg.h>

#include <dev/eisa/eisareg.h>
#include <dev/eisa/eisavar.h>
#include <dev/eisa/eisadevs.h>

int ep_eisa_match(struct device *, void *, void *);
void ep_eisa_attach(struct device *, struct device *, void *);

struct cfattach ep_eisa_ca = {
	sizeof(struct ep_softc), ep_eisa_match, ep_eisa_attach
};

/* XXX move these somewhere else */
#define EISA_CONTROL	0x0c84
#define EISA_RESET	0x04
#define EISA_ERROR	0x02
#define EISA_ENABLE	0x01

int
ep_eisa_match(parent, match, aux)
	struct device *parent;
	void *match, *aux;
{
	struct eisa_attach_args *ea = aux;

	/* must match one of our known ID strings */
	if (strcmp(ea->ea_idstring, "TCM5090") &&
	    strcmp(ea->ea_idstring, "TCM5091") &&
	    strcmp(ea->ea_idstring, "TCM5092") &&
	    strcmp(ea->ea_idstring, "TCM5093") &&
	    strcmp(ea->ea_idstring, "TCM5094") &&
	    strcmp(ea->ea_idstring, "TCM5095") &&
	    strcmp(ea->ea_idstring, "TCM5098") &&
	    strcmp(ea->ea_idstring, "TCM5920") &&
	    strcmp(ea->ea_idstring, "TCM5970") &&
	    strcmp(ea->ea_idstring, "TCM5971") &&
	    strcmp(ea->ea_idstring, "TCM5972"))
		return (0);

	return (1);
}

void
ep_eisa_attach(parent, self, aux)
	struct device *parent, *self;
	void *aux;
{
	struct ep_softc *sc = (void *)self;
	struct eisa_attach_args *ea = aux;
	bus_space_tag_t iot = ea->ea_iot;
	bus_space_handle_t ioh;
	u_int16_t k;
	eisa_chipset_tag_t ec = ea->ea_ec;
	eisa_intr_handle_t ih;
	const char *model, *intrstr;
	int chipset;
	u_int irq;

	/* Map i/o space. */
	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot),
	    EISA_SLOT_SIZE, 0, &ioh))
		panic(": can't map i/o space");

	sc->bustype = EP_BUS_EISA;
	sc->sc_ioh = ioh;
	sc->sc_iot = iot;

	bus_space_write_1(iot, ioh, EISA_CONTROL, EISA_ENABLE);
	delay(4000);

	/* XXX What is this doing?!  Reading the i/o address? */
	k = bus_space_read_2(iot, ioh, EP_W0_ADDRESS_CFG);
	k = (k & 0x1f) * 0x10 + 0x200;

	/* Read the IRQ from the card. */
	irq = bus_space_read_2(iot, ioh, EP_W0_RESOURCE_CFG) >> 12;

	chipset = EP_CHIPSET_3C509;	/* assume dumb chipset */
	if (strcmp(ea->ea_idstring, "TCM5090") == 0)
		model = EISA_PRODUCT_TCM5090;
	else if (strcmp(ea->ea_idstring, "TCM5091") == 0)
		model = EISA_PRODUCT_TCM5091;
	else if (strcmp(ea->ea_idstring, "TCM5092") == 0)
		model = EISA_PRODUCT_TCM5092;
	else if (strcmp(ea->ea_idstring, "TCM5093") == 0)
		model = EISA_PRODUCT_TCM5093;
	else if (strcmp(ea->ea_idstring, "TCM5094") == 0)
		model = EISA_PRODUCT_TCM5094;
	else if (strcmp(ea->ea_idstring, "TCM5095") == 0)
		model = EISA_PRODUCT_TCM5095;
	else if (strcmp(ea->ea_idstring, "TCM5098") == 0)
		model = EISA_PRODUCT_TCM5098;
	else if (strcmp(ea->ea_idstring, "TCM5920") == 0) {
		model = EISA_PRODUCT_TCM5920;
		chipset = EP_CHIPSET_VORTEX;
	} else if (strcmp(ea->ea_idstring, "TCM5970") == 0) {
		model = EISA_PRODUCT_TCM5970;
		chipset = EP_CHIPSET_VORTEX;
	} else if (strcmp(ea->ea_idstring, "TCM5971") == 0) {
		model = EISA_PRODUCT_TCM5971;
		chipset = EP_CHIPSET_VORTEX;
	} else if (strcmp(ea->ea_idstring, "TCM5972") == 0) {
		model = EISA_PRODUCT_TCM5972;
		chipset = EP_CHIPSET_VORTEX;
	} else
		model = "unknown model!";

	if (eisa_intr_map(ec, irq, &ih)) {
		printf(": couldn't map interrupt (%u)\n", irq);
		bus_space_unmap(iot, ioh, EISA_SLOT_SIZE);
		return;
	}
	intrstr = eisa_intr_string(ec, ih);
	sc->sc_ih = eisa_intr_establish(ec, ih, IST_EDGE, IPL_NET,
	    epintr, sc, sc->sc_dev.dv_xname);
	if (sc->sc_ih == NULL) {
		printf(": couldn't establish interrupt");
		if (intrstr != NULL)
			printf(" at %s", intrstr);
		printf("\n");
		bus_space_unmap(iot, ioh, EISA_SLOT_SIZE);
		return;
	}

	printf(": %s,", model);
	if (intrstr != NULL)
		printf(" %s,", intrstr);

	epconfig(sc, chipset, NULL);
	/* XXX because epconfig() will not print a newline for vortex chips */
	if (chipset == EP_CHIPSET_VORTEX)
		printf("\n");
}


code:
/*	$OpenBSD: uha_eisa.c,v 1.13 2014/09/14 14:17:24 jsg Exp $	*/
/*	$NetBSD: uha_eisa.c,v 1.5 1996/10/21 22:31:07 thorpej Exp $	*/

/*
 * Copyright (c) 1994, 1996 Charles M. Hannum.  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 Charles M. Hannum.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <uvm/uvm_extern.h>

#include <machine/bus.h>
#include <machine/intr.h>

#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>

#include <dev/eisa/eisavar.h>
#include <dev/eisa/eisadevs.h>

#include <dev/ic/uhareg.h>
#include <dev/ic/uhavar.h>

#define	UHA_EISA_SLOT_OFFSET	0xc80
#define	UHA_EISA_IOSIZE		0x020

int	uha_eisa_match(struct device *, void *, void *);
void	uha_eisa_attach(struct device *, struct device *, void *);

struct cfattach uha_eisa_ca = {
	sizeof(struct uha_softc), uha_eisa_match, uha_eisa_attach
};

#define KVTOPHYS(x)	vtophys((vaddr_t)(x))

int u24_find(bus_space_tag_t, bus_space_handle_t, struct uha_softc *);
void u24_start_mbox(struct uha_softc *, struct uha_mscp *);
int u24_poll(struct uha_softc *, struct scsi_xfer *, int);
int u24_intr(void *);
void u24_init(struct uha_softc *);

/*
 * Check the slots looking for a board we recognise
 * If we find one, note its address (slot) and call
 * the actual probe routine to check it out.
 */
int
uha_eisa_match(parent, match, aux)
	struct device *parent;
	void *match, *aux;
{
	struct eisa_attach_args *ea = aux;
	bus_space_tag_t iot = ea->ea_iot;
	bus_space_handle_t ioh;
	int rv;

	/* must match one of our known ID strings */
	if (strncmp(ea->ea_idstring, "USC024", 6))
		return (0);

	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot) +
	    UHA_EISA_SLOT_OFFSET, UHA_EISA_IOSIZE, 0, &ioh))
		return (0);

	rv = u24_find(iot, ioh, NULL);

	bus_space_unmap(iot, ioh, UHA_EISA_IOSIZE);

	return (rv);
}

/*
 * Attach all the sub-devices we can find
 */
void
uha_eisa_attach(parent, self, aux)
	struct device *parent, *self;
	void *aux;
{
	struct eisa_attach_args *ea = aux;
	struct uha_softc *sc = (void *)self;
	bus_space_tag_t iot = ea->ea_iot;
	bus_space_handle_t ioh;
	eisa_chipset_tag_t ec = ea->ea_ec;
	eisa_intr_handle_t ih;
	const char *model, *intrstr;

	if (!strncmp(ea->ea_idstring, "USC024", 6))
		model = EISA_PRODUCT_USC0240;
	else
		model = "unknown model!";
	printf(": %s\n", model);

	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot) +
	    UHA_EISA_SLOT_OFFSET, UHA_EISA_IOSIZE, 0, &ioh))
		panic("uha_attach: can't map I/O addresses");

	sc->sc_iot = iot;
	sc->sc_ioh = ioh;
	if (!u24_find(iot, ioh, sc))
		panic("uha_attach: u24_find failed!");

	if (eisa_intr_map(ec, sc->sc_irq, &ih)) {
		printf("%s: couldn't map interrupt (%d)\n",
		    sc->sc_dev.dv_xname, sc->sc_irq);
		return;
	}
	intrstr = eisa_intr_string(ec, ih);
	sc->sc_ih = eisa_intr_establish(ec, ih, IST_LEVEL, IPL_BIO,
	    u24_intr, sc, sc->sc_dev.dv_xname);
	if (sc->sc_ih == NULL) {
		printf("%s: couldn't establish interrupt",
		    sc->sc_dev.dv_xname);
		if (intrstr != NULL)
			printf(" at %s", intrstr);
		printf("\n");
		return;
	}
	printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);

	/* Save function pointers for later use. */
	sc->start_mbox = u24_start_mbox;
	sc->poll = u24_poll;
	sc->init = u24_init;

	uha_attach(sc);
}

int
u24_find(iot, ioh, sc)
	bus_space_tag_t iot;
	bus_space_handle_t ioh;
	struct uha_softc *sc;
{
	u_int8_t config0, config1, config2;
	int irq, drq;
	int resetcount = 4000;	/* 4 secs? */

	config0 = bus_space_read_1(iot, ioh, U24_CONFIG + 0);
	config1 = bus_space_read_1(iot, ioh, U24_CONFIG + 1);
	config2 = bus_space_read_1(iot, ioh, U24_CONFIG + 2);
	if ((config0 & U24_MAGIC1) == 0 ||
	    (config1 & U24_MAGIC2) == 0)
		return (0);

	drq = -1;

	switch (config0 & U24_IRQ_MASK) {
	case U24_IRQ10:
		irq = 10;
		break;
	case U24_IRQ11:
		irq = 11;
		break;
	case U24_IRQ14:
		irq = 14;
		break;
	case U24_IRQ15:
		irq = 15;
		break;
	default:
		printf("u24_find: illegal irq setting %x\n",
		    config0 & U24_IRQ_MASK);
		return (0);
	}

	bus_space_write_1(iot, ioh, U24_LINT, UHA_ASRST);

	while (--resetcount) {
		if (bus_space_read_1(iot, ioh, U24_LINT))
			break;
		delay(1000);	/* 1 mSec per loop */
	}
	if (!resetcount) {
		printf("u24_find: board timed out during reset\n");
		return (0);
	}

	/* if we want to fill in softc, do so now */
	if (sc != NULL) {
		sc->sc_irq = irq;
		sc->sc_drq = drq;
		sc->sc_scsi_dev = config2 & U24_HOSTID_MASK;
	}

	return (1);
}

void
u24_start_mbox(sc, mscp)
	struct uha_softc *sc;
	struct uha_mscp *mscp;
{
	bus_space_tag_t iot = sc->sc_iot;
	bus_space_handle_t ioh = sc->sc_ioh;
	int spincount = 100000;	/* 1s should be enough */

	while (--spincount) {
		if ((bus_space_read_1(iot, ioh, U24_LINT) & U24_LDIP) == 0)
			break;
		delay(100);
	}
	if (!spincount)
		panic("%s: uha_start_mbox, board not responding",
		    sc->sc_dev.dv_xname);

	bus_space_write_4(iot, ioh, U24_OGMPTR, KVTOPHYS(mscp));
	if (mscp->flags & MSCP_ABORT)
		bus_space_write_1(iot, ioh, U24_OGMCMD, 0x80);
	else
		bus_space_write_1(iot, ioh, U24_OGMCMD, 0x01);
	bus_space_write_1(iot, ioh, U24_LINT, U24_OGMFULL);

	if ((mscp->xs->flags & SCSI_POLL) == 0)
		timeout_add_msec(&mscp->xs->stimeout, mscp->timeout);
}

int
u24_poll(sc, xs, count)
	struct uha_softc *sc;
	struct scsi_xfer *xs;
	int count;
{
	bus_space_tag_t iot = sc->sc_iot;
	bus_space_handle_t ioh = sc->sc_ioh;
	int s;

	while (count) {
		/*
		 * If we had interrupts enabled, would we
		 * have got an interrupt?
		 */
		if (bus_space_read_1(iot, ioh, U24_SINT) & U24_SDIP) {
			s = splbio();
			u24_intr(sc);
			splx(s);
		}
		if (xs->flags & ITSDONE)
			return (0);
		delay(1000);
		count--;
	}
	return (1);
}

int
u24_intr(arg)
	void *arg;
{
	struct uha_softc *sc = arg;
	bus_space_tag_t iot = sc->sc_iot;
	bus_space_handle_t ioh = sc->sc_ioh;
	struct uha_mscp *mscp;
	u_char uhastat;
	u_long mboxval;

#ifdef	UHADEBUG
	printf("%s: uhaintr ", sc->sc_dev.dv_xname);
#endif /*UHADEBUG */

	if ((bus_space_read_1(iot, ioh, U24_SINT) & U24_SDIP) == 0)
		return (0);

	for (;;) {
		/*
		 * First get all the information and then
		 * acknowledge the interrupt
		 */
		uhastat = bus_space_read_1(iot, ioh, U24_SINT);
		mboxval = bus_space_read_4(iot, ioh, U24_ICMPTR);
		bus_space_write_1(iot, ioh, U24_SINT, U24_ICM_ACK);
		bus_space_write_1(iot, ioh, U24_ICMCMD, 0);

#ifdef	UHADEBUG
		printf("status = 0x%x ", uhastat);
#endif /*UHADEBUG*/

		/*
		 * Process the completed operation
		 */
		mscp = uha_mscp_phys_kv(sc, mboxval);
		if (!mscp) {
			printf("%s: BAD MSCP RETURNED!\n",
			    sc->sc_dev.dv_xname);
			continue;	/* whatever it was, it'll timeout */
		}
		timeout_del(&mscp->xs->stimeout);
		uha_done(sc, mscp);

		if ((bus_space_read_1(iot, ioh, U24_SINT) & U24_SDIP) == 0)
			return (1);
	}
}

void
u24_init(sc)
	struct uha_softc *sc;
{
	bus_space_tag_t iot = sc->sc_iot;
	bus_space_handle_t ioh = sc->sc_ioh;

	/* free OGM and ICM */
	bus_space_write_1(iot, ioh, U24_OGMCMD, 0);
	bus_space_write_1(iot, ioh, U24_ICMCMD, 0);
	/* make sure interrupts are enabled */
#ifdef UHADEBUG
	printf("u24_init: lmask=%02x, smask=%02x\n",
	    bus_space_read_1(iot, ioh, U24_LMASK),
	    bus_space_read_1(iot, ioh, U24_SMASK));
#endif
	bus_space_write_1(iot, ioh, U24_LMASK, 0xd2);	/* XXX */
	bus_space_write_1(iot, ioh, U24_SMASK, 0x92);	/* XXX */
}


code:
/*	$OpenBSD: firmload.c,v 1.12 2015/03/13 23:05:04 deraadt Exp $	*/

/*
 * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/syslimits.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/device.h>

int
loadfirmware(const char *name, u_char **bufp, size_t *buflen)
{
	struct proc *p = curproc;
	struct nameidata nid;
	char *path, *ptr;
	struct iovec iov;
	struct uio uio;
	struct vattr va;
	int error;

	if (!rootvp || !vcount(rootvp))
		return (EIO);

	path = malloc(MAXPATHLEN, M_TEMP, M_NOWAIT);
	if (path == NULL)
		return (ENOMEM);

	if (snprintf(path, MAXPATHLEN, "/etc/firmware/%s", name) >=
	    MAXPATHLEN) {
		error = ENAMETOOLONG;
		goto err;
	}

	NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, path, p);
	error = namei(&nid);
#ifdef RAMDISK_HOOKS
	/* try again with mounted disk */
	if (error) {
		if (snprintf(path, MAXPATHLEN, "/mnt/etc/firmware/%s", name) >=
		    MAXPATHLEN) {
			error = ENAMETOOLONG;
			goto err;
		}

		NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, path, p);
		error = namei(&nid);
	}
#endif
	if (error)
		goto err;
	error = VOP_GETATTR(nid.ni_vp, &va, p->p_ucred, p);
	if (error)
		goto fail;
	if (nid.ni_vp->v_type != VREG || va.va_size == 0) {
		error = EINVAL;
		goto fail;
	}
	if (va.va_size > FIRMWARE_MAX) {
		error = E2BIG;
		goto fail;
	}
	ptr = malloc(va.va_size, M_DEVBUF, M_NOWAIT);
	if (ptr == NULL) {
		error = ENOMEM;
		goto fail;
	}

	iov.iov_base = ptr;
	iov.iov_len = va.va_size;
	uio.uio_iov = &iov;
	uio.uio_iovcnt = 1;
	uio.uio_offset = 0;
	uio.uio_resid = va.va_size;
	uio.uio_segflg = UIO_SYSSPACE;
	uio.uio_rw = UIO_READ;
	uio.uio_procp = p;

	error = VOP_READ(nid.ni_vp, &uio, 0, p->p_ucred);

	if (error == 0) {
		*bufp = ptr;
		*buflen = va.va_size;
	} else
		free(ptr, M_DEVBUF, 0);

fail:
	vput(nid.ni_vp);
err:
	if (path)
		free(path, M_TEMP, 0);
	return (error);
}


code:
/*	$OpenBSD: flash.c,v 1.30 2014/05/08 21:17:00 miod Exp $	*/

/*
 * Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <sys/param.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/dkio.h>
#include <sys/kernel.h>
#include <sys/stat.h>
#include <sys/systm.h>

#include <dev/flashvar.h>

#include <ufs/ffs/fs.h>		/* XXX */

/* Samsung command set */
#define SAMSUNG_CMD_PTRLO	0x00
#define SAMSUNG_CMD_PTRHI	0x01
#define SAMSUNG_CMD_PTROOB	0x50
#define SAMSUNG_CMD_READ	0x30
#define SAMSUNG_CMD_SEQIN	0x80
#define SAMSUNG_CMD_WRITE	0x10
#define SAMSUNG_CMD_ERASE0	0x60
#define SAMSUNG_CMD_ERASE1	0xd0
#define SAMSUNG_CMD_STATUS	0x70
#define  STATUS_FAIL		(1<<0)
#define  STATUS_READY		(1<<6)
#define  STATUS_NWP		(1<<7)
#define SAMSUNG_CMD_READID	0x90
#define SAMSUNG_CMD_RESET	0xff

int	 flash_wait_ready(struct flash_softc *);
int	 flash_wait_complete(struct flash_softc *);

/* XXX: these should go elsewhere */
cdev_decl(flash);
bdev_decl(flash);

#define flashlookup(unit) \
	(struct flash_softc *)device_lookup(&flash_cd, (unit))

void	flashminphys(struct buf *);
void	flashstart(struct flash_softc *);
void	_flashstart(struct flash_softc *, struct buf *);
void	flashdone(void *);

int	flashsafestrategy(struct flash_softc *, struct buf *);
void	flashgetdefaultlabel(dev_t, struct flash_softc *,
    struct disklabel *);
int	flashgetdisklabel(dev_t, struct flash_softc *, struct disklabel *, int);

/*
 * Driver attachment glue
 */

struct flashvendor {
	u_int8_t	 vendor;
	const char	*name;
};

static const struct flashvendor flashvendors[] = {
	{ FLASH_VENDOR_SAMSUNG, "Samsung" }
};
#define	FLASH_NVENDORS (sizeof(flashvendors) / sizeof(flashvendors[0]))

static const struct flashdev flashdevs[] = {
	{ FLASH_DEVICE_SAMSUNG_K9F2808U0C, "K9F2808U0C 16Mx8 3.3V",
	   512, 16, 32, 32768 },
	{ FLASH_DEVICE_SAMSUNG_K9F1G08U0A, "K9F1G08U0A 128Mx8 3.3V",
	  2048, 64, 64, 65536 },
};
#define	FLASH_NDEVS (sizeof(flashdevs) / sizeof(flashdevs[0]))

struct cfdriver flash_cd = {
	NULL, "flash", DV_DISK
};

void
flashattach(struct flash_softc *sc, struct flash_ctl_tag *tag,
    void *cookie)
{
	u_int8_t vendor, device;
	u_int16_t id;
	int i;

	sc->sc_tag = tag;
	sc->sc_cookie = cookie;

	if (sc->sc_maxwaitready <= 0)
		sc->sc_maxwaitready = 1000;      /* 1ms */
	if (sc->sc_maxwaitcomplete <= 0)
		sc->sc_maxwaitcomplete = 200000; /* 200ms */

	flash_chip_enable(sc);

	/* Identify the flash device. */
	if (flash_chip_identify(sc, &vendor, &device) != 0) {
		printf(": identification failed\n");
		flash_chip_disable(sc);
		return;
	}
	id = (vendor << 8) | device;

	/* Look up device characteristics, abort if not recognized. */
	for (i = 0; i < FLASH_NVENDORS; i++) {
		if (flashvendors[i].vendor == vendor) {
			printf(": %s", flashvendors[i].name);
			break;
		}
	}
	if (i == FLASH_NVENDORS)
		printf(": vendor 0x%02x", vendor);
	for (i = 0; i < FLASH_NDEVS; i++) {
		if (flashdevs[i].id == id) {
			printf(" %s\n", flashdevs[i].longname);
			break;
		}
	}
	if (i == FLASH_NDEVS) {
		/* Need to add this device to flashdevs first. */
		printf(" device 0x%02x\n", device);
		flash_chip_disable(sc);
		return;
	}
	sc->sc_flashdev = &flashdevs[i];

	/* Check if the device really works or fail early. */
	if (flash_chip_reset(sc) != 0) {
		printf("%s: reset failed\n", sc->sc_dev.dv_xname);
		flash_chip_disable(sc);
		return;
	}

	flash_chip_disable(sc);

	/*
	 * Initialize and attach the disk structure.
	 */
	sc->sc_dk.dk_name = sc->sc_dev.dv_xname;
	bufq_init(&sc->sc_bufq, BUFQ_FIFO);
	disk_attach(&sc->sc_dev, &sc->sc_dk);

	/* XXX establish shutdown hook to finish any commands. */
}

int
flashdetach(struct device *self, int flags)
{
	struct flash_softc *sc = (struct flash_softc *)self;

	/* Detach disk. */
	disk_detach(&sc->sc_dk);

	/* XXX more resources need to be freed here. */
	return 0;
}

/*
 * Flash controller and chip functions
 */

u_int8_t
flash_reg8_read(struct flash_softc *sc, int reg)
{
	return sc->sc_tag->reg8_read(sc->sc_cookie, reg);
}

void
flash_reg8_read_page(struct flash_softc *sc, caddr_t data, caddr_t oob)
{
	int i;

	for (i = 0; i < sc->sc_flashdev->pagesize; i++)
		data[i] = flash_reg8_read(sc, FLASH_REG_DATA);

	if (oob != NULL)
		for (i = 0; i < sc->sc_flashdev->oobsize; i++)
			oob[i] = flash_reg8_read(sc, FLASH_REG_DATA);
}

void
flash_reg8_write(struct flash_softc *sc, int reg, u_int8_t value)
{
	sc->sc_tag->reg8_write(sc->sc_cookie, reg, value);
}

void
flash_reg8_write_page(struct flash_softc *sc, caddr_t data, caddr_t oob)
{
	int i;

	for (i = 0; i < sc->sc_flashdev->pagesize; i++)
		flash_reg8_write(sc, FLASH_REG_DATA, data[i]);

	if (oob != NULL)
		for (i = 0; i < sc->sc_flashdev->oobsize; i++)
			flash_reg8_write(sc, FLASH_REG_DATA, oob[i]);
}

/*
 * Wait for the "Ready/Busy" signal to go high, indicating that the
 * device is ready to accept another command.
 */
int
flash_wait_ready(struct flash_softc *sc)
{
	int timo = sc->sc_maxwaitready;
	u_int8_t ready;

	ready = flash_reg8_read(sc, FLASH_REG_READY);
	while (ready == 0 && timo-- > 0) {
		delay(1);
		ready = flash_reg8_read(sc, FLASH_REG_READY);
	}
	return (ready == 0 ? EIO : 0);
}

/*
 * Similar to flash_wait_ready() but looks at IO 6 and IO 0 signals
 * besides R/B to decide whether the last operation was successful.
 */
int
flash_wait_complete(struct flash_softc *sc)
{
	int timo = sc->sc_maxwaitcomplete;
	u_int8_t status;

	(void)flash_wait_ready(sc);

	flash_reg8_write(sc, FLASH_REG_CLE, 1);
	flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_STATUS);
	flash_reg8_write(sc, FLASH_REG_CLE, 0);

	status = flash_reg8_read(sc, FLASH_REG_DATA);
	while ((status & STATUS_READY) == 0 && timo-- > 0) {
		if (flash_reg8_read(sc, FLASH_REG_READY))
			break;
		delay(1);
		status = flash_reg8_read(sc, FLASH_REG_DATA);
	}

	status = flash_reg8_read(sc, FLASH_REG_DATA);
	return ((status & STATUS_FAIL) != 0 ? EIO : 0);
}

void
flash_chip_enable(struct flash_softc *sc)
{
	/* XXX aquire the lock. */
	flash_reg8_write(sc, FLASH_REG_CE, 1);
}

void
flash_chip_disable(struct flash_softc *sc)
{
	flash_reg8_write(sc, FLASH_REG_CE, 0);
	/* XXX release the lock. */
}

int
flash_chip_reset(struct flash_softc *sc)
{
	flash_reg8_write(sc, FLASH_REG_CLE, 1);
	flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_RESET);
	flash_reg8_write(sc, FLASH_REG_CLE, 0);

	return flash_wait_ready(sc);
}

int
flash_chip_identify(struct flash_softc *sc, u_int8_t *vendor,
    u_int8_t *device)
{
	int error;

	(void)flash_wait_ready(sc);

	flash_reg8_write(sc, FLASH_REG_CLE, 1);
	flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_READID);
	flash_reg8_write(sc, FLASH_REG_CLE, 0);

	error = flash_wait_ready(sc);
	if (error == 0) {
		*vendor = flash_reg8_read(sc, FLASH_REG_DATA);
		*device = flash_reg8_read(sc, FLASH_REG_DATA);
	}
	return error;
}

int
flash_chip_erase_block(struct flash_softc *sc, long blkno)
{
	long pageno = blkno * sc->sc_flashdev->blkpages;
	int error;

	(void)flash_wait_ready(sc);

	/* Disable write-protection. */
	flash_reg8_write(sc, FLASH_REG_WP, 0);

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_ERASE0);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno >> 8);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_ERASE1);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	error = flash_wait_complete(sc);

	/* Re-enable write-protection. */
	flash_reg8_write(sc, FLASH_REG_WP, 1);

	return error;
}

int
flash_chip_read_block(struct flash_softc *sc, long blkno, caddr_t data)
{
	long pageno;
	long blkend;
	int error;

	pageno = blkno * sc->sc_flashdev->blkpages;
	blkend = pageno + sc->sc_flashdev->blkpages;

	while (pageno < blkend) {
		error = flash_chip_read_page(sc, pageno, data, NULL);
		if (error != 0)
			return error;
		data += sc->sc_flashdev->pagesize;
		pageno++;
	}
	return 0;
}

int
flash_chip_read_page(struct flash_softc *sc, long pageno, caddr_t data,
    caddr_t oob)
{
	int error;

	(void)flash_wait_ready(sc);

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_PTRLO);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno >> 8);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_READ);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	if ((error = flash_wait_ready(sc)) != 0)
		return error;

	/* Support hardware ECC calculation. */
	if (sc->sc_tag->regx_read_page) {
		error = sc->sc_tag->regx_read_page(sc->sc_cookie, data,
		    oob);
		if (error != 0)
			return error;
	} else
		flash_reg8_read_page(sc, data, oob);

	return 0;
}

int
flash_chip_read_oob(struct flash_softc *sc, long pageno, caddr_t oob)
{
	u_int8_t *p = (u_int8_t *)oob;
	int error;
	int i;

	(void)flash_wait_ready(sc);

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_PTROOB);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_PTRLO);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_COL, 0x08);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno >> 8);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_READ);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	if ((error = flash_wait_ready(sc)) != 0)
		return error;

	for (i = 0; i < sc->sc_flashdev->oobsize; i++)
		p[i] = flash_reg8_read(sc, FLASH_REG_DATA);

	return 0;
}

int
flash_chip_write_block(struct flash_softc *sc, long blkno, caddr_t data,
    caddr_t oob)
{
	long pageno;
	long blkend;
	caddr_t p;
	int error;

	pageno = blkno * sc->sc_flashdev->blkpages;
	blkend = pageno + sc->sc_flashdev->blkpages;

	p = data;
	while (pageno < blkend) {
		error = flash_chip_write_page(sc, pageno, p, oob);
		if (error != 0)
			return error;
		p += sc->sc_flashdev->pagesize;
		pageno++;
	}

	/* Verify the newly written block. */
	return flash_chip_verify_block(sc, blkno, data, oob);
}

int
flash_chip_write_page(struct flash_softc *sc, long pageno, caddr_t data,
    caddr_t oob)
{
	int error;

	(void)flash_wait_ready(sc);

	/* Disable write-protection. */
	flash_reg8_write(sc, FLASH_REG_WP, 0);

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_PTRLO);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_SEQIN);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_COL, 0x00);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_ALE, 1);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno);
		flash_reg8_write(sc, FLASH_REG_ROW, pageno >> 8);
		flash_reg8_write(sc, FLASH_REG_ALE, 0);
		break;
	}

	/* Support hardware ECC calculation. */
	if (sc->sc_tag->regx_write_page) {
		error = sc->sc_tag->regx_write_page(sc->sc_cookie, data,
		    oob);
		if (error != 0)
			return error;
	} else
		flash_reg8_write_page(sc, data, oob);

	switch (sc->sc_flashdev->id) {
	case FLASH_DEVICE_SAMSUNG_K9F2808U0C:
	case FLASH_DEVICE_SAMSUNG_K9F1G08U0A:
		flash_reg8_write(sc, FLASH_REG_CLE, 1);
		flash_reg8_write(sc, FLASH_REG_CMD, SAMSUNG_CMD_WRITE);
		flash_reg8_write(sc, FLASH_REG_CLE, 0);
		break;
	}

	/*
	 * Wait for the write operation to complete although this can
	 * take up to 700 us for the K9F1G08U0A flash type.
	 */
	error = flash_wait_complete(sc);

	/* Re-enable write-protection. */
	flash_reg8_write(sc, FLASH_REG_WP, 1);

	return error;
}

int
flash_chip_verify_block(struct flash_softc *sc, long blkno, caddr_t data,
    caddr_t oob)
{
	long pageno;
	long blkend;
	int error;

	pageno = blkno * sc->sc_flashdev->blkpages;
	blkend = pageno + sc->sc_flashdev->blkpages;

	while (pageno < blkend) {
		error = flash_chip_verify_page(sc, pageno, data, oob);
		if (error != 0) {
			printf("block %ld page %ld verify failed\n",
			    blkno, pageno);
			return error;
		}
		data += sc->sc_flashdev->pagesize;
		pageno++;
	}
	return 0;
}

int
flash_chip_verify_page(struct flash_softc *sc, long pageno, caddr_t data,
    caddr_t oob)
{
	static u_char rbuf[FLASH_MAXPAGESIZE];
	static u_char roob[FLASH_MAXOOBSIZE];
	int error;

	error = flash_chip_read_page(sc, pageno, rbuf,
	    oob == NULL ? NULL : roob);
	if (error != 0)
		return error;

	if (memcmp((const void *)&rbuf[0], (const void *)data,
	    sc->sc_flashdev->pagesize) != 0)
		return EIO;

	if (oob != NULL && memcmp((const void *)&roob[0],
	    (const void *)oob, sc->sc_flashdev->oobsize) != 0)
		return EIO;

	return 0;
}

/*
 * Block device functions
 */

int
flashopen(dev_t dev, int oflags, int devtype, struct proc *p)
{
	struct flash_softc *sc;
	int error;
	int part;

	sc = flashlookup(flashunit(dev));
	if (sc == NULL)
		return ENXIO;

	if ((error = disk_lock(&sc->sc_dk)) != 0) {
		device_unref(&sc->sc_dev);
		return error;
	}

	/*
	 * If no partition is open load the partition info if it is
	 * not already valid.  If partitions are already open, allow
	 * opens only for the same kind of device.
	 */
	if (sc->sc_dk.dk_openmask == 0) {
		if ((sc->sc_flags & FDK_LOADED) == 0 ||
		    ((sc->sc_flags & FDK_SAFE) == 0) !=
		    (flashsafe(dev) == 0)) {
			sc->sc_flags &= ~FDK_SAFE;
			sc->sc_flags |= FDK_LOADED;
			if (flashsafe(dev))
				sc->sc_flags |= FDK_SAFE;
			if ((error = flashgetdisklabel(dev, sc,
			    sc->sc_dk.dk_label, 0)) != 0) {
				disk_unlock(&sc->sc_dk);
				device_unref(&sc->sc_dev);
				return error;
			}
		}
	} else if (((sc->sc_flags & FDK_SAFE) == 0) !=
	    (flashsafe(dev) == 0)) {
		disk_unlock(&sc->sc_dk);
		device_unref(&sc->sc_dev);
		return EBUSY;
	}

	/* Check that the partition exists. */
	part = flashpart(dev);
	if (part != RAW_PART &&
	    (part >= sc->sc_dk.dk_label->d_npartitions ||
	    sc->sc_dk.dk_label->d_partitions[part].p_fstype == FS_UNUSED)) {
		disk_unlock(&sc->sc_dk);
		device_unref(&sc->sc_dev);
		return ENXIO;
	}

	/* Prevent our unit from being deconfigured while open. */
	switch (devtype) {
	case S_IFCHR:
		sc->sc_dk.dk_copenmask |= (1 << part);
		break;
	case S_IFBLK:
		sc->sc_dk.dk_bopenmask |= (1 << part);
		break;
	}
	sc->sc_dk.dk_openmask =
	    sc->sc_dk.dk_copenmask | sc->sc_dk.dk_bopenmask;

	disk_unlock(&sc->sc_dk);
	device_unref(&sc->sc_dev);
	return 0;
}

int
flashclose(dev_t dev, int fflag, int devtype, struct proc *p)
{
	struct flash_softc *sc;
	int part;

	sc = flashlookup(flashunit(dev));
	if (sc == NULL)
		return ENXIO;

	disk_lock_nointr(&sc->sc_dk);

	/* Close one open partition. */
	part = flashpart(dev);
	switch (devtype) {
	case S_IFCHR:
		sc->sc_dk.dk_copenmask &= ~(1 << part);
		break;
	case S_IFBLK:
		sc->sc_dk.dk_bopenmask &= ~(1 << part);
		break;
	}
	sc->sc_dk.dk_openmask =
	    sc->sc_dk.dk_copenmask | sc->sc_dk.dk_bopenmask;

	if (sc->sc_dk.dk_openmask == 0) {
		/* XXX wait for I/O to complete? */
	}

	disk_unlock(&sc->sc_dk);
	device_unref(&sc->sc_dev);
	return 0;
}

/*
 * Queue the transfer of one or more flash pages.
 */
void
flashstrategy(struct buf *bp)
{
	struct flash_softc *sc;
	int s;

	sc = flashlookup(flashunit(bp->b_dev));
	if (sc == NULL) {
		bp->b_error = ENXIO;
		goto bad;
	}

	/* If the device has been invalidated, error out. */
	if ((sc->sc_flags & FDK_LOADED) == 0) {
		bp->b_error = EIO;
		goto bad;
	}

	/* Translate logical block numbers to physical. */
	if (flashsafe(bp->b_dev) && flashsafestrategy(sc, bp) <= 0) {
		if (bp->b_flags & B_ERROR)
			bp->b_resid = bp->b_bcount;
		goto done;
	}

	/* Validate the request. */
	if (bounds_check_with_label(bp, sc->sc_dk.dk_label) == -1)
		goto done;

	/* Queue the transfer. */
	bufq_queue(&sc->sc_bufq, bp);

	s = splbio();
	flashstart(sc);
	splx(s);

	device_unref(&sc->sc_dev);
	return;

 bad:
	bp->b_flags |= B_ERROR;
	bp->b_resid = bp->b_bcount;
 done:
	s = splbio();
	biodone(bp);
	splx(s);
	if (sc != NULL)
		device_unref(&sc->sc_dev);
}

int
flashioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
{
	struct flash_softc *sc;
	int error = 0;

	sc = flashlookup(flashunit(dev));
	if (sc == NULL)
		return ENXIO;

	if ((sc->sc_flags & FDK_LOADED) == 0) {
		device_unref(&sc->sc_dev);
		return EIO;
	}

	switch (cmd) {
	case DIOCGPDINFO:
		flashgetdisklabel(dev, sc, (struct disklabel *)data, 1);
		break;

	case DIOCGDINFO:
		*(struct disklabel *)data = *sc->sc_dk.dk_label;
		break;

	default:
		error = ENOTTY;
		break;
	}

	device_unref(&sc->sc_dev);
	return error;
}

int
flashdump(dev_t dev, daddr_t blkno, caddr_t va, size_t size)
{
	printf("flashdump\n");
	return ENODEV;
}

daddr_t
flashsize(dev_t dev)
{
	printf("flashsize\n");
	return ENODEV;
}

void
flashstart(struct flash_softc *sc)
{
	struct buf *bp;

	while ((bp = bufq_dequeue(&sc->sc_bufq)) != NULL) {
		/* Transfer this buffer now. */
		_flashstart(sc, bp);
	}
}

void
_flashstart(struct flash_softc *sc, struct buf *bp)
{
	struct disklabel *lp;
	int part;
	daddr_t offset;
	long pgno;

	part = flashpart(bp->b_dev);

	lp = sc->sc_dk.dk_label;
	offset = DL_SECTOBLK(lp, DL_GETPOFFSET(&lp->d_partitions[part])) +
	    bp->b_blkno;
	pgno = offset / (sc->sc_flashdev->pagesize / DEV_BSIZE);

	/*
	 * If the requested page is exactly at the end of flash and it
	 * is an "unsafe" device, return EOF, else error out.
	 */
	if (!flashsafe(bp->b_dev) && pgno == sc->sc_flashdev->capacity) {
		bp->b_resid = bp->b_bcount;
		biodone(bp);
		return;
	} else if (pgno >= sc->sc_flashdev->capacity) {
		bp->b_error = EINVAL;
		bp->b_flags |= B_ERROR;
		biodone(bp);
		return;
	}

	sc->sc_bp = bp;

	/* Instrumentation. */
	disk_busy(&sc->sc_dk);

	/* XXX this should be done asynchronously. */
	flash_chip_enable(sc);
	if ((bp->b_flags & B_READ) != 0)
		bp->b_error = flash_chip_read_page(sc, pgno, bp->b_data,
		    NULL);
	else
		bp->b_error = flash_chip_write_page(sc, pgno, bp->b_data,
		    NULL);
	if (bp->b_error == 0)
		bp->b_resid = bp->b_bcount - sc->sc_flashdev->pagesize;
	flash_chip_disable(sc);
	flashdone(sc);
}

void
flashdone(void *v)
{
	struct flash_softc *sc = v;
	struct buf *bp = sc->sc_bp;

	/* Instrumentation. */
	disk_unbusy(&sc->sc_dk, bp->b_bcount - bp->b_resid,
	    (bp->b_flags & B_READ) != 0);

	if (bp->b_error != 0)
		bp->b_flags |= B_ERROR;

	biodone(bp);
	flashstart(sc);
}

void
flashgetdefaultlabel(dev_t dev, struct flash_softc *sc,
    struct disklabel *lp)
{
	size_t len;

	bzero(lp, sizeof(struct disklabel));

	lp->d_type = 0;
	lp->d_subtype = 0;
	strncpy(lp->d_typename, "NAND flash", sizeof(lp->d_typename));

	/* Use the product name up to the first space. */
	strncpy(lp->d_packname, sc->sc_flashdev->longname,
	    sizeof(lp->d_packname));
	for (len = 0; len < sizeof(lp->d_packname); len++)
		if (lp->d_packname[len] == ' ') {
			lp->d_packname[len] = '\0';
			break;
		}

	/* Fake the disk geometry. */
	lp->d_ncylinders = 1;
	lp->d_ntracks = 16;
	lp->d_secsize = sc->sc_flashdev->pagesize;
	lp->d_nsectors = sc->sc_flashdev->capacity / lp->d_ntracks
	    / lp->d_ncylinders;
	lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
	DL_SETDSIZE(lp, (u_int64_t)lp->d_ncylinders * lp->d_secpercyl);

	lp->d_version = 1;

	/* XXX these values assume ffs. */
	lp->d_bbsize = BBSIZE;
	lp->d_sbsize = SBSIZE;

	/* Wrap it up. */
	lp->d_magic = DISKMAGIC;
	lp->d_magic2 = DISKMAGIC;
	lp->d_checksum = dkcksum(lp);
}

int
flashgetdisklabel(dev_t dev, struct flash_softc *sc,
    struct disklabel *lp, int spoofonly)
{
	dev_t labeldev;

	flashgetdefaultlabel(dev, sc, lp);

	if (sc->sc_tag->default_disklabel != NULL)
		sc->sc_tag->default_disklabel(sc->sc_cookie, dev, lp);

	/* Call the generic disklabel extraction routine. */
	labeldev = flashlabeldev(dev);
	return readdisklabel(labeldev, flashstrategy, lp, spoofonly);
}

/*
 * Character device functions
 */

void
flashminphys(struct buf *bp)
{
	struct flash_softc *sc;

	sc = flashlookup(flashunit(bp->b_dev));

	if (bp->b_bcount > sc->sc_flashdev->pagesize)
		bp->b_bcount = sc->sc_flashdev->pagesize;
}

int
flashread(dev_t dev, struct uio *uio, int ioflag)
{
	return physio(flashstrategy, dev, B_READ, flashminphys, uio);
}

int
flashwrite(dev_t dev, struct uio *uio, int ioflag)
{
	return physio(flashstrategy, dev, B_WRITE, flashminphys, uio);
}

/*
 * Physical access strategy "fixup" routines for transparent bad
 * blocks management, wear-leveling, etc.
 */

/*
 * Call the machine-specific routine if there is any or use just a
 * default strategy for bad blocks management.
 */
int
flashsafestrategy(struct flash_softc *sc, struct buf *bp)
{
	if (sc->sc_tag->safe_strategy) {
		return sc->sc_tag->safe_strategy(sc->sc_cookie, bp);
	}

	/* XXX no default bad blocks management strategy yet */
	return 1;
}

void dumppage(u_char *);
void dumppage(u_char *buf)
{
	int i;
	for (i = 0; i < 512; i++) {
		if ((i % 16) == 0)
			printf("%04x: ", i);
		if ((i % 16) == 8)
			printf(" ");
		printf(" %02x", buf[i]);
		if ((i % 16) == 15)
			printf("\n");
	}
	if ((i % 16) != 0)
		printf("\n");
}