diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-05-13 21:08:09 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-05-13 21:08:09 +0000 |
commit | d7e54a785544ac40abc4a88383df3a913ca466e8 (patch) | |
tree | abf630c8372e7c81407172ad31190fa8a617a8ed /kernel/xpp/card_global.h | |
parent | 823cf303caf13cc6e4fd2c2173804f0990b29532 (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/card_global.h')
-rw-r--r-- | kernel/xpp/card_global.h | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/kernel/xpp/card_global.h b/kernel/xpp/card_global.h index 250f4f4..c71f74d 100644 --- a/kernel/xpp/card_global.h +++ b/kernel/xpp/card_global.h @@ -26,8 +26,8 @@ #include "xbus-pcm.h" enum global_opcodes { - XPROTO_NAME(GLOBAL, DESC_REQ) = 0x04, - XPROTO_NAME(GLOBAL, DEV_DESC) = 0x05, + XPROTO_NAME(GLOBAL, AB_REQUEST) = 0x07, + XPROTO_NAME(GLOBAL, AB_DESCRIPTION) = 0x08, XPROTO_NAME(GLOBAL, REGISTER_REQUEST) = 0x0F, XPROTO_NAME(GLOBAL, REGISTER_REPLY) = 0x10, /**/ @@ -42,13 +42,28 @@ enum global_opcodes { XPROTO_NAME(GLOBAL, NULL_REPLY) = 0xFE, }; +struct unit_descriptor { + struct xpd_addr addr; + byte subtype:4; + byte type:4; + byte numchips; + byte ports_per_chip; + byte port_dir; /* bitmask: 0 - PSTN, 1 - PHONE */ + byte reserved[2]; + struct xpd_addr ec_addr; +}; + +#define NUM_UNITS 6 + DEF_RPACKET_DATA(GLOBAL, NULL_REPLY); -DEF_RPACKET_DATA(GLOBAL, DESC_REQ); -DEF_RPACKET_DATA(GLOBAL, DEV_DESC, - byte rev; /* Revision number */ - byte type:4; /* LSB: 1 - to_phone, 0 - to_line */ - byte subtype:4; /* default 0 */ - xpp_line_t line_status; /* hook/ring status, depending on unit */ +DEF_RPACKET_DATA(GLOBAL, AB_REQUEST, + byte rev; + byte reserved; + ); +DEF_RPACKET_DATA(GLOBAL, AB_DESCRIPTION, + byte rev; + byte reserved[3]; + struct unit_descriptor unit_descriptor[NUM_UNITS]; ); DEF_RPACKET_DATA(GLOBAL, REGISTER_REQUEST, reg_cmd_t reg_cmd; @@ -77,18 +92,22 @@ DEF_RPACKET_DATA(GLOBAL, RESET_SYNC_COUNTERS, ); DEF_RPACKET_DATA(GLOBAL, ERROR_CODE, byte errorcode; - union { - reg_cmd_t bad_spi_cmd; - } info; + byte bad_packet[0]; ); -/* 0x04 */ DECLARE_CMD(GLOBAL, DESC_REQ, int xpd_num); +/* 0x07 */ DECLARE_CMD(GLOBAL, AB_REQUEST); /* 0x19 */ DECLARE_CMD(GLOBAL, SYNC_SOURCE, enum sync_mode mode, int drift); /* 0x23 */ DECLARE_CMD(GLOBAL, RESET_SYNC_COUNTERS); -int xpp_register_request(xbus_t *xbus, xpd_t *xpd, - byte chipsel, bool writing, bool do_subreg, byte regnum, byte subreg, byte data_low, byte data_high); +void chip_proc_remove(xbus_t *xbus, xpd_t *xpd); +int chip_proc_create(xbus_t *xbus, xpd_t *xpd); +int xpp_register_request(xbus_t *xbus, xpd_t *xpd, xportno_t portno, + bool writing, byte regnum, bool do_subreg, byte subreg, + byte data_low, bool do_datah, byte data_high, bool should_reply); +int send_multibyte_request(xbus_t *xbus, unsigned unit, xportno_t portno, + bool eoftx, byte *buf, unsigned len); extern xproto_table_t PROTO_TABLE(GLOBAL); int run_initialize_registers(xpd_t *xpd); +extern charp initdir; #endif /* CARD_GLOBAL_H */ |