[VAMOS] osmo-bts-trx: rework handling of Training Sequence
The TSC (Training Sequence Code) value in 'struct gsm_bts_trx_ts' is always initialized in oml_rx_set_chan_attr() during the OML bootstrapping, so there is no need for gsm_ts_tsc() - remove it. Store the initial TSC value in 'struct gsm_bts_trx_ts', so we can apply a different TSC value during the RSL CHANnel ACTIVation. Store the Training Sequence Code/Set in 'struct trx_dl_burst_req'. These values are indicated to the transceiver (TRXDv2 PDUs, 'MTS' field) and used by the new TRX_{GMSK,8PSK}_NB_TSC macros. Change-Id: I3744bc308b99ef941e6e9d139444e414abebc14b Related: SYS#4895, OS#4941
This commit is contained in:
parent
163ff40dd5
commit
207d56afe5
|
@ -441,7 +441,12 @@ struct gsm_bts_trx_ts {
|
|||
|
||||
unsigned int flags;
|
||||
struct gsm_abis_mo mo;
|
||||
int tsc; /* -1 == use BTS TSC */
|
||||
|
||||
/* Training Sequence Code (range 0..7) */
|
||||
uint8_t tsc_oml; /* configured via OML */
|
||||
uint8_t tsc; /* currently in use */
|
||||
/* Training Sequence Set (range 0..3) */
|
||||
uint8_t tsc_set;
|
||||
|
||||
/* Frequency hopping parameters (configured via OML) */
|
||||
struct {
|
||||
|
@ -522,8 +527,6 @@ uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
|
|||
#define BSIC2BCC(bsic) ((bsic) & 0x07)
|
||||
#define BTS_TSC(bts) BSIC2BCC((bts)->bsic)
|
||||
|
||||
uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts);
|
||||
|
||||
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
|
||||
int *rc);
|
||||
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
#define TRX_CHAN_IS_ACTIVE(state, chan) \
|
||||
(trx_chan_desc[chan].flags & TRX_CHAN_FLAG_AUTO_ACTIVE || (state)->active)
|
||||
|
||||
#define TRX_GMSK_NB_TSC(br) \
|
||||
_sched_train_seq_gmsk_nb[(br)->tsc]
|
||||
|
||||
#define TRX_8PSK_NB_TSC(br) \
|
||||
_sched_train_seq_8psk_nb[(br)->tsc]
|
||||
|
||||
/* These types define the different channels on a multiframe.
|
||||
* Each channel has queues and can be activated individually.
|
||||
*/
|
||||
|
|
|
@ -86,7 +86,6 @@ struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts)
|
|||
ts->pchan = GSM_PCHAN_NONE;
|
||||
ts->dyn.pchan_is = GSM_PCHAN_NONE;
|
||||
ts->dyn.pchan_want = GSM_PCHAN_NONE;
|
||||
ts->tsc = -1;
|
||||
|
||||
ts->mo.fi = osmo_fsm_inst_alloc(&nm_chan_fsm, trx, ts,
|
||||
LOGL_INFO, NULL);
|
||||
|
|
|
@ -272,14 +272,6 @@ uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
|
|||
return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr);
|
||||
}
|
||||
|
||||
uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
|
||||
{
|
||||
if (ts->tsc != -1)
|
||||
return ts->tsc;
|
||||
else
|
||||
return BTS_TSC(ts->trx->bts);
|
||||
}
|
||||
|
||||
/* determine logical channel based on TRX and channel number IE */
|
||||
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
|
||||
int *rc)
|
||||
|
|
|
@ -961,10 +961,10 @@ static int oml_rx_set_chan_attr(struct gsm_bts_trx_ts *ts, struct msgb *msg)
|
|||
|
||||
/* 9.4.60 TSC */
|
||||
if (TLVP_PRES_LEN(&tp, NM_ATT_TSC, 1)) {
|
||||
ts->tsc = *TLVP_VAL(&tp, NM_ATT_TSC);
|
||||
ts->tsc_oml = ts->tsc = *TLVP_VAL(&tp, NM_ATT_TSC);
|
||||
} else {
|
||||
/* If there is no TSC specified, use the BCC */
|
||||
ts->tsc = BTS_TSC(bts);
|
||||
ts->tsc_oml = ts->tsc = BTS_TSC(bts);
|
||||
}
|
||||
LOGPFOH(DOML, LOGL_INFO, foh, "SET CHAN ATTR (TSC=%u pchan=%s",
|
||||
ts->tsc, gsm_pchan_name(ts->pchan));
|
||||
|
|
|
@ -217,7 +217,7 @@ static void info_ind_fill_trx(struct gsm_pcu_if_info_trx *trx_info,
|
|||
continue;
|
||||
|
||||
trx_info->pdch_mask |= (1 << tn);
|
||||
trx_info->ts[tn].tsc = gsm_ts_tsc(ts);
|
||||
trx_info->ts[tn].tsc = ts->tsc;
|
||||
|
||||
if (ts->hopping.enabled)
|
||||
info_ind_fill_fhp(&trx_info->ts[tn], ts);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ void _sched_dl_burst(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
|
|||
return;
|
||||
|
||||
/* Training Sequence Code and Set */
|
||||
br->tsc = gsm_ts_tsc(l1ts->ts);
|
||||
br->tsc_set = 0;
|
||||
br->tsc_set = l1ts->ts->tsc_set;
|
||||
br->tsc = l1ts->ts->tsc;
|
||||
|
||||
/* get burst from function */
|
||||
if (func(l1ts, br) != 0)
|
||||
|
|
|
@ -1409,7 +1409,7 @@ static void ts_dump_vty(struct vty *vty, const struct gsm_bts_trx_ts *ts)
|
|||
{
|
||||
vty_out(vty, "BTS %u, TRX %u, Timeslot %u, phys cfg %s, TSC %u",
|
||||
ts->trx->bts->nr, ts->trx->nr, ts->nr,
|
||||
gsm_pchan_name(ts->pchan), gsm_ts_tsc(ts));
|
||||
gsm_pchan_name(ts->pchan), ts->tsc);
|
||||
if (ts->pchan == GSM_PCHAN_TCH_F_PDCH)
|
||||
vty_out(vty, " (%s mode)",
|
||||
ts->flags & TS_F_PDCH_ACTIVE ? "PDCH" : "TCH/F");
|
||||
|
|
|
@ -212,7 +212,7 @@ send_burst:
|
|||
burst = *bursts_p + br->bid * 348;
|
||||
memset(br->burst, 1, 9);
|
||||
memcpy(br->burst + 9, burst, 174);
|
||||
memcpy(br->burst + 183, _sched_train_seq_8psk_nb[gsm_ts_tsc(l1ts->ts)], 78);
|
||||
memcpy(br->burst + 183, TRX_8PSK_NB_TSC(br), 78);
|
||||
memcpy(br->burst + 261, burst + 174, 174);
|
||||
memset(br->burst + 435, 1, 9);
|
||||
|
||||
|
@ -220,7 +220,7 @@ send_burst:
|
|||
} else {
|
||||
burst = *bursts_p + br->bid * 116;
|
||||
memcpy(br->burst + 3, burst, 58);
|
||||
memcpy(br->burst + 61, _sched_train_seq_gmsk_nb[gsm_ts_tsc(l1ts->ts)], 26);
|
||||
memcpy(br->burst + 61, TRX_GMSK_NB_TSC(br), 26);
|
||||
memcpy(br->burst + 87, burst + 58, 58);
|
||||
|
||||
br->burst_len = GSM_BURST_LEN;
|
||||
|
|
|
@ -562,7 +562,7 @@ send_burst:
|
|||
/* compose burst */
|
||||
burst = *bursts_p + br->bid * 116;
|
||||
memcpy(br->burst + 3, burst, 58);
|
||||
memcpy(br->burst + 61, _sched_train_seq_gmsk_nb[gsm_ts_tsc(l1ts->ts)], 26);
|
||||
memcpy(br->burst + 61, TRX_GMSK_NB_TSC(br), 26);
|
||||
memcpy(br->burst + 87, burst + 58, 58);
|
||||
|
||||
br->burst_len = GSM_BURST_LEN;
|
||||
|
|
|
@ -451,7 +451,7 @@ send_burst:
|
|||
/* compose burst */
|
||||
burst = *bursts_p + br->bid * 116;
|
||||
memcpy(br->burst + 3, burst, 58);
|
||||
memcpy(br->burst + 61, _sched_train_seq_gmsk_nb[gsm_ts_tsc(l1ts->ts)], 26);
|
||||
memcpy(br->burst + 61, TRX_GMSK_NB_TSC(br), 26);
|
||||
memcpy(br->burst + 87, burst + 58, 58);
|
||||
|
||||
br->burst_len = GSM_BURST_LEN;
|
||||
|
|
|
@ -239,7 +239,7 @@ send_burst:
|
|||
/* compose burst */
|
||||
burst = *bursts_p + br->bid * 116;
|
||||
memcpy(br->burst + 3, burst, 58);
|
||||
memcpy(br->burst + 61, _sched_train_seq_gmsk_nb[gsm_ts_tsc(l1ts->ts)], 26);
|
||||
memcpy(br->burst + 61, TRX_GMSK_NB_TSC(br), 26);
|
||||
memcpy(br->burst + 87, burst + 58, 58);
|
||||
|
||||
br->burst_len = GSM_BURST_LEN;
|
||||
|
|
Loading…
Reference in New Issue