l1ctl: Add initial tch_mode value in DM_EST_REQ
authorSylvain Munaut <tnt@246tNt.com>
Sun, 26 Sep 2010 20:55:02 +0000 (22:55 +0200)
committerSylvain Munaut <tnt@246tNt.com>
Tue, 28 Sep 2010 06:04:18 +0000 (08:04 +0200)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
include/l1ctl_proto.h
src/host/layer23/include/osmocom/bb/common/l1ctl.h
src/host/layer23/src/common/l1ctl.c
src/host/layer23/src/misc/layer3.c
src/host/layer23/src/mobile/gsm48_rr.c

index f2880eb..24cb64b 100644 (file)
@@ -207,6 +207,8 @@ struct l1ctl_dm_est_req {
                struct l1ctl_h0 h0;
                struct l1ctl_h1 h1;
        };
+       uint8_t tch_mode;
+       uint8_t _padding[1];
 } __attribute__((packed));
 
 struct l1ctl_dm_freq_req {
index 20e9481..88aedcf 100644 (file)
@@ -25,9 +25,10 @@ int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint8_t fn51,
 
 /* 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 chan_nr, uint8_t tsc, uint8_t tch_mode);
 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);
+       uint16_t *ma, uint8_t ma_len, uint8_t chan_nr, uint8_t tsc,
+       uint8_t tch_mode);
 
 /* Transmit L1CTL_DM_FREQ_REQ */
 int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
index 21ee996..e59e525 100644 (file)
@@ -386,7 +386,7 @@ int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint8_t fn51,
 
 /* 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 chan_nr, uint8_t tsc, uint8_t tch_mode)
 {
        struct msgb *msg;
        struct l1ctl_info_ul *ul;
@@ -409,13 +409,14 @@ int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
        req->tsc = tsc;
        req->h = 0;
        req->h0.band_arfcn = htons(band_arfcn);
+       req->tch_mode = tch_mode;
 
        return osmo_send_l1(ms, msg);
 }
 
 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 chan_nr, uint8_t tsc, uint8_t tch_mode)
 {
        struct msgb *msg;
        struct l1ctl_info_ul *ul;
@@ -443,6 +444,7 @@ int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
        req->h1.n = ma_len;
        for (i = 0; i < ma_len; i++)
                req->h1.ma[i] = htons(ma[i]);
+       req->tch_mode = tch_mode;
 
        return osmo_send_l1(ms, msg);
 }
index 37dd2e7..6a6cbec 100644 (file)
@@ -209,7 +209,8 @@ static int gsm48_rx_imm_ass(struct msgb *msg, struct osmocom_ms *ms)
 
                /* request L1 to go to dedicated mode on assigned channel */
                rv = l1ctl_tx_dm_est_req_h0(ms,
-                       arfcn, ia->chan_desc.chan_nr, ia->chan_desc.h0.tsc);
+                       arfcn, ia->chan_desc.chan_nr, ia->chan_desc.h0.tsc,
+                       GSM48_CMODE_SIGN);
        } else {
                /* Hopping */
                uint8_t maio, hsn, ma_len;
@@ -240,7 +241,8 @@ static int gsm48_rx_imm_ass(struct msgb *msg, struct osmocom_ms *ms)
                /* request L1 to go to dedicated mode on assigned channel */
                rv = l1ctl_tx_dm_est_req_h1(ms,
                        maio, hsn, ma, ma_len,
-                       ia->chan_desc.chan_nr, ia->chan_desc.h1.tsc);
+                       ia->chan_desc.chan_nr, ia->chan_desc.h1.tsc,
+                       GSM48_CMODE_SIGN);
        }
 
        DEBUGPC(DRR, "\n");
index 332ed83..e92b1cb 100644 (file)
@@ -3171,16 +3171,15 @@ static int gsm48_rr_activate_channel(struct osmocom_ms *ms,
                ch_type, ch_subch, ch_ts, cd->mode);
        if (cd->h)
                l1ctl_tx_dm_est_req_h1(ms, cd->maio, cd->hsn,
-                       ma, ma_len, cd->chan_nr, cd->tsc);
+                       ma, ma_len, cd->chan_nr, cd->tsc, cd->mode);
        else
-               l1ctl_tx_dm_est_req_h0(ms, cd->arfcn, cd->chan_nr, cd->tsc);
+               l1ctl_tx_dm_est_req_h0(ms, cd->arfcn, cd->chan_nr, cd->tsc,
+                       cd->mode);
        rr->dm_est = 1;
 
        if (rr->cipher_on)
                l1ctl_tx_crypto_req(ms, rr->cipher_type + 1, subscr->key, 8);
 
-       gsm48_rr_set_mode(ms, cd->chan_nr, cd->mode);
-
        return 0;
 }