jolly has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmocore/+/35160?usp=email )
Change subject: Add flag to enable RTS bases polling
......................................................................
Add flag to enable RTS bases polling
RTS based polling in LAPDm code is disabled by default. Make libosmogsm
stay compatible with existing applications that do not use RTS based
polling.
This patch fixes the issue that LAPDM_ENT_F_POLLING_ONLY did enable RTS
based polling too, which breaks existing applications like older
versions of osmo-bts.
Change-Id: I2a75c192bbc24e85bfc1656b2be21cea7a92814a
---
M include/osmocom/gsm/lapdm.h
M src/gsm/lapdm.c
2 files changed, 23 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/35160/1
diff --git a/include/osmocom/gsm/lapdm.h b/include/osmocom/gsm/lapdm.h
index 42ebbce..6812102 100644
--- a/include/osmocom/gsm/lapdm.h
+++ b/include/osmocom/gsm/lapdm.h
@@ -51,6 +51,7 @@
#define LAPDM_ENT_F_EMPTY_FRAME 0x0001
#define LAPDM_ENT_F_POLLING_ONLY 0x0002
#define LAPDM_ENT_F_DROP_2ND_REJ 0x0004
+#define LAPDM_ENT_F_RTS 0x0008
/*! a LAPDm Entity */
struct lapdm_entity {
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index fb892d2..1fc986d 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -363,8 +363,8 @@
if (le->tx_pending || le->flags & LAPDM_ENT_F_POLLING_ONLY) {
struct msgb *old_msg;
- /* In 'Polling only' mode there can be only one message. */
- if (le->flags & LAPDM_ENT_F_POLLING_ONLY) {
+ /* In 'RTS' mode there can be only one message. */
+ if (le->flags & LAPDM_ENT_F_RTS) {
/* Overwrite existing message by removing it first. */
if ((old_msg = msgb_dequeue(&dl->dl.tx_queue))) {
msgb_free(old_msg);
@@ -424,8 +424,8 @@
{
struct msgb *msg;
- /* Call RTS function of LAPD, to poll next frame. */
- if (dl->entity->flags & LAPDM_ENT_F_POLLING_ONLY) {
+ /* Call RTS function of LAPD, to queue next frame. */
+ if (dl->entity->flags & LAPDM_ENT_F_RTS) {
struct lapd_msg_ctx lctx;
int rc;
@@ -1635,7 +1635,7 @@
le->flags = flags;
/* Set flags at LAPD. */
- if (le->flags & LAPDM_ENT_F_POLLING_ONLY)
+ if (le->flags & LAPDM_ENT_F_RTS)
dl_flags |= LAPD_F_RTS;
if (le->flags & LAPDM_ENT_F_DROP_2ND_REJ)
dl_flags |= LAPD_F_DROP_2ND_REJ;
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/35160?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2a75c192bbc24e85bfc1656b2be21cea7a92814a
Gerrit-Change-Number: 35160
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-MessageType: newchange