pc.h 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2002.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 2.1
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifndef PC_H_INCLUDED /* { */
  26. #define PC_H_INCLUDED
  27. /*------------------------------------------------------------------*/
  28. /* buffer definition */
  29. /*------------------------------------------------------------------*/
  30. typedef struct {
  31. word length; /* length of data/parameter field */
  32. byte P[270]; /* data/parameter field */
  33. } PBUFFER;
  34. /*------------------------------------------------------------------*/
  35. /* dual port ram structure */
  36. /*------------------------------------------------------------------*/
  37. struct dual
  38. {
  39. byte Req; /* request register */
  40. byte ReqId; /* request task/entity identification */
  41. byte Rc; /* return code register */
  42. byte RcId; /* return code task/entity identification */
  43. byte Ind; /* Indication register */
  44. byte IndId; /* Indication task/entity identification */
  45. byte IMask; /* Interrupt Mask Flag */
  46. byte RNR; /* Receiver Not Ready (set by PC) */
  47. byte XLock; /* XBuffer locked Flag */
  48. byte Int; /* ISDN-S interrupt */
  49. byte ReqCh; /* Channel field for layer-3 Requests */
  50. byte RcCh; /* Channel field for layer-3 Returncodes */
  51. byte IndCh; /* Channel field for layer-3 Indications */
  52. byte MInd; /* more data indication field */
  53. word MLength; /* more data total packet length */
  54. byte ReadyInt; /* request field for ready interrupt */
  55. byte SWReg; /* Software register for special purposes */
  56. byte Reserved[11]; /* reserved space */
  57. byte InterfaceType; /* interface type 1=16K interface */
  58. word Signature; /* ISDN-S adapter Signature (GD) */
  59. PBUFFER XBuffer; /* Transmit Buffer */
  60. PBUFFER RBuffer; /* Receive Buffer */
  61. };
  62. /*------------------------------------------------------------------*/
  63. /* SWReg Values (0 means no command) */
  64. /*------------------------------------------------------------------*/
  65. #define SWREG_DIE_WITH_LEDON 0x01
  66. #define SWREG_HALT_CPU 0x02 /* Push CPU into a while (1) loop */
  67. /*------------------------------------------------------------------*/
  68. /* Id Fields Coding */
  69. /*------------------------------------------------------------------*/
  70. #define ID_MASK 0xe0 /* Mask for the ID field */
  71. #define GL_ERR_ID 0x1f /* ID for error reporting on global requests*/
  72. #define DSIG_ID 0x00 /* ID for D-channel signaling */
  73. #define NL_ID 0x20 /* ID for network-layer access (B or D) */
  74. #define BLLC_ID 0x60 /* ID for B-channel link level access */
  75. #define TASK_ID 0x80 /* ID for dynamic user tasks */
  76. #define TIMER_ID 0xa0 /* ID for timer task */
  77. #define TEL_ID 0xc0 /* ID for telephone support */
  78. #define MAN_ID 0xe0 /* ID for management */
  79. /*------------------------------------------------------------------*/
  80. /* ASSIGN and REMOVE requests are the same for all entities */
  81. /*------------------------------------------------------------------*/
  82. #define ASSIGN 0x01
  83. #define UREMOVE 0xfe /* without return code */
  84. #define REMOVE 0xff
  85. /*------------------------------------------------------------------*/
  86. /* Timer Interrupt Task Interface */
  87. /*------------------------------------------------------------------*/
  88. #define ASSIGN_TIM 0x01
  89. #define REMOVE_TIM 0xff
  90. /*------------------------------------------------------------------*/
  91. /* dynamic user task interface */
  92. /*------------------------------------------------------------------*/
  93. #define ASSIGN_TSK 0x01
  94. #define REMOVE_TSK 0xff
  95. #define LOAD 0xf0
  96. #define RELOCATE 0xf1
  97. #define START 0xf2
  98. #define LOAD2 0xf3
  99. #define RELOCATE2 0xf4
  100. /*------------------------------------------------------------------*/
  101. /* dynamic user task messages */
  102. /*------------------------------------------------------------------*/
  103. #define TSK_B2 0x0000
  104. #define TSK_WAKEUP 0x2000
  105. #define TSK_TIMER 0x4000
  106. #define TSK_TSK 0x6000
  107. #define TSK_PC 0xe000
  108. /*------------------------------------------------------------------*/
  109. /* LL management primitives */
  110. /*------------------------------------------------------------------*/
  111. #define ASSIGN_LL 1 /* assign logical link */
  112. #define REMOVE_LL 0xff /* remove logical link */
  113. /*------------------------------------------------------------------*/
  114. /* LL service primitives */
  115. /*------------------------------------------------------------------*/
  116. #define LL_UDATA 1 /* link unit data request/indication */
  117. #define LL_ESTABLISH 2 /* link establish request/indication */
  118. #define LL_RELEASE 3 /* link release request/indication */
  119. #define LL_DATA 4 /* data request/indication */
  120. #define LL_LOCAL 5 /* switch to local operation (COM only) */
  121. #define LL_DATA_PEND 5 /* data pending indication (SDLC SHM only) */
  122. #define LL_REMOTE 6 /* switch to remote operation (COM only) */
  123. #define LL_TEST 8 /* link test request */
  124. #define LL_MDATA 9 /* more data request/indication */
  125. #define LL_BUDATA 10 /* broadcast unit data request/indication */
  126. #define LL_XID 12 /* XID command request/indication */
  127. #define LL_XID_R 13 /* XID response request/indication */
  128. /*------------------------------------------------------------------*/
  129. /* NL service primitives */
  130. /*------------------------------------------------------------------*/
  131. #define N_MDATA 1 /* more data to come REQ/IND */
  132. #define N_CONNECT 2 /* OSI N-CONNECT REQ/IND */
  133. #define N_CONNECT_ACK 3 /* OSI N-CONNECT CON/RES */
  134. #define N_DISC 4 /* OSI N-DISC REQ/IND */
  135. #define N_DISC_ACK 5 /* OSI N-DISC CON/RES */
  136. #define N_RESET 6 /* OSI N-RESET REQ/IND */
  137. #define N_RESET_ACK 7 /* OSI N-RESET CON/RES */
  138. #define N_DATA 8 /* OSI N-DATA REQ/IND */
  139. #define N_EDATA 9 /* OSI N-EXPEDITED DATA REQ/IND */
  140. #define N_UDATA 10 /* OSI D-UNIT-DATA REQ/IND */
  141. #define N_BDATA 11 /* BROADCAST-DATA REQ/IND */
  142. #define N_DATA_ACK 12 /* data ack ind for D-bit procedure */
  143. #define N_EDATA_ACK 13 /* data ack ind for INTERRUPT */
  144. #define N_XON 15 /* clear RNR state */
  145. #define N_COMBI_IND N_XON /* combined indication */
  146. #define N_Q_BIT 0x10 /* Q-bit for req/ind */
  147. #define N_M_BIT 0x20 /* M-bit for req/ind */
  148. #define N_D_BIT 0x40 /* D-bit for req/ind */
  149. /*------------------------------------------------------------------*/
  150. /* Signaling management primitives */
  151. /*------------------------------------------------------------------*/
  152. #define ASSIGN_SIG 1 /* assign signaling task */
  153. #define UREMOVE_SIG 0xfe /* remove signaling task without return code*/
  154. #define REMOVE_SIG 0xff /* remove signaling task */
  155. /*------------------------------------------------------------------*/
  156. /* Signaling service primitives */
  157. /*------------------------------------------------------------------*/
  158. #define CALL_REQ 1 /* call request */
  159. #define CALL_CON 1 /* call confirmation */
  160. #define CALL_IND 2 /* incoming call connected */
  161. #define LISTEN_REQ 2 /* listen request */
  162. #define HANGUP 3 /* hangup request/indication */
  163. #define SUSPEND 4 /* call suspend request/confirm */
  164. #define RESUME 5 /* call resume request/confirm */
  165. #define SUSPEND_REJ 6 /* suspend rejected indication */
  166. #define USER_DATA 8 /* user data for user to user signaling */
  167. #define CONGESTION 9 /* network congestion indication */
  168. #define INDICATE_REQ 10 /* request to indicate an incoming call */
  169. #define INDICATE_IND 10 /* indicates that there is an incoming call */
  170. #define CALL_RES 11 /* accept an incoming call */
  171. #define CALL_ALERT 12 /* send ALERT for incoming call */
  172. #define INFO_REQ 13 /* INFO request */
  173. #define INFO_IND 13 /* INFO indication */
  174. #define REJECT 14 /* reject an incoming call */
  175. #define RESOURCES 15 /* reserve B-Channel hardware resources */
  176. #define HW_CTRL 16 /* B-Channel hardware IOCTL req/ind */
  177. #define TEL_CTRL 16 /* Telephone control request/indication */
  178. #define STATUS_REQ 17 /* Request D-State (returned in INFO_IND) */
  179. #define FAC_REG_REQ 18 /* 1TR6 connection independent fac reg */
  180. #define FAC_REG_ACK 19 /* 1TR6 fac registration acknowledge */
  181. #define FAC_REG_REJ 20 /* 1TR6 fac registration reject */
  182. #define CALL_COMPLETE 21/* send a CALL_PROC for incoming call */
  183. #define SW_CTRL 22 /* extended software features */
  184. #define REGISTER_REQ 23 /* Q.931 connection independent reg req */
  185. #define REGISTER_IND 24 /* Q.931 connection independent reg ind */
  186. #define FACILITY_REQ 25 /* Q.931 connection independent fac req */
  187. #define FACILITY_IND 26 /* Q.931 connection independent fac ind */
  188. #define NCR_INFO_REQ 27 /* INFO_REQ with NULL CR */
  189. #define GCR_MIM_REQ 28 /* MANAGEMENT_INFO_REQ with global CR */
  190. #define SIG_CTRL 29 /* Control for Signalling Hardware */
  191. #define DSP_CTRL 30 /* Control for DSPs */
  192. #define LAW_REQ 31 /* Law config request for (returns info_i) */
  193. #define SPID_CTRL 32 /* Request/indication SPID related */
  194. #define NCR_FACILITY 33 /* Request/indication with NULL/DUMMY CR */
  195. #define CALL_HOLD 34 /* Request/indication to hold a CALL */
  196. #define CALL_RETRIEVE 35 /* Request/indication to retrieve a CALL */
  197. #define CALL_HOLD_ACK 36 /* OK of hold a CALL */
  198. #define CALL_RETRIEVE_ACK 37 /* OK of retrieve a CALL */
  199. #define CALL_HOLD_REJ 38 /* Reject of hold a CALL */
  200. #define CALL_RETRIEVE_REJ 39 /* Reject of retrieve a call */
  201. #define GCR_RESTART 40 /* Send/Receive Restart message */
  202. #define S_SERVICE 41 /* Send/Receive Supplementary Service */
  203. #define S_SERVICE_REJ 42 /* Reject Supplementary Service indication */
  204. #define S_SUPPORTED 43 /* Req/Ind to get Supported Services */
  205. #define STATUS_ENQ 44 /* Req to send the D-ch request if !state0 */
  206. #define CALL_GUARD 45 /* Req/Ind to use the FLAGS_CALL_OUTCHECK */
  207. #define CALL_GUARD_HP 46 /* Call Guard function to reject a call */
  208. #define CALL_GUARD_IF 47 /* Call Guard function, inform the appl */
  209. #define SSEXT_REQ 48 /* Supplem.Serv./QSIG specific request */
  210. #define SSEXT_IND 49 /* Supplem.Serv./QSIG specific indication */
  211. /* reserved commands for the US protocols */
  212. #define INT_3PTY_NIND 50 /* US specific indication */
  213. #define INT_CF_NIND 51 /* US specific indication */
  214. #define INT_3PTY_DROP 52 /* US specific indication */
  215. #define INT_MOVE_CONF 53 /* US specific indication */
  216. #define INT_MOVE_RC 54 /* US specific indication */
  217. #define INT_MOVE_FLIPPED_CONF 55 /* US specific indication */
  218. #define INT_X5NI_OK 56 /* internal transfer OK indication */
  219. #define INT_XDMS_START 57 /* internal transfer OK indication */
  220. #define INT_XDMS_STOP 58 /* internal transfer finish indication */
  221. #define INT_XDMS_STOP2 59 /* internal transfer send FA */
  222. #define INT_CUSTCONF_REJ 60 /* internal conference reject */
  223. #define INT_CUSTXFER 61 /* internal transfer request */
  224. #define INT_CUSTX_NIND 62 /* internal transfer ack */
  225. #define INT_CUSTXREJ_NIND 63 /* internal transfer rej */
  226. #define INT_X5NI_CF_XFER 64 /* internal transfer OK indication */
  227. #define VSWITCH_REQ 65 /* communication between protocol and */
  228. #define VSWITCH_IND 66 /* capifunctions for D-CH-switching */
  229. #define MWI_POLL 67 /* Message Waiting Status Request fkt */
  230. #define CALL_PEND_NOTIFY 68 /* notify capi to set new listen */
  231. #define DO_NOTHING 69 /* dont do somethin if you get this */
  232. #define INT_CT_REJ 70 /* ECT rejected internal command */
  233. #define CALL_HOLD_COMPLETE 71 /* In NT Mode indicate hold complete */
  234. #define CALL_RETRIEVE_COMPLETE 72 /* In NT Mode indicate retrieve complete */
  235. /*------------------------------------------------------------------*/
  236. /* management service primitives */
  237. /*------------------------------------------------------------------*/
  238. #define MAN_READ 2
  239. #define MAN_WRITE 3
  240. #define MAN_EXECUTE 4
  241. #define MAN_EVENT_ON 5
  242. #define MAN_EVENT_OFF 6
  243. #define MAN_LOCK 7
  244. #define MAN_UNLOCK 8
  245. #define MAN_INFO_IND 2
  246. #define MAN_EVENT_IND 3
  247. #define MAN_TRACE_IND 4
  248. #define MAN_COMBI_IND 9
  249. #define MAN_ESC 0x80
  250. /*------------------------------------------------------------------*/
  251. /* return code coding */
  252. /*------------------------------------------------------------------*/
  253. #define UNKNOWN_COMMAND 0x01 /* unknown command */
  254. #define WRONG_COMMAND 0x02 /* wrong command */
  255. #define WRONG_ID 0x03 /* unknown task/entity id */
  256. #define WRONG_CH 0x04 /* wrong task/entity id */
  257. #define UNKNOWN_IE 0x05 /* unknown information el. */
  258. #define WRONG_IE 0x06 /* wrong information el. */
  259. #define OUT_OF_RESOURCES 0x07 /* ISDN-S card out of res. */
  260. #define ISDN_GUARD_REJ 0x09 /* ISDN-Guard SuppServ rej */
  261. #define N_FLOW_CONTROL 0x10 /* Flow-Control, retry */
  262. #define ASSIGN_RC 0xe0 /* ASSIGN acknowledgement */
  263. #define ASSIGN_OK 0xef /* ASSIGN OK */
  264. #define OK_FC 0xfc /* Flow-Control RC */
  265. #define READY_INT 0xfd /* Ready interrupt */
  266. #define TIMER_INT 0xfe /* timer interrupt */
  267. #define OK 0xff /* command accepted */
  268. /*------------------------------------------------------------------*/
  269. /* information elements */
  270. /*------------------------------------------------------------------*/
  271. #define SHIFT 0x90 /* codeset shift */
  272. #define MORE 0xa0 /* more data */
  273. #define SDNCMPL 0xa1 /* sending complete */
  274. #define CL 0xb0 /* congestion level */
  275. /* codeset 0 */
  276. #define SMSG 0x00 /* segmented message */
  277. #define BC 0x04 /* Bearer Capability */
  278. #define CAU 0x08 /* cause */
  279. #define CAD 0x0c /* Connected address */
  280. #define CAI 0x10 /* call identity */
  281. #define CHI 0x18 /* channel identification */
  282. #define LLI 0x19 /* logical link id */
  283. #define CHA 0x1a /* charge advice */
  284. #define FTY 0x1c /* Facility */
  285. #define DT 0x29 /* ETSI date/time */
  286. #define KEY 0x2c /* keypad information element */
  287. #define UID 0x2d /* User id information element */
  288. #define DSP 0x28 /* display */
  289. #define SIG 0x34 /* signalling hardware control */
  290. #define OAD 0x6c /* origination address */
  291. #define OSA 0x6d /* origination sub-address */
  292. #define CPN 0x70 /* called party number */
  293. #define DSA 0x71 /* destination sub-address */
  294. #define RDX 0x73 /* redirecting number extended */
  295. #define RDN 0x74 /* redirecting number */
  296. #define RIN 0x76 /* redirection number */
  297. #define IUP 0x76 /* VN6 rerouter->PCS (codeset 6) */
  298. #define IPU 0x77 /* VN6 PCS->rerouter (codeset 6) */
  299. #define RI 0x79 /* restart indicator */
  300. #define MIE 0x7a /* management info element */
  301. #define LLC 0x7c /* low layer compatibility */
  302. #define HLC 0x7d /* high layer compatibility */
  303. #define UUI 0x7e /* user user information */
  304. #define ESC 0x7f /* escape extension */
  305. #define DLC 0x20 /* data link layer configuration */
  306. #define NLC 0x21 /* network layer configuration */
  307. #define REDIRECT_IE 0x22 /* redirection request/indication data */
  308. #define REDIRECT_NET_IE 0x23 /* redirection network override data */
  309. /* codeset 6 */
  310. #define SIN 0x01 /* service indicator */
  311. #define CIF 0x02 /* charging information */
  312. #define DATE 0x03 /* date */
  313. #define CPS 0x07 /* called party status */
  314. /*------------------------------------------------------------------*/
  315. /* ESC information elements */
  316. /*------------------------------------------------------------------*/
  317. #define MSGTYPEIE 0x7a /* Messagetype info element */
  318. #define CRIE 0x7b /* INFO info element */
  319. #define CODESET6IE 0xec /* Tunnel for Codeset 6 IEs */
  320. #define VSWITCHIE 0xed /* VSwitch info element */
  321. #define SSEXTIE 0xee /* Supplem. Service info element */
  322. #define PROFILEIE 0xef /* Profile info element */
  323. /*------------------------------------------------------------------*/
  324. /* TEL_CTRL contents */
  325. /*------------------------------------------------------------------*/
  326. #define RING_ON 0x01
  327. #define RING_OFF 0x02
  328. #define HANDS_FREE_ON 0x03
  329. #define HANDS_FREE_OFF 0x04
  330. #define ON_HOOK 0x80
  331. #define OFF_HOOK 0x90
  332. /* operation values used by ETSI supplementary services */
  333. #define THREE_PTY_BEGIN 0x04
  334. #define THREE_PTY_END 0x05
  335. #define ECT_EXECUTE 0x06
  336. #define ACTIVATION_DIVERSION 0x07
  337. #define DEACTIVATION_DIVERSION 0x08
  338. #define CALL_DEFLECTION 0x0D
  339. #define INTERROGATION_DIVERSION 0x0B
  340. #define INTERROGATION_SERV_USR_NR 0x11
  341. #define ACTIVATION_MWI 0x20
  342. #define DEACTIVATION_MWI 0x21
  343. #define MWI_INDICATION 0x22
  344. #define MWI_RESPONSE 0x23
  345. #define CONF_BEGIN 0x28
  346. #define CONF_ADD 0x29
  347. #define CONF_SPLIT 0x2a
  348. #define CONF_DROP 0x2b
  349. #define CONF_ISOLATE 0x2c
  350. #define CONF_REATTACH 0x2d
  351. #define CONF_PARTYDISC 0x2e
  352. #define CCBS_INFO_RETAIN 0x2f
  353. #define CCBS_ERASECALLLINKAGEID 0x30
  354. #define CCBS_STOP_ALERTING 0x31
  355. #define CCBS_REQUEST 0x32
  356. #define CCBS_DEACTIVATE 0x33
  357. #define CCBS_INTERROGATE 0x34
  358. #define CCBS_STATUS 0x35
  359. #define CCBS_ERASE 0x36
  360. #define CCBS_B_FREE 0x37
  361. #define CCNR_INFO_RETAIN 0x38
  362. #define CCBS_REMOTE_USER_FREE 0x39
  363. #define CCNR_REQUEST 0x3a
  364. #define CCNR_INTERROGATE 0x3b
  365. #define GET_SUPPORTED_SERVICES 0xff
  366. #define DIVERSION_PROCEDURE_CFU 0x70
  367. #define DIVERSION_PROCEDURE_CFB 0x71
  368. #define DIVERSION_PROCEDURE_CFNR 0x72
  369. #define DIVERSION_DEACTIVATION_CFU 0x80
  370. #define DIVERSION_DEACTIVATION_CFB 0x81
  371. #define DIVERSION_DEACTIVATION_CFNR 0x82
  372. #define DIVERSION_INTERROGATE_NUM 0x11
  373. #define DIVERSION_INTERROGATE_CFU 0x60
  374. #define DIVERSION_INTERROGATE_CFB 0x61
  375. #define DIVERSION_INTERROGATE_CFNR 0x62
  376. /* Service Masks */
  377. #define SMASK_HOLD_RETRIEVE 0x00000001
  378. #define SMASK_TERMINAL_PORTABILITY 0x00000002
  379. #define SMASK_ECT 0x00000004
  380. #define SMASK_3PTY 0x00000008
  381. #define SMASK_CALL_FORWARDING 0x00000010
  382. #define SMASK_CALL_DEFLECTION 0x00000020
  383. #define SMASK_MCID 0x00000040
  384. #define SMASK_CCBS 0x00000080
  385. #define SMASK_MWI 0x00000100
  386. #define SMASK_CCNR 0x00000200
  387. #define SMASK_CONF 0x00000400
  388. /* ----------------------------------------------
  389. Types of transfers used to transfer the
  390. information in the 'struct RC->Reserved2[8]'
  391. The information is transferred as 2 dwords
  392. (2 4Byte unsigned values)
  393. First of them is the transfer type.
  394. 2^32-1 possible messages are possible in this way.
  395. The context of the second one had no meaning
  396. ---------------------------------------------- */
  397. #define DIVA_RC_TYPE_NONE 0x00000000
  398. #define DIVA_RC_TYPE_REMOVE_COMPLETE 0x00000008
  399. #define DIVA_RC_TYPE_STREAM_PTR 0x00000009
  400. #define DIVA_RC_TYPE_CMA_PTR 0x0000000a
  401. #define DIVA_RC_TYPE_OK_FC 0x0000000b
  402. #define DIVA_RC_TYPE_RX_DMA 0x0000000c
  403. /* ------------------------------------------------------
  404. IO Control codes for IN BAND SIGNALING
  405. ------------------------------------------------------ */
  406. #define CTRL_L1_SET_SIG_ID 5
  407. #define CTRL_L1_SET_DAD 6
  408. #define CTRL_L1_RESOURCES 7
  409. /* ------------------------------------------------------ */
  410. /* ------------------------------------------------------
  411. Layer 2 types
  412. ------------------------------------------------------ */
  413. #define X75T 1 /* x.75 for ttx */
  414. #define TRF 2 /* transparent with hdlc framing */
  415. #define TRF_IN 3 /* transparent with hdlc fr. inc. */
  416. #define SDLC 4 /* sdlc, sna layer-2 */
  417. #define X75 5 /* x.75 for btx */
  418. #define LAPD 6 /* lapd (Q.921) */
  419. #define X25_L2 7 /* x.25 layer-2 */
  420. #define V120_L2 8 /* V.120 layer-2 protocol */
  421. #define V42_IN 9 /* V.42 layer-2 protocol, incoming */
  422. #define V42 10 /* V.42 layer-2 protocol */
  423. #define MDM_ATP 11 /* AT Parser built in the L2 */
  424. #define X75_V42BIS 12 /* x.75 with V.42bis */
  425. #define RTPL2_IN 13 /* RTP layer-2 protocol, incoming */
  426. #define RTPL2 14 /* RTP layer-2 protocol */
  427. #define V120_V42BIS 15 /* V.120 asynchronous mode supporting V.42bis compression */
  428. #define LISTENER 27 /* Layer 2 to listen line */
  429. #define MTP2 28 /* MTP2 Layer 2 */
  430. #define PIAFS_CRC 29 /* PIAFS Layer 2 with CRC calculation at L2 */
  431. /* ------------------------------------------------------
  432. PIAFS DLC DEFINITIONS
  433. ------------------------------------------------------ */
  434. #define PIAFS_64K 0x01
  435. #define PIAFS_VARIABLE_SPEED 0x02
  436. #define PIAFS_CHINESE_SPEED 0x04
  437. #define PIAFS_UDATA_ABILITY_ID 0x80
  438. #define PIAFS_UDATA_ABILITY_DCDON 0x01
  439. #define PIAFS_UDATA_ABILITY_DDI 0x80
  440. /*
  441. DLC of PIAFS :
  442. Byte | 8 7 6 5 4 3 2 1
  443. -----+--------------------------------------------------------
  444. 0 | 0 0 1 0 0 0 0 0 Data Link Configuration
  445. 1 | X X X X X X X X Length of IE (at least 15 Bytes)
  446. 2 | 0 0 0 0 0 0 0 0 max. information field, LOW byte (not used, fix 73 Bytes)
  447. 3 | 0 0 0 0 0 0 0 0 max. information field, HIGH byte (not used, fix 73 Bytes)
  448. 4 | 0 0 0 0 0 0 0 0 address A (not used)
  449. 5 | 0 0 0 0 0 0 0 0 address B (not used)
  450. 6 | 0 0 0 0 0 0 0 0 Mode (not used, fix 128)
  451. 7 | 0 0 0 0 0 0 0 0 Window Size (not used, fix 127)
  452. 8 | X X X X X X X X XID Length, Low Byte (at least 7 Bytes)
  453. 9 | X X X X X X X X XID Length, High Byte
  454. 10 | 0 0 0 0 0 C V S PIAFS Protocol Speed configuration -> Note(1)
  455. | S = 0 -> Protocol Speed is 32K
  456. | S = 1 -> Protocol Speed is 64K
  457. | V = 0 -> Protocol Speed is fixed
  458. | V = 1 -> Protocol Speed is variable
  459. | C = 0 -> speed setting according to standard
  460. | C = 1 -> speed setting for chinese implementation
  461. 11 | 0 0 0 0 0 0 R T P0 - V42bis Compression enable/disable, Low Byte
  462. | T = 0 -> Transmit Direction enable
  463. | T = 1 -> Transmit Direction disable
  464. | R = 0 -> Receive Direction enable
  465. | R = 1 -> Receive Direction disable
  466. 13 | 0 0 0 0 0 0 0 0 P0 - V42bis Compression enable/disable, High Byte
  467. 14 | X X X X X X X X P1 - V42bis Dictionary Size, Low Byte
  468. 15 | X X X X X X X X P1 - V42bis Dictionary Size, High Byte
  469. 16 | X X X X X X X X P2 - V42bis String Length, Low Byte
  470. 17 | X X X X X X X X P2 - V42bis String Length, High Byte
  471. 18 | X X X X X X X X PIAFS extension length
  472. 19 | 1 0 0 0 0 0 0 0 PIAFS extension Id (0x80) - UDATA abilities
  473. 20 | U 0 0 0 0 0 0 D UDATA abilities -> Note (2)
  474. | up to now the following Bits are defined:
  475. | D - signal DCD ON
  476. | U - use extensive UDATA control communication
  477. | for DDI test application
  478. + Note (1): ----------+------+-----------------------------------------+
  479. | PIAFS Protocol | Bit | |
  480. | Speed configuration | S | Bit 1 - Protocol Speed |
  481. | | | 0 - 32K |
  482. | | | 1 - 64K (default) |
  483. | | V | Bit 2 - Variable Protocol Speed |
  484. | | | 0 - Speed is fix |
  485. | | | 1 - Speed is variable (default) |
  486. | | | OVERWRITES 32k Bit 1 |
  487. | | C | Bit 3 0 - Speed Settings according to |
  488. | | | PIAFS specification |
  489. | | | 1 - Speed setting for chinese |
  490. | | | PIAFS implementation |
  491. | | | Explanation for chinese speed settings: |
  492. | | | if Bit 3 is set the following |
  493. | | | rules apply: |
  494. | | | Bit1=0 Bit2=0: 32k fix |
  495. | | | Bit1=1 Bit2=0: 64k fix |
  496. | | | Bit1=0 Bit2=1: PIAFS is trying |
  497. | | | to negotiate 32k is that is |
  498. | | | not possible it tries to |
  499. | | | negotiate 64k |
  500. | | | Bit1=1 Bit2=1: PIAFS is trying |
  501. | | | to negotiate 64k is that is |
  502. | | | not possible it tries to |
  503. | | | negotiate 32k |
  504. + Note (2): ----------+------+-----------------------------------------+
  505. | PIAFS | Bit | this byte defines the usage of UDATA |
  506. | Implementation | | control communication |
  507. | UDATA usage | D | Bit 1 - DCD-ON signalling |
  508. | | | 0 - no DCD-ON is signalled |
  509. | | | (default) |
  510. | | | 1 - DCD-ON will be signalled |
  511. | | U | Bit 8 - DDI test application UDATA |
  512. | | | control communication |
  513. | | | 0 - no UDATA control |
  514. | | | communication (default) |
  515. | | | sets as well the DCD-ON |
  516. | | | signalling |
  517. | | | 1 - UDATA control communication |
  518. | | | ATTENTION: Do not use these |
  519. | | | setting if you |
  520. | | | are not really |
  521. | | | that you need it |
  522. | | | and you know |
  523. | | | exactly what you |
  524. | | | are doing. |
  525. | | | You can easily |
  526. | | | disable any |
  527. | | | data transfer. |
  528. +---------------------+------+-----------------------------------------+
  529. */
  530. /* ------------------------------------------------------
  531. LISTENER DLC DEFINITIONS
  532. ------------------------------------------------------ */
  533. #define LISTENER_FEATURE_MASK_CUMMULATIVE 0x0001
  534. /* ------------------------------------------------------
  535. LISTENER META-FRAME CODE/PRIMITIVE DEFINITIONS
  536. ------------------------------------------------------ */
  537. #define META_CODE_LL_UDATA_RX 0x01
  538. #define META_CODE_LL_UDATA_TX 0x02
  539. #define META_CODE_LL_DATA_RX 0x03
  540. #define META_CODE_LL_DATA_TX 0x04
  541. #define META_CODE_LL_MDATA_RX 0x05
  542. #define META_CODE_LL_MDATA_TX 0x06
  543. #define META_CODE_EMPTY 0x10
  544. #define META_CODE_LOST_FRAMES 0x11
  545. #define META_FLAG_TRUNCATED 0x0001
  546. /*------------------------------------------------------------------*/
  547. /* CAPI-like profile to indicate features on LAW_REQ */
  548. /*------------------------------------------------------------------*/
  549. #define GL_INTERNAL_CONTROLLER_SUPPORTED 0x00000001L
  550. #define GL_EXTERNAL_EQUIPMENT_SUPPORTED 0x00000002L
  551. #define GL_HANDSET_SUPPORTED 0x00000004L
  552. #define GL_DTMF_SUPPORTED 0x00000008L
  553. #define GL_SUPPLEMENTARY_SERVICES_SUPPORTED 0x00000010L
  554. #define GL_CHANNEL_ALLOCATION_SUPPORTED 0x00000020L
  555. #define GL_BCHANNEL_OPERATION_SUPPORTED 0x00000040L
  556. #define GL_LINE_INTERCONNECT_SUPPORTED 0x00000080L
  557. #define B1_HDLC_SUPPORTED 0x00000001L
  558. #define B1_TRANSPARENT_SUPPORTED 0x00000002L
  559. #define B1_V110_ASYNC_SUPPORTED 0x00000004L
  560. #define B1_V110_SYNC_SUPPORTED 0x00000008L
  561. #define B1_T30_SUPPORTED 0x00000010L
  562. #define B1_HDLC_INVERTED_SUPPORTED 0x00000020L
  563. #define B1_TRANSPARENT_R_SUPPORTED 0x00000040L
  564. #define B1_MODEM_ALL_NEGOTIATE_SUPPORTED 0x00000080L
  565. #define B1_MODEM_ASYNC_SUPPORTED 0x00000100L
  566. #define B1_MODEM_SYNC_HDLC_SUPPORTED 0x00000200L
  567. #define B2_X75_SUPPORTED 0x00000001L
  568. #define B2_TRANSPARENT_SUPPORTED 0x00000002L
  569. #define B2_SDLC_SUPPORTED 0x00000004L
  570. #define B2_LAPD_SUPPORTED 0x00000008L
  571. #define B2_T30_SUPPORTED 0x00000010L
  572. #define B2_PPP_SUPPORTED 0x00000020L
  573. #define B2_TRANSPARENT_NO_CRC_SUPPORTED 0x00000040L
  574. #define B2_MODEM_EC_COMPRESSION_SUPPORTED 0x00000080L
  575. #define B2_X75_V42BIS_SUPPORTED 0x00000100L
  576. #define B2_V120_ASYNC_SUPPORTED 0x00000200L
  577. #define B2_V120_ASYNC_V42BIS_SUPPORTED 0x00000400L
  578. #define B2_V120_BIT_TRANSPARENT_SUPPORTED 0x00000800L
  579. #define B2_LAPD_FREE_SAPI_SEL_SUPPORTED 0x00001000L
  580. #define B3_TRANSPARENT_SUPPORTED 0x00000001L
  581. #define B3_T90NL_SUPPORTED 0x00000002L
  582. #define B3_ISO8208_SUPPORTED 0x00000004L
  583. #define B3_X25_DCE_SUPPORTED 0x00000008L
  584. #define B3_T30_SUPPORTED 0x00000010L
  585. #define B3_T30_WITH_EXTENSIONS_SUPPORTED 0x00000020L
  586. #define B3_RESERVED_SUPPORTED 0x00000040L
  587. #define B3_MODEM_SUPPORTED 0x00000080L
  588. #define MANUFACTURER_FEATURE_SLAVE_CODEC 0x00000001L
  589. #define MANUFACTURER_FEATURE_FAX_MORE_DOCUMENTS 0x00000002L
  590. #define MANUFACTURER_FEATURE_HARDDTMF 0x00000004L
  591. #define MANUFACTURER_FEATURE_SOFTDTMF_SEND 0x00000008L
  592. #define MANUFACTURER_FEATURE_DTMF_PARAMETERS 0x00000010L
  593. #define MANUFACTURER_FEATURE_SOFTDTMF_RECEIVE 0x00000020L
  594. #define MANUFACTURER_FEATURE_FAX_SUB_SEP_PWD 0x00000040L
  595. #define MANUFACTURER_FEATURE_V18 0x00000080L
  596. #define MANUFACTURER_FEATURE_MIXER_CH_CH 0x00000100L
  597. #define MANUFACTURER_FEATURE_MIXER_CH_PC 0x00000200L
  598. #define MANUFACTURER_FEATURE_MIXER_PC_CH 0x00000400L
  599. #define MANUFACTURER_FEATURE_MIXER_PC_PC 0x00000800L
  600. #define MANUFACTURER_FEATURE_ECHO_CANCELLER 0x00001000L
  601. #define MANUFACTURER_FEATURE_RTP 0x00002000L
  602. #define MANUFACTURER_FEATURE_T38 0x00004000L
  603. #define MANUFACTURER_FEATURE_TRANSP_DELIVERY_CONF 0x00008000L
  604. #define MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL 0x00010000L
  605. #define MANUFACTURER_FEATURE_OOB_CHANNEL 0x00020000L
  606. #define MANUFACTURER_FEATURE_IN_BAND_CHANNEL 0x00040000L
  607. #define MANUFACTURER_FEATURE_IN_BAND_FEATURE 0x00080000L
  608. #define MANUFACTURER_FEATURE_PIAFS 0x00100000L
  609. #define MANUFACTURER_FEATURE_DTMF_TONE 0x00200000L
  610. #define MANUFACTURER_FEATURE_FAX_PAPER_FORMATS 0x00400000L
  611. #define MANUFACTURER_FEATURE_OK_FC_LABEL 0x00800000L
  612. #define MANUFACTURER_FEATURE_VOWN 0x01000000L
  613. #define MANUFACTURER_FEATURE_XCONNECT 0x02000000L
  614. #define MANUFACTURER_FEATURE_DMACONNECT 0x04000000L
  615. #define MANUFACTURER_FEATURE_AUDIO_TAP 0x08000000L
  616. #define MANUFACTURER_FEATURE_FAX_NONSTANDARD 0x10000000L
  617. #define MANUFACTURER_FEATURE_SS7 0x20000000L
  618. #define MANUFACTURER_FEATURE_MADAPTER 0x40000000L
  619. #define MANUFACTURER_FEATURE_MEASURE 0x80000000L
  620. #define MANUFACTURER_FEATURE2_LISTENING 0x00000001L
  621. #define MANUFACTURER_FEATURE2_SS_DIFFCONTPOSSIBLE 0x00000002L
  622. #define MANUFACTURER_FEATURE2_GENERIC_TONE 0x00000004L
  623. #define MANUFACTURER_FEATURE2_COLOR_FAX 0x00000008L
  624. #define MANUFACTURER_FEATURE2_SS_ECT_DIFFCONTPOSSIBLE 0x00000010L
  625. #define RTP_PRIM_PAYLOAD_PCMU_8000 0
  626. #define RTP_PRIM_PAYLOAD_1016_8000 1
  627. #define RTP_PRIM_PAYLOAD_G726_32_8000 2
  628. #define RTP_PRIM_PAYLOAD_GSM_8000 3
  629. #define RTP_PRIM_PAYLOAD_G723_8000 4
  630. #define RTP_PRIM_PAYLOAD_DVI4_8000 5
  631. #define RTP_PRIM_PAYLOAD_DVI4_16000 6
  632. #define RTP_PRIM_PAYLOAD_LPC_8000 7
  633. #define RTP_PRIM_PAYLOAD_PCMA_8000 8
  634. #define RTP_PRIM_PAYLOAD_G722_16000 9
  635. #define RTP_PRIM_PAYLOAD_QCELP_8000 12
  636. #define RTP_PRIM_PAYLOAD_G728_8000 14
  637. #define RTP_PRIM_PAYLOAD_G729_8000 18
  638. #define RTP_PRIM_PAYLOAD_GSM_HR_8000 30
  639. #define RTP_PRIM_PAYLOAD_GSM_EFR_8000 31
  640. #define RTP_ADD_PAYLOAD_BASE 32
  641. #define RTP_ADD_PAYLOAD_RED 32
  642. #define RTP_ADD_PAYLOAD_CN_8000 33
  643. #define RTP_ADD_PAYLOAD_DTMF 34
  644. #define RTP_PRIM_PAYLOAD_PCMU_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_PCMU_8000)
  645. #define RTP_PRIM_PAYLOAD_1016_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_1016_8000)
  646. #define RTP_PRIM_PAYLOAD_G726_32_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_G726_32_8000)
  647. #define RTP_PRIM_PAYLOAD_GSM_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_GSM_8000)
  648. #define RTP_PRIM_PAYLOAD_G723_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_G723_8000)
  649. #define RTP_PRIM_PAYLOAD_DVI4_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_DVI4_8000)
  650. #define RTP_PRIM_PAYLOAD_DVI4_16000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_DVI4_16000)
  651. #define RTP_PRIM_PAYLOAD_LPC_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_LPC_8000)
  652. #define RTP_PRIM_PAYLOAD_PCMA_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_PCMA_8000)
  653. #define RTP_PRIM_PAYLOAD_G722_16000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_G722_16000)
  654. #define RTP_PRIM_PAYLOAD_QCELP_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_QCELP_8000)
  655. #define RTP_PRIM_PAYLOAD_G728_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_G728_8000)
  656. #define RTP_PRIM_PAYLOAD_G729_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_G729_8000)
  657. #define RTP_PRIM_PAYLOAD_GSM_HR_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_GSM_HR_8000)
  658. #define RTP_PRIM_PAYLOAD_GSM_EFR_8000_SUPPORTED (1L << RTP_PRIM_PAYLOAD_GSM_EFR_8000)
  659. #define RTP_ADD_PAYLOAD_RED_SUPPORTED (1L << (RTP_ADD_PAYLOAD_RED - RTP_ADD_PAYLOAD_BASE))
  660. #define RTP_ADD_PAYLOAD_CN_8000_SUPPORTED (1L << (RTP_ADD_PAYLOAD_CN_8000 - RTP_ADD_PAYLOAD_BASE))
  661. #define RTP_ADD_PAYLOAD_DTMF_SUPPORTED (1L << (RTP_ADD_PAYLOAD_DTMF - RTP_ADD_PAYLOAD_BASE))
  662. /* virtual switching definitions */
  663. #define VSJOIN 1
  664. #define VSTRANSPORT 2
  665. #define VSGETPARAMS 3
  666. #define VSCAD 1
  667. #define VSRXCPNAME 2
  668. #define VSCALLSTAT 3
  669. #define VSINVOKEID 4
  670. #define VSCLMRKS 5
  671. #define VSTBCTIDENT 6
  672. #define VSETSILINKID 7
  673. #define VSSAMECONTROLLER 8
  674. /* Errorcodes for VSETSILINKID begin */
  675. #define VSETSILINKIDRRWC 1
  676. #define VSETSILINKIDREJECT 2
  677. #define VSETSILINKIDTIMEOUT 3
  678. #define VSETSILINKIDFAILCOUNT 4
  679. #define VSETSILINKIDERROR 5
  680. /* Errorcodes for VSETSILINKID end */
  681. /* -----------------------------------------------------------**
  682. ** The PROTOCOL_FEATURE_STRING in feature.h (included **
  683. ** in prstart.sx and astart.sx) defines capabilities and **
  684. ** features of the actual protocol code. It's used as a bit **
  685. ** mask. **
  686. ** The following Bits are defined: **
  687. ** -----------------------------------------------------------*/
  688. #define PROTCAP_TELINDUS 0x0001 /* Telindus Variant of protocol code */
  689. #define PROTCAP_MAN_IF 0x0002 /* Management interface implemented */
  690. #define PROTCAP_V_42 0x0004 /* V42 implemented */
  691. #define PROTCAP_V90D 0x0008 /* V.90D (implies up to 384k DSP code) */
  692. #define PROTCAP_EXTD_FAX 0x0010 /* Extended FAX (ECM, 2D, T6, Polling) */
  693. #define PROTCAP_EXTD_RXFC 0x0020 /* RxFC (Extd Flow Control), OOB Chnl */
  694. #define PROTCAP_VOIP 0x0040 /* VoIP (implies up to 512k DSP code) */
  695. #define PROTCAP_CMA_ALLPR 0x0080 /* CMA support for all NL primitives */
  696. #define PROTCAP_FREE8 0x0100 /* not used */
  697. #define PROTCAP_FREE9 0x0200 /* not used */
  698. #define PROTCAP_FREE10 0x0400 /* not used */
  699. #define PROTCAP_FREE11 0x0800 /* not used */
  700. #define PROTCAP_FREE12 0x1000 /* not used */
  701. #define PROTCAP_FREE13 0x2000 /* not used */
  702. #define PROTCAP_FREE14 0x4000 /* not used */
  703. #define PROTCAP_EXTENSION 0x8000 /* used for future extensions */
  704. /* -----------------------------------------------------------* */
  705. /* Onhook data transmission ETS30065901 */
  706. /* Message Type */
  707. /*#define RESERVED4 0x4*/
  708. #define CALL_SETUP 0x80
  709. #define MESSAGE_WAITING_INDICATOR 0x82
  710. /*#define RESERVED84 0x84*/
  711. /*#define RESERVED85 0x85*/
  712. #define ADVICE_OF_CHARGE 0x86
  713. /*1111 0001
  714. to
  715. 1111 1111
  716. F1H - Reserved for network operator use
  717. to
  718. FFH*/
  719. /* Parameter Types */
  720. #define DATE_AND_TIME 1
  721. #define CLI_PARAMETER_TYPE 2
  722. #define CALLED_DIRECTORY_NUMBER_PARAMETER_TYPE 3
  723. #define REASON_FOR_ABSENCE_OF_CLI_PARAMETER_TYPE 4
  724. #define NAME_PARAMETER_TYPE 7
  725. #define REASON_FOR_ABSENCE_OF_CALLING_PARTY_NAME_PARAMETER_TYPE 8
  726. #define VISUAL_INDICATOR_PARAMETER_TYPE 0xb
  727. #define COMPLEMENTARY_CLI_PARAMETER_TYPE 0x10
  728. #define CALL_TYPE_PARAMETER_TYPE 0x11
  729. #define FIRST_CALLED_LINE_DIRECTORY_NUMBER_PARAMETER_TYPE 0x12
  730. #define NETWORK_MESSAGE_SYSTEM_STATUS_PARAMETER_TYPE 0x13
  731. #define FORWARDED_CALL_TYPE_PARAMETER_TYPE 0x15
  732. #define TYPE_OF_CALLING_USER_PARAMETER_TYPE 0x16
  733. #define REDIRECTING_NUMBER_PARAMETER_TYPE 0x1a
  734. #define EXTENSION_FOR_NETWORK_OPERATOR_USE_PARAMETER_TYPE 0xe0
  735. /* -----------------------------------------------------------* */
  736. #else
  737. #endif /* PC_H_INCLUDED } */