diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-06-24 18:56:36 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-06-24 18:57:28 +0200 |
commit | bc860c43c291304866cc6fc5ca9acc9499853d06 (patch) | |
tree | d4542e86fef347bd3ee13e606f8cb7c8326c9e1b | |
parent | 39a6b56f8811c4b6f1a36837aecd2f1e771d8e02 (diff) |
[layer23] use the TSC that is passed from L1 when going in dedicated mode
-rw-r--r-- | src/host/layer23/include/osmocom/l1ctl.h | 3 | ||||
-rw-r--r-- | src/host/layer23/src/gsm48_rr.c | 11 | ||||
-rw-r--r-- | src/host/layer23/src/l1ctl.c | 5 | ||||
-rw-r--r-- | src/host/layer23/src/layer3.c | 3 | ||||
-rw-r--r-- | src/target/firmware/layer1/l23_api.c | 4 |
5 files changed, 16 insertions, 10 deletions
diff --git a/src/host/layer23/include/osmocom/l1ctl.h b/src/host/layer23/include/osmocom/l1ctl.h index 2bcbdb32..427f27e8 100644 --- a/src/host/layer23/include/osmocom/l1ctl.h +++ b/src/host/layer23/include/osmocom/l1ctl.h @@ -17,7 +17,8 @@ int tx_ph_data_req(struct osmocom_ms *ms, struct msgb *msg, int tx_ph_rach_req(struct osmocom_ms *ms); /* Transmit L1CTL_DM_EST_REQ */ -int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr); +int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr, + uint8_t tsc); /* Transmit FBSB_REQ */ int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn, uint8_t flags, uint16_t timeout, uint8_t sync_info_idx, diff --git a/src/host/layer23/src/gsm48_rr.c b/src/host/layer23/src/gsm48_rr.c index 10e504d8..de087ced 100644 --- a/src/host/layer23/src/gsm48_rr.c +++ b/src/host/layer23/src/gsm48_rr.c @@ -3008,7 +3008,8 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms) printf("Channel type not supported, exitting.\n"); exit(-ENOTSUP); } - tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr); + tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr, + rr->cd_now.tsc); #endif /* start establishmnet */ @@ -3658,7 +3659,8 @@ static int gsm48_rr_susp_cnf_dedicated(struct osmocom_ms *ms, struct msgb *msg) struct msgb *nmsg; /* change radio to new channel */ - tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr); + tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr, + rr->cd_now.tsc); /* send DL-ESTABLISH REQUEST */ nmsg = gsm48_l3_msgb_alloc(); @@ -4096,7 +4098,7 @@ static int gsm48_rr_mdl_error_ind(struct osmocom_ms *ms, struct msgb *msg) /* change radio to old channel */ tx_ph_dm_est_req(ms, rr->cd_now.arfcn, - rr->cd_now.chan_nr); + rr->cd_now.chan_nr, rr->cd_now.tsc); /* re-establish old link */ nmsg = gsm48_l3_msgb_alloc(); @@ -4133,7 +4135,8 @@ static void timeout_rr_t3124(void *arg) memcpy(&rr->chan_desc, &rr->chan_last, sizeof(*cd)); /* change radio to old channel */ - tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr); + tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr, + rr->cd_now.tsc); /* re-establish old link */ nmsg = gsm48_l3_msgb_alloc(); diff --git a/src/host/layer23/src/l1ctl.c b/src/host/layer23/src/l1ctl.c index fb933c00..9a2d7276 100644 --- a/src/host/layer23/src/l1ctl.c +++ b/src/host/layer23/src/l1ctl.c @@ -318,7 +318,8 @@ int tx_ph_rach_req(struct osmocom_ms *ms) } /* Transmit L1CTL_DM_EST_REQ */ -int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr) +int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr, + uint8_t tsc) { struct msgb *msg; struct l1ctl_info_ul *ul; @@ -337,7 +338,7 @@ int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr ul->tx_power = 0; /* FIXME: initial TX power */ req = (struct l1ctl_dm_est_req *) msgb_put(msg, sizeof(*req)); - req->tsc = 7; /* FIXME */ + req->tsc = tsc; req->h = 0; req->h0.band_arfcn = htons(band_arfcn); diff --git a/src/host/layer23/src/layer3.c b/src/host/layer23/src/layer3.c index d1f2f530..7f37db14 100644 --- a/src/host/layer23/src/layer3.c +++ b/src/host/layer23/src/layer3.c @@ -187,7 +187,8 @@ static int gsm48_rx_imm_ass(struct msgb *msg, struct osmocom_ms *ms) } /* request L1 to go to dedicated mode on assigned channel */ - tx_ph_dm_est_req(ms, arfcn, ia->chan_desc.chan_nr); + tx_ph_dm_est_req(ms, arfcn, ia->chan_desc.chan_nr, + ia->chan_desc.h0.tsc); /* request L2 to establish the SAPI0 connection */ gsm48_tx_loc_upd_req(ms, ia->chan_desc.chan_nr); diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c index 4b673e64..2d5341f5 100644 --- a/src/target/firmware/layer1/l23_api.c +++ b/src/target/firmware/layer1/l23_api.c @@ -167,8 +167,8 @@ static void l1ctl_rx_dm_est_req(struct msgb *msg) struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data; struct l1ctl_dm_est_req *est_req = (struct l1ctl_dm_est_req *) ul->payload; - printd("L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x)\n", - ntohs(est_req->h0.band_arfcn), ul->chan_nr); + printd("L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x, tsc=%u)\n", + ntohs(est_req->h0.band_arfcn), ul->chan_nr, est_req->tsc); if (ntohs(est_req->h0.band_arfcn) != l1s.serving_cell.arfcn) { /* FIXME: ARFCN */ |