summaryrefslogtreecommitdiff
path: root/xpp/mpp_funcs.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-05-13 20:18:20 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-05-13 20:18:20 +0000
commitad798d2aca153c0315d1808fdcea8bb6a0127af6 (patch)
tree92ecf86881de5dab1786e70a069dddafdf913940 /xpp/mpp_funcs.c
parentc61a00f81462788231a78afdfe4616cee61c93c9 (diff)
astribank_tool: Support 'reset' of pre-MPP protocol as fallback
As of USB firmware rev. 6926, the Astribank control connection protocol has changed in an incompatible manner. If astribank_tool fails to open a device when running a reset command, try to reset the device with the command from the old (pre-MPP) protocol (A single 0x20 byte). No support whatsoever for any other feature of the old protocol. From xpp rev. 7067. (previous commit was xpp rev. 7066). git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6617 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/mpp_funcs.c')
-rw-r--r--xpp/mpp_funcs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xpp/mpp_funcs.c b/xpp/mpp_funcs.c
index 61868db..c52397f 100644
--- a/xpp/mpp_funcs.c
+++ b/xpp/mpp_funcs.c
@@ -928,14 +928,19 @@ struct astribank_device *mpp_init(const char devpath[])
ret = mpp_proto_query(astribank);
if(ret < 0) {
ERR("Protocol handshake failed: %d\n", ret);
- return NULL;
+ goto err;
}
ret = mpp_status_query(astribank);
if(ret < 0) {
ERR("Status query failed: %d\n", ret);
- return NULL;
+ goto err;
}
return astribank;
+
+err:
+ if (astribank)
+ astribank_close(astribank, 0);
+ return NULL;
}
void mpp_exit(struct astribank_device *astribank)