⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isdnif.h

📁 基于组件方式开发操作系统的OSKIT源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
#define ISDN_STAT_REDIR   272    /* Redir result                          */#define ISDN_STAT_PROT    273    /* protocol IO specific callback         */#define ISDN_STAT_DISPLAY 274    /* deliver a received display message    */#define ISDN_STAT_L1ERR   275    /* Signal Layer-1 Error                  */#define ISDN_STAT_FAXIND  276    /* FAX indications from HL-driver        */#define ISDN_STAT_AUDIO   277    /* DTMF, DSP indications                 */#define ISDN_STAT_DISCH   278    /* Disable/Enable channel usage          *//* * Audio commands */#define ISDN_AUDIO_SETDD	0	/* Set DTMF detection           */#define ISDN_AUDIO_DTMF		1	/* Rx/Tx DTMF                   *//* * Values for errcode field */#define ISDN_STAT_L1ERR_SEND 1#define ISDN_STAT_L1ERR_RECV 2/* * Values for feature-field of interface-struct. *//* Layer 2 */#define ISDN_FEATURE_L2_X75I    (0x0001 << ISDN_PROTO_L2_X75I)#define ISDN_FEATURE_L2_X75UI   (0x0001 << ISDN_PROTO_L2_X75UI)#define ISDN_FEATURE_L2_X75BUI  (0x0001 << ISDN_PROTO_L2_X75BUI)#define ISDN_FEATURE_L2_HDLC    (0x0001 << ISDN_PROTO_L2_HDLC)#define ISDN_FEATURE_L2_TRANS   (0x0001 << ISDN_PROTO_L2_TRANS)#define ISDN_FEATURE_L2_X25DTE  (0x0001 << ISDN_PROTO_L2_X25DTE)#define ISDN_FEATURE_L2_X25DCE  (0x0001 << ISDN_PROTO_L2_X25DCE)#define ISDN_FEATURE_L2_V11096  (0x0001 << ISDN_PROTO_L2_V11096)#define ISDN_FEATURE_L2_V11019  (0x0001 << ISDN_PROTO_L2_V11019)#define ISDN_FEATURE_L2_V11038  (0x0001 << ISDN_PROTO_L2_V11038)#define ISDN_FEATURE_L2_MODEM   (0x0001 << ISDN_PROTO_L2_MODEM)#define ISDN_FEATURE_L2_FAX	(0x0001 << ISDN_PROTO_L2_FAX)#define ISDN_FEATURE_L2_MASK    (0x0FFFF) /* Max. 16 protocols */#define ISDN_FEATURE_L2_SHIFT   (0)/* Layer 3 */#define ISDN_FEATURE_L3_TRANS   (0x10000 << ISDN_PROTO_L3_TRANS)#define ISDN_FEATURE_L3_TRANSDSP (0x10000 << ISDN_PROTO_L3_TRANSDSP)#define ISDN_FEATURE_L3_FAX	(0x10000 << ISDN_PROTO_L3_FAX)#define ISDN_FEATURE_L3_MASK    (0x0FF0000) /* Max. 8 Protocols */#define ISDN_FEATURE_L3_SHIFT   (16)/* Signaling */#define ISDN_FEATURE_P_UNKNOWN  (0x1000000 << ISDN_PTYPE_UNKNOWN)#define ISDN_FEATURE_P_1TR6     (0x1000000 << ISDN_PTYPE_1TR6)#define ISDN_FEATURE_P_EURO     (0x1000000 << ISDN_PTYPE_EURO)#define ISDN_FEATURE_P_NI1      (0x1000000 << ISDN_PTYPE_NI1)#define ISDN_FEATURE_P_MASK     (0x0FF000000) /* Max. 8 Protocols */#define ISDN_FEATURE_P_SHIFT    (24)typedef struct setup_parm {    unsigned char phone[32];	/* Remote Phone-Number */    unsigned char eazmsn[32];	/* Local EAZ or MSN    */    unsigned char si1;      /* Service Indicator 1 */    unsigned char si2;      /* Service Indicator 2 */    unsigned char plan;     /* Numbering plan      */    unsigned char screen;   /* Screening info      */} setup_parm;#ifdef CONFIG_ISDN_TTY_FAX/* T.30 Fax G3 */#define FAXIDLEN 21typedef struct T30_s {	/* session parameters */	__u8 resolution		__attribute__ ((packed));	__u8 rate		__attribute__ ((packed));	__u8 width		__attribute__ ((packed));	__u8 length		__attribute__ ((packed));	__u8 compression	__attribute__ ((packed));	__u8 ecm		__attribute__ ((packed));	__u8 binary		__attribute__ ((packed));	__u8 scantime		__attribute__ ((packed));	__u8 id[FAXIDLEN]	__attribute__ ((packed));	/* additional parameters */	__u8 phase		__attribute__ ((packed));	__u8 direction		__attribute__ ((packed));	__u8 code		__attribute__ ((packed));	__u8 badlin		__attribute__ ((packed));	__u8 badmul		__attribute__ ((packed));	__u8 bor		__attribute__ ((packed));	__u8 fet		__attribute__ ((packed));	__u8 pollid[FAXIDLEN]	__attribute__ ((packed));	__u8 cq			__attribute__ ((packed));	__u8 cr			__attribute__ ((packed));	__u8 ctcrty		__attribute__ ((packed));	__u8 minsp		__attribute__ ((packed));	__u8 phcto		__attribute__ ((packed));	__u8 rel		__attribute__ ((packed));	__u8 nbc		__attribute__ ((packed));	/* remote station parameters */	__u8 r_resolution	__attribute__ ((packed));	__u8 r_rate		__attribute__ ((packed));	__u8 r_width		__attribute__ ((packed));	__u8 r_length		__attribute__ ((packed));	__u8 r_compression	__attribute__ ((packed));	__u8 r_ecm		__attribute__ ((packed));	__u8 r_binary		__attribute__ ((packed));	__u8 r_scantime		__attribute__ ((packed));	__u8 r_id[FAXIDLEN]	__attribute__ ((packed));	__u8 r_code		__attribute__ ((packed));} T30_s;#define ISDN_TTY_FAX_CONN_IN	0#define ISDN_TTY_FAX_CONN_OUT	1#define ISDN_TTY_FAX_FCON	0#define ISDN_TTY_FAX_DIS 	1#define ISDN_TTY_FAX_FTT 	2#define ISDN_TTY_FAX_MCF 	3#define ISDN_TTY_FAX_DCS 	4#define ISDN_TTY_FAX_TRAIN_OK	5#define ISDN_TTY_FAX_EOP 	6#define ISDN_TTY_FAX_EOM 	7#define ISDN_TTY_FAX_MPS 	8#define ISDN_TTY_FAX_DTC 	9#define ISDN_TTY_FAX_RID 	10#define ISDN_TTY_FAX_HNG 	11#define ISDN_TTY_FAX_DT  	12#define ISDN_TTY_FAX_FCON_I	13#define ISDN_TTY_FAX_DR  	14#define ISDN_TTY_FAX_ET  	15#define ISDN_TTY_FAX_CFR 	16#define ISDN_TTY_FAX_PTS 	17#define ISDN_TTY_FAX_SENT	18#define ISDN_FAX_PHASE_IDLE	0#define ISDN_FAX_PHASE_A	1#define ISDN_FAX_PHASE_B   	2#define ISDN_FAX_PHASE_C   	3#define ISDN_FAX_PHASE_D   	4#define ISDN_FAX_PHASE_E   	5#endif /* TTY_FAX *//* CAPI structs *//* this is compatible to the old union size */#define MAX_CAPI_PARA_LEN 50typedef struct {	/* Header */	__u16 Length;	__u16 ApplId;	__u8 Command;	__u8 Subcommand;	__u16 Messagenumber;	/* Parameter */	union {		__u32 Controller;		__u32 PLCI;		__u32 NCCI;	} adr;	__u8 para[MAX_CAPI_PARA_LEN];} capi_msg;/* * Structure for exchanging above infos * */typedef struct {	int   driver;		/* Lowlevel-Driver-ID            */	int   command;		/* Command or Status (see above) */	ulong arg;		/* Additional Data               */	union {		ulong errcode;	/* Type of error with STAT_L1ERR         */		int length;	/* Amount of bytes sent with STAT_BSENT  */		u_char num[50];/* Additional Data			*/		setup_parm setup;/* For SETUP msg			*/		capi_msg cmsg;	/* For CAPI like messages		*/		char display[85];/* display message data          */ 		dss1_cmd_stat dss1_io; /* DSS1 IO-parameter/result */#ifdef CONFIG_ISDN_TTY_FAX		T30_s	*fax;	/* Pointer to ttys fax struct		*/#endif	} parm;} isdn_ctrl;/* * The interface-struct itself (initialized at load-time of lowlevel-driver) * * See Documentation/isdn/INTERFACE for a description, how the communication * between the ISDN subsystem and its drivers is done. * */typedef struct {  /* Number of channels supported by this driver   */  int channels;  /*    * Maximum Size of transmit/receive-buffer this driver supports.   */  int maxbufsize;  /* Feature-Flags for this driver.   * See defines ISDN_FEATURE_... for Values   */  unsigned long features;  /*   * Needed for calculating   * dev->hard_header_len = linklayer header + hl_hdrlen;   * Drivers, not supporting sk_buff's should set this to 0.   */  unsigned short hl_hdrlen;  /*   * Receive-Callback using sk_buff's   * Parameters:   *             int                    Driver-ID   *             int                    local channel-number (0 ...)   *             struct sk_buff *skb    received Data   */  void (*rcvcallb_skb)(int, int, struct sk_buff *);  /* Status-Callback   * Parameters:   *             isdn_ctrl*   *                   driver  = Driver ID.   *                   command = One of above ISDN_STAT_... constants.   *                   arg     = depending on status-type.   *                   num     = depending on status-type.   */  int (*statcallb)(isdn_ctrl*);  /* Send command   * Parameters:   *             isdn_ctrl*   *                   driver  = Driver ID.   *                   command = One of above ISDN_CMD_... constants.   *                   arg     = depending on command.   *                   num     = depending on command.   */  int (*command)(isdn_ctrl*);  /*   * Send data using sk_buff's   * Parameters:   *             int                    driverId   *             int                    local channel-number (0...)   *             int                    Flag: Need ACK for this packet.   *             struct sk_buff *skb    Data to send   */  int (*writebuf_skb) (int, int, int, struct sk_buff *);  /* Send raw D-Channel-Commands   * Parameters:   *             u_char pointer data   *             int    length of data   *             int    Flag: 0 = Call form Kernel-Space (use memcpy,   *                              no schedule allowed)    *                          1 = Data is in User-Space (use memcpy_fromfs,   *                              may schedule)   *             int    driverId   *             int    local channel-number (0 ...)   */  int (*writecmd)(const u_char*, int, int, int, int);  /* Read raw Status replies   *             u_char pointer data (volatile)   *             int    length of buffer   *             int    Flag: 0 = Call form Kernel-Space (use memcpy,   *                              no schedule allowed)    *                          1 = Data is in User-Space (use memcpy_fromfs,   *                              may schedule)   *             int    driverId   *             int    local channel-number (0 ...)   */  int (*readstat)(u_char*, int, int, int, int);  char id[20];} isdn_if;/* * Function which must be called by lowlevel-driver at loadtime with * the following fields of above struct set: * * channels     Number of channels that will be supported. * hl_hdrlen    Space to preserve in sk_buff's when sending. Drivers, not *              supporting sk_buff's should set this to 0. * command      Address of Command-Handler. * features     Bitwise coded Features of this driver. (use ISDN_FEATURE_...) * writebuf_skb Address of Skbuff-Send-Handler. * writecmd        "    "  D-Channel  " which accepts raw D-Ch-Commands. * readstat        "    "  D-Channel  " which delivers raw Status-Data. * * The linklevel-driver fills the following fields: * * channels      Driver-ID assigned to this driver. (Must be used on all *               subsequent callbacks. * rcvcallb_skb  Address of handler for received Skbuff's. * statcallb        "    "     "    for status-changes. * */extern int register_isdn(isdn_if*);#include <asm/uaccess.h>#endif /* __KERNEL__ */#endif /* isdnif_h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -