aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mISDNif.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mISDNif.h')
-rw-r--r--include/linux/mISDNif.h92
1 files changed, 78 insertions, 14 deletions
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h
index 8f2d60da04e7..5da3d95b27f1 100644
--- a/include/linux/mISDNif.h
+++ b/include/linux/mISDNif.h
@@ -36,8 +36,8 @@
36 * - should be incremented on every checkin 36 * - should be incremented on every checkin
37 */ 37 */
38#define MISDN_MAJOR_VERSION 1 38#define MISDN_MAJOR_VERSION 1
39#define MISDN_MINOR_VERSION 0 39#define MISDN_MINOR_VERSION 1
40#define MISDN_RELEASE 19 40#define MISDN_RELEASE 20
41 41
42/* primitives for information exchange 42/* primitives for information exchange
43 * generell format 43 * generell format
@@ -80,6 +80,7 @@
80#define PH_DEACTIVATE_IND 0x0202 80#define PH_DEACTIVATE_IND 0x0202
81#define PH_DEACTIVATE_CNF 0x4202 81#define PH_DEACTIVATE_CNF 0x4202
82#define PH_DATA_IND 0x2002 82#define PH_DATA_IND 0x2002
83#define PH_DATA_E_IND 0x3002
83#define MPH_ACTIVATE_IND 0x0502 84#define MPH_ACTIVATE_IND 0x0502
84#define MPH_DEACTIVATE_IND 0x0602 85#define MPH_DEACTIVATE_IND 0x0602
85#define MPH_INFORMATION_IND 0x0702 86#define MPH_INFORMATION_IND 0x0702
@@ -199,6 +200,18 @@
199#define ISDN_P_NT_S0 0x02 200#define ISDN_P_NT_S0 0x02
200#define ISDN_P_TE_E1 0x03 201#define ISDN_P_TE_E1 0x03
201#define ISDN_P_NT_E1 0x04 202#define ISDN_P_NT_E1 0x04
203#define ISDN_P_TE_UP0 0x05
204#define ISDN_P_NT_UP0 0x06
205
206#define IS_ISDN_P_TE(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_TE_E1) || \
207 (p == ISDN_P_TE_UP0) || (p == ISDN_P_LAPD_TE))
208#define IS_ISDN_P_NT(p) ((p == ISDN_P_NT_S0) || (p == ISDN_P_NT_E1) || \
209 (p == ISDN_P_NT_UP0) || (p == ISDN_P_LAPD_NT))
210#define IS_ISDN_P_S0(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_NT_S0))
211#define IS_ISDN_P_E1(p) ((p == ISDN_P_TE_E1) || (p == ISDN_P_NT_E1))
212#define IS_ISDN_P_UP0(p) ((p == ISDN_P_TE_UP0) || (p == ISDN_P_NT_UP0))
213
214
202#define ISDN_P_LAPD_TE 0x10 215#define ISDN_P_LAPD_TE 0x10
203#define ISDN_P_LAPD_NT 0x11 216#define ISDN_P_LAPD_NT 0x11
204 217
@@ -255,16 +268,6 @@ struct sockaddr_mISDN {
255 unsigned char tei; 268 unsigned char tei;
256}; 269};
257 270
258/* timer device ioctl */
259#define IMADDTIMER _IOR('I', 64, int)
260#define IMDELTIMER _IOR('I', 65, int)
261/* socket ioctls */
262#define IMGETVERSION _IOR('I', 66, int)
263#define IMGETCOUNT _IOR('I', 67, int)
264#define IMGETDEVINFO _IOR('I', 68, int)
265#define IMCTRLREQ _IOR('I', 69, int)
266#define IMCLEAR_L2 _IOR('I', 70, int)
267
268struct mISDNversion { 271struct mISDNversion {
269 unsigned char major; 272 unsigned char major;
270 unsigned char minor; 273 unsigned char minor;
@@ -281,6 +284,40 @@ struct mISDN_devinfo {
281 char name[MISDN_MAX_IDLEN]; 284 char name[MISDN_MAX_IDLEN];
282}; 285};
283 286
287struct mISDN_devrename {
288 u_int id;
289 char name[MISDN_MAX_IDLEN]; /* new name */
290};
291
292/* MPH_INFORMATION_REQ payload */
293struct ph_info_ch {
294 __u32 protocol;
295 __u64 Flags;
296};
297
298struct ph_info_dch {
299 struct ph_info_ch ch;
300 __u16 state;
301 __u16 num_bch;
302};
303
304struct ph_info {
305 struct ph_info_dch dch;
306 struct ph_info_ch bch[];
307};
308
309/* timer device ioctl */
310#define IMADDTIMER _IOR('I', 64, int)
311#define IMDELTIMER _IOR('I', 65, int)
312
313/* socket ioctls */
314#define IMGETVERSION _IOR('I', 66, int)
315#define IMGETCOUNT _IOR('I', 67, int)
316#define IMGETDEVINFO _IOR('I', 68, int)
317#define IMCTRLREQ _IOR('I', 69, int)
318#define IMCLEAR_L2 _IOR('I', 70, int)
319#define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename)
320
284static inline int 321static inline int
285test_channelmap(u_int nr, u_char *map) 322test_channelmap(u_int nr, u_char *map)
286{ 323{
@@ -312,6 +349,8 @@ clear_channelmap(u_int nr, u_char *map)
312#define MISDN_CTRL_SETPEER 0x0040 349#define MISDN_CTRL_SETPEER 0x0040
313#define MISDN_CTRL_UNSETPEER 0x0080 350#define MISDN_CTRL_UNSETPEER 0x0080
314#define MISDN_CTRL_RX_OFF 0x0100 351#define MISDN_CTRL_RX_OFF 0x0100
352#define MISDN_CTRL_FILL_EMPTY 0x0200
353#define MISDN_CTRL_GETPEER 0x0400
315#define MISDN_CTRL_HW_FEATURES_OP 0x2000 354#define MISDN_CTRL_HW_FEATURES_OP 0x2000
316#define MISDN_CTRL_HW_FEATURES 0x2001 355#define MISDN_CTRL_HW_FEATURES 0x2001
317#define MISDN_CTRL_HFC_OP 0x4000 356#define MISDN_CTRL_HFC_OP 0x4000
@@ -362,6 +401,7 @@ struct mISDN_ctrl_req {
362#define DEBUG_L2_TEI 0x00100000 401#define DEBUG_L2_TEI 0x00100000
363#define DEBUG_L2_TEIFSM 0x00200000 402#define DEBUG_L2_TEIFSM 0x00200000
364#define DEBUG_TIMER 0x01000000 403#define DEBUG_TIMER 0x01000000
404#define DEBUG_CLOCK 0x02000000
365 405
366#define mISDN_HEAD_P(s) ((struct mISDNhead *)&s->cb[0]) 406#define mISDN_HEAD_P(s) ((struct mISDNhead *)&s->cb[0])
367#define mISDN_HEAD_PRIM(s) (((struct mISDNhead *)&s->cb[0])->prim) 407#define mISDN_HEAD_PRIM(s) (((struct mISDNhead *)&s->cb[0])->prim)
@@ -375,6 +415,7 @@ struct mISDN_ctrl_req {
375struct mISDNchannel; 415struct mISDNchannel;
376struct mISDNdevice; 416struct mISDNdevice;
377struct mISDNstack; 417struct mISDNstack;
418struct mISDNclock;
378 419
379struct channel_req { 420struct channel_req {
380 u_int protocol; 421 u_int protocol;
@@ -423,7 +464,6 @@ struct mISDN_sock {
423struct mISDNdevice { 464struct mISDNdevice {
424 struct mISDNchannel D; 465 struct mISDNchannel D;
425 u_int id; 466 u_int id;
426 char name[MISDN_MAX_IDLEN];
427 u_int Dprotocols; 467 u_int Dprotocols;
428 u_int Bprotocols; 468 u_int Bprotocols;
429 u_int nrbchan; 469 u_int nrbchan;
@@ -452,6 +492,16 @@ struct mISDNstack {
452#endif 492#endif
453}; 493};
454 494
495typedef int (clockctl_func_t)(void *, int);
496
497struct mISDNclock {
498 struct list_head list;
499 char name[64];
500 int pri;
501 clockctl_func_t *ctl;
502 void *priv;
503};
504
455/* global alloc/queue functions */ 505/* global alloc/queue functions */
456 506
457static inline struct sk_buff * 507static inline struct sk_buff *
@@ -498,12 +548,26 @@ _queue_data(struct mISDNchannel *ch, u_int prim,
498 548
499/* global register/unregister functions */ 549/* global register/unregister functions */
500 550
501extern int mISDN_register_device(struct mISDNdevice *, char *name); 551extern int mISDN_register_device(struct mISDNdevice *,
552 struct device *parent, char *name);
502extern void mISDN_unregister_device(struct mISDNdevice *); 553extern void mISDN_unregister_device(struct mISDNdevice *);
503extern int mISDN_register_Bprotocol(struct Bprotocol *); 554extern int mISDN_register_Bprotocol(struct Bprotocol *);
504extern void mISDN_unregister_Bprotocol(struct Bprotocol *); 555extern void mISDN_unregister_Bprotocol(struct Bprotocol *);
556extern struct mISDNclock *mISDN_register_clock(char *, int, clockctl_func_t *,
557 void *);
558extern void mISDN_unregister_clock(struct mISDNclock *);
559
560static inline struct mISDNdevice *dev_to_mISDN(struct device *dev)
561{
562 if (dev)
563 return dev_get_drvdata(dev);
564 else
565 return NULL;
566}
505 567
506extern void set_channel_address(struct mISDNchannel *, u_int, u_int); 568extern void set_channel_address(struct mISDNchannel *, u_int, u_int);
569extern void mISDN_clock_update(struct mISDNclock *, int, struct timeval *);
570extern unsigned short mISDN_clock_get(void);
507 571
508#endif /* __KERNEL__ */ 572#endif /* __KERNEL__ */
509#endif /* mISDNIF_H */ 573#endif /* mISDNIF_H */