summaryrefslogtreecommitdiff
path: root/xpp/xpd.h
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-09 19:12:55 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-09 19:12:55 +0000
commitcc599ab08d6f58a2d5e57db4150e2f9efe1112b8 (patch)
tree3f6df61996f5a6df4f05cd447c2b120ae8b4669e /xpp/xpd.h
parenteeaa77f409b4e0e158e62cb852e462ccef317f3f (diff)
Merged revisions 2123-2124 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.4 ........ r2123 | tzafrir | 2007-02-08 02:05:17 +0200 (Thu, 08 Feb 2007) | 27 lines Branch 1.4 is back in sync (currently: xorcom rev. 3332): * Performance improvements for multi-XPD (span) devices. * Astribank BRI driver (in next commit). * Changes under /proc: - XBUS and XPD numbers have two digits. - Every script wildcard should be replaced from XBUS-? to XBUS-[0-9]* - Added /proc/xpp/XBUS-*/XPD-*/blink: echo 1 to start and 0 to stop. * Several countries (South Africa, UAE, anybody else) require a shorter ring delay. Adjust FXO reg 0x17 (23)'s bits 0:2 to 011. * Use tasklets to move most of the interrupt PCM copying out of the interrupt. * Debugfs-based code to dump data to userspace (used to debug BRI D channel). * Pretend every 2.6.9 actually has later RHEL's typedefs. * fpga_load supports /dev/bus/usb . * Fixed physical order sorting in genzaptelconf. * Reverse polarity and power denial detection. * A short led flash at registration time. * Add a real version of the xpp modules to them (independent of the Zaptel version). * Update our line status even when not registered. * Fixed a false SIG_CHANGED when inserting or removing cable to FXO. * Fixed compilation fixes for 2.6.20 (Bug #8982) * A cleaner fix for the bool changes of 2.6.19 . * Automatically detect echo_can_state_t at debug time. * Automaitcally set XPP_DEBUGFS (depending on debugfs) at compile time. * Bug-fixes to zaptel-helper. Moved to xpp/utils . * Xbus protocol version: 2.4 (Zaptel 1.2.12/1.4.0 had 2.3). XPS Init scripts renamed accordingly. ........ r2124 | tzafrir | 2007-02-08 02:30:56 +0200 (Thu, 08 Feb 2007) | 1 line Now 'chans' is used after all. ........ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2144 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/xpd.h')
-rw-r--r--xpp/xpd.h61
1 files changed, 39 insertions, 22 deletions
diff --git a/xpp/xpd.h b/xpp/xpd.h
index 6debd03..40a6a20 100644
--- a/xpp/xpd.h
+++ b/xpp/xpd.h
@@ -32,7 +32,15 @@
#include <asm/atomic.h>
#include <asm/semaphore.h>
#include <linux/moduleparam.h>
+#ifdef XPP_DEBUGFS
+#ifndef CONFIG_DEBUG_FS
+#warning kernel does not include CONFIG_DEBUG_FS, canceling XPP_DEBUGFS support
+#undef XPP_DEBUGFS
+#else
+#include <linux/debugfs.h>
+#endif
#endif
+#endif /* __KERNEL__ */
#include <zaptel.h>
@@ -43,13 +51,20 @@
typedef unsigned gfp_t; /* Added in 2.6.14 */
#endif
#endif
-#define DEF_PARM(type,name,init,desc) \
- type name = init; \
- module_param(name, type, 0600); \
+
+/*
+ * FIXME: Kludge for 2.6.19
+ * bool is now defined as a proper boolean type (gcc _Bool)
+ * but the command line parsing framework handles it as int.
+ */
+#define DEF_PARM_BOOL(name,init,perm,desc) \
+ int name = init; \
+ module_param(name, bool, perm); \
MODULE_PARM_DESC(name, desc)
-#define DEF_PARM_RO(type,name,init,desc) \
+
+#define DEF_PARM(type,name,init,perm,desc) \
type name = init; \
- module_param(name, type, 0400); \
+ module_param(name, type, perm); \
MODULE_PARM_DESC(name, desc)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
@@ -92,9 +107,9 @@ typedef struct packet_queue {
} packet_queue_t;
struct xbus_ops {
- int (*packet_send)(xbus_t *xbus, xpacket_t *packet);
- xpacket_t *(*packet_new)(xbus_t *xbus, gfp_t flags);
- void (*packet_free)(xbus_t *xbus, xpacket_t *p);
+ int (*xframe_send)(xbus_t *xbus, xframe_t *xframe);
+ xframe_t *(*xframe_new)(xbus_t *xbus, gfp_t flags);
+ void (*xframe_free)(xbus_t *xbus, xframe_t *p);
};
/*
@@ -104,7 +119,7 @@ enum {
XBUS_N_DESC_REQ,
XBUS_N_DEV_DESC_FULL,
XBUS_N_DEV_DESC_EMPTY,
- XBUS_N_PCM_WRITE,
+ XBUS_N_SEND_PCM,
XBUS_N_PCM_READ,
XBUS_N_TX_BYTES,
XBUS_N_RX_BYTES,
@@ -121,7 +136,7 @@ static struct xbus_counters {
C_(DESC_REQ),
C_(DEV_DESC_FULL),
C_(DEV_DESC_EMPTY),
- C_(PCM_WRITE),
+ C_(SEND_PCM),
C_(PCM_READ),
C_(TX_BYTES),
C_(RX_BYTES),
@@ -142,6 +157,11 @@ struct card_desc_struct {
xpd_addr_t xpd_addr;
};
+#ifdef XPP_DEBUGFS
+/* definition in xbus-core.c */
+struct debugfs_data;
+#endif
+
/*
* An xbus is a transport layer for Xorcom Protocol commands
*/
@@ -183,6 +203,11 @@ struct xbus {
int num_xpds;
void *priv; /* Pointer to transport level data structures */
+#ifdef XPP_DEBUGFS
+ struct dentry *debugfs_dir;
+ struct dentry *debugfs_file;
+ struct debugfs_data *debugfs_data;
+#endif
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_xbus_dir;
struct proc_dir_entry *proc_xbus_summary;
@@ -230,12 +255,6 @@ static struct xpd_counters {
#define XPD_COUNTER_MAX (sizeof(xpd_counters)/sizeof(xpd_counters[0]))
-#define LED_BLINK_PERIOD (HZ/8)
-
-#define LED_ON 1
-#define LED_OFF 0
-#define LED_BLINK (-LED_BLINK_PERIOD)
-
/* Values of SLIC register 0x40 */
enum fxs_state {
FXS_LINE_DISABLED = 0x00,
@@ -264,11 +283,7 @@ struct xpd {
xpp_line_t digital_inputs; /* 0 - no, 1 - yes */
xpp_line_t digital_signalling; /* PRI/BRI signalling channels */
- int ringing[CHANNELS_PERXPD];
- bool ringer_on[CHANNELS_PERXPD]; /* For ring toggling */
-
- wait_queue_head_t txstateq[CHANNELS_PERXPD]; /* waiting on the tx state to change */
- int delay_until_dialtone[CHANNELS_PERXPD];
+ bool ringing[CHANNELS_PERXPD];
enum fxs_state lasttxhook[CHANNELS_PERXPD];
int idletxhookstate[CHANNELS_PERXPD]; /* IDLE changing hook state */
@@ -281,11 +296,14 @@ struct xpd {
atomic_t open_counter; /* Number of open channels */
int flags;
+ bool blink_mode; /* for visual identification */
+#define DEFAULT_LED_PERIOD (1000/8) /* in tick */
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_xpd_dir;
struct proc_dir_entry *proc_xpd_summary;
struct proc_dir_entry *proc_xpd_ztregister;
+ struct proc_dir_entry *proc_xpd_blink;
#endif
int counters[XPD_COUNTER_MAX];
@@ -302,7 +320,6 @@ struct xpd {
xpd_addr_t addr;
struct list_head xpd_list;
unsigned int timer_count;
- volatile u_char *writechunk; /* Double-word aligned write memory */
volatile u_char *readchunk; /* Double-word aligned read memory */
/* Echo cancelation */
u_char ec_chunk1[CHANNELS_PERXPD][ZT_CHUNKSIZE];