/* * Header file for: * BSD Telephony Of Mexico "Tormenta" card driver, version 1.4 12/23/00 * * Part of the "Zapata" Computer Telephony Technology. * * See http://www.bsdtelephony.com.mx * * * The technologies, software, hardware, designs, drawings, scheumatics, board * layouts and/or artwork, concepts, methodologies (including the use of all * of these, and that which is derived from the use of all of these), all other * intellectual properties contained herein, and all intellectual property * rights have been and shall continue to be expressly for the benefit of all * mankind, and are perpetually placed in the public domain, and may be used, * copied, and/or modified by anyone, in any manner, for any legal purpose, * without restriction. * */ #ifndef _MACHINE_TOR_H_ #define _MACHINE_TOR_H_ #include typedef struct tor_params { int sigtype; /* read-only */ int prewinktime; int preflashtime; int winktime; int flashtime; int starttime; int rxwinktime; int rxflashtime; int debouncetime; } TOR_PARAMS; typedef struct tor_spaninfo { int spanno; /* span number */ int alarms; /* alarms status */ int txlevel; /* what TX level is set to */ int rxlevel; /* current RX level */ int bpvcount; /* current BPV count */ int syncsrc; /* span # of current sync source, or 0 for free run */ } TOR_SPANINFO; typedef struct tor_maintinfo { int spanno; /* span number 1-2 */ int command; /* command */ } TOR_MAINTINFO; typedef struct tor_confinfo { int chan; /* channel number, 0 for current */ int confno; /* conference number */ int confmode; /* conferencing mode */ } TOR_CONFINFO; typedef struct tor_gains { int chan; /* channel number, 0 for current */ float rxgain; /* receive gain in db */ float txgain; /* transmit gain in db */ } TOR_GAINS; #define TORMAX 48 /* max physical (real) TOR ports */ #define NCONF (TORMAX/2) /* number of conferences */ /* * Get Transfer Block Size. */ #define TOR_GET_BLOCKSIZE _IOR('s', 4, int *) /* * Set Transfer Block Size. */ #define TOR_SET_BLOCKSIZE _IOW('s', 5, int) /* * Flush Buffer(s) and stop I/O */ #define TOR_FLUSH _IOW('s', 6, int) /* * Wait for Write to Finish */ #define TOR_SYNC _IOW('s', 7, int) /* * Get channel parameters */ #define TOR_GET_PARAMS _IOR('s',8, struct tor_params) /* * Get channel parameters */ #define TOR_SET_PARAMS _IOW('s',9, struct tor_params) /* * Set Hookswitch Status */ #define TOR_HOOK _IOW('s',10,int) /* * Get Signalling Event */ #define TOR_GETEVENT _IOR('s',11,int) /* * Wait for something to happen (IO Mux) */ #define TOR_IOMUX _IOWR('s',12,int) /* * Get Span Status */ #define TOR_SPANSTAT _IOWR('s',13,struct tor_spaninfo) /* * Set Maintenance Mode */ #define TOR_MAINT _IOW('s',14,struct tor_maintinfo) /* * Get Conference Mode */ #define TOR_GETCONF _IOWR('s',15,struct tor_confinfo) /* * Set Conference Mode */ #define TOR_SETCONF _IOWR('s',16,struct tor_confinfo) /* * Setup or Remove Conference Link */ #define TOR_CONFLINK _IOW('s',17,struct tor_confinfo) /* * Display Conference Diagnostic Information on Console */ #define TOR_CONFDIAG _IOR('s',18,int) /* * Get Channel audio gains */ #define TOR_GETGAINS _IOWR('s',19,struct tor_gains) /* * Set Channel audio gains */ #define TOR_SETGAINS _IOWR('s',20,struct tor_gains) /* * Set Conference mute mode */ #define TOR_CONFMUTE _IOW('s',21,int) /* Define the maximum block size */ #define TOR_MAX_BLOCKSIZE 8192 /* Flush and stop the read (input) process */ #define TOR_FLUSH_READ 1 /* Flush and stop the write (output) process */ #define TOR_FLUSH_WRITE 2 /* Flush and stop both (input and output) processes */ #define TOR_FLUSH_BOTH (TOR_FLUSH_READ | TOR_FLUSH_WRITE) /* Flush the event queue */ #define TOR_FLUSH_EVENT 4 /* Flush everything */ #define TOR_FLUSH_ALL (TOR_FLUSH_READ | TOR_FLUSH_WRITE | TOR_FLUSH_EVENT) /* Value for TOR_HOOK, set to ON hook */ #define TOR_ONHOOK 0 /* Value for TOR_HOOK, set to OFF hook */ #define TOR_OFFHOOK 1 /* Value for TOR_HOOK, wink (off hook momentarily) */ #define TOR_WINK 2 /* Value for TOR_HOOK, flash (on hook momentarily) */ #define TOR_FLASH 3 /* Value for TOR_HOOK, start line */ #define TOR_START 4 /* Value for TOR_HOOK, ring line (same as start line) */ #define TOR_RING TOR_START /* Ret. Value for GET/WAIT Event, no event */ #define TOR_EVENT_NONE 0 /* Ret. Value for GET/WAIT Event, Went Onhook */ #define TOR_EVENT_ONHOOK 1 /* Ret. Value for GET/WAIT Event, Went Offhook or got Ring */ #define TOR_EVENT_RINGOFFHOOK 2 /* Ret. Value for GET/WAIT Event, Got Wink or Flash */ #define TOR_EVENT_WINKFLASH 3 /* Ret. Value for GET/WAIT Event, Got Alarm */ #define TOR_EVENT_ALARM 4 /* Ret. Value for GET/WAIT Event, Got No Alarm (after alarm) */ #define TOR_EVENT_NOALARM 5 /* Value For signal type, E&M Trunk */ #define TOR_EM 1 /* Value For signal type, FXS Loopstart Trunk */ #define TOR_FXSLS 2 /* Value For signal type, FXS Groundstart Trunk */ #define TOR_FXSGS 3 /* Value For signal type, FXO Loopstart Trunk */ #define TOR_FXOLS 4 /* Value For signal type, FXS Groundstart Trunk */ #define TOR_FXOGS 5 /* Value for signal type, flag to indicate pseudo-trunk */ #define TOR_PSEUDO 0x100 /* Flag Value for IOMUX, read avail */ #define TOR_IOMUX_READ 1 /* Flag Value for IOMUX, write avail */ #define TOR_IOMUX_WRITE 2 /* Flag Value for IOMUX, write done */ #define TOR_IOMUX_WRITEEMPTY 4 /* Flag Value for IOMUX, signalling event avail */ #define TOR_IOMUX_SIGEVENT 8 /* Flag Value for IOMUX, Do Not Wait if nothing to report */ #define TOR_IOMUX_NOWAIT 0x100 /* Alarm Condition bits */ #define TOR_ALARM_NONE 0 /* No alarms */ #define TOR_ALARM_RECOVER 1 /* Recovering from alarm */ #define TOR_ALARM_LOOPBACK 2 /* In loopback */ #define TOR_ALARM_YELLOW 4 /* Yellow Alarm */ #define TOR_ALARM_RED 8 /* Red Alarm */ #define TOR_ALARM_BLUE 16 /* Blue Alarm */ #define TOR_ALARM_NOTOPEN 32 /* No channels open */ /* Maintenance modes */ #define TOR_MAINT_NONE 0 /* Normal Mode */ #define TOR_MAINT_LOCALLOOP 1 /* Local Loopback */ #define TOR_MAINT_REMOTELOOP 2 /* Remote Loopback */ #define TOR_MAINT_LOOPUP 3 /* send loopup code */ #define TOR_MAINT_LOOPDOWN 4 /* send loopdown code */ /* Per-span configuration values */ #define TOR_CONFIG_TXLEVEL 7 /* bits 0-2 are tx level */ #define TOR_CONFIG_ESF 0x10 /* bit 4 is set for ESF, clear for SF */ #define TOR_CONFIG_B8ZS 0x20 /* bit 5 is set for B8ZS, clear for D4 */ #define TOR_CONFIG_NOTOPEN 0x40 /* bit 6 is set YELALRM if no chans open */ /* Conference modes */ #define TOR_CONF_MODE_MASK 0xff /* mask for modes */ #define TOR_CONF_NORMAL 0 /* normal mode */ #define TOR_CONF_MONITOR 1 /* monitor mode (rx of other chan) */ #define TOR_CONF_MONITORTX 2 /* monitor mode (tx of other chan) */ #define TOR_CONF_MONITORBOTH 3 /* monitor mode (rx & tx of other chan) */ #define TOR_CONF_CONF 4 /* conference mode */ #define TOR_CONF_CONFANN 5 /* conference announce mode */ #define TOR_CONF_CONFMON 6 /* conference monitor mode */ #define TOR_CONF_CONFANNMON 7 /* conference announce/monitor mode */ #define TOR_CONF_FLAG_MASK 0xff00 /* mask for flags */ #define TOR_CONF_LISTENER 0x100 /* is a listener on the conference */ #define TOR_CONF_TALKER 0x200 /* is a talker on the conference */ #define TOR_DEFAULT_WINKTIME 150 /* 150 ms default wink time */ #define TOR_DEFAULT_FLASHTIME 750 /* 750 ms default flash time */ #define TOR_DEFAULT_PREWINKTIME 50 /* 50 ms before wink */ #define TOR_DEFAULT_PREFLASHTIME 50 /* 50 ms before flash */ #define TOR_DEFAULT_STARTTIME 1500 /* 1500 ms of start */ #define TOR_DEFAULT_RINGTIME 2000 /* 2000 ms of ring on (start, FXO) */ #define TOR_DEFAULT_RXWINKTIME 250 /* 250ms longest rx wink */ #define TOR_DEFAULT_RXFLASHTIME 1250 /* 1250ms longest rx flash */ #define TOR_DEFAULT_DEBOUNCETIME 600 /* 600ms of FXS GS signalling debounce */ #define TOR_LOOPCODE_TIME 10000 /* send loop codes for 10 secs */ #define TOR_ALARMSETTLE_TIME 5000 /* allow alarms to settle for 5 secs */ #define TOR_AFTERSTART_TIME 500 /* 500ms after start */ #endif /* !_MACHINE_TOR_H_ */