diff options
Diffstat (limited to 'xpp/xbus-core.h')
-rw-r--r-- | xpp/xbus-core.h | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/xpp/xbus-core.h b/xpp/xbus-core.h index 2ebb3c0..85fac80 100644 --- a/xpp/xbus-core.h +++ b/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); |