cistpl.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * cistpl.h
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * The initial developer of the original code is David A. Hinds
  9. * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
  10. * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
  11. *
  12. * (C) 1999 David A. Hinds
  13. */
  14. #ifndef _LINUX_CISTPL_H
  15. #define _LINUX_CISTPL_H
  16. #define CISTPL_NULL 0x00
  17. #define CISTPL_DEVICE 0x01
  18. #define CISTPL_LONGLINK_CB 0x02
  19. #define CISTPL_INDIRECT 0x03
  20. #define CISTPL_CONFIG_CB 0x04
  21. #define CISTPL_CFTABLE_ENTRY_CB 0x05
  22. #define CISTPL_LONGLINK_MFC 0x06
  23. #define CISTPL_BAR 0x07
  24. #define CISTPL_PWR_MGMNT 0x08
  25. #define CISTPL_EXTDEVICE 0x09
  26. #define CISTPL_CHECKSUM 0x10
  27. #define CISTPL_LONGLINK_A 0x11
  28. #define CISTPL_LONGLINK_C 0x12
  29. #define CISTPL_LINKTARGET 0x13
  30. #define CISTPL_NO_LINK 0x14
  31. #define CISTPL_VERS_1 0x15
  32. #define CISTPL_ALTSTR 0x16
  33. #define CISTPL_DEVICE_A 0x17
  34. #define CISTPL_JEDEC_C 0x18
  35. #define CISTPL_JEDEC_A 0x19
  36. #define CISTPL_CONFIG 0x1a
  37. #define CISTPL_CFTABLE_ENTRY 0x1b
  38. #define CISTPL_DEVICE_OC 0x1c
  39. #define CISTPL_DEVICE_OA 0x1d
  40. #define CISTPL_DEVICE_GEO 0x1e
  41. #define CISTPL_DEVICE_GEO_A 0x1f
  42. #define CISTPL_MANFID 0x20
  43. #define CISTPL_FUNCID 0x21
  44. #define CISTPL_FUNCE 0x22
  45. #define CISTPL_SWIL 0x23
  46. #define CISTPL_END 0xff
  47. /* Layer 2 tuples */
  48. #define CISTPL_VERS_2 0x40
  49. #define CISTPL_FORMAT 0x41
  50. #define CISTPL_GEOMETRY 0x42
  51. #define CISTPL_BYTEORDER 0x43
  52. #define CISTPL_DATE 0x44
  53. #define CISTPL_BATTERY 0x45
  54. #define CISTPL_FORMAT_A 0x47
  55. /* Layer 3 tuples */
  56. #define CISTPL_ORG 0x46
  57. #define CISTPL_SPCL 0x90
  58. typedef struct cistpl_longlink_t {
  59. u_int addr;
  60. } cistpl_longlink_t;
  61. typedef struct cistpl_checksum_t {
  62. u_short addr;
  63. u_short len;
  64. u_char sum;
  65. } cistpl_checksum_t;
  66. #define CISTPL_MAX_FUNCTIONS 8
  67. #define CISTPL_MFC_ATTR 0x00
  68. #define CISTPL_MFC_COMMON 0x01
  69. typedef struct cistpl_longlink_mfc_t {
  70. u_char nfn;
  71. struct {
  72. u_char space;
  73. u_int addr;
  74. } fn[CISTPL_MAX_FUNCTIONS];
  75. } cistpl_longlink_mfc_t;
  76. #define CISTPL_MAX_ALTSTR_STRINGS 4
  77. typedef struct cistpl_altstr_t {
  78. u_char ns;
  79. u_char ofs[CISTPL_MAX_ALTSTR_STRINGS];
  80. char str[254];
  81. } cistpl_altstr_t;
  82. #define CISTPL_DTYPE_NULL 0x00
  83. #define CISTPL_DTYPE_ROM 0x01
  84. #define CISTPL_DTYPE_OTPROM 0x02
  85. #define CISTPL_DTYPE_EPROM 0x03
  86. #define CISTPL_DTYPE_EEPROM 0x04
  87. #define CISTPL_DTYPE_FLASH 0x05
  88. #define CISTPL_DTYPE_SRAM 0x06
  89. #define CISTPL_DTYPE_DRAM 0x07
  90. #define CISTPL_DTYPE_FUNCSPEC 0x0d
  91. #define CISTPL_DTYPE_EXTEND 0x0e
  92. #define CISTPL_MAX_DEVICES 4
  93. typedef struct cistpl_device_t {
  94. u_char ndev;
  95. struct {
  96. u_char type;
  97. u_char wp;
  98. u_int speed;
  99. u_int size;
  100. } dev[CISTPL_MAX_DEVICES];
  101. } cistpl_device_t;
  102. #define CISTPL_DEVICE_MWAIT 0x01
  103. #define CISTPL_DEVICE_3VCC 0x02
  104. typedef struct cistpl_device_o_t {
  105. u_char flags;
  106. cistpl_device_t device;
  107. } cistpl_device_o_t;
  108. #define CISTPL_VERS_1_MAX_PROD_STRINGS 4
  109. typedef struct cistpl_vers_1_t {
  110. u_char major;
  111. u_char minor;
  112. u_char ns;
  113. u_char ofs[CISTPL_VERS_1_MAX_PROD_STRINGS];
  114. char str[254];
  115. } cistpl_vers_1_t;
  116. typedef struct cistpl_jedec_t {
  117. u_char nid;
  118. struct {
  119. u_char mfr;
  120. u_char info;
  121. } id[CISTPL_MAX_DEVICES];
  122. } cistpl_jedec_t;
  123. typedef struct cistpl_manfid_t {
  124. u_short manf;
  125. u_short card;
  126. } cistpl_manfid_t;
  127. #define CISTPL_FUNCID_MULTI 0x00
  128. #define CISTPL_FUNCID_MEMORY 0x01
  129. #define CISTPL_FUNCID_SERIAL 0x02
  130. #define CISTPL_FUNCID_PARALLEL 0x03
  131. #define CISTPL_FUNCID_FIXED 0x04
  132. #define CISTPL_FUNCID_VIDEO 0x05
  133. #define CISTPL_FUNCID_NETWORK 0x06
  134. #define CISTPL_FUNCID_AIMS 0x07
  135. #define CISTPL_FUNCID_SCSI 0x08
  136. #define CISTPL_SYSINIT_POST 0x01
  137. #define CISTPL_SYSINIT_ROM 0x02
  138. typedef struct cistpl_funcid_t {
  139. u_char func;
  140. u_char sysinit;
  141. } cistpl_funcid_t;
  142. typedef struct cistpl_funce_t {
  143. u_char type;
  144. u_char data[0];
  145. } cistpl_funce_t;
  146. /*======================================================================
  147. Modem Function Extension Tuples
  148. ======================================================================*/
  149. #define CISTPL_FUNCE_SERIAL_IF 0x00
  150. #define CISTPL_FUNCE_SERIAL_CAP 0x01
  151. #define CISTPL_FUNCE_SERIAL_SERV_DATA 0x02
  152. #define CISTPL_FUNCE_SERIAL_SERV_FAX 0x03
  153. #define CISTPL_FUNCE_SERIAL_SERV_VOICE 0x04
  154. #define CISTPL_FUNCE_SERIAL_CAP_DATA 0x05
  155. #define CISTPL_FUNCE_SERIAL_CAP_FAX 0x06
  156. #define CISTPL_FUNCE_SERIAL_CAP_VOICE 0x07
  157. #define CISTPL_FUNCE_SERIAL_IF_DATA 0x08
  158. #define CISTPL_FUNCE_SERIAL_IF_FAX 0x09
  159. #define CISTPL_FUNCE_SERIAL_IF_VOICE 0x0a
  160. /* UART identification */
  161. #define CISTPL_SERIAL_UART_8250 0x00
  162. #define CISTPL_SERIAL_UART_16450 0x01
  163. #define CISTPL_SERIAL_UART_16550 0x02
  164. #define CISTPL_SERIAL_UART_8251 0x03
  165. #define CISTPL_SERIAL_UART_8530 0x04
  166. #define CISTPL_SERIAL_UART_85230 0x05
  167. /* UART capabilities */
  168. #define CISTPL_SERIAL_UART_SPACE 0x01
  169. #define CISTPL_SERIAL_UART_MARK 0x02
  170. #define CISTPL_SERIAL_UART_ODD 0x04
  171. #define CISTPL_SERIAL_UART_EVEN 0x08
  172. #define CISTPL_SERIAL_UART_5BIT 0x01
  173. #define CISTPL_SERIAL_UART_6BIT 0x02
  174. #define CISTPL_SERIAL_UART_7BIT 0x04
  175. #define CISTPL_SERIAL_UART_8BIT 0x08
  176. #define CISTPL_SERIAL_UART_1STOP 0x10
  177. #define CISTPL_SERIAL_UART_MSTOP 0x20
  178. #define CISTPL_SERIAL_UART_2STOP 0x40
  179. typedef struct cistpl_serial_t {
  180. u_char uart_type;
  181. u_char uart_cap_0;
  182. u_char uart_cap_1;
  183. } cistpl_serial_t;
  184. typedef struct cistpl_modem_cap_t {
  185. u_char flow;
  186. u_char cmd_buf;
  187. u_char rcv_buf_0, rcv_buf_1, rcv_buf_2;
  188. u_char xmit_buf_0, xmit_buf_1, xmit_buf_2;
  189. } cistpl_modem_cap_t;
  190. #define CISTPL_SERIAL_MOD_103 0x01
  191. #define CISTPL_SERIAL_MOD_V21 0x02
  192. #define CISTPL_SERIAL_MOD_V23 0x04
  193. #define CISTPL_SERIAL_MOD_V22 0x08
  194. #define CISTPL_SERIAL_MOD_212A 0x10
  195. #define CISTPL_SERIAL_MOD_V22BIS 0x20
  196. #define CISTPL_SERIAL_MOD_V26 0x40
  197. #define CISTPL_SERIAL_MOD_V26BIS 0x80
  198. #define CISTPL_SERIAL_MOD_V27BIS 0x01
  199. #define CISTPL_SERIAL_MOD_V29 0x02
  200. #define CISTPL_SERIAL_MOD_V32 0x04
  201. #define CISTPL_SERIAL_MOD_V32BIS 0x08
  202. #define CISTPL_SERIAL_MOD_V34 0x10
  203. #define CISTPL_SERIAL_ERR_MNP2_4 0x01
  204. #define CISTPL_SERIAL_ERR_V42_LAPM 0x02
  205. #define CISTPL_SERIAL_CMPR_V42BIS 0x01
  206. #define CISTPL_SERIAL_CMPR_MNP5 0x02
  207. #define CISTPL_SERIAL_CMD_AT1 0x01
  208. #define CISTPL_SERIAL_CMD_AT2 0x02
  209. #define CISTPL_SERIAL_CMD_AT3 0x04
  210. #define CISTPL_SERIAL_CMD_MNP_AT 0x08
  211. #define CISTPL_SERIAL_CMD_V25BIS 0x10
  212. #define CISTPL_SERIAL_CMD_V25A 0x20
  213. #define CISTPL_SERIAL_CMD_DMCL 0x40
  214. typedef struct cistpl_data_serv_t {
  215. u_char max_data_0;
  216. u_char max_data_1;
  217. u_char modulation_0;
  218. u_char modulation_1;
  219. u_char error_control;
  220. u_char compression;
  221. u_char cmd_protocol;
  222. u_char escape;
  223. u_char encrypt;
  224. u_char misc_features;
  225. u_char ccitt_code[0];
  226. } cistpl_data_serv_t;
  227. typedef struct cistpl_fax_serv_t {
  228. u_char max_data_0;
  229. u_char max_data_1;
  230. u_char modulation;
  231. u_char encrypt;
  232. u_char features_0;
  233. u_char features_1;
  234. u_char ccitt_code[0];
  235. } cistpl_fax_serv_t;
  236. typedef struct cistpl_voice_serv_t {
  237. u_char max_data_0;
  238. u_char max_data_1;
  239. } cistpl_voice_serv_t;
  240. /*======================================================================
  241. LAN Function Extension Tuples
  242. ======================================================================*/
  243. #define CISTPL_FUNCE_LAN_TECH 0x01
  244. #define CISTPL_FUNCE_LAN_SPEED 0x02
  245. #define CISTPL_FUNCE_LAN_MEDIA 0x03
  246. #define CISTPL_FUNCE_LAN_NODE_ID 0x04
  247. #define CISTPL_FUNCE_LAN_CONNECTOR 0x05
  248. /* LAN technologies */
  249. #define CISTPL_LAN_TECH_ARCNET 0x01
  250. #define CISTPL_LAN_TECH_ETHERNET 0x02
  251. #define CISTPL_LAN_TECH_TOKENRING 0x03
  252. #define CISTPL_LAN_TECH_LOCALTALK 0x04
  253. #define CISTPL_LAN_TECH_FDDI 0x05
  254. #define CISTPL_LAN_TECH_ATM 0x06
  255. #define CISTPL_LAN_TECH_WIRELESS 0x07
  256. typedef struct cistpl_lan_tech_t {
  257. u_char tech;
  258. } cistpl_lan_tech_t;
  259. typedef struct cistpl_lan_speed_t {
  260. u_int speed;
  261. } cistpl_lan_speed_t;
  262. /* LAN media definitions */
  263. #define CISTPL_LAN_MEDIA_UTP 0x01
  264. #define CISTPL_LAN_MEDIA_STP 0x02
  265. #define CISTPL_LAN_MEDIA_THIN_COAX 0x03
  266. #define CISTPL_LAN_MEDIA_THICK_COAX 0x04
  267. #define CISTPL_LAN_MEDIA_FIBER 0x05
  268. #define CISTPL_LAN_MEDIA_900MHZ 0x06
  269. #define CISTPL_LAN_MEDIA_2GHZ 0x07
  270. #define CISTPL_LAN_MEDIA_5GHZ 0x08
  271. #define CISTPL_LAN_MEDIA_DIFF_IR 0x09
  272. #define CISTPL_LAN_MEDIA_PTP_IR 0x0a
  273. typedef struct cistpl_lan_media_t {
  274. u_char media;
  275. } cistpl_lan_media_t;
  276. typedef struct cistpl_lan_node_id_t {
  277. u_char nb;
  278. u_char id[16];
  279. } cistpl_lan_node_id_t;
  280. typedef struct cistpl_lan_connector_t {
  281. u_char code;
  282. } cistpl_lan_connector_t;
  283. /*======================================================================
  284. IDE Function Extension Tuples
  285. ======================================================================*/
  286. #define CISTPL_IDE_INTERFACE 0x01
  287. typedef struct cistpl_ide_interface_t {
  288. u_char interface;
  289. } cistpl_ide_interface_t;
  290. /* First feature byte */
  291. #define CISTPL_IDE_SILICON 0x04
  292. #define CISTPL_IDE_UNIQUE 0x08
  293. #define CISTPL_IDE_DUAL 0x10
  294. /* Second feature byte */
  295. #define CISTPL_IDE_HAS_SLEEP 0x01
  296. #define CISTPL_IDE_HAS_STANDBY 0x02
  297. #define CISTPL_IDE_HAS_IDLE 0x04
  298. #define CISTPL_IDE_LOW_POWER 0x08
  299. #define CISTPL_IDE_REG_INHIBIT 0x10
  300. #define CISTPL_IDE_HAS_INDEX 0x20
  301. #define CISTPL_IDE_IOIS16 0x40
  302. typedef struct cistpl_ide_feature_t {
  303. u_char feature1;
  304. u_char feature2;
  305. } cistpl_ide_feature_t;
  306. #define CISTPL_FUNCE_IDE_IFACE 0x01
  307. #define CISTPL_FUNCE_IDE_MASTER 0x02
  308. #define CISTPL_FUNCE_IDE_SLAVE 0x03
  309. /*======================================================================
  310. Configuration Table Entries
  311. ======================================================================*/
  312. #define CISTPL_BAR_SPACE 0x07
  313. #define CISTPL_BAR_SPACE_IO 0x10
  314. #define CISTPL_BAR_PREFETCH 0x20
  315. #define CISTPL_BAR_CACHEABLE 0x40
  316. #define CISTPL_BAR_1MEG_MAP 0x80
  317. typedef struct cistpl_bar_t {
  318. u_char attr;
  319. u_int size;
  320. } cistpl_bar_t;
  321. typedef struct cistpl_config_t {
  322. u_char last_idx;
  323. u_int base;
  324. u_int rmask[4];
  325. u_char subtuples;
  326. } cistpl_config_t;
  327. /* These are bits in the 'present' field, and indices in 'param' */
  328. #define CISTPL_POWER_VNOM 0
  329. #define CISTPL_POWER_VMIN 1
  330. #define CISTPL_POWER_VMAX 2
  331. #define CISTPL_POWER_ISTATIC 3
  332. #define CISTPL_POWER_IAVG 4
  333. #define CISTPL_POWER_IPEAK 5
  334. #define CISTPL_POWER_IDOWN 6
  335. #define CISTPL_POWER_HIGHZ_OK 0x01
  336. #define CISTPL_POWER_HIGHZ_REQ 0x02
  337. typedef struct cistpl_power_t {
  338. u_char present;
  339. u_char flags;
  340. u_int param[7];
  341. } cistpl_power_t;
  342. typedef struct cistpl_timing_t {
  343. u_int wait, waitscale;
  344. u_int ready, rdyscale;
  345. u_int reserved, rsvscale;
  346. } cistpl_timing_t;
  347. #define CISTPL_IO_LINES_MASK 0x1f
  348. #define CISTPL_IO_8BIT 0x20
  349. #define CISTPL_IO_16BIT 0x40
  350. #define CISTPL_IO_RANGE 0x80
  351. #define CISTPL_IO_MAX_WIN 16
  352. typedef struct cistpl_io_t {
  353. u_char flags;
  354. u_char nwin;
  355. struct {
  356. u_int base;
  357. u_int len;
  358. } win[CISTPL_IO_MAX_WIN];
  359. } cistpl_io_t;
  360. typedef struct cistpl_irq_t {
  361. u_int IRQInfo1;
  362. u_int IRQInfo2;
  363. } cistpl_irq_t;
  364. #define CISTPL_MEM_MAX_WIN 8
  365. typedef struct cistpl_mem_t {
  366. u_char flags;
  367. u_char nwin;
  368. struct {
  369. u_int len;
  370. u_int card_addr;
  371. u_int host_addr;
  372. } win[CISTPL_MEM_MAX_WIN];
  373. } cistpl_mem_t;
  374. #define CISTPL_CFTABLE_DEFAULT 0x0001
  375. #define CISTPL_CFTABLE_BVDS 0x0002
  376. #define CISTPL_CFTABLE_WP 0x0004
  377. #define CISTPL_CFTABLE_RDYBSY 0x0008
  378. #define CISTPL_CFTABLE_MWAIT 0x0010
  379. #define CISTPL_CFTABLE_AUDIO 0x0800
  380. #define CISTPL_CFTABLE_READONLY 0x1000
  381. #define CISTPL_CFTABLE_PWRDOWN 0x2000
  382. typedef struct cistpl_cftable_entry_t {
  383. u_char index;
  384. u_short flags;
  385. u_char interface;
  386. cistpl_power_t vcc, vpp1, vpp2;
  387. cistpl_timing_t timing;
  388. cistpl_io_t io;
  389. cistpl_irq_t irq;
  390. cistpl_mem_t mem;
  391. u_char subtuples;
  392. } cistpl_cftable_entry_t;
  393. #define CISTPL_CFTABLE_MASTER 0x000100
  394. #define CISTPL_CFTABLE_INVALIDATE 0x000200
  395. #define CISTPL_CFTABLE_VGA_PALETTE 0x000400
  396. #define CISTPL_CFTABLE_PARITY 0x000800
  397. #define CISTPL_CFTABLE_WAIT 0x001000
  398. #define CISTPL_CFTABLE_SERR 0x002000
  399. #define CISTPL_CFTABLE_FAST_BACK 0x004000
  400. #define CISTPL_CFTABLE_BINARY_AUDIO 0x010000
  401. #define CISTPL_CFTABLE_PWM_AUDIO 0x020000
  402. typedef struct cistpl_cftable_entry_cb_t {
  403. u_char index;
  404. u_int flags;
  405. cistpl_power_t vcc, vpp1, vpp2;
  406. u_char io;
  407. cistpl_irq_t irq;
  408. u_char mem;
  409. u_char subtuples;
  410. } cistpl_cftable_entry_cb_t;
  411. typedef struct cistpl_device_geo_t {
  412. u_char ngeo;
  413. struct {
  414. u_char buswidth;
  415. u_int erase_block;
  416. u_int read_block;
  417. u_int write_block;
  418. u_int partition;
  419. u_int interleave;
  420. } geo[CISTPL_MAX_DEVICES];
  421. } cistpl_device_geo_t;
  422. typedef struct cistpl_vers_2_t {
  423. u_char vers;
  424. u_char comply;
  425. u_short dindex;
  426. u_char vspec8, vspec9;
  427. u_char nhdr;
  428. u_char vendor, info;
  429. char str[244];
  430. } cistpl_vers_2_t;
  431. typedef struct cistpl_org_t {
  432. u_char data_org;
  433. char desc[30];
  434. } cistpl_org_t;
  435. #define CISTPL_ORG_FS 0x00
  436. #define CISTPL_ORG_APPSPEC 0x01
  437. #define CISTPL_ORG_XIP 0x02
  438. typedef struct cistpl_format_t {
  439. u_char type;
  440. u_char edc;
  441. u_int offset;
  442. u_int length;
  443. } cistpl_format_t;
  444. #define CISTPL_FORMAT_DISK 0x00
  445. #define CISTPL_FORMAT_MEM 0x01
  446. #define CISTPL_EDC_NONE 0x00
  447. #define CISTPL_EDC_CKSUM 0x01
  448. #define CISTPL_EDC_CRC 0x02
  449. #define CISTPL_EDC_PCC 0x03
  450. typedef union cisparse_t {
  451. cistpl_device_t device;
  452. cistpl_checksum_t checksum;
  453. cistpl_longlink_t longlink;
  454. cistpl_longlink_mfc_t longlink_mfc;
  455. cistpl_vers_1_t version_1;
  456. cistpl_altstr_t altstr;
  457. cistpl_jedec_t jedec;
  458. cistpl_manfid_t manfid;
  459. cistpl_funcid_t funcid;
  460. cistpl_funce_t funce;
  461. cistpl_bar_t bar;
  462. cistpl_config_t config;
  463. cistpl_cftable_entry_t cftable_entry;
  464. cistpl_cftable_entry_cb_t cftable_entry_cb;
  465. cistpl_device_geo_t device_geo;
  466. cistpl_vers_2_t vers_2;
  467. cistpl_org_t org;
  468. cistpl_format_t format;
  469. } cisparse_t;
  470. typedef struct tuple_t {
  471. u_int Attributes;
  472. cisdata_t DesiredTuple;
  473. u_int Flags; /* internal use */
  474. u_int LinkOffset; /* internal use */
  475. u_int CISOffset; /* internal use */
  476. cisdata_t TupleCode;
  477. cisdata_t TupleLink;
  478. cisdata_t TupleOffset;
  479. cisdata_t TupleDataMax;
  480. cisdata_t TupleDataLen;
  481. cisdata_t *TupleData;
  482. } tuple_t;
  483. /* Special cisdata_t value */
  484. #define RETURN_FIRST_TUPLE 0xff
  485. /* Attributes for tuple calls */
  486. #define TUPLE_RETURN_LINK 0x01
  487. #define TUPLE_RETURN_COMMON 0x02
  488. /* For ValidateCIS */
  489. typedef struct cisinfo_t {
  490. u_int Chains;
  491. } cisinfo_t;
  492. #define CISTPL_MAX_CIS_SIZE 0x200
  493. /* For ReplaceCIS */
  494. typedef struct cisdump_t {
  495. u_int Length;
  496. cisdata_t Data[CISTPL_MAX_CIS_SIZE];
  497. } cisdump_t;
  498. int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis);
  499. /* don't use outside of PCMCIA core yet */
  500. int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *tuple);
  501. int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple);
  502. int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
  503. int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
  504. int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info);
  505. /* ... but use these wrappers instead */
  506. #define pcmcia_get_first_tuple(p_dev, tuple) \
  507. pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple)
  508. #define pcmcia_get_next_tuple(p_dev, tuple) \
  509. pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple)
  510. #define pcmcia_get_tuple_data(p_dev, tuple) \
  511. pccard_get_tuple_data(p_dev->socket, tuple)
  512. #define pcmcia_parse_tuple(p_dev, tuple, parse) \
  513. pccard_parse_tuple(tuple, parse)
  514. #define pcmcia_validate_cis(p_dev, info) \
  515. pccard_validate_cis(p_dev->socket, p_dev->func, info)
  516. #endif /* LINUX_CISTPL_H */