[layer23] use the TSC that is passed from L1 when going in dedicated mode
authorHarald Welte <laforge@gnumonks.org>
Thu, 24 Jun 2010 16:56:36 +0000 (18:56 +0200)
committerHarald Welte <laforge@gnumonks.org>
Thu, 24 Jun 2010 16:57:28 +0000 (18:57 +0200)
src/host/layer23/include/osmocom/l1ctl.h
src/host/layer23/src/gsm48_rr.c
src/host/layer23/src/l1ctl.c
src/host/layer23/src/layer3.c
src/target/firmware/layer1/l23_api.c

index 2bcbdb3..427f27e 100644 (file)
@@ -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,
index 10e504d..de087ce 100644 (file)
@@ -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();
index fb933c0..9a2d727 100644 (file)
@@ -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);
 
index d1f2f53..7f37db1 100644 (file)
@@ -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);
index 4b673e6..2d5341f 100644 (file)
@@ -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 */