
/*
 Copyright 1999 by Digi International (www.digi.com)

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the 
 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
 PURPOSE.  See the GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/*
 *	blackbox.h:
 *
 *	Definition of black box recording control and data
 *	structures.  Also contains all of the black box event
 *  #defines. The black box implements a circular
 *	buffer of collected events that can be used for
 *	real-time debugging and post-mortem analysis.
 *
 *	NOTE: for efficiency reasons, this data is always
 *	stored in the native endianness of the board.
 */


/************************************************************************/
/*									*/
/*	Data structures							*/
/*									*/
/************************************************************************/

/*
 *	Here is a datum that is stored in the circular buffer
 */
typedef struct	bb_data
{
	/*
	 *	The absolute timestamp of the event
	 */
	uint32	timestamp;

	/*
	 *	The event number.  The upper 16 bits are a
	 *	bitmask that controls what subsystem data is
	 *	recorded.  The lower 16 bits are subsystem
	 *	defined.
	 */
	uint32	event;

	/*
	 *	Subsystem defined data associated with event
	 */
	uint32	data[2];

} BB_DATA, BLACKBOX_DATA;

/*
 *	Here is the control structure that is used to read and write
 *	the circular buffer.
 *
 *	NOTE: Any items marked "App: R/W" can be written by an
 *	application program running on the host.  However, these
 *	items should only be written using the RW structure.
 *	This is because the FEP always reads this structure
 *	through the cache (for efficiency).
 *
 *	NOTE: all pointers are in the FEP *virtual* address space. An
 *	application reading this data must convert these to host
 *	virtual addresses.  This is implementation defined. In
 *	the case of HLC, masking the pointers with GLOBAL_POST_DATA's
 *	(summary.memsize - 1) is the most general method to get the
 *	the *physical* RAM location on the board.  Stripping the upper
 *	8 bits will work in a pinch.  Then you convert that to a
 *	host virtual address (which is host OS/driver dependant).
 */
typedef struct	blackbox_ctrl
{
	/*
	 *	Magic number for locating this structure in a core dump
	 *
	 *	NOTE This structure will always start on a cacheline.
	 *	This is an actual quote from a Cockpit Voice Recorder.
	 */
	char	magic[32];				/* App: Read only */

		#define BB_MAGIC "CVR: Yeah, I like that altimeter"

	/*
	 *	Frequency of BB_DATA timestamp clock.
	 *
	 *	This is implementation defined.  On an HLC, it is
	 *	1/2 the CPU frequency (50Mhz or 75Mhz).  This gives
	 *	a range of about 57 seconds at 75 Mhz.  There is no
	 *	indication of wrap(s).  The application reading
	 *	timestamps must adjust for this.
	 *
	 *	This value is static (unchanging).
	 */
	uint32	timestamp_hz;				/* App: Read only */

	/*
	 *	Mask of events to capture
	 *
	 *	Only the upper 16 bits play a part in determining
	 *	which events to capture.
	 *
	 *	This mask can be written by an application.
	 *
	 *	Default: 0
	 */
	uint32	event_mask;				/* App: R/W */

	/*
	 *	Operational mode
	 *
	 *	The mode can be written by an application.
	 *
	 *	Default: BB_MODE_CONTINUOUS.
	 *
	 *	The application can set CONTINUOUS or 1SHOT.  The
	 *	transition to BB_MODE_1SHOT causes the in pointer
	 *	to be reset.
	 */
	uint32	mode;
		#define	BB_MODE_CONTINUOUS	0	/* App: R/W */
		#define	BB_MODE_1SHOT		1	/* App: R/W */
		#define	BB_MODE_1SHOT_RUNNING	2	/* App: Read only */
		#define	BB_MODE_1SHOT_STOPPED	3	/* App: Read only */

	/*
	 *	Pointer to the start of BB_DATA circular buffer
	 *
	 *	This value is static (unchanging).
	 */
	BB_DATA	*buf;					/* App: Read only */

	/*
	 *	Pointer to the end+1 of BB_DATA circular buffer
	 *
	 *	This value is static (unchanging).
	 */
	BB_DATA	*bufend;				/* App: Read only */

	/*
	 *	Pointer to location where next event will be stored
	 *
	 *	This value advances each time an event is stored.
	 *	When its value would become equal to "bufend", it
	 *	is set to "buf" instead, thus wrapping the buffer.
	 *
	 *	NOTE: the FEP will always write this pointer using
	 *	uncached writes (or will flush the cache).  The
	 *	FEP also will always write any BB_DATA with uncached
	 *	writes (or will flush the cache).  The order of the
	 *	writes will guarantee a coherent view of the buffer.
	 */
	BB_DATA	*in;					/* App: Read only */

	/*
	 *	CSC channel mask
	 *
	 *      (i.e. 0x1=CSC chan 0, 0x2=chan 1, 0x4=chan 2, ...)
	 *
	 *	Each bit in csc_channel represents a CSC channel to 
	 *	trace in terms of Vocal events.  It is only recommended
	 *	that one or two CSC channels be traced at a time for
	 *	performance reasons.  You can add more to the mask, 
	 *	but it will cost in terms of FEP performance.
	 *
	 *	N.B.:  Obviously, since there are only 32 bits in the
	 *	csc_channel, only the first 32 CSC channels can be
	 *	traced.  This shouldn't inhibit debugging too
	 *	much.  Besides, a mask is an improvement over the old
	 *	method (if "more available info is better" is your 
	 *	debugging motto).
	 *
	 *	Default: 0 (no CSC recording, regardless of event mask)
	 */
	uint32	csc_channel;				/* App: R/W */

	/*
	 *	Interrupt notification of BlackBox data (to Host).  
	 *
	 *		- Set to non-zero to enable
	 *		- Set to zero to  disable (Disabled by default)
	 *
	 */
	uint32	interrupt_host;				/* App: R/W */

	/*
	 *	Max Channels
	 *
	 *	This value tells the host exactly what the maximum 
	 *	per-channel channel value will be.  This was requested
	 *	by IBM so that they could allocate the exact number of 
	 *	per-channel `bins' in order to store per-channel events.
	 *	In a nutshell, 'max_channels' should reflect the largest
	 *	'chan' argument ever passed in to one of the BBPC[012]
	 *	per-channel macros.
	 */
	uint32	max_channels;				/* App: Read only */

	/*
	 *	Add any new structure members here...
	 */

} BB_CTRL, BLACKBOX_CTRL;


/************************************************************************/
/*									*/
/*	Internal functions used by the FEP				*/
/*									*/
/************************************************************************/

#ifdef GAL9

	/*
	 * Useful defines for those who don't want to cast every stinkin'
	 * call to bb1() or bb2() to prevent compiler warnings.
	 */
	#define BB0(f,e)		bb0((f), (e))
	#define BB1(f,e,d1)		bb1((f), (e), (uint32)(d1))
	#define BB2(f,e,d1,d2)	bb2((f), (e), (uint32)(d1), (uint32)(d2))

	/*
	 * If a BlackBox event can be tied to a channel (namely, if the
	 * event is a per-channel event), then please use the macros
	 * defined later in this file instead of the above (global event) 
	 * macros.  The per-channel macros are named BBPC[0|1|2].
	 */

	#if __cplusplus
		extern "C" {
	#endif

	extern void	bb_epoch(void);
	extern void	bb_common(uint32 event, uint32 data1, uint32 data2);
	extern void	bb_bytes(int cscchan, uint32 event, void *data, int len);
	extern void	bb_asciiz(int cscchan, uint32 event, void *data);

	extern	BB_CTRL	BlackBox;
	extern	BB_DATA	BlackBoxData[];

	static inline void
	bb0(uint32 flags, uint32 event)
	{
		if (BlackBox.event_mask & flags)
			bb_common(event, 0, 0);
	}

	static inline void
	bb1(uint32 flags, uint32 event, uint32 data1)
	{
		if (BlackBox.event_mask & flags)
			bb_common(event, data1, 0);
	}

	static inline void
	bb2(uint32 flags, uint32 event, uint32 data1, uint32 data2)
	{
		if (BlackBox.event_mask & flags)
			bb_common(event, data1, data2);
	}

	#if __cplusplus
		}
	#endif

#endif



/************************************************************************/
/*									*/
/*	Event masks for dense modems - 16 can be defined		*/
/*									*/
/************************************************************************/

/* 
 * The BB_ALWAYS flag always forces the event to be logged in the Black Box.  
 * Keep in mind that part of the usefulness of the Black Box is that 
 * post-symptom and post-mortem debugging can be enhanced by having 
 * important events that are * _always_ placed in the Black Box.  
 * Therefore, BB_ALWAYS can be used for carefully placed bb0(), bb1(), or 
 * bb2() calls in the firmware to provide more information to the 
 * person debugging a problem. 
 *
 */

/*
 * Event mask flags.  There are only 32 of them, so use them wisely.
 * The BB_ALWAYS bit will always be enabled (by default) in the firmware.
 * So use the BB_ALWAYS flag carefully (do not place bb?() calls with the
 * BB_ALWAYS flag bit set in a place where you might affect performance).
 * Aside from a few special bits like BB_ALWAYS, etc., each bit is
 * probably best represented as a subsystem (BB_CSC_EVENT, BB_ARBITER, etc.).
 */

#define	BB_ALWAYS		0x1	/* Event is always logged */
#define	BB_MISC			0x2	/* Miscellaneous events */
#define BB_ARBITER		0x4	/* Arbiter subsystem */
#define BB_IL3_SM		0x8	/* IL3 State Machine Debug Events */
#define	BB_IL3			0x8	/* IL3 events */
#define BB_LAPD_DLPI		0x10	/* LAPD DLPI Events */
#define BB_SDXB			0x20	/* SDXB Events */
#define BB_MGMT			0x40	/* MGMT Events */
#define	BB_DCHAN		0x80	/* D-chan controller events. */
#define	BB_SIGNAL		0x100	/* Signalling (csc<->arbiter) events */
#define	BB_AVIATOR		0x200	/* pump aviator events */
#define	BB_CAS			0x400	/* CT1 & E1R2 signalling events */

/*
 *	CSC events
 *
 *	CSC events and status reports are collected under BB_CSC_EVENT.
 *	The actual event or status numbers are defined
 *	in the csc header files libcsc/csc/include/{events.h,status.h}.
 *
 *	CSC state changes are collected under BB_CSC_STATE.  CSC state
 *	numbers are hardwired into the CSC code.
 */
#define	BB_CSC_EVENT	0x40000000 /* Log Vocal Command Set Controller Events */
#define	BB_CSC_STATE	0x80000000 /* Log Vocal Command Set Controller Status */
#define	BB_CSC_ALL	(BB_CSC_EVENT|BB_CSC_STATE)	/* Log Both */

/*
 * Special define to separate Digi BB events from Vocal event types (see
 * comments below).
 */
#define BB_DIGI_EVENT	0x80000000

/* 
 * Special define to separate per-channel BlackBox events from
 * other event types.  This done to ensure minimal headaches 
 * with respect to our tools and other environments.
 */
#define BB_PC_EVENT	0x40000000

/*
 * If the BB_PC_EVENT bit is set, then the 32-bit event type 
 * is broken down as follows:
 *
 *         0xXXccEEEE
 *
 * where XX can be anything, cc is a channel number from 0 to 0xff,
 * and EEEE is the 16-bit event number.  Note that if the 0x80 bit
 * is set in the XX value, then the event type will be 
 * (0xXX000000 | 0xEEEE).
 */

#define BB_IS_PER_CHANNEL(event)	(((event) & BB_PC_EVENT) ? 1 : 0)
#define BB_IS_GLOBAL(event)		(!BB_IS_PER_CHANNEL((event)))

#define BB_GET_CHANNEL(event)		(((event) >> 16) & 0xff)
#define BB_STRIP_CHANNEL_INFO(event)	(( (event) & ~(BB_PC_EVENT|0x00FF0000)))

#define BB_PER_CHANNEL(event, chan)	\
		((event) | (((chan) & 0xff) << 16) | BB_PC_EVENT)

#define BBPC0(chan,f,e)		BB0((f), BB_PER_CHANNEL((e),(chan)))
#define BBPC1(chan,f,e,d1)	BB1((f), BB_PER_CHANNEL((e),(chan)),(d1))
#define BBPC2(chan,f,e,d1,d2)	BB2((f), BB_PER_CHANNEL((e),(chan)),(d1),(d2))

/*
 * DO NOT REMOVE THIS COMMENT! 
 * BEGIN_BLACK_BOX_DEFINES
 */

/*
 * Below is where all event flags must be kept (aside from the Vocal stuff).
 * When adding new events, keep in mind the following goals:
 *    - We want to keep the event #defines from changing so that the Black Box
 *      dump utility can ideally look at old Black Box contents as well
 *      as new.  It will suck if you have to go fetch an old dumper utility
 *      to pretty print the contents of an old Black Box.
 *    - The Black Box dumper tool (dm_bb) must always be able to distinguish 
 *      between Digi events and Vocal events.  Therefore, all of Digi's
 *      event #defines must be ORed with 0x80000000 in this include file.
 *    - Keep all new event #defines in this file!  This will prevent
 *      anyone (including dm_bb) from having to include some
 *      esoteric include file from the bowels of the firmware source tree.
 */
#define ARBITER_EVENT_XN_LISTEN_REQ		(BB_DIGI_EVENT | 1)
#define ARBITER_EVENT_XN_LISTEN_RESP	(BB_DIGI_EVENT | 2)
#define ARBITER_EVENT_XN_CONNECT_REQ	(BB_DIGI_EVENT | 3)
#define ARBITER_EVENT_XN_CONNECT_RESP	(BB_DIGI_EVENT | 4)
#define ARBITER_EVENT_XN_CONNACK_REQ	(BB_DIGI_EVENT | 5)
#define ARBITER_EVENT_XN_CONNACK_RESP	(BB_DIGI_EVENT | 6)
#define ARBITER_EVENT_XN_CACTIVE_RESP	(BB_DIGI_EVENT | 7)
#define ARBITER_EVENT_XN_DISCONN_REQ	(BB_DIGI_EVENT | 8)
#define ARBITER_EVENT_XN_DISCONN_RESP	(BB_DIGI_EVENT | 9)
#define ARBITER_EVENT_XN_CONNEND_REQ	(BB_DIGI_EVENT | 0xa)
#define ARBITER_EVENT_XN_CONNEND_RESP	(BB_DIGI_EVENT | 0xb)
#define ARBITER_EVENT_XN_INFO_RESP		(BB_DIGI_EVENT | 0xc)
#define ARBITER_EVENT_XN_UPDATE_RESP	(BB_DIGI_EVENT | 0xd)
#define ARBITER_EVENT_XN_BAD_MSG_RESP	(BB_DIGI_EVENT | 0xe)
#define ARBITER_EVENT_ENVELOPE_START	(BB_DIGI_EVENT | 0xf)
#define ARBITER_EVENT_ENVELOPE_STOP		(BB_DIGI_EVENT | 0x10)
#define ARBITER_EVENT_RING_START		(BB_DIGI_EVENT | 0x11)
#define ARBITER_EVENT_RING_STOP			(BB_DIGI_EVENT | 0x12)
#define ARBITER_EVENT_WINK_FINISHED		(BB_DIGI_EVENT | 0x13)
#define ARBITER_EVENT_XN_DATA_RESP		(BB_DIGI_EVENT | 0x14)
#define ARBITER_EVENT_XN_ALERT_REQ		(BB_DIGI_EVENT | 0x15)
#define ARBITER_EVENT_E1R2_ANSWER               (BB_DIGI_EVENT | 0x16)

#define BBE_U_SETUP_REQUEST_SM			(BB_DIGI_EVENT | 0x20)
#define BBE_U_DISCONNECT_REQUEST_SM		(BB_DIGI_EVENT | 0x21)
#define BBE_U_RELEASE_REQUEST_SM		(BB_DIGI_EVENT | 0x22)
#define BBE_U_ALERTING_REQUEST_SM		(BB_DIGI_EVENT | 0x23)
#define BBE_U_SETUP_RESPONSE_SM			(BB_DIGI_EVENT | 0x24)
#define BBE_U_REJECT_REQUEST_SM			(BB_DIGI_EVENT | 0x25)
#define BBE_U_CONNEND_SM				(BB_DIGI_EVENT | 0x26)
#define BBE_IL3_RELEASE_COMPLETE_IT_SM	(BB_DIGI_EVENT | 0x27)
#define BBE_IL3_RELEASE_IT_SM			(BB_DIGI_EVENT | 0x28)
#define BBE_IL3_CLEAR_CALL				(BB_DIGI_EVENT | 0x29)
#define BBE_IL3_TIMER_CLEAR_CALL		(BB_DIGI_EVENT | 0x2a)
#define BBE_IL3_DROP_CALL				(BB_DIGI_EVENT | 0x2b)
#define BBE_MT_SETUP_SM					(BB_DIGI_EVENT | 0x2c)
#define BBE_MT_CALL_PROCEEDING			(BB_DIGI_EVENT | 0x2d)
#define BBE_MT_ALERTING_SM				(BB_DIGI_EVENT | 0x2e)
#define BBE_MT_CONNECT_SM				(BB_DIGI_EVENT | 0x2f)
#define BBE_MT_FAC_SM					(BB_DIGI_EVENT | 0x30)
#define BBE_MT_CONNECT_ACK_SM			(BB_DIGI_EVENT | 0x31)
#define BBE_MT_STATUS_SM				(BB_DIGI_EVENT | 0x32)
#define BBE_MT_STATUS_ENQ_SM			(BB_DIGI_EVENT | 0x33)
#define BBE_MT_RELEASE_SM				(BB_DIGI_EVENT | 0x34)
#define BBE_MT_RELEASE_COMPLETE_SM		(BB_DIGI_EVENT | 0x35)
#define BBE_MT_SETUP_ACK_SM				(BB_DIGI_EVENT | 0x36)
#define BBE_MT_PROGRESS_SM				(BB_DIGI_EVENT | 0x37)
#define BBE_MT_DISCONNECT_SM			(BB_DIGI_EVENT | 0x38)
#define BBE_MT_NOTIFY_SM				(BB_DIGI_EVENT | 0x39)
#define BBE_MT_INFORMATION_SM			(BB_DIGI_EVENT | 0x3a)
#define BBE_MT_SPID_SM					(BB_DIGI_EVENT | 0x3b)
#define BBE_MT_UNEXPECTED_SM			(BB_DIGI_EVENT | 0x3c)
#define BBE_MT_UNRECOGNISED_SM			(BB_DIGI_EVENT | 0x3d)
#define BBE_MT_RESTART_SM				(BB_DIGI_EVENT | 0x3e)
#define BBE_MT_41449_SERVICE_SM			(BB_DIGI_EVENT | 0x3f)
#define BBE_MT_NAT_MIM_SM				(BB_DIGI_EVENT | 0x40)
#define BBE_GCR_RESTART_REQUEST_SM		(BB_DIGI_EVENT | 0x41)
#define BBE_DL_RELEASE_IND_SM			(BB_DIGI_EVENT | 0x42)
#define BBE_DL_ESTABLISH_CON_SM			(BB_DIGI_EVENT | 0x43)
#define BBE_DL_ESTABLISH_IND_SM			(BB_DIGI_EVENT | 0x44)
#define BBE_MT_CLOSE_SM					(BB_DIGI_EVENT | 0x45)
#define BBE_MT_CLOSE_ACK_SM				(BB_DIGI_EVENT | 0x46)
#define BBE_IL3_CLOSE_IT_SM				(BB_DIGI_EVENT | 0x47)
#define BBE_ONETR6_n0_RELEASE_SM		(BB_DIGI_EVENT | 0x48)
#define BBE_ONETR6_n1_RELEASE_SM		(BB_DIGI_EVENT | 0x49)
#define BBE_IL3_ABORT_CONN				(BB_DIGI_EVENT | 0x4a)
#define BBE_MT_41449_SERVICE_ACK_SM		(BB_DIGI_EVENT | 0x4b)
#define BBE_U_SETUP_ACK_REQUEST_SM		(BB_DIGI_EVENT | 0x4c)
#define BBE_U_CALL_PROCEEDING_REQUEST_SM	(BB_DIGI_EVENT | 0x4d)
#define BBE_MT_INFO_SM				(BB_DIGI_EVENT | 0x4e)
#define BBE_U_RESTART_REQUEST_SM		(BB_DIGI_EVENT | 0x4f)

#define BBE_LAPD_DL_INFO_ACK			(BB_DIGI_EVENT | 0x50)
#define BBE_LAPD_DL_INFO_REQ			(BB_DIGI_EVENT | 0x51)
#define BBE_LAPD_DL_ATTACH_REQ			(BB_DIGI_EVENT | 0x52)
#define BBE_LAPD_DL_DETACH_REQ			(BB_DIGI_EVENT | 0x53)
#define BBE_LAPD_DL_BIND_REQ			(BB_DIGI_EVENT | 0x54)
#define BBE_LAPD_DL_UNBIND_REQ			(BB_DIGI_EVENT | 0x55)
#define BBE_LAPD_DL_CONNECT_REQ			(BB_DIGI_EVENT | 0x56)
#define BBE_LAPD_DL_CONNECT_RES			(BB_DIGI_EVENT | 0x57)
#define BBE_LAPD_DL_TOKEN_REQ			(BB_DIGI_EVENT | 0x58)
#define BBE_LAPD_DL_DISCONNECT_REQ		(BB_DIGI_EVENT | 0x59)
#define BBE_LAPD_DL_RESET_REQ			(BB_DIGI_EVENT | 0x5a)
#define BBE_LAPD_DL_RESET_RES			(BB_DIGI_EVENT | 0x5b)
#define BBE_LAPD_DL_UNITDATA_REQ		(BB_DIGI_EVENT | 0x5c)
#define BBE_LAPD_DL_DATA_REQ			(BB_DIGI_EVENT | 0x5d)
#define BBE_LAPD_DLPI_TONET_DL_BIND_ACK	(BB_DIGI_EVENT | 0x5e)
#define BBE_LAPD_DLPI_TONET_DL_ERROR_ACK	(BB_DIGI_EVENT | 0x5f)
#define BBE_LAPD_DLPI_TONET_DL_CONNECT_IND	(BB_DIGI_EVENT | 0x60)
#define BBE_LAPD_DLPI_TONET_DL_CONNECT_CON	(BB_DIGI_EVENT | 0x61)
#define BBE_LAPD_DLPI_TONET_DL_DISCONNECT_IND	(BB_DIGI_EVENT | 0x62)
#define BBE_LAPD_DLPI_TONET_DL_OK_ACK			(BB_DIGI_EVENT | 0x63)
#define BBE_LAPD_DLPI_TONET_DL_RESET_IND	(BB_DIGI_EVENT | 0x64)
#define BBE_LAPD_DLPI_TONET_DL_RESET_CON	(BB_DIGI_EVENT | 0x65)

#define BBE_SDXB_PROCESSED_SDXB_SYNC		(BB_DIGI_EVENT | 0x70)
#define BBE_SDXB_PROCESSED_SDXB_BUFSIZE		(BB_DIGI_EVENT | 0x71)
#define BBE_SDXB_PROCESSED_SDXB_MSTAT		(BB_DIGI_EVENT | 0x72)
#define BBE_SDXB_PROCESSED_SDXB_EVENT		(BB_DIGI_EVENT | 0x73)
#define BBE_SDXB_PROCESSED_SDXB_LERR		(BB_DIGI_EVENT | 0x74)
#define BBE_SDXB_PROCESSED_SDXB_PCAP		(BB_DIGI_EVENT | 0x75)
#define BBE_SDXB_PROCESSED_SDXB_PARAM		(BB_DIGI_EVENT | 0x76)
#define BBE_SDXB_PROCESSED_SDXB_WMARK		(BB_DIGI_EVENT | 0x77)
#define BBE_SDXB_PROCESSED_SDXB_SEQ_OCLEN	(BB_DIGI_EVENT | 0x78)
#define BBE_SDXB_PROCESSED_SDXB_SEQ_CLEN	(BB_DIGI_EVENT | 0x79)
#define BBE_SDXB_PROCESSED_SDXB_SCIMMED		(BB_DIGI_EVENT | 0x7a)
#define BBE_SDXB_PROCESSED_SDXB_BREAK		(BB_DIGI_EVENT | 0x7b)
#define BBE_SDXB_PROCESSED_SDXB_FLUSH		(BB_DIGI_EVENT | 0x7c)
#define BBE_SDXB_PROCESSED_SDXB_PAUSE		(BB_DIGI_EVENT | 0x7d)
#define BBE_SDXB_PROCESSED_SDXB_MARKIDLE	(BB_DIGI_EVENT | 0x7e)
#define BBE_SDXB_PROCESSED_SDXB_ISDN		(BB_DIGI_EVENT | 0x7f)
#define BBE_SDXB_OPEN				(BB_DIGI_EVENT | 0x80)
#define BBE_SDXB_CLOSE				(BB_DIGI_EVENT | 0x81)
#define	BBE_SDXB_DCD_ON				(BB_DIGI_EVENT | 0x82)
#define	BBE_SDXB_DCD_OFF			(BB_DIGI_EVENT | 0x83)
#define	BBE_SDXB_DSR_ON				(BB_DIGI_EVENT | 0x84)
#define	BBE_SDXB_DSR_OFF			(BB_DIGI_EVENT | 0x85)
#define	BBE_SDXB_CTS_ON				(BB_DIGI_EVENT | 0x86)
#define	BBE_SDXB_CTS_OFF			(BB_DIGI_EVENT | 0x87)
#define	BBE_SDXB_RI_ON				(BB_DIGI_EVENT | 0x86)
#define	BBE_SDXB_RI_OFF				(BB_DIGI_EVENT | 0x87)
#define	BBE_SDXB_SENT_MSTAT			(BB_DIGI_EVENT | 0x88)


#define BBE_MGMT_DID_GET_MGMT_PROTOCOL_VERSION	(BB_DIGI_EVENT | 0x90)
#define BBE_MGMT_DID_GET_ADAPTER_INFO			(BB_DIGI_EVENT | 0x91)
#define BBE_MGMT_DID_GET_ADAPTER_STATE			(BB_DIGI_EVENT | 0x92)
#define BBE_MGMT_DID_GET_DS1_CONFIG			(BB_DIGI_EVENT | 0x93)
#define BBE_MGMT_DID_SET_DS1_CONFIG			(BB_DIGI_EVENT | 0x94)
#define BBE_MGMT_DID_GET_DS1_STATUS			(BB_DIGI_EVENT | 0x95)
#define BBE_MGMT_DID_GET_DS1_EXT_CONFIG		(BB_DIGI_EVENT | 0x96)
#define BBE_MGMT_DID_SET_DS1_EXT_CONFIG		(BB_DIGI_EVENT | 0x97)
#define BBE_MGMT_DID_SET_DCHAN_EXT_CONFIG	(BB_DIGI_EVENT | 0x98)
#define BBE_MGMT_DID_GET_DCHAN_EXT_CONFIG	(BB_DIGI_EVENT | 0x99)
#define BBE_MGMT_DID_GET_DCHAN_EXT_STATUS	(BB_DIGI_EVENT | 0x9a)
#define BBE_MGMT_DID_GET_BCHAN_STATUS		(BB_DIGI_EVENT | 0x9b)
#define BBE_MGMT_DID_GET_BCHAN_EXT_CONFIG	(BB_DIGI_EVENT | 0x9c)
#define BBE_MGMT_DID_SET_BCHAN_EXT_CONFIG	(BB_DIGI_EVENT | 0x9d)
#define BBE_MGMT_DID_GET_BRI_CONFIG			(BB_DIGI_EVENT | 0x9e)
#define BBE_MGMT_DID_SET_BRI_CONFIG			(BB_DIGI_EVENT | 0x9f)
#define BBE_MGMT_DID_GET_BRI_STATUS			(BB_DIGI_EVENT | 0xa0)
#define BBE_MGMT_DID_GET_DS1_EXT_STATUS		(BB_DIGI_EVENT | 0xa1)
#define BBE_MGMT_DID_GET_BCHAN_EXT_STATUS	(BB_DIGI_EVENT | 0xa2)
#define BBE_MGMT_DID_GET_MODEM_NATIONALITY	(BB_DIGI_EVENT | 0xa3)
#define BBE_MGMT_DID_SET_MODEM_NATIONALITY	(BB_DIGI_EVENT | 0xa4)
#define BBE_MGMT_DID_GET_MODEM_CONFIG		(BB_DIGI_EVENT | 0xa5)
#define BBE_MGMT_DID_SET_MODEM_CONFIG		(BB_DIGI_EVENT | 0xa6)
#define BBE_MGMT_DID_GET_MODEM_EXT_CONFIG	(BB_DIGI_EVENT | 0xa7)
#define BBE_MGMT_DID_SET_MODEM_EXT_CONFIG	(BB_DIGI_EVENT | 0xa8)
#define BBE_MGMT_DID_GET_MODEM_STATUS		(BB_DIGI_EVENT | 0xa9)
#define BBE_MGMT_DID_GET_MODEM_EXT_STATUS	(BB_DIGI_EVENT | 0xaa)
#define BBE_MGMT_DID_GET_SERIAL_CONFIG		(BB_DIGI_EVENT | 0xab)
#define BBE_MGMT_DID_SET_SERIAL_CONFIG		(BB_DIGI_EVENT | 0xac)
#define BBE_MGMT_DID_GET_SERIAL_EXT_CONFIG	(BB_DIGI_EVENT | 0xad)
#define BBE_MGMT_DID_SET_SERIAL_EXT_CONFIG	(BB_DIGI_EVENT | 0xae)
#define BBE_MGMT_DID_GET_SERIAL_STATUS		(BB_DIGI_EVENT | 0xaf)
#define BBE_MGMT_DID_GET_SERIAL_EXT_STATUS	(BB_DIGI_EVENT | 0xb0)
#define BBE_MGMT_DID_GET_CALL_STATUS		(BB_DIGI_EVENT | 0xb1)
#define BBE_MGMT_DID_GET_ALL_CALL_STATUS	(BB_DIGI_EVENT | 0xb2)
#define BBE_MGMT_DID_SET_CALL_STATUS_TRC	(BB_DIGI_EVENT | 0xb3)
#define BBE_MGMT_DID_SET_DS1_CONFIG_TRC		(BB_DIGI_EVENT | 0xb4)
#define BBE_MGMT_DID_SET_MODEM_CONFIG_TRC	(BB_DIGI_EVENT | 0xb5)
#define BBE_MGMT_DID_SET_MODEM_EXT_CONFIG_TRC	(BB_DIGI_EVENT | 0xb6)
#define BBE_MGMT_DID_SET_DCHAN_EXT_CONFIG_TRC	(BB_DIGI_EVENT | 0xb7)
#define BBE_MGMT_DID_SET_BCHAN_EXT_CONFIG_TRC	(BB_DIGI_EVENT | 0xb8)
#define BBE_MGMT_DID_SET_DS1_STATUS_TRC			(BB_DIGI_EVENT | 0xb9)
#define BBE_MGMT_DID_SET_DS1_EXT_STATUS_TRC		(BB_DIGI_EVENT | 0xba)
#define BBE_MGMT_DID_SET_DS1_EXT_CONFIG_TRC		(BB_DIGI_EVENT | 0xbb)
#define BBE_MGMT_DID_GET_DS1_CT1_SIG_STATUS		(BB_DIGI_EVENT | 0xbc)
#define BBE_MGMT_DID_GET_DS1_ALL_CT1_SIG_STATUS	(BB_DIGI_EVENT | 0xbd)
#define BBE_MGMT_DID_SET_BRI_STATUS_TRC			(BB_DIGI_EVENT | 0xbe)
#define BBE_MGMT_DID_SET_SERIAL_STATUS_TRC		(BB_DIGI_EVENT | 0xbf)
#define BBE_MGMT_DID_SET_SERIAL_EXT_STATUS_TRC	(BB_DIGI_EVENT | 0xc0)
#define BBE_MGMT_DID_SET_MODEM_STATUS_TRC		(BB_DIGI_EVENT | 0xc1)
#define BBE_MGMT_DID_SET_MODEM_EXT_STATUS_TRC	(BB_DIGI_EVENT | 0xc2)
#define BBE_MGMT_DID_SET_DCHAN_EXT_STATUS_TRC	(BB_DIGI_EVENT | 0xc3)
#define BBE_MGMT_DID_SET_BCHAN_STATUS_TRC		(BB_DIGI_EVENT | 0xc4)
#define BBE_MGMT_DID_SET_BCHAN_EXT_STATUS_TRC	(BB_DIGI_EVENT | 0xc5)
#define BBE_MGMT_DID_SET_DCHAN_DATA_TRC			(BB_DIGI_EVENT | 0xc6)
#define BBE_MGMT_DID_SET_DCHAN_TX_DATA_TRC		(BB_DIGI_EVENT | 0xc7)
#define BBE_MGMT_DID_SET_DCHAN_RX_DATA_TRC		(BB_DIGI_EVENT | 0xc8)
#define BBE_MGMT_DID_SET_BCHAN_RXTX_DATA_TRC	(BB_DIGI_EVENT | 0xc9)
#define BBE_MGMT_DID_SET_SERIAL_RXTX_DATA_TRC	(BB_DIGI_EVENT | 0xca)
#define BBE_MGMT_DID_GET_DAUGHTERCARD_SERIALID	(BB_DIGI_EVENT | 0xcb)
#define BBE_MGMT_DID_SET_DAUGHTERCARD_SERIALID	(BB_DIGI_EVENT | 0xcc)
#define BBE_MGMT_MODEM_CONFIG_CALLBACK_CALLED	(BB_DIGI_EVENT | 0xcd)
#define BBE_MGMT_DID_SET_BRI_AND_DCHAN_EXT_CONFIG	(BB_DIGI_EVENT | 0xce)

#define BBE_MGMT_DID_GET_NVRAM_CONFIG		(BB_DIGI_EVENT | 0xd0)
#define BBE_MGMT_DID_SET_NVRAM_CONFIG		(BB_DIGI_EVENT | 0xd1)

#define BBE_MGMT_DID_GET_DS1_E1R2_CONFIG	(BB_DIGI_EVENT | 0xd2)
#define BBE_MGMT_DID_SET_DS1_E1R2_CONFIG	(BB_DIGI_EVENT | 0xd3)
#define BBE_MGMT_DID_SET_DS1_E1R2_CONFIG_TRC	(BB_DIGI_EVENT | 0xd4)

#define BBE_ON_HOOK_NOTIFY_CALLED				(BB_DIGI_EVENT | 0xe0)
#define BBE_ON_HOOK_NOTIFY_REGISTER				(BB_DIGI_EVENT | 0xe1)
#define BBE_ON_HOOK_NOTIFY_UNREGISTER			(BB_DIGI_EVENT | 0xe2)
#define BBE_HANGUP_ABLE_CALLED					(BB_DIGI_EVENT | 0xe3)

#define BBE_CSC_ATCMD				(BB_DIGI_EVENT | 0xe4)
#define BBE_CSC_ATRESP				(BB_DIGI_EVENT | 0xe5)
#define BBE_CSC_OVERLAY_LOAD			(BB_DIGI_EVENT | 0xe6)
#define BBE_CSC_OVERLAY_LOADED			(BB_DIGI_EVENT | 0xe7)
#define	BBE_DCHAN_INIT				(BB_DIGI_EVENT | 0xe8)
#define	BBE_DCHAN_TXFREE			(BB_DIGI_EVENT | 0xe9)
#define	BBE_DCHAN_TXCLEAN			(BB_DIGI_EVENT | 0xea)
#define	BBE_DCHAN_TSLOT				(BB_DIGI_EVENT | 0xeb)
#define	BBE_DCHAN_INITX				(BB_DIGI_EVENT | 0xec)
#define	BBE_DCHAN_INTR				(BB_DIGI_EVENT | 0xed)
#define	BBE_DCHAN_INTRX				(BB_DIGI_EVENT | 0xee)
#define	BBE_DCHAN_OPEN				(BB_DIGI_EVENT | 0xef)
#define	BBE_DCHAN_BADARG			(BB_DIGI_EVENT | 0xf0)
#define	BBE_DCHAN_INITFAIL			(BB_DIGI_EVENT | 0xf1)
#define	BBE_DCHAN_OPENX				(BB_DIGI_EVENT | 0xf2)
#define	BBE_DCHAN_CLOSE				(BB_DIGI_EVENT | 0xf3)
#define	BBE_DCHAN_CLOSEX			(BB_DIGI_EVENT | 0xf4)
#define	BBE_DCHAN_WPUT				(BB_DIGI_EVENT | 0xf5)
#define	BBE_DCHAN_WPUTX				(BB_DIGI_EVENT | 0xf6)
#define	BBE_DCHAN_CLOSE_QTOSS			(BB_DIGI_EVENT | 0xf7)
#define	BBE_DCHAN_CLOSE_TXTOSS			(BB_DIGI_EVENT | 0xf8)
#define	BBE_DCHAN_TX_START			(BB_DIGI_EVENT | 0xf9)
#define	BBE_DCHAN_TX_DATA			(BB_DIGI_EVENT | 0xfa)
#define	BBE_DCHAN_TX_EOF			(BB_DIGI_EVENT | 0xfb)
#define	BBE_DCHAN_TX_STARTX			(BB_DIGI_EVENT | 0xfc)
#define	BBE_DCHAN_TX_GETCHAR			(BB_DIGI_EVENT | 0xfd)
#define	BBE_DCHAN_RELEASE			(BB_DIGI_EVENT | 0xfe)
#define	BBE_DCHAN_PROTO				(BB_DIGI_EVENT | 0xff)
#define	BBE_DCHAN_PROTOX			(BB_DIGI_EVENT | 0x100)
#define	BBE_DCHAN_PROTO_CTL			(BB_DIGI_EVENT | 0x101)
#define	BBE_DCHAN_IOCTL				(BB_DIGI_EVENT | 0x102)
#define	BBE_DCHAN_IOCTLX			(BB_DIGI_EVENT | 0x103)
#define	BBE_DCHAN_SPAN_STATUS			(BB_DIGI_EVENT | 0x104)
#define	BBE_DCHAN_SPAN_STATUSX			(BB_DIGI_EVENT | 0x105)
#define	BBE_DCHAN_SPAN_SEND			(BB_DIGI_EVENT | 0x106)
#define	BBE_DCHAN_TX_UNDERRUN			(BB_DIGI_EVENT | 0x107)
#define	BBE_DCHAN_TX_UNDERRUNX			(BB_DIGI_EVENT | 0x108)
#define	BBE_DCHAN_RX_FIFO			(BB_DIGI_EVENT | 0x109)
#define	BBE_DCHAN_RX_FIFOX			(BB_DIGI_EVENT | 0x10a)
#define	BBE_DCHAN_RX_FIFO_STAT			(BB_DIGI_EVENT | 0x10b)
#define	BBE_DCHAN_RX_FIFO_OFLOW			(BB_DIGI_EVENT | 0x10c)
#define	BBE_DCHAN_RX_FIFO_EOF			(BB_DIGI_EVENT | 0x10d)
#define	BBE_DCHAN_WSRV				(BB_DIGI_EVENT | 0x10e)
#define	BBE_DCHAN_WSRVX				(BB_DIGI_EVENT | 0x10f)
#define	BBE_DCHAN_TX_ENQUEUE			(BB_DIGI_EVENT | 0x110)
#define	BBE_DCHAN_TX_ENQUEUEX			(BB_DIGI_EVENT | 0x111)
#define	BBE_DCHAN_TX_ENQUEUE_PUT		(BB_DIGI_EVENT | 0x112)
#define	BBE_DCHAN_WPUT_TOSS			(BB_DIGI_EVENT | 0x113)
#define	BBE_DCHAN_RSRV				(BB_DIGI_EVENT | 0x114)
#define	BBE_DCHAN_RSRVX				(BB_DIGI_EVENT | 0x115)
#define	BBE_DCHAN_RX_STOCK			(BB_DIGI_EVENT | 0x116)
#define	BBE_DCHAN_RX_STOCKX			(BB_DIGI_EVENT | 0x117)
#define	BBE_DCHAN_RX_STOCK_FAIL			(BB_DIGI_EVENT | 0x118)
#define	BBE_DCHAN_RX_FIFO_DROP			(BB_DIGI_EVENT | 0x119)
#define	BBE_IL3_UWSRV				(BB_DIGI_EVENT | 0x11a)
#define	BBE_IL3_UWSRVX				(BB_DIGI_EVENT | 0x11b)
#define	BBE_IL3_UWSRV_NULL			(BB_DIGI_EVENT | 0x11c)
#define	BBE_IL3_UWSRV_MP			(BB_DIGI_EVENT | 0x11d)
#define	BBE_IL3_UWSRV_LMSI_D			(BB_DIGI_EVENT | 0x11e)
#define	BBE_IL3_UWSRV_REQUEUE			(BB_DIGI_EVENT | 0x11f)
#define	BBE_IL3_UWSRV_PUTBQ			(BB_DIGI_EVENT | 0x120)
#define	BBE_IL3_UWSRV_UNOPEN			(BB_DIGI_EVENT | 0x121)
#define	BBE_IL3_UWSRV_HDR_FAIL			(BB_DIGI_EVENT | 0x122)
#define	BBE_IL3_UWSRV_BLOWERQ			(BB_DIGI_EVENT | 0x123)
#define	BBE_IL3_URSRV				(BB_DIGI_EVENT | 0x124)
#define	BBE_IL3_URSRVX				(BB_DIGI_EVENT | 0x125)
#define	BBE_IL3_URSRV_NULL			(BB_DIGI_EVENT | 0x126)
#define	BBE_IL3_LRPUT_DCHAN			(BB_DIGI_EVENT | 0x127)
#define	BBE_IL3_LRPUT_BADTYPE			(BB_DIGI_EVENT | 0x128)
#define	BBE_IL3_LRSRV_DCHAN			(BB_DIGI_EVENT | 0x129)
#define	BBE_IL3_LRSRV_GETSTOCK			(BB_DIGI_EVENT | 0x12a)
#define	BBE_IL3_LRSRV_REQUEUE			(BB_DIGI_EVENT | 0x12b)
#define	BBE_IL3_LRSRV_CLNS			(BB_DIGI_EVENT | 0x12c)
#define	BBE_IL3_LRSRV_CONS			(BB_DIGI_EVENT | 0x12d)
#define	BBE_IL3_LRSRV_DECODE_BUG		(BB_DIGI_EVENT | 0x12e)
#define	BBE_IL3_LRSRV_DELAY			(BB_DIGI_EVENT | 0x12f)
#define	BBE_IL3_LRSRV_FAIL			(BB_DIGI_EVENT | 0x130)
#define	BBE_IL3_LRSRV_OK			(BB_DIGI_EVENT | 0x131)
#define	BBE_IL3_LRSRV_DCHANX			(BB_DIGI_EVENT | 0x132)
#define	BBE_IL3_LWSRV				(BB_DIGI_EVENT | 0x133)
#define	BBE_IL3_LWSRV_QNULL			(BB_DIGI_EVENT | 0x134)
#define	BBE_IL3_LWSRVX				(BB_DIGI_EVENT | 0x135)
#define	BBE_IL3_TRACE				(BB_DIGI_EVENT | 0x136)
#define	BBE_IL3_TRACE_NULL			(BB_DIGI_EVENT | 0x137)
#define	BBE_IL3_TRACE_FAIL			(BB_DIGI_EVENT | 0x138)
#define	BBE_IL3_DLPI				(BB_DIGI_EVENT | 0x139)
#define	BBE_IL3_DLPI_BADARG			(BB_DIGI_EVENT | 0x13a)
#define	BBE_IL3_DLPI_STATE			(BB_DIGI_EVENT | 0x13b)
#define	BBE_IL3_DLPI_RESULT			(BB_DIGI_EVENT | 0x13c)
#define	BBE_DCHAN_FETCH_HDLC			(BB_DIGI_EVENT | 0x13d)
#define	BBE_DCHAN_FETCH_HDLC_BADARG		(BB_DIGI_EVENT | 0x13e)
#define	BBE_DCHAN_FETCH_HDLCX			(BB_DIGI_EVENT | 0x13f)
#define	BBE_DCHAN_SEND				(BB_DIGI_EVENT | 0x140)
#define	BBE_DCHAN_SENDX				(BB_DIGI_EVENT | 0x141)
#define	BBE_DCHAN_SEND_NEXT			(BB_DIGI_EVENT | 0x142)
#define	BBE_CSC_OVERLAY_LATE			(BB_DIGI_EVENT | 0x143)
#define	BBE_SIGNAL_OPEN				(BB_DIGI_EVENT | 0x144)
#define	BBE_SIGNAL_OPEN_NORMAL			(BB_DIGI_EVENT | 0x145)
#define	BBE_SIGNAL_OPENX			(BB_DIGI_EVENT | 0x146)
#define	BBE_SIGNAL_CLOSE			(BB_DIGI_EVENT | 0x147)
#define	BBE_SIGNAL_CLOSE_NORMAL			(BB_DIGI_EVENT | 0x148)
#define	BBE_SIGNAL_CLOSEX			(BB_DIGI_EVENT | 0x149)
#define	BBE_SIGNAL_ISDN_MSG			(BB_DIGI_EVENT | 0x14a)
#define	BBE_SIGNAL_ISDN_CONNECT			(BB_DIGI_EVENT | 0x14b)
#define	BBE_SIGNAL_ISDN_CONNACK			(BB_DIGI_EVENT | 0x14c)
#define	BBE_SIGNAL_ISDN_OTHER			(BB_DIGI_EVENT | 0x14d)
#define	BBE_SIGNAL_ISDN_MSGX			(BB_DIGI_EVENT | 0x14e)
#define	BBE_SIGNAL_EPOCH			(BB_DIGI_EVENT | 0x14f)
#define	BBE_SIGNAL_HOOK_CMD			(BB_DIGI_EVENT | 0x150)
#define	BBE_SIGNAL_HOOK_CMD_BAD			(BB_DIGI_EVENT | 0x151)
#define	BBE_SIGNAL_HOOK_CMD_DETACH		(BB_DIGI_EVENT | 0x152)
#define	BBE_SIGNAL_HOOK_CMD_ON			(BB_DIGI_EVENT | 0x153)
#define	BBE_SIGNAL_HOOK_CMDX			(BB_DIGI_EVENT | 0x154)
#define	BBE_SIGNAL_TASK_START			(BB_DIGI_EVENT | 0x155)
#define	BBE_SIGNAL_TASK_RUN			(BB_DIGI_EVENT | 0x156)
#define	BBE_SIGNAL_CACTIVE			(BB_DIGI_EVENT | 0x157)
#define	BBE_SIGNAL_CACTIVE_REMAP		(BB_DIGI_EVENT | 0x158)
#define	BBE_SIGNAL_CACTIVE_ATTACH		(BB_DIGI_EVENT | 0x159)
#define	BBE_SIGNAL_CACTIVEX			(BB_DIGI_EVENT | 0x15a)
#define	BBE_SIGNAL_ANSWER			(BB_DIGI_EVENT | 0x15b)
#define	BBE_SIGNAL_ANSWER_CONNACK		(BB_DIGI_EVENT | 0x15c)
#define	BBE_SIGNAL_DIAL				(BB_DIGI_EVENT | 0x15d)
#define	BBE_SIGNAL_DIAL_CONNECT			(BB_DIGI_EVENT | 0x15e)
#define	BBE_SIGNAL_HANGUP			(BB_DIGI_EVENT | 0x15f)
#define	BBE_SIGNAL_INPUT			(BB_DIGI_EVENT | 0x160)
#define	BBE_SIGNAL_INPUT_COPY			(BB_DIGI_EVENT | 0x161)
#define	BBE_SIGNAL_INPUT_MORE			(BB_DIGI_EVENT | 0x162)
#define	BBE_SIGNAL_INPUT_EMPTY			(BB_DIGI_EVENT | 0x163)
#define	BBE_SIGNAL_CONNACK			(BB_DIGI_EVENT | 0x164)
#define	BBE_SIGNAL_CONNACK_REMAP		(BB_DIGI_EVENT | 0x165)
#define	BBE_SIGNAL_CONNACK_ATTACH		(BB_DIGI_EVENT | 0x166)
#define	BBE_SIGNAL_CONNACKX			(BB_DIGI_EVENT | 0x167)
#define	BBE_SIGNAL_RING				(BB_DIGI_EVENT | 0x168)
#define	BBE_SIGNAL_RING_REMAP			(BB_DIGI_EVENT | 0x169)
#define	BBE_SIGNAL_RINGX			(BB_DIGI_EVENT | 0x16a)
#define	BBE_SIGNAL_CONNEND			(BB_DIGI_EVENT | 0x16b)
#define	BBE_SIGNAL_CONNEND_REFUSE		(BB_DIGI_EVENT | 0x16c)
#define	BBE_SIGNAL_CONNEND_VALID		(BB_DIGI_EVENT | 0x16d)
#define	BBE_SIGNAL_CONNENDX			(BB_DIGI_EVENT | 0x16e)
#define	BBE_SIGNAL_DISCONN			(BB_DIGI_EVENT | 0x16f)
#define	BBE_SIGNAL_DISCONNX			(BB_DIGI_EVENT | 0x170)
#define	BBE_SIGNAL_CONNECT			(BB_DIGI_EVENT | 0x171)
#define	BBE_SIGNAL_CONNECT_REMAP		(BB_DIGI_EVENT | 0x172)
#define	BBE_SIGNAL_CONNECTX			(BB_DIGI_EVENT | 0x173)
#define	BBE_SIGNAL_STRING2ISDNF			(BB_DIGI_EVENT | 0x174)
#define	BBE_SIGNAL_STRING2ISDNFX		(BB_DIGI_EVENT | 0x175)
#define	BBE_SIGNAL_ISDNF2STRING			(BB_DIGI_EVENT | 0x176)
#define	BBE_SIGNAL_ISDNF2STRINGX		(BB_DIGI_EVENT | 0x177)
#define	BBE_SIGNAL_POST_LISTEN			(BB_DIGI_EVENT | 0x178)
#define	BBE_SIGNAL_ENVELOPE_END			(BB_DIGI_EVENT | 0x179)
#define	BBE_SIGNAL_ENVELOPE_END_NEXT		(BB_DIGI_EVENT | 0x17a)
#define	BBE_SIGNAL_ENVELOPE_END_UNLINK		(BB_DIGI_EVENT | 0x17b)
#define	BBE_SIGNAL_ENVELOPE_ENDX		(BB_DIGI_EVENT | 0x17c)
#define	BBE_SIGNAL_ENVELOPE_START		(BB_DIGI_EVENT | 0x17d)
#define	BBE_SIGNAL_ENVELOPE_STARTX		(BB_DIGI_EVENT | 0x17e)
#define	BBE_SIGNAL_RINGER			(BB_DIGI_EVENT | 0x17f)
#define	BBE_SIGNAL_RINGER_END			(BB_DIGI_EVENT | 0x180)
#define	BBE_SIGNAL_RINGERX			(BB_DIGI_EVENT | 0x181)
#define	BBE_SIGNAL_NFAS_PORT2SNID		(BB_DIGI_EVENT | 0x182)
#define	BBE_SIGNAL_NFAS_PORT2SNID_SLAVE		(BB_DIGI_EVENT | 0x183)
#define	BBE_SIGNAL_NFAS_CHAN_REMAP		(BB_DIGI_EVENT | 0x184)
#define	BBE_SIGNAL_NFAS_CHAN_REMAPX		(BB_DIGI_EVENT | 0x185)
#define	BBE_CSC_DSP_READ			(BB_DIGI_EVENT | 0x186)
#define	BBE_CSC_DSP_WRITE			(BB_DIGI_EVENT | 0x187)
#define	BBE_CSC_DSP_DEBUG1			(BB_DIGI_EVENT | 0x188)
#define	BBE_CSC_DSP_DEBUG2			(BB_DIGI_EVENT | 0x189)
#define	BBE_CSC_DSP_DEBUG3			(BB_DIGI_EVENT | 0x18a)
#define	BBE_CSC_DSP_DEBUG4			(BB_DIGI_EVENT | 0x18b)
#define	BBE_CSC_FAX_FHS				(BB_DIGI_EVENT | 0x18c)
#define	BBE_CSC_FAX_FPS_LINE_CNT		(BB_DIGI_EVENT | 0x18d)
#define	BBE_CSC_FAX_FPS_BAD_LINE_CNT		(BB_DIGI_EVENT | 0x18e)
#define BBE_CSC_FOOBUF_PUT			(BB_DIGI_EVENT | 0x18f)
#define BBE_CSC_DSP_BAD_STATUS_PTRS		(BB_DIGI_EVENT | 0x190)
#define BBE_CSC_BAD_HOOKSTATE			(BB_DIGI_EVENT | 0x191)
#define	BBE_CSC_ANOMALY				(BB_DIGI_EVENT | 0x192)
#define	BBE_CSC_CHANNEL				(BB_DIGI_EVENT | 0x193)
#define	BBE_CSC_SEND_CAN			(BB_DIGI_EVENT | 0x194)
#define BBE_MGMT_DID_SET_DCHAN_CONFIG		(BB_DIGI_EVENT | 0x195)
#define BBE_MGMT_DID_GET_DCHAN_CONFIG		(BB_DIGI_EVENT | 0x196)
#define	BBE_HOTPATH_DSP_FAILURE			(BB_DIGI_EVENT | 0x197)
#define	BBE_SIGNAL_SELECT_CSC			(BB_DIGI_EVENT | 0x198)
#define	BBE_SIGNAL_SELECT_CSC_REMAP		(BB_DIGI_EVENT | 0x199)
#define	BBE_SIGNAL_SELECT_CSC_SEARCH		(BB_DIGI_EVENT | 0x19a)
#define	BBE_SIGNAL_SELECT_CSC_MAP1		(BB_DIGI_EVENT | 0x19b)
#define	BBE_SIGNAL_SELECT_CSC_MAP2		(BB_DIGI_EVENT | 0x19c)
#define	BBE_SIGNAL_CONNECT_FAIL			(BB_DIGI_EVENT | 0x19d)
#define	BBE_SIGNAL_FIND_CSC			(BB_DIGI_EVENT | 0x19e)
#define	BBE_SIGNAL_FIND_CSC_OK			(BB_DIGI_EVENT | 0x19f)
#define	BBE_SIGNAL_FIND_CSC_FAIL		(BB_DIGI_EVENT | 0x1a0)
#define	BBE_SIGNAL_DIAL_FAIL			(BB_DIGI_EVENT | 0x1a1)
#define	BBE_SIGNAL_ANSWER_FAIL			(BB_DIGI_EVENT | 0x1a2)
#define	BBE_SIGNAL_FD_OPEN			(BB_DIGI_EVENT | 0x1a3)
#define	BBE_SIGNAL_FD_OPENX			(BB_DIGI_EVENT | 0x1a4)
#define	BBE_SIGNAL_FD_CLOSE			(BB_DIGI_EVENT | 0x1a5)
#define	BBE_SIGNAL_CONNECT_FAIL2		(BB_DIGI_EVENT | 0x1a6)
#define	BBE_MGMT_HANGUP_TIMEOUT			(BB_DIGI_EVENT | 0x1a7)
#define	BBE_HOTPATH_XN_SYNC_CMD			(BB_DIGI_EVENT | 0x1a8)
#define	BBE_HOTPATH_XN_SYNC_RESP		(BB_DIGI_EVENT | 0x1a9)
#define	BBE_AVIATOR_WFIXUP			(BB_DIGI_EVENT | 0x1aa)
#define	BBE_AVIATOR_CONST			(BB_DIGI_EVENT | 0x1ab)
#define	BBE_AVIATOR_DSP				(BB_DIGI_EVENT | 0x1ac)
#define	BBE_AVIATOR_CONSTX			(BB_DIGI_EVENT | 0x1ad)
#define	BBE_AVIATOR_DEST			(BB_DIGI_EVENT | 0x1ae)
#define	BBE_AVIATOR_DETAILS			(BB_DIGI_EVENT | 0x1af)
#define	BBE_AVIATOR_SEND			(BB_DIGI_EVENT | 0x1b0)
#define	BBE_CAS_STATE_CHANGE			(BB_DIGI_EVENT | 0x1b1)
#define	BBE_CAS_TX_BITS				(BB_DIGI_EVENT | 0x1b2)
#define	BBE_CAS_HOOK				(BB_DIGI_EVENT | 0x1b3)
#define	BBE_CAS_BUSY				(BB_DIGI_EVENT | 0x1b4)
#define	BBE_CAS_WINK_ILLEGAL			(BB_DIGI_EVENT | 0x1b5)
#define	BBE_CAS_WINK_INBOUND			(BB_DIGI_EVENT | 0x1b6)
#define	BBE_CAS_WINK_IDLE			(BB_DIGI_EVENT | 0x1b7)
#define	BBE_CAS_WINK_TIMEOUT			(BB_DIGI_EVENT | 0x1b8)
#define	BBE_CAS_WINK_ABANDON			(BB_DIGI_EVENT | 0x1b9)
#define	BBE_CAS_WINK_DSP_TIMEOUT		(BB_DIGI_EVENT | 0x1ba)
#define	BBE_CAS_WINK_IN_DONE2			(BB_DIGI_EVENT | 0x1bb)
#define	BBE_CAS_WINK_HANGUP			(BB_DIGI_EVENT | 0x1bc)
#define	BBE_CAS_WINK_OPEN			(BB_DIGI_EVENT | 0x1bd)
#define	BBE_CAS_WINK_GLARE			(BB_DIGI_EVENT | 0x1be)
#define	BBE_CAS_WINK_IN_DONE1			(BB_DIGI_EVENT | 0x1bf)
#define	BBE_CAS_WINK_OUT_DONE1			(BB_DIGI_EVENT | 0x1c0)
#define	BBE_CAS_WINK_OUT_DONE2			(BB_DIGI_EVENT | 0x1c1)
#define	BBE_CAS_WINK_GOT_DIGITS			(BB_DIGI_EVENT | 0x1c2)
#define	BBE_CAS_WINK_WAIT			(BB_DIGI_EVENT | 0x1c3)
#define	BBE_CAS_WINK_READY			(BB_DIGI_EVENT | 0x1c4)
#define	BBE_HOTPATH_TX_OVERFLOW			(BB_DIGI_EVENT | 0x1c5)
#define	BBE_HOTPATH_DELAYED_SYNC		(BB_DIGI_EVENT | 0x1c6)

/* ADD NEW EVENTS DOWN HERE.  READ INSTRUCTIONS ABOVE. */

/* Events for Chaska caller id */
#define	BBE_CID_OBJ_CREATED			(BB_DIGI_EVENT | 0x1c7)
#define	BBE_CID_OBJ_DESTROYED		        (BB_DIGI_EVENT | 0x1c8)

/* DBG event for vantive 5963 */
#define BBE_CSC_CURRENT_STATE                   (BB_DIGI_EVENT | 0x1c9)
#define BBE_OMC_FORCE_DISCONNECT                (BB_DIGI_EVENT | 0x1ca)
#define BBE_OMC_INSTALLED                       (BB_DIGI_EVENT | 0x1cb)

/*
 * DO NOT REMOVE THIS COMMENT! 
 * END_BLACK_BOX_DEFINES
 */


