diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-07-06 13:47:05 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-07-06 13:47:05 +0000 |
commit | 39a1812c1ef76b6a792f00087f1e507616bbbb25 (patch) | |
tree | e50633c999779c514ef16f4a2ce7a70fc7511c9e /xpp/xdefs.h | |
parent | 70ef1183eba2d2fe4f00668fd3438b7f1c842c94 (diff) |
Tons of updates to the Astribank (xpp) driver:
* xpd_fxo.ko (FXO span) is now operational
* Remove obsolete .inc initialization files (we use user-space init)
* Added an install target to the utils dir.
* Updated README.Astribank accordingly.
* Using RBS signalling, as caller ID did not work well otherwise.
* Better handling of USB protocol errors.
* Fixed some procfs-related races.
* per-card-module ioctls.
* fxotune support.
* opermode support (set through /etc/default/zaptel for now)
* Userspace initialization script can also read registers.
* Power calibration works (and implemented in perl)
* some fine-tuning to the regster initialization parameters.
* Leds turn on before registration and turn off after it.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1204 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/xdefs.h')
-rw-r--r-- | xpp/xdefs.h | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/xpp/xdefs.h b/xpp/xdefs.h index c69b8a9..491e7b6 100644 --- a/xpp/xdefs.h +++ b/xpp/xdefs.h @@ -45,6 +45,48 @@ struct list_head { struct list_head *next; struct list_head *prev; }; #endif +#define PACKED __attribute__((packed)) + +#define ALL_LINES ((lineno_t)-1) + +#define BIT(i) (1 << (i)) +#define BIT_SET(x,i) ((x) |= BIT(i)) +#define BIT_CLR(x,i) ((x) &= ~BIT(i)) +#define IS_SET(x,i) (((x) & BIT(i)) != 0) +#define BITMASK(i) (BIT(i) - 1) + +#define CHANNELS_PERXPD 30 /* Depends on xpp_line_t and protocol fields */ + +#define MAX_SPANNAME 20 /* From zaptel.h */ +#define MAX_SPANDESC 40 /* From zaptel.h */ +#define MAX_CHANNAME 40 /* From zaptel.h */ + +#define XPD_NAMELEN 10 /* must be <= from maximal workqueue name */ +#define XPD_DESCLEN 20 +#define XBUS_NAMELEN 20 /* must be <= from maximal workqueue name */ +#define XBUS_DESCLEN 40 + +#define UNIT_BITS 4 /* Bit for Astribank unit number */ +#define SUBUNIT_BITS 4 /* Bit for Astribank subunit number */ + +#define MAX_UNIT 4 /* 1 FXS + 3 FXS/FXO */ +#define MAX_SUBUNIT 1 /* Firmware does not support subunits yet */ + +/* + * Compile time sanity checks + */ +#if MAX_UNIT > BIT(UNIT_BITS) +#error "MAX_UNIT too large" +#endif + +#if MAX_SUBUNIT > BIT(SUBUNIT_BITS) +#error "MAX_SUBUNIT too large" +#endif + +#define MAX_XPDS (MAX_UNIT*MAX_SUBUNIT) + +#define VALID_XPD_NUM(x) ((x) < MAX_XPDS && (x) >= 0) + typedef char *charp; typedef unsigned char byte; typedef int bool; @@ -56,13 +98,5 @@ typedef struct xops xops_t; typedef __u32 xpp_line_t; /* at most 31 lines for E1 */ typedef int lineno_t; -#define ALL_LINES ((lineno_t)-1) - -#define BIT(i) (1 << (i)) -#define BIT_SET(x,i) ((x) |= BIT(i)) -#define BIT_CLR(x,i) ((x) &= ~BIT(i)) -#define IS_SET(x,i) (((x) & BIT(i)) != 0) - -#define CHANNELS_PERXPD 30 /* Depends on xpp_line_t and protocol fields */ #endif /* XDEFS_H */ |