klaptopdaemon
cistpl.h
Go to the documentation of this file.00001 /* 00002 * cistpl.h 1.27 1998/09/30 18:08:46 00003 * 00004 * The contents of this file are subject to the Mozilla Public License 00005 * Version 1.0 (the "License"); you may not use this file except in 00006 * compliance with the License. You may obtain a copy of the License 00007 * at http://www.mozilla.org/MPL/ 00008 * 00009 * Software distributed under the License is distributed on an "AS IS" 00010 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00011 * the License for the specific language governing rights and 00012 * limitations under the License. 00013 * 00014 * The initial developer of the original code is David A. Hinds 00015 * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds 00016 * are Copyright (C) 1998 David A. Hinds. All Rights Reserved. 00017 */ 00018 00019 #ifndef _LINUX_CISTPL_H 00020 #define _LINUX_CISTPL_H 00021 00022 #define CISTPL_NULL 0x00 00023 #define CISTPL_DEVICE 0x01 00024 #define CISTPL_LONGLINK_CB 0x02 00025 #define CISTPL_CONFIG_CB 0x04 00026 #define CISTPL_CFTABLE_ENTRY_CB 0x05 00027 #define CISTPL_LONGLINK_MFC 0x06 00028 #define CISTPL_BAR 0x07 00029 #define CISTPL_CHECKSUM 0x10 00030 #define CISTPL_LONGLINK_A 0x11 00031 #define CISTPL_LONGLINK_C 0x12 00032 #define CISTPL_LINKTARGET 0x13 00033 #define CISTPL_NO_LINK 0x14 00034 #define CISTPL_VERS_1 0x15 00035 #define CISTPL_ALTSTR 0x16 00036 #define CISTPL_DEVICE_A 0x17 00037 #define CISTPL_JEDEC_C 0x18 00038 #define CISTPL_JEDEC_A 0x19 00039 #define CISTPL_CONFIG 0x1a 00040 #define CISTPL_CFTABLE_ENTRY 0x1b 00041 #define CISTPL_DEVICE_OC 0x1c 00042 #define CISTPL_DEVICE_OA 0x1d 00043 #define CISTPL_DEVICE_GEO 0x1e 00044 #define CISTPL_DEVICE_GEO_A 0x1f 00045 #define CISTPL_MANFID 0x20 00046 #define CISTPL_FUNCID 0x21 00047 #define CISTPL_FUNCE 0x22 00048 #define CISTPL_SWIL 0x23 00049 #define CISTPL_END 0xff 00050 /* Layer 2 tuples */ 00051 #define CISTPL_VERS_2 0x40 00052 #define CISTPL_FORMAT 0x41 00053 #define CISTPL_GEOMETRY 0x42 00054 #define CISTPL_BYTEORDER 0x43 00055 #define CISTPL_DATE 0x44 00056 #define CISTPL_BATTERY 0x45 00057 /* Layer 3 tuples */ 00058 #define CISTPL_ORG 0x46 00059 00060 typedef struct cistpl_longlink_t { 00061 u_int addr; 00062 } cistpl_longlink_t; 00063 00064 typedef struct cistpl_checksum_t { 00065 u_short addr; 00066 u_short len; 00067 u_char sum; 00068 } cistpl_checksum_t; 00069 00070 #define CISTPL_MAX_FUNCTIONS 8 00071 #define CISTPL_MFC_ATTR 0x00 00072 #define CISTPL_MFC_COMMON 0x01 00073 00074 typedef struct cistpl_longlink_mfc_t { 00075 u_char nfn; 00076 struct { 00077 u_char space; 00078 u_int addr; 00079 } fn[CISTPL_MAX_FUNCTIONS]; 00080 } cistpl_longlink_mfc_t; 00081 00082 #define CISTPL_MAX_ALTSTR_STRINGS 4 00083 00084 typedef struct cistpl_altstr_t { 00085 u_char ns; 00086 u_char ofs[CISTPL_MAX_ALTSTR_STRINGS]; 00087 char str[254]; 00088 } cistpl_altstr_t; 00089 00090 #define CISTPL_DTYPE_NULL 0x00 00091 #define CISTPL_DTYPE_ROM 0x01 00092 #define CISTPL_DTYPE_OTPROM 0x02 00093 #define CISTPL_DTYPE_EPROM 0x03 00094 #define CISTPL_DTYPE_EEPROM 0x04 00095 #define CISTPL_DTYPE_FLASH 0x05 00096 #define CISTPL_DTYPE_SRAM 0x06 00097 #define CISTPL_DTYPE_DRAM 0x07 00098 #define CISTPL_DTYPE_FUNCSPEC 0x0d 00099 #define CISTPL_DTYPE_EXTEND 0x0e 00100 00101 #define CISTPL_MAX_DEVICES 4 00102 00103 typedef struct cistpl_device_t { 00104 u_char ndev; 00105 struct { 00106 u_char type; 00107 u_char wp; 00108 u_int speed; 00109 u_int size; 00110 } dev[CISTPL_MAX_DEVICES]; 00111 } cistpl_device_t; 00112 00113 #define CISTPL_DEVICE_MWAIT 0x01 00114 #define CISTPL_DEVICE_3VCC 0x02 00115 00116 typedef struct cistpl_device_o_t { 00117 u_char flags; 00118 cistpl_device_t device; 00119 } cistpl_device_o_t; 00120 00121 #define CISTPL_VERS_1_MAX_PROD_STRINGS 4 00122 00123 typedef struct cistpl_vers_1_t { 00124 u_char major; 00125 u_char minor; 00126 u_char ns; 00127 u_char ofs[CISTPL_VERS_1_MAX_PROD_STRINGS]; 00128 char str[254]; 00129 } cistpl_vers_1_t; 00130 00131 typedef struct cistpl_jedec_t { 00132 u_char nid; 00133 struct { 00134 u_char mfr; 00135 u_char info; 00136 } id[CISTPL_MAX_DEVICES]; 00137 } cistpl_jedec_t; 00138 00139 typedef struct cistpl_manfid_t { 00140 u_short manf; 00141 u_short card; 00142 } cistpl_manfid_t; 00143 00144 #define CISTPL_FUNCID_MULTI 0x00 00145 #define CISTPL_FUNCID_MEMORY 0x01 00146 #define CISTPL_FUNCID_SERIAL 0x02 00147 #define CISTPL_FUNCID_PARALLEL 0x03 00148 #define CISTPL_FUNCID_FIXED 0x04 00149 #define CISTPL_FUNCID_VIDEO 0x05 00150 #define CISTPL_FUNCID_NETWORK 0x06 00151 #define CISTPL_FUNCID_AIMS 0x07 00152 #define CISTPL_FUNCID_SCSI 0x08 00153 00154 #define CISTPL_SYSINIT_POST 0x01 00155 #define CISTPL_SYSINIT_ROM 0x02 00156 00157 typedef struct cistpl_funcid_t { 00158 u_char func; 00159 u_char sysinit; 00160 } cistpl_funcid_t; 00161 00162 typedef struct cistpl_funce_t { 00163 u_char type; 00164 u_char data[1]; 00165 } cistpl_funce_t; 00166 00167 /*====================================================================== 00168 00169 Modem Function Extension Tuples 00170 00171 ======================================================================*/ 00172 00173 #define CISTPL_FUNCE_SERIAL 0x00 00174 #define CISTPL_FUNCE_SERIAL_DATA 0x08 00175 #define CISTPL_FUNCE_SERIAL_FAX 0x09 00176 #define CISTPL_FUNCE_SERIAL_VOICE 0x0a 00177 #define CISTPL_FUNCE_CAP 0x01 00178 #define CISTPL_FUNCE_CAP_DATA 0x05 00179 #define CISTPL_FUNCE_CAP_FAX 0x06 00180 #define CISTPL_FUNCE_CAP_VOICE 0x07 00181 #define CISTPL_FUNCE_SERV_DATA 0x02 00182 #define CISTPL_FUNCE_SERV_FAX_1 0x13 00183 #define CISTPL_FUNCE_SERV_FAX_2 0x23 00184 #define CISTPL_FUNCE_SERV_FAX_3 0x33 00185 #define CISTPL_FUNCE_SERV_VOICE 0x84 00186 00187 /* UART identification */ 00188 #define CISTPL_SERIAL_UART_8250 0x00 00189 #define CISTPL_SERIAL_UART_16450 0x01 00190 #define CISTPL_SERIAL_UART_16550 0x02 00191 00192 /* UART capabilities */ 00193 #define CISTPL_SERIAL_UART_SPACE 0x01 00194 #define CISTPL_SERIAL_UART_MARK 0x02 00195 #define CISTPL_SERIAL_UART_ODD 0x04 00196 #define CISTPL_SERIAL_UART_EVEN 0x08 00197 #define CISTPL_SERIAL_UART_5BIT 0x01 00198 #define CISTPL_SERIAL_UART_6BIT 0x02 00199 #define CISTPL_SERIAL_UART_7BIT 0x04 00200 #define CISTPL_SERIAL_UART_8BIT 0x08 00201 #define CISTPL_SERIAL_UART_1STOP 0x10 00202 #define CISTPL_SERIAL_UART_MSTOP 0x20 00203 #define CISTPL_SERIAL_UART_2STOP 0x40 00204 00205 typedef struct cistpl_serial_t { 00206 u_char uart_type; 00207 u_char uart_cap_0; 00208 u_char uart_cap_1; 00209 } cistpl_serial_t; 00210 00211 typedef struct cistpl_modem_cap_t { 00212 u_char flow; 00213 u_char cmd_buf; 00214 u_int rcv_buf:24; 00215 u_int xmit_buf:24; 00216 } cistpl_modem_cap_t; 00217 00218 typedef struct cistpl_data_serv_t { 00219 u_char max_data_0; 00220 u_char max_data_1; 00221 u_char modulation_0; 00222 u_char modulation_1; 00223 u_char error_control; 00224 u_char compression; 00225 u_char cmd_protocol; 00226 u_char escape; 00227 u_char encrypt; 00228 u_char misc_features; 00229 u_char ccitt_code[1]; 00230 } cistpl_data_serv_t; 00231 00232 typedef struct cistpl_fax_serv_t { 00233 u_char max_data_0; 00234 u_char max_data_1; 00235 u_char modulation; 00236 u_char encrypt; 00237 u_char features_0; 00238 u_char features_1; 00239 u_char ccitt_code[1]; 00240 } cistpl_fax_serv_t; 00241 00242 typedef struct cistpl_voice_serv_t { 00243 u_char max_data_0; 00244 u_char max_data_1; 00245 } cistpl_voice_serv_t; 00246 00247 /*====================================================================== 00248 00249 LAN Function Extension Tuples 00250 00251 ======================================================================*/ 00252 00253 #define CISTPL_FUNCE_LAN_TECH 0x01 00254 #define CISTPL_FUNCE_LAN_SPEED 0x02 00255 #define CISTPL_FUNCE_LAN_MEDIA 0x03 00256 #define CISTPL_FUNCE_LAN_NODE_ID 0x04 00257 #define CISTPL_FUNCE_LAN_CONNECTOR 0x05 00258 00259 /* LAN technologies */ 00260 #define CISTPL_LAN_TECH_ARCNET 0x01 00261 #define CISTPL_LAN_TECH_ETHERNET 0x02 00262 #define CISTPL_LAN_TECH_TOKENRING 0x03 00263 #define CISTPL_LAN_TECH_LOCALTALK 0x04 00264 #define CISTPL_LAN_TECH_FDDI 0x05 00265 #define CISTPL_LAN_TECH_ATM 0x06 00266 #define CISTPL_LAN_TECH_WIRELESS 0x07 00267 00268 typedef struct cistpl_lan_tech_t { 00269 u_char tech; 00270 } cistpl_lan_tech_t; 00271 00272 typedef struct cistpl_lan_speed_t { 00273 u_int speed; 00274 } cistpl_lan_speed_t; 00275 00276 /* LAN media definitions */ 00277 #define CISTPL_LAN_MEDIA_UTP 0x01 00278 #define CISTPL_LAN_MEDIA_STP 0x02 00279 #define CISTPL_LAN_MEDIA_THIN_COAX 0x03 00280 #define CISTPL_LAN_MEDIA_THICK_COAX 0x04 00281 #define CISTPL_LAN_MEDIA_FIBER 0x05 00282 #define CISTPL_LAN_MEDIA_900MHZ 0x06 00283 #define CISTPL_LAN_MEDIA_2GHZ 0x07 00284 #define CISTPL_LAN_MEDIA_5GHZ 0x08 00285 #define CISTPL_LAN_MEDIA_DIFF_IR 0x09 00286 #define CISTPL_LAN_MEDIA_PTP_IR 0x0a 00287 00288 typedef struct cistpl_lan_media_t { 00289 u_char media; 00290 } cistpl_lan_media_t; 00291 00292 typedef struct cistpl_lan_node_id_t { 00293 u_char nb; 00294 u_char id[16]; 00295 } cistpl_lan_node_id_t; 00296 00297 typedef struct cistpl_lan_connector_t { 00298 u_char code; 00299 } cistpl_lan_connector_t; 00300 00301 /*====================================================================== 00302 00303 IDE Function Extension Tuples 00304 00305 ======================================================================*/ 00306 00307 #define CISTPL_IDE_INTERFACE 0x01 00308 00309 typedef struct cistpl_ide_interface_t { 00310 u_char interface; 00311 } cistpl_ide_interface_t; 00312 00313 /* First feature byte */ 00314 #define CISTPL_IDE_SILICON 0x04 00315 #define CISTPL_IDE_UNIQUE 0x08 00316 #define CISTPL_IDE_DUAL 0x10 00317 00318 /* Second feature byte */ 00319 #define CISTPL_IDE_HAS_SLEEP 0x01 00320 #define CISTPL_IDE_HAS_STANDBY 0x02 00321 #define CISTPL_IDE_HAS_IDLE 0x04 00322 #define CISTPL_IDE_LOW_POWER 0x08 00323 #define CISTPL_IDE_REG_INHIBIT 0x10 00324 #define CISTPL_IDE_HAS_INDEX 0x20 00325 #define CISTPL_IDE_IOIS16 0x40 00326 00327 typedef struct cistpl_ide_feature_t { 00328 u_char feature1; 00329 u_char feature2; 00330 } cistpl_ide_feature_t; 00331 00332 #define CISTPL_FUNCE_IDE_IFACE 0x01 00333 #define CISTPL_FUNCE_IDE_MASTER 0x02 00334 #define CISTPL_FUNCE_IDE_SLAVE 0x03 00335 00336 /*====================================================================== 00337 00338 Configuration Table Entries 00339 00340 ======================================================================*/ 00341 00342 #define CISTPL_BAR_SPACE 0x07 00343 #define CISTPL_BAR_SPACE_IO 0x10 00344 #define CISTPL_BAR_PREFETCH 0x20 00345 #define CISTPL_BAR_CACHEABLE 0x40 00346 #define CISTPL_BAR_1MEG_MAP 0x80 00347 00348 typedef struct cistpl_bar_t { 00349 u_char attr; 00350 u_int size; 00351 } cistpl_bar_t; 00352 00353 typedef struct cistpl_config_t { 00354 u_char last_idx; 00355 u_int base; 00356 u_int rmask[4]; 00357 u_char subtuples; 00358 } cistpl_config_t; 00359 00360 /* These are bits in the 'present' field, and indices in 'param' */ 00361 #define CISTPL_POWER_VNOM 0 00362 #define CISTPL_POWER_VMIN 1 00363 #define CISTPL_POWER_VMAX 2 00364 #define CISTPL_POWER_ISTATIC 3 00365 #define CISTPL_POWER_IAVG 4 00366 #define CISTPL_POWER_IPEAK 5 00367 #define CISTPL_POWER_IDOWN 6 00368 00369 #define CISTPL_POWER_HIGHZ_OK 0x01 00370 #define CISTPL_POWER_HIGHZ_REQ 0x02 00371 00372 typedef struct cistpl_power_t { 00373 u_char present; 00374 u_char flags; 00375 u_int param[7]; 00376 } cistpl_power_t; 00377 00378 typedef struct cistpl_timing_t { 00379 u_int wait, waitscale; 00380 u_int ready, rdyscale; 00381 u_int reserved, rsvscale; 00382 } cistpl_timing_t; 00383 00384 #define CISTPL_IO_LINES_MASK 0x1f 00385 #define CISTPL_IO_8BIT 0x20 00386 #define CISTPL_IO_16BIT 0x40 00387 #define CISTPL_IO_RANGE 0x80 00388 00389 #define CISTPL_IO_MAX_WIN 16 00390 00391 typedef struct cistpl_io_t { 00392 u_char flags; 00393 u_char nwin; 00394 struct { 00395 u_int base; 00396 u_int len; 00397 } win[CISTPL_IO_MAX_WIN]; 00398 } cistpl_io_t; 00399 00400 typedef struct cistpl_irq_t { 00401 u_int IRQInfo1; 00402 u_int IRQInfo2; 00403 } cistpl_irq_t; 00404 00405 #define CISTPL_MEM_MAX_WIN 8 00406 00407 typedef struct cistpl_mem_t { 00408 u_char flags; 00409 u_char nwin; 00410 struct { 00411 u_int len; 00412 u_int card_addr; 00413 u_int host_addr; 00414 } win[CISTPL_MEM_MAX_WIN]; 00415 } cistpl_mem_t; 00416 00417 #define CISTPL_CFTABLE_DEFAULT 0x0001 00418 #define CISTPL_CFTABLE_BVDS 0x0002 00419 #define CISTPL_CFTABLE_WP 0x0004 00420 #define CISTPL_CFTABLE_RDYBSY 0x0008 00421 #define CISTPL_CFTABLE_MWAIT 0x0010 00422 #define CISTPL_CFTABLE_AUDIO 0x0800 00423 #define CISTPL_CFTABLE_READONLY 0x1000 00424 #define CISTPL_CFTABLE_PWRDOWN 0x2000 00425 00426 typedef struct cistpl_cftable_entry_t { 00427 u_char index; 00428 u_short flags; 00429 u_char interface; 00430 cistpl_power_t vcc, vpp1, vpp2; 00431 cistpl_timing_t timing; 00432 cistpl_io_t io; 00433 cistpl_irq_t irq; 00434 cistpl_mem_t mem; 00435 u_char subtuples; 00436 } cistpl_cftable_entry_t; 00437 00438 #define CISTPL_CFTABLE_MASTER 0x000100 00439 #define CISTPL_CFTABLE_INVALIDATE 0x000200 00440 #define CISTPL_CFTABLE_VGA_PALETTE 0x000400 00441 #define CISTPL_CFTABLE_PARITY 0x000800 00442 #define CISTPL_CFTABLE_WAIT 0x001000 00443 #define CISTPL_CFTABLE_SERR 0x002000 00444 #define CISTPL_CFTABLE_FAST_BACK 0x004000 00445 #define CISTPL_CFTABLE_BINARY_AUDIO 0x010000 00446 #define CISTPL_CFTABLE_PWM_AUDIO 0x020000 00447 00448 typedef struct cistpl_cftable_entry_cb_t { 00449 u_char index; 00450 u_int flags; 00451 cistpl_power_t vcc, vpp1, vpp2; 00452 u_char io; 00453 cistpl_irq_t irq; 00454 u_char mem; 00455 u_char subtuples; 00456 } cistpl_cftable_entry_cb_t; 00457 00458 typedef struct cistpl_device_geo_t { 00459 u_char ngeo; 00460 struct { 00461 u_char buswidth; 00462 u_int erase_block; 00463 u_int read_block; 00464 u_int write_block; 00465 u_int partition; 00466 u_int interleave; 00467 } geo[CISTPL_MAX_DEVICES]; 00468 } cistpl_device_geo_t; 00469 00470 typedef struct cistpl_vers_2_t { 00471 u_char vers; 00472 u_char comply; 00473 u_short dindex; 00474 u_char vspec8, vspec9; 00475 u_char nhdr; 00476 u_char vendor, info; 00477 char str[244]; 00478 } cistpl_vers_2_t; 00479 00480 typedef struct cistpl_org_t { 00481 u_char data_org; 00482 char desc[30]; 00483 } cistpl_org_t; 00484 00485 #define CISTPL_ORG_FS 0x00 00486 #define CISTPL_ORG_APPSPEC 0x01 00487 #define CISTPL_ORG_XIP 0x02 00488 00489 typedef union cisparse_t { 00490 cistpl_device_t device; 00491 cistpl_checksum_t checksum; 00492 cistpl_longlink_t longlink; 00493 cistpl_longlink_mfc_t longlink_mfc; 00494 cistpl_vers_1_t version_1; 00495 cistpl_altstr_t altstr; 00496 cistpl_jedec_t jedec; 00497 cistpl_manfid_t manfid; 00498 cistpl_funcid_t funcid; 00499 cistpl_funce_t funce; 00500 cistpl_bar_t bar; 00501 cistpl_config_t config; 00502 cistpl_cftable_entry_t cftable_entry; 00503 cistpl_cftable_entry_cb_t cftable_entry_cb; 00504 cistpl_device_geo_t device_geo; 00505 cistpl_vers_2_t vers_2; 00506 cistpl_org_t org; 00507 } cisparse_t; 00508 00509 typedef struct tuple_t { 00510 u_int Attributes; 00511 cisdata_t DesiredTuple; 00512 u_int Flags; /* internal use */ 00513 u_int LinkOffset; /* internal use */ 00514 u_int CISOffset; /* internal use */ 00515 cisdata_t TupleCode; 00516 cisdata_t TupleLink; 00517 cisdata_t TupleOffset; 00518 cisdata_t TupleDataMax; 00519 cisdata_t TupleDataLen; 00520 cisdata_t *TupleData; 00521 } tuple_t; 00522 00523 /* Special cisdata_t value */ 00524 #define RETURN_FIRST_TUPLE 0xff 00525 00526 /* Attributes for tuple calls */ 00527 #define TUPLE_RETURN_LINK 0x01 00528 #define TUPLE_RETURN_COMMON 0x02 00529 00530 /* For ValidateCIS */ 00531 typedef struct cisinfo_t { 00532 u_int Chains; 00533 } cisinfo_t; 00534 00535 #define CISTPL_MAX_CIS_SIZE 0x200 00536 00537 /* For ReplaceCIS */ 00538 typedef struct cisdump_t { 00539 u_int Length; 00540 cisdata_t Data[CISTPL_MAX_CIS_SIZE]; 00541 } cisdump_t; 00542 00543 #endif /* LINUX_CISTPL_H */
KDE 4.0 API Reference