📄 hisax.h
字号:
/* $Id: hisax.h,v 2.52.6.1 2000/12/06 16:59:19 kai Exp $ * * Basic declarations, defines and prototypes * * This file is (c) under GNU PUBLIC LICENSE * */#include <linux/config.h>#include <linux/module.h>#include <linux/version.h>#include <linux/errno.h>#include <linux/fs.h>#include <linux/major.h>#include <asm/segment.h>#include <asm/io.h>#include <linux/delay.h>#include <linux/kernel.h>#include <linux/signal.h>#include <linux/malloc.h>#include <linux/mm.h>#include <linux/mman.h>#include <linux/ioport.h>#include <linux/timer.h>#include <linux/wait.h>#include <linux/isdnif.h>#include <linux/tty.h>#include <linux/serial_reg.h>#include <linux/netdevice.h>#define ERROR_STATISTIC#define REQUEST 0#define CONFIRM 1#define INDICATION 2#define RESPONSE 3#define HW_ENABLE 0x0000#define HW_RESET 0x0004#define HW_POWERUP 0x0008#define HW_ACTIVATE 0x0010#define HW_DEACTIVATE 0x0018#define HW_INFO1 0x0010#define HW_INFO2 0x0020#define HW_INFO3 0x0030#define HW_INFO4 0x0040#define HW_INFO4_P8 0x0040#define HW_INFO4_P10 0x0048#define HW_RSYNC 0x0060#define HW_TESTLOOP 0x0070#define CARD_RESET 0x00F0#define CARD_INIT 0x00F2#define CARD_RELEASE 0x00F3#define CARD_TEST 0x00F4#define CARD_AUX_IND 0x00F5#define PH_ACTIVATE 0x0100#define PH_DEACTIVATE 0x0110#define PH_DATA 0x0120#define PH_PULL 0x0130#define PH_TESTLOOP 0x0140#define PH_PAUSE 0x0150#define MPH_ACTIVATE 0x0180#define MPH_DEACTIVATE 0x0190#define MPH_INFORMATION 0x01A0#define DL_ESTABLISH 0x0200#define DL_RELEASE 0x0210#define DL_DATA 0x0220#define DL_FLUSH 0x0224#define DL_UNIT_DATA 0x0230#define MDL_ASSIGN 0x0280#define MDL_REMOVE 0x0284#define MDL_ERROR 0x0288#define MDL_INFO_SETUP 0x02E0#define MDL_INFO_CONN 0x02E4#define MDL_INFO_REL 0x02E8#define CC_SETUP 0x0300#define CC_RESUME 0x0304#define CC_MORE_INFO 0x0310#define CC_IGNORE 0x0320#define CC_REJECT 0x0324#define CC_SETUP_COMPL 0x0330#define CC_PROCEEDING 0x0340#define CC_ALERTING 0x0344#define CC_PROGRESS 0x0348#define CC_CONNECT 0x0350#define CC_CHARGE 0x0354#define CC_NOTIFY 0x0358#define CC_DISCONNECT 0x0360#define CC_RELEASE 0x0368#define CC_SUSPEND 0x0370#define CC_PROCEED_SEND 0x0374#define CC_REDIR 0x0378#define CC_T302 0x0382#define CC_T303 0x0383#define CC_T304 0x0384#define CC_T305 0x0385#define CC_T308_1 0x0388#define CC_T308_2 0x038A#define CC_T309 0x0309#define CC_T310 0x0390#define CC_T313 0x0393#define CC_T318 0x0398#define CC_T319 0x0399#define CC_TSPID 0x03A0#define CC_NOSETUP_RSP 0x03E0#define CC_SETUP_ERR 0x03E1#define CC_SUSPEND_ERR 0x03E2#define CC_RESUME_ERR 0x03E3#define CC_CONNECT_ERR 0x03E4#define CC_RELEASE_ERR 0x03E5#define CC_RESTART 0x03F4#define CC_TDSS1_IO 0x13F4 /* DSS1 IO user timer */#define CC_TNI1_IO 0x13F5 /* NI1 IO user timer *//* define maximum number of possible waiting incoming calls */#define MAX_WAITING_CALLS 2#ifdef __KERNEL__/* include l3dss1 & ni1 specific process structures, but no other defines */#ifdef CONFIG_HISAX_EURO #define l3dss1_process #include "l3dss1.h" #undef l3dss1_process#endif CONFIG_HISAX_EURO#ifdef CONFIG_HISAX_NI1 #define l3ni1_process #include "l3ni1.h" #undef l3ni1_process#endif CONFIG_HISAX_NI1#define MAX_DFRAME_LEN 260#define MAX_DFRAME_LEN_L1 300#define HSCX_BUFMAX 4096#define MAX_DATA_SIZE (HSCX_BUFMAX - 4)#define MAX_DATA_MEM (HSCX_BUFMAX + 64)#define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)#define MAX_HEADER_LEN 4#define MAX_WINDOW 8#define MAX_MON_FRAME 32#define MAX_DLOG_SPACE 2048#define MAX_BLOG_SPACE 256/* #define I4L_IRQ_FLAG SA_INTERRUPT */#define I4L_IRQ_FLAG 0/* * Statemachine */struct FsmInst;typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);struct Fsm { FSMFNPTR *jumpmatrix; int state_count, event_count; char **strEvent, **strState;};struct FsmInst { struct Fsm *fsm; int state; int debug; void *userdata; int userint; void (*printdebug) (struct FsmInst *, char *, ...);};struct FsmNode { int state, event; void (*routine) (struct FsmInst *, int, void *);};struct FsmTimer { struct FsmInst *fi; struct timer_list tl; int event; void *arg;};struct L3Timer { struct l3_process *pc; struct timer_list tl; int event;};#define FLG_L1_ACTIVATING 1#define FLG_L1_ACTIVATED 2#define FLG_L1_DEACTTIMER 3#define FLG_L1_ACTTIMER 4#define FLG_L1_T3RUN 5#define FLG_L1_PULL_REQ 6#define FLG_L1_UINT 7struct Layer1 { void *hardware; struct BCState *bcs; struct PStack **stlistp; long Flags; struct FsmInst l1m; struct FsmTimer timer; void (*l1l2) (struct PStack *, int, void *); void (*l1hw) (struct PStack *, int, void *); void (*l1tei) (struct PStack *, int, void *); int mode, bc; int delay;};#define GROUP_TEI 127#define TEI_SAPI 63#define CTRL_SAPI 0#define PACKET_NOACK 250/* Layer2 Flags */#define FLG_LAPB 0#define FLG_LAPD 1#define FLG_ORIG 2#define FLG_MOD128 3#define FLG_PEND_REL 4#define FLG_L3_INIT 5#define FLG_T200_RUN 6#define FLG_ACK_PEND 7#define FLG_REJEXC 8#define FLG_OWN_BUSY 9#define FLG_PEER_BUSY 10#define FLG_DCHAN_BUSY 11#define FLG_L1_ACTIV 12#define FLG_ESTAB_PEND 13#define FLG_PTP 14#define FLG_FIXED_TEI 15#define FLG_L2BLOCK 16struct Layer2 { int tei; int sap; int maxlen; unsigned long flag; unsigned int vs, va, vr; int rc; unsigned int window; unsigned int sow; struct sk_buff *windowar[MAX_WINDOW]; struct sk_buff_head i_queue; struct sk_buff_head ui_queue; void (*l2l1) (struct PStack *, int, void *); void (*l2l3) (struct PStack *, int, void *); void (*l2tei) (struct PStack *, int, void *); struct FsmInst l2m; struct FsmTimer t200, t203; int T200, N200, T203; int debug; char debug_id[16];};struct Layer3 { void (*l3l4) (struct PStack *, int, void *); void (*l3ml3) (struct PStack *, int, void *); void (*l3l2) (struct PStack *, int, void *); struct FsmInst l3m; struct FsmTimer l3m_timer; struct sk_buff_head squeue; struct l3_process *proc; struct l3_process *global; int N303; int debug; char debug_id[8];};struct LLInterface { void (*l4l3) (struct PStack *, int, void *); int (*l4l3_proto) (struct PStack *, isdn_ctrl *); void *userdata; void (*l1writewakeup) (struct PStack *, int); void (*l2writewakeup) (struct PStack *, int);};struct Management { int ri; struct FsmInst tei_m; struct FsmTimer t202; int T202, N202, debug; void (*layer) (struct PStack *, int, void *);};#define NO_CAUSE 254struct Param { u_char cause; u_char loc; u_char diag[6]; int bchannel; int chargeinfo; int spv; /* SPV Flag */ setup_parm setup; /* from isdnif.h numbers and Serviceindicator */ u_char moderate; /* transfer mode and rate (bearer octet 4) */};struct PStack { struct PStack *next; struct Layer1 l1; struct Layer2 l2; struct Layer3 l3; struct LLInterface lli; struct Management ma; int protocol; /* EDSS1, 1TR6 or NI1 */ /* protocol specific data fields */ union { u_char uuuu; /* only as dummy */#ifdef CONFIG_HISAX_EURO dss1_stk_priv dss1; /* private dss1 data */#endif CONFIG_HISAX_EURO #ifdef CONFIG_HISAX_NI1 ni1_stk_priv ni1; /* private ni1 data */#endif CONFIG_HISAX_NI1 } prot;};struct l3_process { int callref; int state; struct L3Timer timer; int N303; int debug; struct Param para; struct Channel *chan; struct PStack *st; struct l3_process *next; ulong redir_result; /* protocol specific data fields */ union { u_char uuuu; /* only when euro not defined, avoiding empty union */#ifdef CONFIG_HISAX_EURO dss1_proc_priv dss1; /* private dss1 data */#endif CONFIG_HISAX_EURO #ifdef CONFIG_HISAX_NI1 ni1_proc_priv ni1; /* private ni1 data */#endif CONFIG_HISAX_NI1 } prot;};struct hscx_hw { int hscx; int rcvidx; int count; /* Current skb sent count */ u_char *rcvbuf; /* B-Channel receive Buffer */ u_char tsaxr0; u_char tsaxr1;};struct w6692B_hw { int bchan; int rcvidx; int count; /* Current skb sent count */ u_char *rcvbuf; /* B-Channel receive Buffer */};struct isar_reg { unsigned long Flags; volatile u_char bstat; volatile u_char iis; volatile u_char cmsb; volatile u_char clsb; volatile u_char par[8];};struct isar_hw { int dpath; int rcvidx; int txcnt; int mml; u_char state; u_char cmd; u_char mod; u_char newcmd; u_char newmod; char try_mod; struct timer_list ftimer; u_char *rcvbuf; /* B-Channel receive Buffer */ u_char conmsg[16]; struct isar_reg *reg;};struct hdlc_stat_reg {#ifdef __BIG_ENDIAN u_char fill __attribute__((packed)); u_char mode __attribute__((packed)); u_char xml __attribute__((packed)); u_char cmd __attribute__((packed));#else u_char cmd __attribute__((packed)); u_char xml __attribute__((packed)); u_char mode __attribute__((packed)); u_char fill __attribute__((packed));#endif};struct hdlc_hw { union { u_int ctrl; struct hdlc_stat_reg sr; } ctrl; u_int stat; int rcvidx; int count; /* Current skb sent count */ u_char *rcvbuf; /* B-Channel receive Buffer */};struct hfcB_hw { unsigned int *send; int f1; int f2;};struct tiger_hw { u_int *send; u_int *s_irq; u_int *s_end; u_int *sendp; u_int *rec; int free; u_char *rcvbuf; u_char *sendbuf; u_char *sp; int sendcnt; u_int s_tot; u_int r_bitcnt; u_int r_tot; u_int r_err; u_int r_fcs; u_char r_state; u_char r_one; u_char r_val; u_char s_state;};struct amd7930_hw { u_char *tx_buff; u_char *rv_buff; int rv_buff_in; int rv_buff_out; struct sk_buff *rv_skb; struct hdlc_state *hdlc_state; struct tq_struct tq_rcv; struct tq_struct tq_xmt;};#define BC_FLG_INIT 1#define BC_FLG_ACTIV 2#define BC_FLG_BUSY 3#define BC_FLG_NOFRAME 4#define BC_FLG_HALF 5#define BC_FLG_EMPTY 6#define BC_FLG_ORIG 7#define BC_FLG_DLEETX 8#define BC_FLG_LASTDLE 9#define BC_FLG_FIRST 10#define BC_FLG_LASTDATA 11#define BC_FLG_NMD_DATA 12#define BC_FLG_FTI_RUN 13#define BC_FLG_LL_OK 14#define BC_FLG_LL_CONN 15#define L1_MODE_NULL 0#define L1_MODE_TRANS 1#define L1_MODE_HDLC 2#define L1_MODE_EXTRN 3#define L1_MODE_HDLC_56K 4#define L1_MODE_MODEM 7#define L1_MODE_V32 8#define L1_MODE_FAX 9struct BCState { int channel; int mode; long Flag; /* long req'd for set_bit --RR */ struct IsdnCardState *cs; int tx_cnt; /* B-Channel transmit counter */ struct sk_buff *tx_skb; /* B-Channel transmit Buffer */ struct sk_buff_head rqueue; /* B-Channel receive Queue */ struct sk_buff_head squeue; /* B-Channel send Queue */ struct PStack *st; u_char *blog; u_char *conmsg; struct timer_list transbusy; struct tq_struct tqueue; int event; int (*BC_SetStack) (struct PStack *, struct BCState *); void (*BC_Close) (struct BCState *);#ifdef ERROR_STATISTIC int err_crc; int err_tx; int err_rdo; int err_inv;#endif union { struct hscx_hw hscx; struct hdlc_hw hdlc; struct isar_hw isar; struct hfcB_hw hfc; struct tiger_hw tiger; struct amd7930_hw amd7930; struct w6692B_hw w6692; } hw;};struct Channel { struct PStack *b_st, *d_st; struct IsdnCardState *cs; struct BCState *bcs; int chan; int incoming; struct FsmInst fi; struct FsmTimer drel_timer, dial_timer; int debug; int l2_protocol, l2_active_protocol; int l3_protocol; int data_open; struct l3_process *proc; setup_parm setup; /* from isdnif.h numbers and Serviceindicator */ long Flags; /* for remembering action done in l4 */ /* long req'd for set_bit --RR */ int leased;};struct elsa_hw { unsigned int base; unsigned int cfg; unsigned int ctrl; unsigned int ale; unsigned int isac; unsigned int itac; unsigned int hscx; unsigned int trig; unsigned int timer; unsigned int counter; unsigned int status; struct timer_list tl; unsigned int MFlag; struct BCState *bcs; u_char *transbuf; u_char *rcvbuf; unsigned int transp; unsigned int rcvp; unsigned int transcnt; unsigned int rcvcnt; u_char IER; u_char FCR; u_char LCR; u_char MCR; u_char ctrl_reg;};struct teles3_hw { unsigned int cfg_reg; signed int isac; signed int hscx[2]; signed int isacfifo; signed int hscxfifo[2];};struct teles0_hw { unsigned int cfg_reg; unsigned long membase; unsigned long phymem;};struct avm_hw { unsigned int cfg_reg; unsigned int isac; unsigned int hscx[2]; unsigned int isacfifo; unsigned int hscxfifo[2]; unsigned int counter;};struct ix1_hw { unsigned int cfg_reg; unsigned int isac_ale; unsigned int isac; unsigned int hscx_ale; unsigned int hscx;};struct diva_hw { unsigned long cfg_reg; unsigned long pci_cfg; unsigned int ctrl; unsigned int isac_adr; unsigned int isac; unsigned int hscx_adr; unsigned int hscx; unsigned int status; struct timer_list tl; u_char ctrl_reg;};struct asus_hw { unsigned int cfg_reg; unsigned int adr; unsigned int isac; unsigned int hscx; unsigned int u7; unsigned int pots;};struct hfc_hw { unsigned int addr; unsigned int fifosize; unsigned char cirm; unsigned char ctmt; unsigned char cip; u_char isac_spcr; struct timer_list timer;};struct sedl_hw { unsigned int cfg_reg; unsigned int adr; unsigned int isac; unsigned int hscx; unsigned int reset_on; unsigned int reset_off; struct isar_reg isar; unsigned int chip; unsigned int bus;};struct spt_hw { unsigned int cfg_reg; unsigned int isac; unsigned int hscx[2]; unsigned char res_irq;};struct mic_hw { unsigned int cfg_reg; unsigned int adr; unsigned int isac; unsigned int hscx;};struct njet_hw { unsigned int base; unsigned int isac; unsigned int auxa; unsigned char auxd; unsigned char dmactrl; unsigned char ctrl_reg; unsigned char irqmask0; unsigned char irqstat0; unsigned char last_is0;};struct hfcPCI_hw { unsigned char cirm; unsigned char ctmt; unsigned char conn; unsigned char mst_m; unsigned char int_m1; unsigned char int_m2; unsigned char int_s1; unsigned char sctrl; unsigned char sctrl_r; unsigned char sctrl_e;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -