summaryrefslogtreecommitdiff
path: root/xpp/xpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/xpd.h')
-rw-r--r--xpp/xpd.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/xpp/xpd.h b/xpp/xpd.h
index 4de2510..71db99e 100644
--- a/xpp/xpd.h
+++ b/xpp/xpd.h
@@ -37,6 +37,9 @@
#include <zaptel.h>
#ifdef __KERNEL__
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+typedef unsigned gfp_t; /* Added in 2.6.14 */
+#endif
#define DEF_PARM(type,name,init,desc) \
type name = init; \
module_param(name, type, 0600); \
@@ -83,7 +86,7 @@ typedef struct packet_queue {
struct xbus_ops {
int (*packet_send)(xbus_t *xbus, xpacket_t *packet);
- xpacket_t *(*packet_new)(xbus_t *xbus, int flags);
+ xpacket_t *(*packet_new)(xbus_t *xbus, gfp_t flags);
void (*packet_free)(xbus_t *xbus, xpacket_t *p);
};
@@ -132,7 +135,6 @@ struct card_desc_struct {
xpd_addr_t xpd_addr;
};
-
/*
* An xbus is a transport layer for Xorcom Protocol commands
*/
@@ -157,15 +159,18 @@ struct xbus {
atomic_t packet_counter; /* Allocated packets */
wait_queue_head_t packet_cache_empty;
- struct timer_list poll_timer;
/*
* Bus scanning
*/
atomic_t count_poll_answers;
struct list_head poll_results;
wait_queue_head_t wait_for_polls;
+
struct work_struct xpds_init_work;
- struct completion xpds_initialized;
+
+ atomic_t count_xpds_to_initialize;
+ atomic_t count_xpds_initialized;
+ wait_queue_head_t wait_for_xpd_initialization;
struct rw_semaphore in_use;
int num_xpds;
@@ -175,6 +180,9 @@ struct xbus {
struct proc_dir_entry *proc_xbus_dir;
struct proc_dir_entry *proc_xbus_summary;
struct proc_dir_entry *proc_xbus_waitfor_xpds;
+#ifdef PROTOCOL_DEBUG
+ struct proc_dir_entry *proc_xbus_command;
+#endif
#endif
/* statistics */
@@ -243,7 +251,7 @@ struct xpd {
byte revision; /* Card revision */
xpd_direction_t direction; /* TO_PHONE, TO_PSTN */
xpp_line_t no_pcm; /* Temporary: disable PCM (for USB-1) */
- xpp_line_t hookstate; /* Actual chip state: 0 - ONHOOK, 1 - OFHOOK */
+ xpp_line_t offhook; /* Actual chip state: 0 - ONHOOK, 1 - OFHOOK */
xpp_line_t cid_on;
xpp_line_t digital_outputs; /* 0 - no, 1 - yes */
xpp_line_t digital_inputs; /* 0 - no, 1 - yes */
@@ -261,6 +269,7 @@ struct xpd {
xbus_t *xbus; /* The XBUS we are connected to */
spinlock_t lock;
+ atomic_t zt_registered; /* Am I fully registered with zaptel */
atomic_t open_counter; /* Number of open channels */
int flags;
@@ -278,8 +287,6 @@ struct xpd {
void *priv; /* Card level private data */
bool card_present;
- unsigned int recv_errors;
- unsigned int seq_errors;
unsigned long last_response; /* in jiffies */
unsigned id;
xpd_addr_t addr;
@@ -292,8 +299,7 @@ struct xpd {
u_char ec_chunk2[CHANNELS_PERXPD][ZT_CHUNKSIZE];
};
-#define for_each_line(xpd,i) \
- for((i) = 0; (i) < (xpd)->channels; (i)++)
+#define for_each_line(xpd,i) for((i) = 0; (i) < (xpd)->channels; (i)++)
#endif