diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-01-20 22:50:06 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-02-15 14:27:29 +0100 |
commit | e9a17292e8545d5f651e9614c43bc1626e10ac5f (patch) | |
tree | 6e2cf1ae92d8c4cd6de786eb4f0f3aab18f9ef91 /src/osmo-bts-litecell15 | |
parent | 9b5cff87ecc4b76f9f8a0a86aa64e9394e2a8374 (diff) |
LC15/sysmobts: Don't try to refer to fl1h from PHY config
At the time the phy link / phy instance level VTY configuration
commands are parsed, we did not yet call l1if_open() and thus
pinst->u.{lc15,sysmobts}.hdl == NULL.
PHY or PHY instance specific configuration must thus be stored inside
the phy_link or phy_instance itself, and not inside the (not yet
existing) handle.
We solve this by moving around some parameters:
* clk_use_eeprom/clk_cal/clk_src/calib_path get replicated in
phy_instance
* min_qual_{rach,norm} are moved into the generic part (which means
that osmo-bts-octphy and osmo-bts-trx should also implement them)
Diffstat (limited to 'src/osmo-bts-litecell15')
-rw-r--r-- | src/osmo-bts-litecell15/calib_file.c | 6 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/l1_if.c | 11 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/l1_if.h | 3 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/lc15bts_vty.c | 44 |
4 files changed, 12 insertions, 52 deletions
diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 2a35a05c..da79df6f 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -104,6 +104,7 @@ static int calib_file_open(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc) { struct calib_send_state *st = &fl1h->st; + char *calib_path = fl1h->phy_inst->u.lc15.calib_path; char fname[PATH_MAX]; if (st->fp) { @@ -113,7 +114,7 @@ static int calib_file_open(struct lc15l1_hdl *fl1h, } fname[0] = '\0'; - snprintf(fname, sizeof(fname)-1, "%s/%s", fl1h->calib_path, desc->fname); + snprintf(fname, sizeof(fname)-1, "%s/%s", calib_path, desc->fname); fname[sizeof(fname)-1] = '\0'; st->fp = fopen(fname, "rb"); @@ -241,8 +242,9 @@ int calib_load(struct lc15l1_hdl *fl1h) { int rc; struct calib_send_state *st = &fl1h->st; + char *calib_path = fl1h->phy_inst->u.lc15.calib_path; - if (!fl1h->calib_path) { + if (!calib_path) { LOGP(DL1C, LOGL_ERROR, "Calibration file path not specified\n"); return -1; } diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index e65f97d4..1e81b74c 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -69,10 +69,6 @@ extern int pcu_direct; -#define MIN_QUAL_RACH 5.0f /* at least 5 dB C/I */ -#define MIN_QUAL_NORM -0.5f /* at least -1 dB C/I */ - - struct wait_l1_conf { struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ @@ -833,6 +829,7 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1, GsmL1_PhDataInd_t *data_in struct msgb *l1p_msg) { struct gsm_bts_trx *trx = lc15l1_hdl_trx(fl1); + struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; @@ -853,7 +850,7 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1, GsmL1_PhDataInd_t *data_in process_meas_res(trx, chan_nr, &data_ind->measParam); - if (data_ind->measParam.fLinkQuality < fl1->min_qual_norm + if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { msgb_free(l1p_msg); return 0; @@ -918,7 +915,7 @@ static int handle_ph_ra_ind(struct lc15l1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, ra_ind->measParam.fRssi >= btsb->load.rach.busy_thresh) btsb->load.rach.busy++; - if (ra_ind->measParam.fLinkQuality < fl1->min_qual_rach) { + if (ra_ind->measParam.fLinkQuality < btsb->min_qual_rach) { msgb_free(l1p_msg); return 0; } @@ -1400,8 +1397,6 @@ struct lc15l1_hdl *l1if_open(struct phy_instance *pinst) fl1h->phy_inst = pinst; fl1h->clk_cal = 0; - fl1h->min_qual_rach = MIN_QUAL_RACH; - fl1h->min_qual_norm = MIN_QUAL_NORM; fl1h->dsp_trace_f = pinst->u.lc15.dsp_trace_f; get_hwinfo(fl1h); diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h index bb56c2b9..78421a0b 100644 --- a/src/osmo-bts-litecell15/l1_if.h +++ b/src/osmo-bts-litecell15/l1_if.h @@ -38,9 +38,6 @@ struct lc15l1_hdl { uint32_t hLayer1; /* handle to the L1 instance in the DSP */ uint32_t dsp_trace_f; /* currently operational DSP trace flags */ int clk_cal; - float min_qual_rach; - float min_qual_norm; - char *calib_path; struct llist_head wlc_list; struct phy_instance *phy_inst; diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 558e7e1c..2f624c8d 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -94,38 +94,11 @@ DEFUN(cfg_phy_cal_path, cfg_phy_cal_path_cmd, "Set the path name to TRX calibration data\n" "Path name\n") { struct phy_instance *pinst = vty->index; - struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; - if (fl1h->calib_path) - talloc_free(fl1h->calib_path); + if (pinst->u.lc15.calib_path) + talloc_free(pinst->u.lc15.calib_path); - fl1h->calib_path = talloc_strdup(fl1h, argv[0]); - - return CMD_SUCCESS; -} - -DEFUN(cfg_phy_min_qual_rach, cfg_phy_min_qual_rach_cmd, - "min-qual-rach <-100-100>", - "Set the minimum quality level of RACH burst to be accpeted\n" - "C/I level in tenth of dB\n") -{ - struct phy_instance *pinst = vty->index; - struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; - - fl1h->min_qual_rach = strtof(argv[0], NULL) / 10.0f; - - return CMD_SUCCESS; -} - -DEFUN(cfg_phy_min_qual_norm, cfg_phy_min_qual_norm_cmd, - "min-qual-norm <-100-100>", - "Set the minimum quality level of normal burst to be accpeted\n" - "C/I level in tenth of dB\n") -{ - struct phy_instance *pinst = vty->index; - struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; - - fl1h->min_qual_norm = strtof(argv[0], NULL) / 10.0f; + pinst->u.lc15.calib_path = talloc_strdup(pinst, argv[0]); return CMD_SUCCESS; } @@ -362,7 +335,6 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) static void write_phy_inst(struct vty *vty, struct phy_instance *pinst) { - struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; int i; for (i = 0; i < 32; i++) { @@ -373,13 +345,9 @@ static void write_phy_inst(struct vty *vty, struct phy_instance *pinst) VTY_NEWLINE); } } - if (fl1h->calib_path) + if (pinst->u.lc15.calib_path) vty_out(vty, " trx-calibration-path %s%s", - fl1h->calib_path, VTY_NEWLINE); - vty_out(vty, " min-qual-rach %.0f%s", fl1h->min_qual_rach * 10.0f, - VTY_NEWLINE); - vty_out(vty, " min-qual-norm %.0f%s", fl1h->min_qual_norm * 10.0f, - VTY_NEWLINE); + pinst->u.lc15.calib_path, VTY_NEWLINE); } void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) @@ -444,8 +412,6 @@ int bts_model_vty_init(struct gsm_bts *bts) install_element(PHY_INST_NODE, &cfg_phy_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_no_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_cal_path_cmd); - install_element(PHY_INST_NODE, &cfg_phy_min_qual_rach_cmd); - install_element(PHY_INST_NODE, &cfg_phy_min_qual_norm_cmd); return 0; } |