isdnif.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. /* $Id: isdnif.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
  2. *
  3. * Linux ISDN subsystem
  4. * Definition of the interface between the subsystem and its low-level drivers.
  5. *
  6. * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
  7. * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
  8. *
  9. * This software may be used and distributed according to the terms
  10. * of the GNU General Public License, incorporated herein by reference.
  11. *
  12. */
  13. #ifndef __ISDNIF_H__
  14. #define __ISDNIF_H__
  15. /*
  16. * Values for general protocol-selection
  17. */
  18. #define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
  19. #define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
  20. #define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
  21. #define ISDN_PTYPE_LEASED 3 /* for leased lines */
  22. #define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
  23. #define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
  24. /*
  25. * Values for Layer-2-protocol-selection
  26. */
  27. #define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
  28. #define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
  29. #define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
  30. #define ISDN_PROTO_L2_HDLC 3 /* HDLC */
  31. #define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
  32. #define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
  33. #define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
  34. #define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
  35. #define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
  36. #define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
  37. #define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
  38. #define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
  39. #define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
  40. #define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
  41. /*
  42. * Values for Layer-3-protocol-selection
  43. */
  44. #define ISDN_PROTO_L3_TRANS 0 /* Transparent */
  45. #define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
  46. #define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
  47. #define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
  48. #define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
  49. #ifdef __KERNEL__
  50. #include <linux/skbuff.h>
  51. /***************************************************************************/
  52. /* Extensions made by Werner Cornelius (werner@ikt.de) */
  53. /* */
  54. /* The proceed command holds a incoming call in a state to leave processes */
  55. /* enough time to check whether ist should be accepted. */
  56. /* The PROT_IO Command extends the interface to make protocol dependent */
  57. /* features available (call diversion, call waiting...). */
  58. /* */
  59. /* The PROT_IO Command is executed with the desired driver id and the arg */
  60. /* parameter coded as follows: */
  61. /* The lower 8 bits of arg contain the desired protocol from ISDN_PTYPE */
  62. /* definitions. The upper 24 bits represent the protocol specific cmd/stat.*/
  63. /* Any additional data is protocol and command specific. */
  64. /* This mechanism also applies to the statcallb callback STAT_PROT. */
  65. /* */
  66. /* This suggested extension permits an easy expansion of protocol specific */
  67. /* handling. Extensions may be added at any time without changing the HL */
  68. /* driver code and not getting conflicts without certifications. */
  69. /* The well known CAPI 2.0 interface handles such extensions in a similar */
  70. /* way. Perhaps a protocol specific module may be added and separately */
  71. /* loaded and linked to the basic isdn module for handling. */
  72. /***************************************************************************/
  73. /*****************/
  74. /* DSS1 commands */
  75. /*****************/
  76. #define DSS1_CMD_INVOKE ((0x00 << 8) | ISDN_PTYPE_EURO) /* invoke a supplementary service */
  77. #define DSS1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_EURO) /* abort a invoke cmd */
  78. /*******************************/
  79. /* DSS1 Status callback values */
  80. /*******************************/
  81. #define DSS1_STAT_INVOKE_RES ((0x80 << 8) | ISDN_PTYPE_EURO) /* Result for invocation */
  82. #define DSS1_STAT_INVOKE_ERR ((0x81 << 8) | ISDN_PTYPE_EURO) /* Error Return for invocation */
  83. #define DSS1_STAT_INVOKE_BRD ((0x82 << 8) | ISDN_PTYPE_EURO) /* Deliver invoke broadcast info */
  84. /*********************************************************************/
  85. /* structures for DSS1 commands and callback */
  86. /* */
  87. /* An action is invoked by sending a DSS1_CMD_INVOKE. The ll_id, proc*/
  88. /* timeout, datalen and data fields must be set before calling. */
  89. /* */
  90. /* The return value is a positive hl_id value also delivered in the */
  91. /* hl_id field. A value of zero signals no more left hl_id capacitys.*/
  92. /* A negative return value signals errors in LL. So if the return */
  93. /* value is <= 0 no action in LL will be taken -> request ignored */
  94. /* */
  95. /* The timeout field must be filled with a positive value specifying */
  96. /* the amount of time the INVOKED process waits for a reaction from */
  97. /* the network. */
  98. /* If a response (either error or result) is received during this */
  99. /* intervall, a reporting callback is initiated and the process will */
  100. /* be deleted, the hl identifier will be freed. */
  101. /* If no response is received during the specified intervall, a error*/
  102. /* callback is initiated with timeout set to -1 and a datalen set */
  103. /* to 0. */
  104. /* If timeout is set to a value <= 0 during INVOCATION the process is*/
  105. /* immediately deleted after sending the data. No callback occurs ! */
  106. /* */
  107. /* A currently waiting process may be aborted with INVOKE_ABORT. No */
  108. /* callback will occur when a process has been aborted. */
  109. /* */
  110. /* Broadcast invoke frames from the network are reported via the */
  111. /* STAT_INVOKE_BRD callback. The ll_id is set to 0, the other fields */
  112. /* are supplied by the network and not by the HL. */
  113. /*********************************************************************/
  114. /*****************/
  115. /* NI1 commands */
  116. /*****************/
  117. #define NI1_CMD_INVOKE ((0x00 << 8) | ISDN_PTYPE_NI1) /* invoke a supplementary service */
  118. #define NI1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_NI1) /* abort a invoke cmd */
  119. /*******************************/
  120. /* NI1 Status callback values */
  121. /*******************************/
  122. #define NI1_STAT_INVOKE_RES ((0x80 << 8) | ISDN_PTYPE_NI1) /* Result for invocation */
  123. #define NI1_STAT_INVOKE_ERR ((0x81 << 8) | ISDN_PTYPE_NI1) /* Error Return for invocation */
  124. #define NI1_STAT_INVOKE_BRD ((0x82 << 8) | ISDN_PTYPE_NI1) /* Deliver invoke broadcast info */
  125. typedef struct
  126. { ulong ll_id; /* ID supplied by LL when executing */
  127. /* a command and returned by HL for */
  128. /* INVOKE_RES and INVOKE_ERR */
  129. int hl_id; /* ID supplied by HL when called */
  130. /* for executing a cmd and delivered */
  131. /* for results and errors */
  132. /* must be supplied by LL when aborting*/
  133. int proc; /* invoke procedure used by CMD_INVOKE */
  134. /* returned by callback and broadcast */
  135. int timeout; /* timeout for INVOKE CMD in ms */
  136. /* -1 in stat callback when timed out */
  137. /* error value when error callback */
  138. int datalen; /* length of cmd or stat data */
  139. u_char *data;/* pointer to data delivered or send */
  140. } isdn_cmd_stat;
  141. /*
  142. * Commands from linklevel to lowlevel
  143. *
  144. */
  145. #define ISDN_CMD_IOCTL 0 /* Perform ioctl */
  146. #define ISDN_CMD_DIAL 1 /* Dial out */
  147. #define ISDN_CMD_ACCEPTD 2 /* Accept an incoming call on D-Chan. */
  148. #define ISDN_CMD_ACCEPTB 3 /* Request B-Channel connect. */
  149. #define ISDN_CMD_HANGUP 4 /* Hangup */
  150. #define ISDN_CMD_CLREAZ 5 /* Clear EAZ(s) of channel */
  151. #define ISDN_CMD_SETEAZ 6 /* Set EAZ(s) of channel */
  152. #define ISDN_CMD_GETEAZ 7 /* Get EAZ(s) of channel */
  153. #define ISDN_CMD_SETSIL 8 /* Set Service-Indicator-List of channel */
  154. #define ISDN_CMD_GETSIL 9 /* Get Service-Indicator-List of channel */
  155. #define ISDN_CMD_SETL2 10 /* Set B-Chan. Layer2-Parameter */
  156. #define ISDN_CMD_GETL2 11 /* Get B-Chan. Layer2-Parameter */
  157. #define ISDN_CMD_SETL3 12 /* Set B-Chan. Layer3-Parameter */
  158. #define ISDN_CMD_GETL3 13 /* Get B-Chan. Layer3-Parameter */
  159. // #define ISDN_CMD_LOCK 14 /* Signal usage by upper levels */
  160. // #define ISDN_CMD_UNLOCK 15 /* Release usage-lock */
  161. #define ISDN_CMD_SUSPEND 16 /* Suspend connection */
  162. #define ISDN_CMD_RESUME 17 /* Resume connection */
  163. #define ISDN_CMD_PROCEED 18 /* Proceed with call establishment */
  164. #define ISDN_CMD_ALERT 19 /* Alert after Proceeding */
  165. #define ISDN_CMD_REDIR 20 /* Redir a incoming call */
  166. #define ISDN_CMD_PROT_IO 21 /* Protocol specific commands */
  167. #define CAPI_PUT_MESSAGE 22 /* CAPI message send down or up */
  168. #define ISDN_CMD_FAXCMD 23 /* FAX commands to HL-driver */
  169. #define ISDN_CMD_AUDIO 24 /* DSP, DTMF, ... settings */
  170. /*
  171. * Status-Values delivered from lowlevel to linklevel via
  172. * statcallb().
  173. *
  174. */
  175. #define ISDN_STAT_STAVAIL 256 /* Raw status-data available */
  176. #define ISDN_STAT_ICALL 257 /* Incoming call detected */
  177. #define ISDN_STAT_RUN 258 /* Signal protocol-code is running */
  178. #define ISDN_STAT_STOP 259 /* Signal halt of protocol-code */
  179. #define ISDN_STAT_DCONN 260 /* Signal D-Channel connect */
  180. #define ISDN_STAT_BCONN 261 /* Signal B-Channel connect */
  181. #define ISDN_STAT_DHUP 262 /* Signal D-Channel disconnect */
  182. #define ISDN_STAT_BHUP 263 /* Signal B-Channel disconnect */
  183. #define ISDN_STAT_CINF 264 /* Charge-Info */
  184. #define ISDN_STAT_LOAD 265 /* Signal new lowlevel-driver is loaded */
  185. #define ISDN_STAT_UNLOAD 266 /* Signal unload of lowlevel-driver */
  186. #define ISDN_STAT_BSENT 267 /* Signal packet sent */
  187. #define ISDN_STAT_NODCH 268 /* Signal no D-Channel */
  188. #define ISDN_STAT_ADDCH 269 /* Add more Channels */
  189. #define ISDN_STAT_CAUSE 270 /* Cause-Message */
  190. #define ISDN_STAT_ICALLW 271 /* Incoming call without B-chan waiting */
  191. #define ISDN_STAT_REDIR 272 /* Redir result */
  192. #define ISDN_STAT_PROT 273 /* protocol IO specific callback */
  193. #define ISDN_STAT_DISPLAY 274 /* deliver a received display message */
  194. #define ISDN_STAT_L1ERR 275 /* Signal Layer-1 Error */
  195. #define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
  196. #define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
  197. #define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
  198. /*
  199. * Audio commands
  200. */
  201. #define ISDN_AUDIO_SETDD 0 /* Set DTMF detection */
  202. #define ISDN_AUDIO_DTMF 1 /* Rx/Tx DTMF */
  203. /*
  204. * Values for errcode field
  205. */
  206. #define ISDN_STAT_L1ERR_SEND 1
  207. #define ISDN_STAT_L1ERR_RECV 2
  208. /*
  209. * Values for feature-field of interface-struct.
  210. */
  211. /* Layer 2 */
  212. #define ISDN_FEATURE_L2_X75I (0x0001 << ISDN_PROTO_L2_X75I)
  213. #define ISDN_FEATURE_L2_X75UI (0x0001 << ISDN_PROTO_L2_X75UI)
  214. #define ISDN_FEATURE_L2_X75BUI (0x0001 << ISDN_PROTO_L2_X75BUI)
  215. #define ISDN_FEATURE_L2_HDLC (0x0001 << ISDN_PROTO_L2_HDLC)
  216. #define ISDN_FEATURE_L2_TRANS (0x0001 << ISDN_PROTO_L2_TRANS)
  217. #define ISDN_FEATURE_L2_X25DTE (0x0001 << ISDN_PROTO_L2_X25DTE)
  218. #define ISDN_FEATURE_L2_X25DCE (0x0001 << ISDN_PROTO_L2_X25DCE)
  219. #define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096)
  220. #define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019)
  221. #define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038)
  222. #define ISDN_FEATURE_L2_MODEM (0x0001 << ISDN_PROTO_L2_MODEM)
  223. #define ISDN_FEATURE_L2_FAX (0x0001 << ISDN_PROTO_L2_FAX)
  224. #define ISDN_FEATURE_L2_HDLC_56K (0x0001 << ISDN_PROTO_L2_HDLC_56K)
  225. #define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */
  226. #define ISDN_FEATURE_L2_SHIFT (0)
  227. /* Layer 3 */
  228. #define ISDN_FEATURE_L3_TRANS (0x10000 << ISDN_PROTO_L3_TRANS)
  229. #define ISDN_FEATURE_L3_TRANSDSP (0x10000 << ISDN_PROTO_L3_TRANSDSP)
  230. #define ISDN_FEATURE_L3_FCLASS2 (0x10000 << ISDN_PROTO_L3_FCLASS2)
  231. #define ISDN_FEATURE_L3_FCLASS1 (0x10000 << ISDN_PROTO_L3_FCLASS1)
  232. #define ISDN_FEATURE_L3_MASK (0x0FF0000) /* Max. 8 Protocols */
  233. #define ISDN_FEATURE_L3_SHIFT (16)
  234. /* Signaling */
  235. #define ISDN_FEATURE_P_UNKNOWN (0x1000000 << ISDN_PTYPE_UNKNOWN)
  236. #define ISDN_FEATURE_P_1TR6 (0x1000000 << ISDN_PTYPE_1TR6)
  237. #define ISDN_FEATURE_P_EURO (0x1000000 << ISDN_PTYPE_EURO)
  238. #define ISDN_FEATURE_P_NI1 (0x1000000 << ISDN_PTYPE_NI1)
  239. #define ISDN_FEATURE_P_MASK (0x0FF000000) /* Max. 8 Protocols */
  240. #define ISDN_FEATURE_P_SHIFT (24)
  241. typedef struct setup_parm {
  242. unsigned char phone[32]; /* Remote Phone-Number */
  243. unsigned char eazmsn[32]; /* Local EAZ or MSN */
  244. unsigned char si1; /* Service Indicator 1 */
  245. unsigned char si2; /* Service Indicator 2 */
  246. unsigned char plan; /* Numbering plan */
  247. unsigned char screen; /* Screening info */
  248. } setup_parm;
  249. #ifdef CONFIG_ISDN_TTY_FAX
  250. /* T.30 Fax G3 */
  251. #define FAXIDLEN 21
  252. typedef struct T30_s {
  253. /* session parameters */
  254. __u8 resolution;
  255. __u8 rate;
  256. __u8 width;
  257. __u8 length;
  258. __u8 compression;
  259. __u8 ecm;
  260. __u8 binary;
  261. __u8 scantime;
  262. __u8 id[FAXIDLEN];
  263. /* additional parameters */
  264. __u8 phase;
  265. __u8 direction;
  266. __u8 code;
  267. __u8 badlin;
  268. __u8 badmul;
  269. __u8 bor;
  270. __u8 fet;
  271. __u8 pollid[FAXIDLEN];
  272. __u8 cq;
  273. __u8 cr;
  274. __u8 ctcrty;
  275. __u8 minsp;
  276. __u8 phcto;
  277. __u8 rel;
  278. __u8 nbc;
  279. /* remote station parameters */
  280. __u8 r_resolution;
  281. __u8 r_rate;
  282. __u8 r_width;
  283. __u8 r_length;
  284. __u8 r_compression;
  285. __u8 r_ecm;
  286. __u8 r_binary;
  287. __u8 r_scantime;
  288. __u8 r_id[FAXIDLEN];
  289. __u8 r_code;
  290. } __attribute__((packed)) T30_s;
  291. #define ISDN_TTY_FAX_CONN_IN 0
  292. #define ISDN_TTY_FAX_CONN_OUT 1
  293. #define ISDN_TTY_FAX_FCON 0
  294. #define ISDN_TTY_FAX_DIS 1
  295. #define ISDN_TTY_FAX_FTT 2
  296. #define ISDN_TTY_FAX_MCF 3
  297. #define ISDN_TTY_FAX_DCS 4
  298. #define ISDN_TTY_FAX_TRAIN_OK 5
  299. #define ISDN_TTY_FAX_EOP 6
  300. #define ISDN_TTY_FAX_EOM 7
  301. #define ISDN_TTY_FAX_MPS 8
  302. #define ISDN_TTY_FAX_DTC 9
  303. #define ISDN_TTY_FAX_RID 10
  304. #define ISDN_TTY_FAX_HNG 11
  305. #define ISDN_TTY_FAX_DT 12
  306. #define ISDN_TTY_FAX_FCON_I 13
  307. #define ISDN_TTY_FAX_DR 14
  308. #define ISDN_TTY_FAX_ET 15
  309. #define ISDN_TTY_FAX_CFR 16
  310. #define ISDN_TTY_FAX_PTS 17
  311. #define ISDN_TTY_FAX_SENT 18
  312. #define ISDN_FAX_PHASE_IDLE 0
  313. #define ISDN_FAX_PHASE_A 1
  314. #define ISDN_FAX_PHASE_B 2
  315. #define ISDN_FAX_PHASE_C 3
  316. #define ISDN_FAX_PHASE_D 4
  317. #define ISDN_FAX_PHASE_E 5
  318. #endif /* TTY_FAX */
  319. #define ISDN_FAX_CLASS1_FAE 0
  320. #define ISDN_FAX_CLASS1_FTS 1
  321. #define ISDN_FAX_CLASS1_FRS 2
  322. #define ISDN_FAX_CLASS1_FTM 3
  323. #define ISDN_FAX_CLASS1_FRM 4
  324. #define ISDN_FAX_CLASS1_FTH 5
  325. #define ISDN_FAX_CLASS1_FRH 6
  326. #define ISDN_FAX_CLASS1_CTRL 7
  327. #define ISDN_FAX_CLASS1_OK 0
  328. #define ISDN_FAX_CLASS1_CONNECT 1
  329. #define ISDN_FAX_CLASS1_NOCARR 2
  330. #define ISDN_FAX_CLASS1_ERROR 3
  331. #define ISDN_FAX_CLASS1_FCERROR 4
  332. #define ISDN_FAX_CLASS1_QUERY 5
  333. typedef struct {
  334. __u8 cmd;
  335. __u8 subcmd;
  336. __u8 para[50];
  337. } aux_s;
  338. #define AT_COMMAND 0
  339. #define AT_EQ_VALUE 1
  340. #define AT_QUERY 2
  341. #define AT_EQ_QUERY 3
  342. /* CAPI structs */
  343. /* this is compatible to the old union size */
  344. #define MAX_CAPI_PARA_LEN 50
  345. typedef struct {
  346. /* Header */
  347. __u16 Length;
  348. __u16 ApplId;
  349. __u8 Command;
  350. __u8 Subcommand;
  351. __u16 Messagenumber;
  352. /* Parameter */
  353. union {
  354. __u32 Controller;
  355. __u32 PLCI;
  356. __u32 NCCI;
  357. } adr;
  358. __u8 para[MAX_CAPI_PARA_LEN];
  359. } capi_msg;
  360. /*
  361. * Structure for exchanging above infos
  362. *
  363. */
  364. typedef struct {
  365. int driver; /* Lowlevel-Driver-ID */
  366. int command; /* Command or Status (see above) */
  367. ulong arg; /* Additional Data */
  368. union {
  369. ulong errcode; /* Type of error with STAT_L1ERR */
  370. int length; /* Amount of bytes sent with STAT_BSENT */
  371. u_char num[50]; /* Additional Data */
  372. setup_parm setup;/* For SETUP msg */
  373. capi_msg cmsg; /* For CAPI like messages */
  374. char display[85];/* display message data */
  375. isdn_cmd_stat isdn_io; /* ISDN IO-parameter/result */
  376. aux_s aux; /* for modem commands/indications */
  377. #ifdef CONFIG_ISDN_TTY_FAX
  378. T30_s *fax; /* Pointer to ttys fax struct */
  379. #endif
  380. ulong userdata; /* User Data */
  381. } parm;
  382. } isdn_ctrl;
  383. #define dss1_io isdn_io
  384. #define ni1_io isdn_io
  385. /*
  386. * The interface-struct itself (initialized at load-time of lowlevel-driver)
  387. *
  388. * See Documentation/isdn/INTERFACE for a description, how the communication
  389. * between the ISDN subsystem and its drivers is done.
  390. *
  391. */
  392. typedef struct {
  393. struct module *owner;
  394. /* Number of channels supported by this driver
  395. */
  396. int channels;
  397. /*
  398. * Maximum Size of transmit/receive-buffer this driver supports.
  399. */
  400. int maxbufsize;
  401. /* Feature-Flags for this driver.
  402. * See defines ISDN_FEATURE_... for Values
  403. */
  404. unsigned long features;
  405. /*
  406. * Needed for calculating
  407. * dev->hard_header_len = linklayer header + hl_hdrlen;
  408. * Drivers, not supporting sk_buff's should set this to 0.
  409. */
  410. unsigned short hl_hdrlen;
  411. /*
  412. * Receive-Callback using sk_buff's
  413. * Parameters:
  414. * int Driver-ID
  415. * int local channel-number (0 ...)
  416. * struct sk_buff *skb received Data
  417. */
  418. void (*rcvcallb_skb)(int, int, struct sk_buff *);
  419. /* Status-Callback
  420. * Parameters:
  421. * isdn_ctrl*
  422. * driver = Driver ID.
  423. * command = One of above ISDN_STAT_... constants.
  424. * arg = depending on status-type.
  425. * num = depending on status-type.
  426. */
  427. int (*statcallb)(isdn_ctrl*);
  428. /* Send command
  429. * Parameters:
  430. * isdn_ctrl*
  431. * driver = Driver ID.
  432. * command = One of above ISDN_CMD_... constants.
  433. * arg = depending on command.
  434. * num = depending on command.
  435. */
  436. int (*command)(isdn_ctrl*);
  437. /*
  438. * Send data using sk_buff's
  439. * Parameters:
  440. * int driverId
  441. * int local channel-number (0...)
  442. * int Flag: Need ACK for this packet.
  443. * struct sk_buff *skb Data to send
  444. */
  445. int (*writebuf_skb) (int, int, int, struct sk_buff *);
  446. /* Send raw D-Channel-Commands
  447. * Parameters:
  448. * u_char pointer data
  449. * int length of data
  450. * int driverId
  451. * int local channel-number (0 ...)
  452. */
  453. int (*writecmd)(const u_char __user *, int, int, int);
  454. /* Read raw Status replies
  455. * u_char pointer data (volatile)
  456. * int length of buffer
  457. * int driverId
  458. * int local channel-number (0 ...)
  459. */
  460. int (*readstat)(u_char __user *, int, int, int);
  461. char id[20];
  462. } isdn_if;
  463. /*
  464. * Function which must be called by lowlevel-driver at loadtime with
  465. * the following fields of above struct set:
  466. *
  467. * channels Number of channels that will be supported.
  468. * hl_hdrlen Space to preserve in sk_buff's when sending. Drivers, not
  469. * supporting sk_buff's should set this to 0.
  470. * command Address of Command-Handler.
  471. * features Bitwise coded Features of this driver. (use ISDN_FEATURE_...)
  472. * writebuf_skb Address of Skbuff-Send-Handler.
  473. * writecmd " " D-Channel " which accepts raw D-Ch-Commands.
  474. * readstat " " D-Channel " which delivers raw Status-Data.
  475. *
  476. * The linklevel-driver fills the following fields:
  477. *
  478. * channels Driver-ID assigned to this driver. (Must be used on all
  479. * subsequent callbacks.
  480. * rcvcallb_skb Address of handler for received Skbuff's.
  481. * statcallb " " " for status-changes.
  482. *
  483. */
  484. extern int register_isdn(isdn_if*);
  485. #include <asm/uaccess.h>
  486. #endif /* __KERNEL__ */
  487. #endif /* __ISDNIF_H__ */