[subscriber] Introduce subscr_put_channel
Introduce subscr_put_channel to release a channel and to allow gsm_subscriber.c to hand this channel to any suitable pending requests.
This commit is contained in:
parent
4a49e77ff4
commit
a1f92f0a43
|
@ -43,6 +43,7 @@ struct gsm_subscriber *subscr_get_by_tmsi(const char *tmsi);
|
||||||
struct gsm_subscriber *subscr_get_by_imsi(const char *imsi);
|
struct gsm_subscriber *subscr_get_by_imsi(const char *imsi);
|
||||||
struct gsm_subscriber *subscr_get_by_extension(const char *ext);
|
struct gsm_subscriber *subscr_get_by_extension(const char *ext);
|
||||||
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason);
|
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason);
|
||||||
|
void subscr_put_channel(struct gsm_lchan *lchan);
|
||||||
|
|
||||||
/* internal */
|
/* internal */
|
||||||
struct gsm_subscriber *subscr_alloc(void);
|
struct gsm_subscriber *subscr_alloc(void);
|
||||||
|
|
|
@ -1208,7 +1208,13 @@ static int gsm48_cc_rx_disconnect(struct msgb *msg)
|
||||||
DEBUGP(DCC, "A <- RELEASE\n");
|
DEBUGP(DCC, "A <- RELEASE\n");
|
||||||
rc = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,
|
rc = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,
|
||||||
GSM48_MT_CC_RELEASE);
|
GSM48_MT_CC_RELEASE);
|
||||||
put_lchan(msg->lchan);
|
|
||||||
|
/*
|
||||||
|
* FIXME: This looks wrong! We should have a single
|
||||||
|
* place to do MMCC-REL-CNF/-REQ/-IND and then switch
|
||||||
|
* to the NULL state and relase the call
|
||||||
|
*/
|
||||||
|
subscr_put_channel(msg->lchan);
|
||||||
|
|
||||||
/* forward DISCONNECT to other party */
|
/* forward DISCONNECT to other party */
|
||||||
if (!call->remote_lchan)
|
if (!call->remote_lchan)
|
||||||
|
@ -1294,7 +1300,7 @@ static int gsm0408_rcv_cc(struct msgb *msg)
|
||||||
/* need to respond with RELEASE_COMPLETE */
|
/* need to respond with RELEASE_COMPLETE */
|
||||||
rc = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,
|
rc = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,
|
||||||
GSM48_MT_CC_RELEASE_COMPL);
|
GSM48_MT_CC_RELEASE_COMPL);
|
||||||
put_lchan(msg->lchan);
|
subscr_put_channel(msg->lchan);
|
||||||
call->state = GSM_CSTATE_NULL;
|
call->state = GSM_CSTATE_NULL;
|
||||||
break;
|
break;
|
||||||
case GSM48_MT_CC_STATUS_ENQ:
|
case GSM48_MT_CC_STATUS_ENQ:
|
||||||
|
|
|
@ -122,3 +122,14 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr)
|
||||||
subscr_free(subscr);
|
subscr_free(subscr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void subscr_put_channel(struct gsm_lchan *lchan)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* FIXME: Continue with other requests now... by checking
|
||||||
|
* the gsm_subscriber inside the gsm_lchan. Drop the ref count
|
||||||
|
* of the lchan after having asked the next requestee to handle
|
||||||
|
* the channel.
|
||||||
|
*/
|
||||||
|
put_lchan(lchan);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue