summaryrefslogtreecommitdiff
path: root/kernel/xpp/xbus-core.h
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-13 21:08:09 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-13 21:08:09 +0000
commitd7e54a785544ac40abc4a88383df3a913ca466e8 (patch)
treeabf630c8372e7c81407172ad31190fa8a617a8ed /kernel/xpp/xbus-core.h
parent823cf303caf13cc6e4fd2c2173804f0990b29532 (diff)
xpp r5723: Includes, among others:
* New firmware protocol version: 3.0 . * New numbers for the device types: (e.g. in card_init* scripts) - FXS: 1 (was: 3) - FXO: 2 (was: 4) - BRI: 3 (was: 6 for TE, 7 for NT) - PRI: 4 (was: 9) * Init scripts of FXS and FXO modules are now written in Perl as well (be sure to have File::Basename, e.g: perl-modules in Debian). * calibrate_slics merged into init_card_1_30 . * Module parameter print_dbg replaced with debug . Same meaning. * init_fxo_modes removed: content moved into init_card_2_30, verified at build time. * Code tested with sparse. Most warnings were fixed. * Set ZT_SIG_DACS for the bchans in the PRI and BRI modules to not get ignored by ztscan. * Handle null config_desc we get from some crazy USB controllers. * genzaptelconf: Fix reporting of empty slots in list mode. * xpp_blink can now blink a single analog port. * "slics" has been renamed "chipregs". * Fixed a small typo in fpga_load(8). * Fixed bashism in xpp_fxloader. Merged revisions 4264 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4266 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/xpp/xbus-core.h')
-rw-r--r--kernel/xpp/xbus-core.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/kernel/xpp/xbus-core.h b/kernel/xpp/xbus-core.h
index 2ebb3c0..85fac80 100644
--- a/kernel/xpp/xbus-core.h
+++ b/kernel/xpp/xbus-core.h
@@ -32,7 +32,7 @@
#define XFRAME_DATASIZE 512
/* forward declarations */
-struct xbus_poller;
+struct xbus_workqueue;
#ifdef XPP_DEBUGFS
struct debugfs_data;
#endif
@@ -50,9 +50,7 @@ struct xbus_ops {
* XBUS statistics counters
*/
enum {
- XBUS_N_DESC_REQ,
- XBUS_N_DEV_DESC_FULL,
- XBUS_N_DEV_DESC_EMPTY,
+ XBUS_N_UNITS,
XBUS_N_TX_XFRAME_PCM,
XBUS_N_RX_XFRAME_PCM,
XBUS_N_TX_PACK_PCM,
@@ -72,9 +70,7 @@ enum {
static struct xbus_counters {
char *name;
} xbus_counters[] = {
- C_(DESC_REQ),
- C_(DEV_DESC_FULL),
- C_(DEV_DESC_EMPTY),
+ C_(UNITS),
C_(TX_XFRAME_PCM),
C_(RX_XFRAME_PCM),
C_(TX_PACK_PCM),
@@ -108,6 +104,22 @@ struct xbus_ops *transportops_get(xbus_t *xbus);
void transportops_put(xbus_t *xbus);
/*
+ * Encapsulate all poll related data of a single xbus.
+ */
+struct xbus_workqueue {
+ xbus_t *xbus;
+ struct workqueue_struct *wq;
+ struct work_struct xpds_init_work;
+ bool xpds_init_done;
+ struct list_head card_list;
+ int num_units;
+ int num_units_initialized;
+ wait_queue_head_t wait_for_xpd_initialization;
+ struct proc_dir_entry *proc_xbus_waitfor_xpds;
+ spinlock_t worker_lock;
+};
+
+/*
* Allocate/Free an xframe from pools of empty xframes.
* Calls to {get,put}_xframe are wrapped in
* the macros bellow, so we take/return it
@@ -133,6 +145,7 @@ struct xbus {
/* low-level bus drivers set these 2 fields */
char location[XBUS_DESCLEN];
char label[LABEL_SIZE];
+ byte revision; /* Protocol revision */
struct xbus_transport transport;
int num;
@@ -184,7 +197,7 @@ struct xbus {
int sample_pos;
#endif
- struct xbus_poller *poller;
+ struct xbus_workqueue *worker;
/*
* Sync adjustment
@@ -248,7 +261,7 @@ int xbus_log(xbus_t *xbus, xpd_t *xpd, int direction, const void *buf, unsigned
#endif
/* Frame handling */
-void dump_xframe(const char msg[], const xbus_t *xbus, const xframe_t *xframe, int print_dbg);
+void dump_xframe(const char msg[], const xbus_t *xbus, const xframe_t *xframe, int debug);
int send_cmd_frame(xbus_t *xbus, xframe_t *xframe);
/*
@@ -273,8 +286,12 @@ void xbus_remove(xbus_t *xbus);
int xbus_activate(xbus_t *xbus);
void xbus_disconnect(xbus_t *xbus);
void xbus_receive_xframe(xbus_t *xbus, xframe_t *xframe);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+void xbus_populate(struct work_struct *work);
+#else
+void xbus_populate(void *data);
+#endif
-void xbus_poller_notify(xbus_t *xbus, struct card_desc_struct *card_desc);
int xbus_register_xpd(xbus_t *xbus, xpd_t *xpd);
int xbus_unregister_xpd(xbus_t *xbus, xpd_t *xpd);