[MERGED] osmo-bts[master]: Add version to phy_instance

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon May 29 21:13:46 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Add version to phy_instance
......................................................................


Add version to phy_instance

Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693
Related: OS#1614
---
M include/osmo-bts/phy_link.h
M src/osmo-bts-octphy/l1_oml.c
M src/osmo-bts-sysmo/l1_if.c
3 files changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index e8fd7eb..4d1dadb 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -75,7 +75,7 @@
 	struct llist_head list;
 	int num;
 	char *description;
-
+	char version[MAX_VERSION_LENGTH];
 	/* pointer to the PHY link to which we belong */
 	struct phy_link *phy_link;
 
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 4652e10..ccef231 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1140,14 +1140,14 @@
 
 	LOGP(DL1C, LOGL_INFO, "Tx APP-INFO-SYSTEM.req\n");
 
-	return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, 0);
+	return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, pinst);
 }
 
 static int app_info_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp,
 			     void *data)
 {
 	char ver_hdr[32];
-
+	struct phy_instance *pinst = data;
 	tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *air =
 		(tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *) resp->l2h;
 
@@ -1171,6 +1171,7 @@
 	talloc_replace(fl1h->info.app.name, fl1h, air->szName);
 	talloc_replace(fl1h->info.app.description, fl1h, air->szDescription);
 	talloc_replace(fl1h->info.app.version, fl1h, air->szVersion);
+	osmo_strlcpy(pinst->version, ver_hdr, sizeof(pinst->version));
 
 	/* in a completion call-back, we take msgb ownership and must
 	 * release it before returning */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 60638e1..418d3f5 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1875,6 +1875,10 @@
 
 	hdl = pinst->u.sysmobts.hdl;
 	osmo_strlcpy(bts->sub_model, sysmobts_model(hdl->hw_info.model_nr, hdl->hw_info.trx_nr), sizeof(bts->sub_model));
+	talloc_asprintf(pinst->version, "%u.%u dsp %u.%u.%u fpga %u.%u.%u",
+			hdl->hw_info.ver_major, hdl->hw_info.ver_minor,
+			hdl->hw_info.dsp_version[0], hdl->hw_info.dsp_version[1], hdl->hw_info.dsp_version[2],
+			hdl->hw_info.fpga_version[0], hdl->hw_info.fpga_version[1], hdl->hw_info.fpga_version[2]);
 
 	phy_link_state_set(plink, PHY_LINK_CONNECTED);
 

-- 
To view, visit https://gerrit.osmocom.org/2784
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list