cardbus_cis.h revision 107301
1139825Simp/* 2124469Sgrehan * Copyright (c) 2000,2001 Jonathan Chen. 3124469Sgrehan * All rights reserved. 4124469Sgrehan * 5124469Sgrehan * Redistribution and use in source and binary forms, with or without 6124469Sgrehan * modification, are permitted provided that the following conditions 7124469Sgrehan * are met: 8124469Sgrehan * 1. Redistributions of source code must retain the above copyright 9124469Sgrehan * notice, this list of conditions, and the following disclaimer, 10124469Sgrehan * without modification, immediately at the beginning of the file. 11124469Sgrehan * 2. Redistributions in binary form must reproduce the above copyright 12124469Sgrehan * notice, this list of conditions and the following disclaimer in 13124469Sgrehan * the documentation and/or other materials provided with the 14124469Sgrehan * distribution. 15124469Sgrehan * 16124469Sgrehan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17124469Sgrehan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18124469Sgrehan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19124469Sgrehan * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 20124469Sgrehan * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21124469Sgrehan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22124469Sgrehan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23124469Sgrehan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24124469Sgrehan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25124469Sgrehan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26124469Sgrehan * SUCH DAMAGE. 27124469Sgrehan * 28124469Sgrehan * $FreeBSD: head/sys/dev/cardbus/cardbus_cis.h 107301 2002-11-27 06:56:29Z imp $ 29124469Sgrehan */ 30124469Sgrehan 31124469Sgrehan/* 32124469Sgrehan * Cardbus CIS definitions 33124469Sgrehan */ 34124469Sgrehan 35124469Sgrehanstruct cis_tupleinfo; 36124469Sgrehan 37124469Sgrehanint cardbus_do_cis(device_t, device_t); 38131102Sgrehanint cardbus_cis_read(device_t, device_t, u_int8_t, struct cis_tupleinfo**, 39124469Sgrehan int*); 40124469Sgrehanvoid cardbus_cis_free(device_t, struct cis_tupleinfo*, int*); 41124469Sgrehan 42124469Sgrehan#define MAXTUPLESIZE 0x400 43124469Sgrehan 44124469Sgrehan/* CIS TUPLES */ 45124469Sgrehan 46124469Sgrehan#define CISTPL_NULL 0x00 47124469Sgrehan#define CISTPL_DEVICE 0x01 48124469Sgrehan#define CISTPL_LONG_LINK_CB 0x02 49124469Sgrehan#define CISTPL_INDIRECT 0x03 50124469Sgrehan#define CISTPL_CONFIG_CB 0x04 51124469Sgrehan#define CISTPL_CFTABLE_ENTRY_CB 0x05 52124469Sgrehan#define CISTPL_LONGLINK_MFC 0x06 53124469Sgrehan#define CISTPL_BAR 0x07 54124469Sgrehan#define CISTPL_PWR_MGMNT 0x08 55124469Sgrehan#define CISTPL_EXTDEVICE 0x09 56124469Sgrehan#define CISTPL_CHECKSUM 0x10 57124469Sgrehan#define CISTPL_LONGLINK_A 0x11 58124469Sgrehan#define CISTPL_LONGLINK_C 0x12 59124469Sgrehan#define CISTPL_LINKTARGET 0x13 60124469Sgrehan#define CISTPL_NO_LINK 0x14 61124469Sgrehan#define CISTPL_VERS_1 0x15 62124469Sgrehan#define CISTPL_ALTSTR 0x16 63124469Sgrehan#define CISTPL_DEVICE_A 0x17 64124469Sgrehan#define CISTPL_JEDEC_C 0x18 65124469Sgrehan#define CISTPL_JEDEC_A 0x19 66124469Sgrehan#define CISTPL_CONFIG 0x1A 67124469Sgrehan#define CISTPL_CFTABLE_ENTRY 0x1B 68124469Sgrehan#define CISTPL_DEVICE_OC 0x1C 69124469Sgrehan#define CISTPL_DEVICE_OA 0x1D 70124469Sgrehan#define CISTPL_DEVICE_GEO 0x1E 71124469Sgrehan#define CISTPL_DEVICE_GEO_A 0x1F 72124469Sgrehan#define CISTPL_MANFID 0x20 73124469Sgrehan#define CISTPL_FUNCID 0x21 74124469Sgrehan#define CISTPL_FUNCE 0x22 75124469Sgrehan#define CISTPL_SWIL 0x23 76124469Sgrehan#define CISTPL_VERS_2 0x40 77124469Sgrehan#define CISTPL_FORMAT 0x41 78124469Sgrehan#define CISTPL_GEOMETRY 0x42 79124469Sgrehan#define CISTPL_BYTEORDER 0x43 80124469Sgrehan#define CISTPL_DATE 0x44 81124469Sgrehan#define CISTPL_BATTERY 0x45 82124469Sgrehan#define CISTPL_ORG 0x46 83124469Sgrehan#define CISTPL_CUSTOMSTART 0x80 84124469Sgrehan#define CISTPL_END 0xFF 85124469Sgrehan 86124469Sgrehan#define CISTPL_GENERIC -1 /* catchall */ 87124469Sgrehan 88124469Sgrehan/* BAR */ 89124469Sgrehan#define TPL_BAR_REG_ASI_MASK 0x07 90124469Sgrehan#define TPL_BAR_REG_AS 0x10 91124469Sgrehan#define TPL_BAR_REG_PREFETCHABLE_ONLY 0x20 92124469Sgrehan#define TPL_BAR_REG_PREFETCHABLE_CACHEABLE 0x40 93124469Sgrehan#define TPL_BAR_REG_PREFETCHABLE 0x60 94124469Sgrehan#define TPL_BAR_REG_BELOW1MB 0x80 95124469Sgrehan 96124469Sgrehan/* CISTPL_FUNC */ 97124469Sgrehan#define TPL_FUNC_MF 0 /* multi function tuple */ 98124469Sgrehan#define TPL_FUNC_MEM 1 /* memory */ 99124469Sgrehan#define TPL_FUNC_SERIAL 2 /* serial, including modem and fax */ 100124469Sgrehan#define TPL_FUNC_PARALLEL 3 /* parallel, including printer and SCSI */ 101124469Sgrehan#define TPL_FUNC_DISK 4 /* Disk */ 102124469Sgrehan#define TPL_FUNC_VIDEO 5 /* Video Adaptor */ 103124469Sgrehan#define TPL_FUNC_LAN 6 /* LAN Adaptor */ 104124469Sgrehan#define TPL_FUNC_AIMS 7 /* Auto Inclement Mass Strages */ 105124469Sgrehan 106124469Sgrehan/* TPL_FUNC_LAN */ 107124469Sgrehan#define TPL_FUNCE_LAN_TECH 1 /* technology */ 108124469Sgrehan#define TPL_FUNCE_LAN_SPEED 2 /* speed */ 109124469Sgrehan#define TPL_FUNCE_LAN_MEDIA 3 /* which media do you use? */ 110124469Sgrehan#define TPL_FUNCE_LAN_NID 4 /* node id (address) */ 111124469Sgrehan#define TPL_FUNCE_LAN_CONN 5 /* connector type (shape) */ 112124469Sgrehan 113124469Sgrehan/* TPL_FUNC_SERIAL */ 114124469Sgrehan#define TPL_FUNCE_SER_UART 0 /* UART type */ 115124469Sgrehan