diff options
author | Russ Meyerriecks <rmeyerreicks@digium.com> | 2010-03-08 23:22:24 +0000 |
---|---|---|
committer | Russ Meyerriecks <rmeyerreicks@digium.com> | 2010-03-08 23:22:24 +0000 |
commit | 8f12bafb59716465938026ae90d83b9ad77b831f (patch) | |
tree | 8dc930b584d0e20c8ecbfa8d46a857234a8a2a26 | |
parent | 142d60f0cbca2d58a2a72a93c7be80dbed5ff084 (diff) |
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
-rw-r--r-- | dahdi_maint.c | 15 |
1 files changed, 15 insertions, 0 deletions
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; |