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

📄 isdnif.h

📁 umon bootloader source code, support mips cpu.
💻 H
📖 第 1 页 / 共 2 页
字号:
} setup_parm;


#ifdef CONFIG_ISDN_TTY_FAX
/* T.30 Fax G3 */

#define FAXIDLEN 21

typedef 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 */

#define ISDN_FAX_CLASS1_FAE	0
#define ISDN_FAX_CLASS1_FTS	1
#define ISDN_FAX_CLASS1_FRS	2
#define ISDN_FAX_CLASS1_FTM	3
#define ISDN_FAX_CLASS1_FRM	4
#define ISDN_FAX_CLASS1_FTH	5
#define ISDN_FAX_CLASS1_FRH	6
#define ISDN_FAX_CLASS1_CTRL	7

#define ISDN_FAX_CLASS1_OK	0
#define ISDN_FAX_CLASS1_CONNECT	1
#define ISDN_FAX_CLASS1_NOCARR	2
#define ISDN_FAX_CLASS1_ERROR	3
#define ISDN_FAX_CLASS1_FCERROR	4
#define ISDN_FAX_CLASS1_QUERY	5

typedef struct {
	__u8	cmd;
	__u8	subcmd;
	__u8	para[50];
} aux_s;

#define AT_COMMAND	0
#define AT_EQ_VALUE	1
#define AT_QUERY	2
#define AT_EQ_QUERY	3

/* CAPI structs */

/* this is compatible to the old union size */
#define MAX_CAPI_PARA_LEN 50

typedef 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		*/ 
		isdn_cmd_stat isdn_io; /* ISDN IO-parameter/result	*/
		aux_s aux;	/* for modem commands/indications	*/
#ifdef CONFIG_ISDN_TTY_FAX
		T30_s	*fax;	/* Pointer to ttys fax struct		*/
#endif
		ulong userdata;	/* User Data */
	} parm;
} isdn_ctrl;

#define dss1_io    isdn_io
#define ni1_io     isdn_io

/*
 * 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 {
  struct module *owner;

  /* 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    driverId
   *             int    local channel-number (0 ...)
   */
  int (*writecmd)(const u_char __user *, int, int, int);

  /* Read raw Status replies
   *             u_char pointer data (volatile)
   *             int    length of buffer
   *             int    driverId
   *             int    local channel-number (0 ...)
   */
  int (*readstat)(u_char __user *, 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 + -