[layer23/lapdm] Added more headroom for data indication to prevent underrun
[osmocom-bb.git] / src / host / layer23 / src / common / lapdm.c
index e798cdc..1147c4f 100644 (file)
 #include <osmocore/protocol/gsm_04_08.h>
 #include <osmocore/protocol/gsm_08_58.h>
 
-#include <osmocom/osmocom_data.h>
-#include <osmocom/l1ctl.h>
-#include <osmocom/lapdm.h>
-#include <osmocom/logging.h>
+#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/l1ctl.h>
+#include <osmocom/bb/common/lapdm.h>
+#include <osmocom/bb/common/logging.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 /* TS 04.06 Figure 4 / Section 3.2 */
 #define LAPDm_LPD_NORMAL  0
@@ -306,7 +306,7 @@ for (i = 0; i < msgb_l2len(msg); i++)
 printf("\n");
 #endif
        lapdm_pad_msgb(msg, n201);
-       return tx_ph_data_req(ms, msg, chan_nr, link_id);
+       return l1ctl_tx_data_req(ms, msg, chan_nr, link_id);
 }
 
 /* get next frame from the tx queue. because the ms has multiple datalinks,
@@ -362,7 +362,7 @@ for (i = 0; i < msgb_l2len(msg); i++)
 printf("\n");
 #endif
        lapdm_pad_msgb(msg, n201);
-       return tx_ph_data_req(ms, msg, chan_nr, link_id);
+       return l1ctl_tx_data_req(ms, msg, chan_nr, link_id);
 }
 
 /* Create RSLms various RSLms messages */
@@ -1394,7 +1394,7 @@ static int lapdm_rx_i(struct msgb *msg, struct lapdm_msg_ctx *mctx)
                        if (!dl->rcv_buffer) {
                                LOGP(DLAPDM, LOGL_INFO, "message in multiple I "
                                        "frames (first message)\n");
-                               dl->rcv_buffer = msgb_alloc_headroom(200+10, 10,
+                               dl->rcv_buffer = msgb_alloc_headroom(200+56, 56,
                                                                "LAPDm RX");
                                dl->rcv_buffer->l3h = dl->rcv_buffer->data;
                        }
@@ -2013,9 +2013,9 @@ static int rslms_rx_chan_rqd(struct osmocom_ms *ms, struct msgb *msg)
        }
 
        /* TA = 0 - delay */
-       rc = l1ctl_tx_ph_param_req(ms, 0 - cch->data[5], cch->data[7]);
+       rc = l1ctl_tx_param_req(ms, 0 - cch->data[5], cch->data[7]);
 
-       rc = tx_ph_rach_req(ms, cch->data[1], cch->data[2], cch->data[3]);
+       rc = l1ctl_tx_rach_req(ms, cch->data[1], cch->data[2], cch->data[3]);
 
        msgb_free(msg);