1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: 16: 17:
18:
19: #ifndef __DEVICE_PCMCIA_H__
20: #define __DEVICE_PCMCIA_H__
21:
22: #include <basic.h>
23: #include <tk/syscall.h>
24: #include <tk/syslib.h>
25:
26: #ifdef __cplusplus
27: extern "C" {
28: #endif
29:
30:
31: #define CE_INSERT 1
32: #define CE_EJECT 2
33: #define CE_BATTERY 3
34:
35:
36: #define CR_NONE 0
37: #define CR_OWN 1
38: #define CR_SHARE 2
39:
40:
41: #define CK_MULTI 0
42: #define CK_MEMORY 1
43: #define CK_SERIAL 2
44: #define CK_PARALLEL 3
45: #define CK_FIXED 4
46: #define CK_VIDEO 5
47: #define CK_NETWORK 6
48: #define CK_AIMS 7
49: #define CK_SCSI 8
50: #define CK_ANY 255
51: #define CK_NONE (-1)
52:
53: typedef struct {
54: UW kind:8;
55: UW battery:2;
56: UW wprotect:1;
57: UW power:1;
58: UW client:1;
59: UW rsv:19;
60: } CardStat;
61:
62:
63: #define CA_IONOCHK 0x10000
64: #define CA_IOMAP 0x8000
65: #define CA_ATTRMEM 0x4000
66: #define CA_WPROTECT 0x2000
67: #define CA_16BIT 0x0800
68: #define CA_IOCS16 0x0400
69:
70: #define CA_WAIT0 0x0100
71: #define CA_WAIT1 0x0101
72: #define CA_WAIT2 0x0102
73: #define CA_WAIT3 (CA_WAIT1 | CA_WAIT2)
74: #define CA_ZWAIT 0x0104
75: #define CA_SPEED 0x00FF
76:
77:
78: #define CP_POWEROFF 0x00
79: #define CP_POWERON 0x01
80: #define CP_SUSPEND 0x10
81: #define CP_RESUME 0x11
82: #define CP_SUSRIRES 0x12
83: #define CP_POFFREQ(tm) (((tm) << 16) + 0x99)
84:
85:
86: #define TEST_CARDID 0x12345678
87:
88:
89: #define MAX_TUPLESZ (255 + 2)
90:
91:
92: typedef struct {
93: ID cardid;
94: W evtype;
95: CardStat cardstat;
96: } CardReq;
97:
98: 99: 100:
101: 102: 103: 104: 105: 106: 107:
108:
109: 110: 111:
112:
113: IMPORT ER pcRegClient(ID portid, W kind);
114: IMPORT INT pcGetTuple(ID cardid, W tuple, W order, UB* buf);
115: IMPORT INT pcMap(ID cardid, W offset, W len, UW attr, void **addr);
116: IMPORT ER pcReMap(ID cardid, ID mapid);
117: IMPORT ER pcUnMap(ID mapid);
118: IMPORT ER pcReadMem(ID cardid, W offset, W len, UW attr, void *buf);
119: IMPORT ER pcWriteMem(ID cardid, W offset, W len, UW attr, void *buf);
120: IMPORT INT pcGetStat(ID cardid);
121: IMPORT INT pcDefInt(ID cardid, T_DINT *dint, INTVEC vec, UW par);
122: IMPORT ER pcPowerCtl(ID cardid, UW power);
123:
124:
125: #ifdef __cplusplus
126: }
127: #endif
128: #endif