From 27c5e2357fb2ad60c952db6688e5d93f3e7131b3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 18 Jan 2011 18:52:34 +0100 Subject: [PATCH] mtp: Send the TFP for every POC we want to handle. --- src/mtp_layer3.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index 1138d3c..5826dd4 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -289,6 +289,17 @@ void mtp_link_set_reset(struct mtp_link_set *link) bsc_schedule_timer(&link->delay_timer, START_DELAY); } +static int send_tfp(struct mtp_link_set *link, int apoc) +{ + struct msgb *msg; + msg = mtp_tfp_alloc(link, apoc); + if (!msg) + return -1; + + mtp_link_set_submit(link->slc[0], msg); + return 0; +} + static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *hdr, int l3_len) { struct msgb *msg; @@ -313,10 +324,16 @@ static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr * link->sccp_up = 0; mtp_link_set_sccp_down(link); - msg = mtp_tfp_alloc(link, 0); - if (!msg) + if (send_tfp(link, 0) != 0) + return -1; + if (send_tfp(link, link->opc) != 0) + return -1; + if (link->sccp_opc != link->opc && + send_tfp(link, link->sccp_opc) != 0) + return -1; + if (link->isup_opc != link->opc && + send_tfp(link, link->isup_opc) != 0) return -1; - mtp_link_set_submit(link->slc[0], msg); msg = mtp_tra_alloc(link); if (!msg)