1 /* This is taken straight from Appendix C of the specification */
3 typedef long Device_Link;
5 enum Device_AddrFamily {
10 typedef long Device_Flags;
12 typedef long Device_ErrorCode;
15 Device_ErrorCode error;
18 struct Create_LinkParms {
19 long clientId; /* implementation specific value */
20 bool lockDevice; /* attempt to lock the device */
21 unsigned long lock_timeout; /* time to wait on a lock */
22 string device<>; /* name of device */
25 struct Create_LinkResp {
26 Device_ErrorCode error;
28 unsigned short abortPort; /* for the abort RPC */
29 unsigned long maxRecvSize; /* specifies max data size in bytes
30 device will accept on a write */
33 struct Device_WriteParms {
34 Device_Link lid; /* link id from create_link */
35 unsigned long io_timeout; /* time to wait for I/O */
36 unsigned long lock_timeout; /* time to wait for lock */
38 opaque data<>; /* data length and the data itself */
41 struct Device_WriteResp {
42 Device_ErrorCode error;
43 unsigned long size; /* number of bytes written */
46 struct Device_ReadParms {
47 Device_Link lid; /* link id from create_link */
48 unsigned long requestSize; /* bytes requested */
49 unsigned long io_timeout; /* time to wait for I/O */
50 unsigned long lock_timeout; /* time to wait for lock */
52 char termChar; /* valid if flags & termchrset */
55 struct Device_ReadResp {
56 Device_ErrorCode error;
57 long reason; /* reason(s) read completed */
58 opaque data<>; /* data.len and data.val */
61 struct Device_ReadStbResp {
62 Device_ErrorCode error; /* error code */
63 unsigned char stb; /* the returned status byte */
66 struct Device_GenericParms {
67 Device_Link lid; /* Device_Link id from connect call */
68 Device_Flags flags; /* flags with options */
69 unsigned long lock_timeout; /* time to wait for lock */
70 unsigned long io_timeout; /* time to wait for I/O */
73 struct Device_RemoteFunc {
74 unsigned long hostAddr; /* host servicing interrupt */
75 unsigned short hostPort; /* valid port # on client */
76 unsigned long progNum; /* DEVICE_INTR */
77 unsigned long progVers; /* DEVICE_INTR_VERSION */
78 Device_AddrFamily progFamily; /* DEVICE_UDP | DEVICE_TCP */
81 struct Device_EnableSrqParms {
83 bool enable; /* enable or disable interrupts */
84 opaque handle<40>; /* host specific data */
87 struct Device_LockParms {
88 Device_Link lid; /* link id from create_link */
89 Device_Flags flags; /* contains the waitlock flag */
90 unsigned long lock_timeout; /* time to wait to acquire lock */
93 struct Device_DocmdParms {
94 Device_Link lid; /* link id from create_link */
95 Device_Flags flags; /* flags specifying various options */
96 unsigned long io_timeout; /* time to wait for I/O to complete */
97 unsigned long lock_timeout; /* time to wait on a lock */
98 long cmd; /* which command to execute */
99 bool network_order; /* client's byte order */
100 long datasize; /* size of individual data elements */
101 opaque data_in<>; /* docmd data parameters */
104 struct Device_DocmdResp {
105 Device_ErrorCode error; /* returned status */
106 opaque data_out<>; /* returned data parameter */
109 struct Device_SrqParms {
113 program DEVICE_ASYNC{
114 version DEVICE_ASYNC_VERSION {
115 Device_Error device_abort(Device_Link) = 1;
119 program DEVICE_CORE {
120 version DEVICE_CORE_VERSION {
121 Create_LinkResp create_link(Create_LinkParms) = 10;
122 Device_WriteResp device_write(Device_WriteParms) = 11;
123 Device_ReadResp device_read(Device_ReadParms) = 12;
124 Device_ReadStbResp device_readstb(Device_GenericParms) = 13;
125 Device_Error device_trigger(Device_GenericParms) = 14;
126 Device_Error device_clear(Device_GenericParms) = 15;
127 Device_Error device_remote(Device_GenericParms) = 16;
128 Device_Error device_local(Device_GenericParms) = 17;
129 Device_Error device_lock(Device_LockParms) = 18;
130 Device_Error device_unlock(Device_Link) = 19;
131 Device_Error device_enable_srq(Device_EnableSrqParms)= 20;
132 Device_DocmdResp device_docmd(Device_DocmdParms) = 22;
133 Device_Error destroy_link(Device_Link) = 23;
134 Device_Error create_intr_chan(Device_RemoteFunc) = 25;
135 Device_Error destroy_intr_chan(void) = 26;
139 program DEVICE_INTR {
140 version DEVICE_INTR_VERSION {
141 void device_intr_srq(Device_SrqParms) = 30;