diff options
Diffstat (limited to 'xpp/xpd.h')
-rw-r--r-- | xpp/xpd.h | 49 |
1 files changed, 23 insertions, 26 deletions
@@ -155,6 +155,7 @@ struct card_desc_struct { byte rev; /* Revision number */ byte type; /* LSB: 1 - to_phone, 0 - to_line */ xpd_addr_t xpd_addr; + xpp_line_t line_status; /* Initial line status (offhook) */ }; #ifdef XPP_DEBUGFS @@ -163,6 +164,27 @@ struct debugfs_data; #endif /* + * Encapsulate all poll related data of a single xbus. + */ +struct xbus_poller { + /* + * Bus scanning + */ + xbus_t *xbus; + struct workqueue_struct *wq; + bool is_polling; + atomic_t count_poll_answers; + struct list_head poll_results; + wait_queue_head_t wait_for_polls; + + struct work_struct xpds_init_work; + + atomic_t count_xpds_to_initialize; + atomic_t count_xpds_initialized; + wait_queue_head_t wait_for_xpd_initialization; +}; + +/* * An xbus is a transport layer for Xorcom Protocol commands */ struct xbus { @@ -186,18 +208,7 @@ struct xbus { atomic_t packet_counter; /* Allocated packets */ wait_queue_head_t packet_cache_empty; - /* - * 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; - - atomic_t count_xpds_to_initialize; - atomic_t count_xpds_initialized; - wait_queue_head_t wait_for_xpd_initialization; + struct xbus_poller *poller; struct rw_semaphore in_use; int num_xpds; @@ -255,16 +266,6 @@ static struct xpd_counters { #define XPD_COUNTER_MAX (sizeof(xpd_counters)/sizeof(xpd_counters[0])) -/* Values of SLIC register 0x40 */ -enum fxs_state { - FXS_LINE_DISABLED = 0x00, - FXS_LINE_ENABLED = 0x01, - FXS_LINE_CID = 0x02, - FXS_LINE_TIPOPEN = 0x03, /* For GroundStart signalling */ - FXS_LINE_RING = 0x04, - FXS_LINE_REV_ACTIVE = 0x05 -}; - /* * An XPD is a single Xorcom Protocol Device */ @@ -285,10 +286,6 @@ struct xpd { bool ringing[CHANNELS_PERXPD]; - enum fxs_state lasttxhook[CHANNELS_PERXPD]; - int idletxhookstate[CHANNELS_PERXPD]; /* IDLE changing hook state */ - int ohttimer[CHANNELS_PERXPD]; - xbus_t *xbus; /* The XBUS we are connected to */ spinlock_t lock; |