Dear Holger,

Thanks for the commit on my previous patch.

Here is a new one:

This pacth makes hopping type (baseband or RF) a user changeable parameter.

Tested with:

 - MetroSite: baseband and RF hopping works
 - UltraSite: RF hopping works

As previously, the default behavior of OpenBSC is not changed. If the 
configuration parameter is not provided, it will default to baseband hopping, 
as before.

It builds against the latest version of OpenBSC master.

Regards,
Csaba
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 86bf557..2765c33 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -653,7 +653,8 @@ struct gsm_bts {
 				no_loc_rel_cnf:1,
 				bts_reset_timer_cnf,
 				did_reset:1,
-				wait_reset:1;
+				wait_reset:1,
+				hopping_type:1;
 			struct osmo_timer_list reset_timer;
 		} nokia;
 	};
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index af30f39..51be94b 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -606,6 +606,7 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
 		vty_out(vty, "  nokia_site no-local-rel-conf %d%s",
 			bts->nokia.no_loc_rel_cnf, VTY_NEWLINE);
 		vty_out(vty, "  nokia_site bts-reset-timer %d%s", bts->nokia.bts_reset_timer_cnf, VTY_NEWLINE);
+		vty_out(vty, "  nokia_site hopping-type %d%s", bts->nokia.hopping_type, VTY_NEWLINE);
 		/* fall through: Nokia requires "oml e1" parameters also */
 	default:
 		config_write_e1_link(vty, &bts->oml_e1_link, "  oml ");
@@ -1857,6 +1858,25 @@ DEFUN(cfg_bts_nokia_site_bts_reset_timer_cnf,
 
 	return CMD_SUCCESS;
 }
+
+DEFUN(cfg_bts_nokia_site_hopping_type,
+      cfg_bts_nokia_site_hopping_type_cmd,
+      "nokia_site hopping-type (0|1)",
+      NOKIA_STR
+      "Set the hopping type. 0=Baseband hopping, 1=Synthesizer (RF) hopping\n")
+{
+	struct gsm_bts *bts = vty->index;
+
+	if (bts->type != GSM_BTS_TYPE_NOKIA_SITE) {
+		vty_out(vty, "%% BTS is not of Nokia *Site type%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	bts->nokia.hopping_type = atoi(argv[0]);
+
+	return CMD_SUCCESS;
+}
+
 #define OML_STR	"Organization & Maintenance Link\n"
 #define IPA_STR "A-bis/IP Specific Options\n"
 
diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/openbsc/src/libbsc/bts_nokia_site.c
index 32a885c..894b7e2 100644
--- a/openbsc/src/libbsc/bts_nokia_site.c
+++ b/openbsc/src/libbsc/bts_nokia_site.c
@@ -980,7 +980,7 @@ void set_real_time(uint8_t * real_time)
   build the configuration data
 */
 
-static int make_bts_config(uint8_t bts_type, int n_trx, uint8_t * fu_config,
+static int make_bts_config(int hopping_type, uint8_t bts_type, int n_trx, uint8_t * fu_config,
 			   int need_hopping)
 {
 	/* is it an InSite BTS ? */
@@ -1012,8 +1012,17 @@ static int make_bts_config(uint8_t bts_type, int n_trx, uint8_t * fu_config,
 
 	memcpy(fu_config + len, bts_config_2, sizeof(bts_config_2));
 	/* set hopping mode (Baseband and RF hopping work for the MetroSite) */
-	if (need_hopping)
-		fu_config[len + 2 + 1] = 1;	/* 0: no hopping, 1: Baseband hopping, 2: RF hopping */
+	if (need_hopping) {
+		if(hopping_type != 1){
+			LOGP(DNM, LOGL_NOTICE, "Baseband hopping selected!\n");
+			fu_config[len + 2 + 1] = 1;	/* 0: no hopping, 1: Baseband hopping, 2: RF hopping */
+		}
+		else
+		{
+			LOGP(DNM, LOGL_NOTICE, "Synthesizer (RF) hopping selected!\n");
+			fu_config[len + 2 + 1] = 2;	/* 0: no hopping, 1: Baseband hopping, 2: RF hopping */
+		}
+	}
 	len += sizeof(bts_config_2);
 
 	/* set extended cell radius for each TRX */
@@ -1259,6 +1268,9 @@ static int abis_nm_send_config(struct gsm_bts *bts, uint8_t bts_type)
 	int ret;
 	int hopping = 0;
 	int need_hopping = 0;
+	int hopping_type = 0;
+	
+	hopping_type = bts->nokia.hopping_type;
 
 	memset(config, 0, sizeof(config));
 
@@ -1285,7 +1297,7 @@ static int abis_nm_send_config(struct gsm_bts *bts, uint8_t bts_type)
 		idx++;
 	}
 
-	ret = make_bts_config(bts_type, idx, config + len, need_hopping);
+	ret = make_bts_config(hopping_type, bts_type, idx, config + len, need_hopping);
 	len += ret;
 
 #if 0				/* debugging */

Reply via email to