[PATCH][MISDNUSER] Fix CAPI-initiated disconnection in direct layer 1 mode

"Maciej S. Szmigiero" <[email protected]> Sun, 13 Mar 2016 00:24:46 +0100
Newsgroups gmane.linux.isdn.i4l.user
Message-ID <[email protected]>
When CAPI application asks for B3 disconnection the NCCI state machine
sends disconnect request further down the stack and then goes into N_4
state waiting for disconnection confirmation.

If B channel was in direct layer 1 mode the disconnect request will be
sent as PH_DEACTIVATE_REQ which will go all the way down to an individual
mISDN chip driver.

It looks like all current chip drivers reply to such requests by sending
only PH_DEACTIVATE_IND message, however the state machine in N_4 state
only reacts to PH_DEACTIVATE_CNF message (translated into
EV_DL_RELEASE_CONF).

This means that such call will get stuck until remote side disconnects it.

Fix this by reacting to PH_DEACTIVATE_IND message also in N_4 state,
just like it is done in N_ACT state.

Signed-off-by: Maciej S. Szmigiero <[email protected]>
---
 capi20/ncci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/capi20/ncci.c b/capi20/ncci.c
index 922761602175..1307d20a38f7 100644
--- a/capi20/ncci.c
+++ b/capi20/ncci.c
@@ -557,6 +557,7 @@ static struct FsmNode fn_ncci_list[] = {
 #endif
 	{ST_NCCI_N_4, EV_NC_DISCONNECT_B3_CONF, ncci_disconnect_b3_conf},
 	{ST_NCCI_N_4, EV_NC_DISCONNECT_B3_IND, ncci_disconnect_b3_ind},
+	{ST_NCCI_N_4, EV_DL_RELEASE_IND, ncci_dl_release_ind_conf},
 	{ST_NCCI_N_4, EV_DL_RELEASE_CONF, ncci_dl_release_ind_conf},
 	{ST_NCCI_N_4, EV_DL_DOWN_IND, ncci_dl_down_ind},
 	{ST_NCCI_N_4, EV_AP_MANUFACTURER_REQ, ncci_manufacturer_req},