summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-12-11 11:31:39 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2016-09-25 08:11:42 +0200
commitb67a42daa127efbf4520a81cf7e1e36c3088cbee (patch)
tree7f7fcad48b07bc8a6c2fcd0cd011b16551c15883
parent1466d42251c79a59ee96abb62810c9d226750ee5 (diff)
[WIP] HO: Add new parameters to L1CTL_DM_EST_REQ
* Flag to enter dedicated mode with TX disabled * Flag to use sync info of neighbor cell * Flag to use sync info of previous serving cell * Index of neighbor cell All these parameters are required to handover to a new channel.
-rw-r--r--include/l1ctl_proto.h6
-rw-r--r--src/host/layer23/include/osmocom/bb/common/l1ctl.h5
-rw-r--r--src/host/layer23/src/common/l1ctl.c20
-rw-r--r--src/host/layer23/src/misc/app_cbch_sniff.c4
-rw-r--r--src/host/layer23/src/mobile/gsm48_rr.c31
5 files changed, 49 insertions, 17 deletions
diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h
index dd7aa5b..5adc6a1 100644
--- a/include/l1ctl_proto.h
+++ b/include/l1ctl_proto.h
@@ -233,8 +233,14 @@ struct l1ctl_dm_est_req {
};
uint8_t tch_mode;
uint8_t audio_mode;
+ uint8_t flags;
+ uint8_t neighbor;
} __attribute__((packed));
+#define L1CTL_EST_F_RXONLY (1<<0) /* TX disabled */
+#define L1CTL_EST_F_NBSYNC (1<<1) /* use neighbor cell's sync info */
+#define L1CTL_EST_F_LASTSYNC (1<<2) /* use sync of last cell */
+
struct l1ctl_dm_freq_req {
uint16_t fn;
uint8_t tsc;
diff --git a/src/host/layer23/include/osmocom/bb/common/l1ctl.h b/src/host/layer23/include/osmocom/bb/common/l1ctl.h
index 3534589..e95f47b 100644
--- a/src/host/layer23/include/osmocom/bb/common/l1ctl.h
+++ b/src/host/layer23/include/osmocom/bb/common/l1ctl.h
@@ -25,10 +25,11 @@ int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint16_t offset,
/* Transmit L1CTL_DM_EST_REQ */
int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
- uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode, uint8_t audio_mode);
+ uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode, uint8_t audio_mode,
+ int tx, int sync, int index);
int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
uint16_t *ma, uint8_t ma_len, uint8_t chan_nr, uint8_t tsc,
- uint8_t tch_mode, uint8_t audio_mode);
+ uint8_t tch_mode, uint8_t audio_mode, int tx, int sync, int index);
/* Transmit L1CTL_DM_FREQ_REQ */
int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index dd1b6ee..bdb4853 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -473,7 +473,7 @@ int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint16_t offset,
/* Transmit L1CTL_DM_EST_REQ */
int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode,
- uint8_t audio_mode)
+ uint8_t audio_mode, int tx, int sync, int index)
{
struct msgb *msg;
struct l1ctl_info_ul *ul;
@@ -496,6 +496,14 @@ int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
req->h0.band_arfcn = htons(band_arfcn);
req->tch_mode = tch_mode;
req->audio_mode = audio_mode;
+ req->flags = (tx) ? 0 : L1CTL_EST_F_RXONLY;
+ if (sync) {
+ if (index >= 0) {
+ req->flags |= L1CTL_EST_F_NBSYNC;
+ req->neighbor = index;
+ } else
+ req->flags |= L1CTL_EST_F_LASTSYNC;
+ }
return osmo_send_l1(ms, msg);
}
@@ -503,7 +511,7 @@ int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
uint16_t *ma, uint8_t ma_len,
uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode,
- uint8_t audio_mode)
+ uint8_t audio_mode, int tx, int sync, int index)
{
struct msgb *msg;
struct l1ctl_info_ul *ul;
@@ -531,6 +539,14 @@ int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
req->h1.ma[i] = htons(ma[i]);
req->tch_mode = tch_mode;
req->audio_mode = audio_mode;
+ req->flags = (tx) ? 0 : L1CTL_EST_F_RXONLY;
+ if (sync) {
+ if (index >= 0) {
+ req->flags |= L1CTL_EST_F_NBSYNC;
+ req->neighbor = index;
+ } else
+ req->flags |= L1CTL_EST_F_LASTSYNC;
+ }
return osmo_send_l1(ms, msg);
}
diff --git a/src/host/layer23/src/misc/app_cbch_sniff.c b/src/host/layer23/src/misc/app_cbch_sniff.c
index 8256eaf..20e730f 100644
--- a/src/host/layer23/src/misc/app_cbch_sniff.c
+++ b/src/host/layer23/src/misc/app_cbch_sniff.c
@@ -57,12 +57,12 @@ static int try_cbch(struct osmocom_ms *ms, struct gsm48_sysinfo *s)
return l1ctl_tx_dm_est_req_h1(ms,
s->maio, s->hsn, s->hopping, s->hopp_len,
s->chan_nr, s->tsc,
- GSM48_CMODE_SIGN, 0);
+ GSM48_CMODE_SIGN, 0, 1, 0, 0);
} else {
LOGP(DRR, LOGL_INFO, "chan_nr = 0x%02x TSC = %d ARFCN = %d\n",
s->chan_nr, s->tsc, s->arfcn);
return l1ctl_tx_dm_est_req_h0(ms, s->arfcn,
- s->chan_nr, s->tsc, GSM48_CMODE_SIGN, 0);
+ s->chan_nr, s->tsc, GSM48_CMODE_SIGN, 0, 1, 0, 0);
}
}
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index 76eaf8f..ec053fd 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -2949,7 +2949,8 @@ int gsm48_rr_los(struct osmocom_ms *ms)
/* activation of channel in dedicated mode */
static int gsm48_rr_activate_channel(struct osmocom_ms *ms,
- struct gsm48_rr_cd *cd, uint16_t *ma, uint8_t ma_len)
+ struct gsm48_rr_cd *cd, uint16_t *ma, uint8_t ma_len, int tx,
+ int sync, int index)
{
struct gsm_subscriber *subscr = &ms->subscr;
struct gsm48_rrlayer *rr = &ms->rrlayer;
@@ -2958,11 +2959,17 @@ static int gsm48_rr_activate_channel(struct osmocom_ms *ms,
struct rx_meas_stat *meas = &ms->meas;
uint8_t ch_type, ch_subch, ch_ts;
uint8_t timeout = 64;
+ int ta = cd->ind_ta;
/* setting (new) timing advance */
- LOGP(DRR, LOGL_INFO, "setting indicated TA %d (actual TA %d)\n",
- cd->ind_ta, cd->ind_ta - set->alter_delay);
- l1ctl_tx_param_req(ms, cd->ind_ta - set->alter_delay,
+ if (!tx) {
+ ta = 0;
+ LOGP(DRR, LOGL_INFO, "setting TA 0 for access bursts "
+ "(actual TA %d)\n", ta - set->alter_delay);
+ } else
+ LOGP(DRR, LOGL_INFO, "setting indicated TA %d "
+ "(actual TA %d)\n", cd->ind_ta, ta - set->alter_delay);
+ l1ctl_tx_param_req(ms, ta - set->alter_delay,
(set->alter_tx_power) ? set->alter_tx_power_value
: cd->ind_tx_power);
@@ -2997,15 +3004,17 @@ static int gsm48_rr_activate_channel(struct osmocom_ms *ms,
LOGP(DRR, LOGL_INFO, "establishing channel in dedicated mode\n");
rsl_dec_chan_nr(cd->chan_nr, &ch_type, &ch_subch, &ch_ts);
LOGP(DRR, LOGL_INFO, " Channel type %d, subch %d, ts %d, mode %d, "
- "audio-mode %d, cipher %d\n", ch_type, ch_subch, ch_ts,
- cd->mode, rr->audio_mode, rr->cipher_type + 1);
+ "audio-mode %d, cipher %d, tsc %d, ARFCN %s, hopping=%s\n",
+ ch_type, ch_subch, ch_ts, cd->mode, rr->audio_mode,
+ rr->cipher_type + 1, cd->tsc, gsm_print_arfcn(cd->arfcn),
+ (cd->h) ? "yes":"no");
if (cd->h)
l1ctl_tx_dm_est_req_h1(ms, cd->maio, cd->hsn,
ma, ma_len, cd->chan_nr, cd->tsc, cd->mode,
- rr->audio_mode);
+ rr->audio_mode, tx, sync, index);
else
l1ctl_tx_dm_est_req_h0(ms, cd->arfcn, cd->chan_nr, cd->tsc,
- cd->mode, rr->audio_mode);
+ cd->mode, rr->audio_mode, tx, sync, index);
rr->dm_est = 1;
/* old SI 5/6 are not valid on a new dedicated channel */
@@ -3273,7 +3282,7 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms)
rr->cd_before.h = 0;
rr->cd_before.arfcn = 0;
/* activate channel */
- gsm48_rr_activate_channel(ms, &rr->cd_before, ma, ma_len);
+ gsm48_rr_activate_channel(ms, &rr->cd_before, ma, ma_len, 1, 0, 0);
/* render channel "after time" */
gsm48_rr_render_ma(ms, &rr->cd_now, ma, &ma_len);
/* schedule change of channel */
@@ -3281,7 +3290,7 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms)
rr->cd_now.start_tm.fn);
#else
/* activate channel */
- gsm48_rr_activate_channel(ms, &rr->cd_now, ma, ma_len);
+ gsm48_rr_activate_channel(ms, &rr->cd_now, ma, ma_len, 1, 0, 0);
#endif
/* set T200 of SAPI 0 */
@@ -4438,7 +4447,7 @@ static int gsm48_rr_susp_cnf_dedicated(struct osmocom_ms *ms, struct msgb *msg)
/* activate channel */
gsm48_rr_activate_channel(ms, &rr->cd_before, ma,
- ma_len);
+ ma_len, enable_tx, sync, rr->hando_meas_index);
/* render channel "after time" */
gsm48_rr_render_ma(ms, &rr->cd_now, ma, &ma_len);