From 8f12bafb59716465938026ae90d83b9ad77b831f Mon Sep 17 00:00:00 2001 From: Russ Meyerriecks Date: Mon, 8 Mar 2010 23:22:24 +0000 Subject: dahdi_maint: Added unsupported function handling Added handling for -1 returns by the driver. This indicates that the specific hardware doesn't support a particular feature. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@8290 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- dahdi_maint.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dahdi_maint.c b/dahdi_maint.c index 5fa7ac7..90ae659 100644 --- a/dahdi_maint.c +++ b/dahdi_maint.c @@ -139,6 +139,8 @@ int main(int argc, char *argv[]) if (!(doloopback || iflag || gflag || rflag)) { s.spanno = span; res = ioctl(ctl, DAHDI_SPANSTAT, &s); + if (res) + printf("Error counters not supported on this card\n"); printf("Span %d:\n", span); printf(">FEC : %d:\n", s.fecount); printf(">CEC : %d:\n", s.crc4count); @@ -171,6 +173,9 @@ int main(int argc, char *argv[]) } res = ioctl(ctl, DAHDI_MAINT, &m); + if (res) + printf("This type of looping not"\ + "supported on this card\n"); } if (iflag) { @@ -196,6 +201,8 @@ int main(int argc, char *argv[]) display_help(argv[0], 1); } res = ioctl(ctl, DAHDI_MAINT, &m); + if (res) + printf("Network line loop not supported on this card\n"); } if (gflag) { @@ -203,12 +210,20 @@ int main(int argc, char *argv[]) " and Monitor\n"); m.command = DAHDI_MAINT_PRBS; res = ioctl(ctl, DAHDI_MAINT, &m); + if (res) { + printf("This type of error injection is not"\ + " supported on this card\n"); + } } if (rflag) { printf("Resetting error counters for span %d\n", span); m.command = DAHDI_RESET_COUNTERS; res = ioctl(ctl, DAHDI_MAINT, &m); + if (res) { + printf("Resetting error counters"\ + " is not supported on this card\n"); + } } return 0; -- cgit v1.2.3