Change in libosmocore[master]: ns2: Don't start sending NS-RESET until FR DLC is available

2021-02-02 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/22580 )

Change subject: ns2: Don't start sending NS-RESET until FR DLC is available
..

ns2: Don't start sending NS-RESET until FR DLC is available

There's no point in sending NS-RESET (or any other) messages to the
underlying FR layer if the FR DLC has not been marked as
available/active yet.

Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Closes: OS#4999
---
M src/gb/gprs_ns2_fr.c
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  daniel: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index b5ddf7e..fc6a5c4 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -179,6 +179,17 @@
talloc_free(priv);
 }

+static void fr_dlci_status_cb(struct osmo_fr_dlc *dlc, void *cb_data, bool 
active)
+{
+   struct gprs_ns2_vc *nsvc = cb_data;
+
+   if (active) {
+   ns2_vc_fsm_start(nsvc);
+   } else {
+   ns2_vc_force_unconfigured(nsvc);
+   }
+}
+
 static struct priv_vc *fr_alloc_vc(struct gprs_ns2_vc_bind *bind,
   struct gprs_ns2_vc *nsvc,
   uint16_t dlci)
@@ -200,6 +211,7 @@

priv->dlc->cb_data = nsvc;
priv->dlc->rx_cb = fr_dlci_rx_cb;
+   priv->dlc->status_cb = fr_dlci_status_cb;

return priv;
 }
@@ -899,8 +911,6 @@
nsvc->nsvci = nsvci;
nsvc->nsvci_is_valid = true;

-   ns2_vc_fsm_start(nsvc);
-
return nsvc;

 err:

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22580
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Gerrit-Change-Number: 22580
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-MessageType: merged


Change in libosmocore[master]: ns2: Don't start sending NS-RESET until FR DLC is available

2021-02-01 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/22580 )

Change subject: ns2: Don't start sending NS-RESET until FR DLC is available
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22580
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Gerrit-Change-Number: 22580
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Comment-Date: Mon, 01 Feb 2021 10:28:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: ns2: Don't start sending NS-RESET until FR DLC is available

2021-01-31 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/22580 )

Change subject: ns2: Don't start sending NS-RESET until FR DLC is available
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22580
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Gerrit-Change-Number: 22580
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Comment-Date: Mon, 01 Feb 2021 02:09:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: ns2: Don't start sending NS-RESET until FR DLC is available

2021-01-31 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/22580 )


Change subject: ns2: Don't start sending NS-RESET until FR DLC is available
..

ns2: Don't start sending NS-RESET until FR DLC is available

There's no point in sending NS-RESET (or any other) messages to the
underlying FR layer if the FR DLC has not been marked as
available/active yet.

Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Closes: OS#4999
---
M src/gb/gprs_ns2_fr.c
1 file changed, 14 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/22580/1

diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 49e92ae..fc6a5c4 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -179,6 +179,17 @@
talloc_free(priv);
 }

+static void fr_dlci_status_cb(struct osmo_fr_dlc *dlc, void *cb_data, bool 
active)
+{
+   struct gprs_ns2_vc *nsvc = cb_data;
+
+   if (active) {
+   ns2_vc_fsm_start(nsvc);
+   } else {
+   ns2_vc_force_unconfigured(nsvc);
+   }
+}
+
 static struct priv_vc *fr_alloc_vc(struct gprs_ns2_vc_bind *bind,
   struct gprs_ns2_vc *nsvc,
   uint16_t dlci)
@@ -198,8 +209,9 @@
return NULL;
}

-   priv->dlc->rx_cb_data = nsvc;
+   priv->dlc->cb_data = nsvc;
priv->dlc->rx_cb = fr_dlci_rx_cb;
+   priv->dlc->status_cb = fr_dlci_status_cb;

return priv;
 }
@@ -756,7 +768,7 @@
}

fr_link->tx_cb = fr_tx_cb;
-   fr_link->tx_cb_data = bind;
+   fr_link->cb_data = bind;
priv->link = fr_link;

priv->ifindex = rc = devname2ifindex(netif);
@@ -899,8 +911,6 @@
nsvc->nsvci = nsvci;
nsvc->nsvci_is_valid = true;

-   ns2_vc_fsm_start(nsvc);
-
return nsvc;

 err:

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22580
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Gerrit-Change-Number: 22580
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange