From 4f5d4f0b197b12f93a839c3d706d1e58fc764500 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Thu, 15 Mar 2012 20:43:18 +0000 Subject: xpp: Add info to astribank_tool -Q * In MPP serial protocol add support for SER_STAT_GET command * Use it to query firmware for: - FPGA build configuration number (1 - old main, 2 - new main) - Watchdog timer state bit (ready/expired) - XPD Alive timer state bit (yes/no) * Also cleanup the code in mpps_card_info(): - In all MPP serial commands the send/recive buffers must have identical size - No need to alias struct pointers to byte-buffers, just use the structs themselves as buffers. Signed-off-by: Oron Peled Acked-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10501 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- xpp/astribank_tool.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'xpp/astribank_tool.c') diff --git a/xpp/astribank_tool.c b/xpp/astribank_tool.c index 7a88334..f3ca976 100644 --- a/xpp/astribank_tool.c +++ b/xpp/astribank_tool.c @@ -79,9 +79,6 @@ static int reset_kind(const char *arg) static int show_hardware(struct astribank_device *astribank) { - uint8_t unit; - uint8_t card_status; - uint8_t card_type; int ret; struct eeprom_table eeprom_table; struct capabilities capabilities; @@ -95,6 +92,12 @@ static int show_hardware(struct astribank_device *astribank) if(astribank->eeprom_type == EEPROM_TYPE_LARGE) { show_capabilities(&capabilities, stdout); if(STATUS_FPGA_LOADED(astribank->status)) { + uint8_t unit; + uint8_t card_status; + uint8_t card_type; + uint8_t fpga_configuration; + uint8_t status; + for(unit = 0; unit < 5; unit++) { ret = mpps_card_info(astribank, unit, &card_type, &card_status); if(ret < 0) @@ -103,6 +106,14 @@ static int show_hardware(struct astribank_device *astribank) ((card_type >> 4) & 0xF), (card_type & 0xF), ((card_status & 0x1) ? "PIC" : "NOPIC")); } + ret = mpps_stat(astribank, unit, &fpga_configuration, &status); + if (ret < 0) + return ret; + printf("FPGA: %-17s: %d\n", "Configuration num", fpga_configuration); + printf("FPGA: %-17s: %s\n", "Watchdog Timer", + (SER_STAT_WATCHDOG_READY(status)) ? "ready" : "expired"); + printf("FPGA: %-17s: %s\n", "XPD Alive", + (SER_STAT_XPD_ALIVE(status)) ? "yes" : "no"); } ret = mpp_extrainfo_get(astribank, &extrainfo); if(ret < 0) -- cgit v1.2.3