From a0e532fc44b63d9996b16ca7329d9a98e04e3362 Mon Sep 17 00:00:00 2001 From: Russ Meyerriecks Date: Mon, 22 Feb 2010 16:18:45 +0000 Subject: Branch merge from the maintenance modes project * Added logic for both the single and dual/quad span cards for supporting local loopback (virtual loopback plug), network loopback, network payload loopback, loopup, and loopback transmitting. * Added logic for the dual/quad span driver to support exporting the performance and error counters including : - errored seconds - framing errors - coding violations - bipolar violations - crc4 errors - ebit errors - fas errors * Moved the error and performance counters into a substructure for all drivers taking advantage of dahdi_span bpvcount. * Modified the DAHDI_SPANSTAT ioctl interface, so I moved the old interface to DAHDI_SPANSTAT_V1. The new interface comes with a nice, new shiny packed struct dahdi_spaninfo. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8061 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- include/dahdi/kernel.h | 5 +---- include/dahdi/user.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index 1d75245..c905234 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -759,10 +759,7 @@ struct dahdi_span { int txlevel; /*!< Tx level */ int rxlevel; /*!< Rx level */ int syncsrc; /*!< current sync src (gets copied here) */ - unsigned int bpvcount; /*!< BPV counter */ - unsigned int crc4count; /*!< CRC4 error counter */ - unsigned int ebitcount; /*!< current E-bit error count */ - unsigned int fascount; /*!< current FAS error count */ + struct dahdi_count count; /*!< Performance and Error counters */ int maintstat; /*!< Maintenance state */ wait_queue_head_t maintq; /*!< Maintenance queue */ diff --git a/include/dahdi/user.h b/include/dahdi/user.h index 1d0570a..a5d6ed2 100644 --- a/include/dahdi/user.h +++ b/include/dahdi/user.h @@ -323,9 +323,19 @@ enum { #define DAHDI_MAINT_NONE 0 /* Normal Mode */ #define DAHDI_MAINT_LOCALLOOP 1 /* Local Loopback */ #define DAHDI_MAINT_REMOTELOOP 2 /* Remote Loopback */ +#define DAHDI_MAINT_NETWORKLINELOOP 2 /* Remote Loopback */ #define DAHDI_MAINT_LOOPUP 3 /* send loopup code */ #define DAHDI_MAINT_LOOPDOWN 4 /* send loopdown code */ #define DAHDI_MAINT_LOOPSTOP 5 /* stop sending loop codes */ +#define DAHDI_MAINT_FAS_DEFECT 6 /* insert a FAS defect */ +#define DAHDI_MAINT_MULTI_DEFECT 7 /* insert a Multiframe defect */ +#define DAHDI_MAINT_CRC_DEFECT 8 /* insert a FAS defect */ +#define DAHDI_MAINT_CAS_DEFECT 9 /* insert a FAS defect */ +#define DAHDI_MAINT_PRBS_DEFECT 10 /* insert a FAS defect */ +#define DAHDI_MAINT_BIPOLAR_DEFECT 11 /* insert a FAS defect */ +#define DAHDI_MAINT_PRBS 12 /* enable the PRBS gen/mon */ +#define DAHDI_MAINT_NETWORKPAYLOADLOOP 13 /* Remote Loopback */ +#define DAHDI_RESET_COUNTERS 14 /* clear the error counters */ /* Flag Value for IOMUX, read avail */ #define DAHDI_IOMUX_READ 1 @@ -519,10 +529,47 @@ struct dahdi_params { */ #define DAHDI_IOMUX _IOWR(DAHDI_CODE, 9, int) +struct dahdi_count { + __u32 fe; /*!< Framing error counter */ + __u32 cv; /*!< Coding violations counter */ + __u32 bpv; /*!< Bipolar Violation counter */ + __u32 crc4; /*!< CRC4 error counter */ + __u32 ebit; /*!< current E-bit error count */ + __u32 fas; /*!< current FAS error count */ + __u32 be; /*!< current bit error count */ + __u32 prbs; /*!< current PRBS detected pattern */ + __u32 errsec; /*!< errored seconds */ +}; + /* * Get Span Status */ struct dahdi_spaninfo { + int spanno; /* span number */ + char name[20]; /* Name */ + char desc[40]; /* Description */ + int alarms; /* alarms status */ + int txlevel; /* what TX level is set to */ + int rxlevel; /* current RX level */ + struct dahdi_count count;/* Performance and Error counters */ + int irqmisses; /* current IRQ misses */ + int syncsrc; /* span # of current sync source, + or 0 for free run */ + int numchans; /* number of configured channels on this span */ + int totalchans; /* total number of channels on the span */ + int totalspans; /* total number of spans in entire system */ + int lbo; /* line build out */ + int lineconfig; /* framing/coding */ + char lboname[40]; /* line build out in text form */ + char location[40]; /* span's device location in system */ + char manufacturer[40]; /* manufacturer of span's device */ + char devicetype[40]; /* span's device type */ + int irq; /* span's device IRQ */ + int linecompat; /* signaling modes possible on this span */ + char spantype[6]; /* type of span in text form */ +} __attribute__((packed)); + +struct dahdi_spaninfo_v1 { int spanno; /* span number */ char name[20]; /* Name */ char desc[40]; /* Description */ @@ -548,14 +595,14 @@ struct dahdi_spaninfo { int linecompat; /* signaling modes possible on this span */ char spantype[6]; /* type of span in text form */ }; - -#define DAHDI_SPANSTAT _IOWR(DAHDI_CODE, 10, struct dahdi_spaninfo) +#define DAHDI_SPANSTAT _IOWR(DAHDI_CODE, 10, struct dahdi_spaninfo) +#define DAHDI_SPANSTAT_V1 _IOWR(DAHDI_CODE, 10, struct dahdi_spaninfo_v1) /* * Set Maintenance Mode */ struct dahdi_maintinfo { - int spanno; /* span number 1-2 */ + int spanno; /* span number */ int command; /* command */ }; -- cgit v1.2.3