Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-22 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..

RSL: restructure MDCX functions

In preparation for upcoming LCLS changes we have to split IPA RSL MDCX
generation into separate function with the ability to set destination
explicitly instead of just using the value from lchan which will be used
in follow-up patches.

Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Related: OS#3659
---
M include/osmocom/bsc/abis_rsl.h
M src/osmo-bsc/abis_rsl.c
2 files changed, 19 insertions(+), 6 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index 5ada3fc..098d2e6 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -61,6 +61,7 @@
 int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);

 /* ip.access specfic RSL extensions */
+struct msgb *rsl_make_ipacc_mdcx(const struct gsm_lchan *lchan, uint32_t 
dest_ip, uint16_t dest_port);
 int rsl_tx_ipacc_crcx(const struct gsm_lchan *lchan);
 int rsl_tx_ipacc_mdcx(const struct gsm_lchan *lchan);
 int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 6e8d078..954fb0f 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1847,11 +1847,12 @@
return abis_rsl_sendmsg(msg);
 }

-/*! Send IPA RSL MDCX to configure the RTP port the BTS sends to (MGW).
- * \param[in] lchan Logical Channel for which we issue MDCX
- * Remote (MGW) IP address, port and payload types for RTP are determined from 
lchan->abis_ip.
+/*! Allocate buffer for IPA RSL MDCX and populate it with given parameters.
+ * \param[in] lchan Logical Channel for which we make MDCX
+ * \param[in] dest_ip The IP address to connect to
+ * \param[in] dest_port The port to connect to
  */
-int rsl_tx_ipacc_mdcx(const struct gsm_lchan *lchan)
+struct msgb *rsl_make_ipacc_mdcx(const struct gsm_lchan *lchan, uint32_t 
dest_ip, uint16_t dest_port)
 {
struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh;
@@ -1865,8 +1866,8 @@
msgb_tv16_put(msg, RSL_IE_IPAC_CONN_ID, lchan->abis_ip.conn_id);
msgb_v_put(msg, RSL_IE_IPAC_REMOTE_IP);
att_ip = (uint32_t *)msgb_put(msg, sizeof(uint32_t));
-   *att_ip = htonl(lchan->abis_ip.connect_ip);
-   msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, 
lchan->abis_ip.connect_port);
+   *att_ip = htonl(dest_ip);
+   msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, dest_port);
msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD, lchan->abis_ip.rtp_payload);
if (lchan->abis_ip.rtp_payload2)
@@ -1874,6 +1875,17 @@

msg->dst = lchan->ts->trx->rsl_link;

+   return msg;
+}
+
+/*! Send IPA RSL MDCX to configure the RTP port the BTS sends to (MGW).
+ * \param[in] lchan Logical Channel for which we issue MDCX
+ * Remote (MGW) IP address, port and payload types for RTP are determined from 
lchan->abis_ip.
+ */
+int rsl_tx_ipacc_mdcx(const struct gsm_lchan *lchan)
+{
+   struct msgb *msg = rsl_make_ipacc_mdcx(lchan, 
lchan->abis_ip.connect_ip, lchan->abis_ip.connect_port);
+
LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:"
  " %s:%u rtp_payload=%u rtp_payload2=%u conn_id=%u 
speech_mode=0x%02x\n",
  ip_to_a(lchan->abis_ip.connect_ip),

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-22 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Patch Set 8: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 8
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 22 Nov 2018 12:53:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-19 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Set Ready For Review


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 8
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 19 Nov 2018 10:14:07 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-07 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Set Ready For Review


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 5
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 07 Nov 2018 12:10:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-04 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Patch Set 3: Code-Review-1

(5 comments)

https://gerrit.osmocom.org/#/c/11550/3//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/11550/3//COMMIT_MSG@12
PS3, Line 12: * make IP address helper accessible via header file
why? I see no-one using it outside of the static context


https://gerrit.osmocom.org/#/c/11550/3//COMMIT_MSG@14
PS3, Line 14: * constify rsl_tx_ipacc_*cx() parameters
this lists three changes that seem unrelated and should hence be in separate, 
smaller patches.


https://gerrit.osmocom.org/#/c/11550/3/include/osmocom/bsc/abis_rsl.h
File include/osmocom/bsc/abis_rsl.h:

https://gerrit.osmocom.org/#/c/11550/3/include/osmocom/bsc/abis_rsl.h@64
PS3, Line 64: struct msgb *rsl_make_ipacc_mdcx(const struct gsm_lchan *lchan, 
uint32_t dest_ip, uint16_t dest_port);
At least mention in the commit log in which other commit this will be used; but 
I'd prefer squashing with the actual caller that needs this change. (that would 
also have answered Pau's question, most likely)


https://gerrit.osmocom.org/#/c/11550/3/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/#/c/11550/3/src/osmo-bsc/abis_rsl.c@1873
PS3, Line 1873:
rather omit whitespace change


https://gerrit.osmocom.org/#/c/11550/3/src/osmo-bsc/abis_rsl.c@1876
PS3, Line 1876:
rather omit whitespace change



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 05 Nov 2018 02:51:25 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-02 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Patch Set 3:

Yes, we have to be able to set it explicitly regardless of what's in lchan.


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 02 Nov 2018 10:23:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-02 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/11550/3/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/#/c/11550/3/src/osmo-bsc/abis_rsl.c@1860
PS3, Line 1860: struct msgb *rsl_make_ipacc_mdcx(const struct gsm_lchan *lchan, 
uint32_t dest_ip, uint16_t dest_port)
why do you keep dest_ip and dest_port as params despite they come from lchan? 
Because in later patches you require to pass  ones not coming from lchan? or 
for no reason?



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 02 Nov 2018 09:35:55 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-11-01 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Set Ready For Review


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 01 Nov 2018 12:20:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-10-31 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/11550/2/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/#/c/11550/2/src/osmo-bsc/abis_rsl.c@1865
PS2, Line 1865: struct msgb *rsl_make_ipacc_mdcx(uint8_t chan_nr, uint16_t 
conn_id, uint32_t connect_ip, uint16_t connect_port,
Why not simply passing lchan and keeping all code? Lots of parameters for no 
apparent reason?



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 31 Oct 2018 19:23:20 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bsc[master]: RSL: restructure MDCX functions

2018-10-31 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11550 )

Change subject: RSL: restructure MDCX functions
..


Set Ready For Review


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iffe2f4f10e841fc36965cce02b4e5f017a5ae6c8
Gerrit-Change-Number: 11550
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Wed, 31 Oct 2018 19:13:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: No