[PATCH] osmo-bts[master]: Set and report BTS features

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/.

Max gerrit-no-reply at lists.osmocom.org
Tue May 30 16:42:13 UTC 2017


Review at  https://gerrit.osmocom.org/2799

Set and report BTS features

Set (possibly incomplete) list of BTS model-specific features and report
them in response to attribute request via OML.

Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f
Related: OS#1614
---
M src/common/oml.c
M src/osmo-bts-litecell15/main.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-sysmo/main.c
M src/osmo-bts-trx/main.c
5 files changed, 44 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/2799/1

diff --git a/src/common/oml.c b/src/common/oml.c
index 4fe6916..798d870 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -163,6 +163,12 @@
 		abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true);
 }
 
+/* Add BTS features as 3GPP TS 52.021 §9.4.30 Manufacturer Id */
+static inline void add_bts_feat(struct msgb *msg, const struct gsm_bts *bts)
+{
+	msgb_tl16v_put(msg, NM_ATT_MANUF_ID, _NUM_BTS_FEAT/8 + 1, bts->_features_data);
+}
+
 static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx)
 {
 	struct phy_instance *pinst = trx_phy_instance(trx);
@@ -170,6 +176,7 @@
 	abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown",
 			    true);
 }
+
 /* Add nominal TRX power (if available) as 3GPP TS 52.021 §9.4.28 Manufacturer Dependent State */
 static inline void add_trx_power(struct msgb *msg, struct gsm_bts_trx *trx)
 {
@@ -246,9 +253,29 @@
 				return -EINVAL;
 			}
 			break;
+		case NM_ATT_MANUF_ID:
+			switch (mo->obj_class) {
+			case NM_OC_BTS:
+				add_bts_feat(attr_buf, bts);
+				break;
+			case NM_OC_BASEB_TRANSC:
+				LOGP(DOML, LOGL_NOTICE, "TRX does not support NM_ATT_MANUF_ID in Get Attribute "
+				     "Response\n");
+				out[attr_out_index] = attr[i];
+				attr_out_index++;
+				break;
+			default:
+				LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute "
+				     "Response(NM_ATT_MANUF_ID)\n",
+				     get_value_string(abis_nm_obj_class_names, mo->obj_class));
+				return -EINVAL;
+				break;
+			}
+			break;
 		default:
-			LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported.\n", i,
-			     get_value_string(abis_nm_att_names, attr[i]));
+			LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by %s.\n", i,
+			     get_value_string(abis_nm_att_names, attr[i]),
+			     get_value_string(abis_nm_obj_class_names, mo->obj_class));
 			out[attr_out_index] = attr[i];
 			attr_out_index++;
 		}
diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c
index ab13981..97b5359 100644
--- a/src/osmo-bts-litecell15/main.c
+++ b/src/osmo-bts-litecell15/main.c
@@ -91,6 +91,10 @@
 		exit(23);
 	}
 
+	gsm_bts_set_feature(bts, BTS_FEAT_GPRS);
+	gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS);
+	gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP);
+
 	bts_model_vty_init(bts);
 
 	return 0;
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 042ecc3..85b5a86 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -782,6 +782,9 @@
 	/* FIXME: what is the nominal transmit power of the PHY/board? */
 	bts->c0->nominal_power = 15;
 
+	gsm_bts_set_feature(bts, BTS_FEAT_GPRS);
+	gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS);
+
 	bts_model_vty_init(bts);
 
 	return 0;
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 547d084..a8b7b50 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -78,6 +78,11 @@
 		exit(23);
 	}
 
+	gsm_bts_set_feature(bts, BTS_FEAT_GPRS);
+	gsm_bts_set_feature(bts, BTS_FEAT_EGPRS);
+	gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS);
+	gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP);
+
 	bts_model_vty_init(bts);
 
 	return 0;
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 0148e5b..5a5cd61 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -106,6 +106,9 @@
 	 * value */
 	bts->c0->nominal_power = 23;
 
+	gsm_bts_set_feature(bts, BTS_FEAT_GPRS);
+	gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS);
+
 	bts_model_vty_init(bts);
 
 	return 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list