diff options
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 */ |