summaryrefslogtreecommitdiff
path: root/xpp/xpd.h
diff options
context:
space:
mode:
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];