fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/28566 )


Change subject: trxcon: send proper slot type in TRXC SETSLOT messages
......................................................................

trxcon: send proper slot type in TRXC SETSLOT messages

Change-Id: I42f5620b50beb7df0a3463d70c1f48d041006371
Related: OS#5599
---
M src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h
M src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
M src/host/trxcon/src/sched_trx.c
M src/host/trxcon/src/trx_if.c
4 files changed, 24 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/28566/1

diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h 
b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h
index f78230b..7cdb043 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h
@@ -125,7 +125,7 @@
        union {
                struct {
                        uint8_t tn;
-                       uint8_t pchan;
+                       enum gsm_phys_chan_config pchan;
                } pchan_comb;
        };
 };
diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h 
b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
index f176417..e336225 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
@@ -68,7 +68,8 @@
 int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t band_arfcn);
 int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t band_arfcn);

-int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, uint8_t type);
+int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn,
+                      enum gsm_phys_chan_config pchan);
 int trx_if_cmd_setfh(struct trx_instance *trx, uint8_t hsn,
        uint8_t maio, uint16_t *ma, size_t ma_len);

diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c
index 48d8e17..55b5ed5 100644
--- a/src/host/trxcon/src/sched_trx.c
+++ b/src/host/trxcon/src/sched_trx.c
@@ -36,7 +36,7 @@
 #include <osmocom/bb/trxcon/logging.h>

 static int l1sched_cfg_pchan_comb_req(struct l1sched_state *sched,
-                                     uint8_t tn, uint8_t pchan)
+                                     uint8_t tn, enum gsm_phys_chan_config 
pchan)
 {
        const struct l1sched_config_req cr = {
                .type = L1SCHED_CFG_PCHAN_COMB,
@@ -251,7 +251,7 @@
        talloc_free(ts);

        /* Notify transceiver about that */
-       l1sched_cfg_pchan_comb_req(sched, tn, 0);
+       l1sched_cfg_pchan_comb_req(sched, tn, GSM_PCHAN_NONE);
 }

 #define LAYOUT_HAS_LCHAN(layout, lchan) \
@@ -316,8 +316,7 @@
        }

        /* Notify transceiver about TS activation */
-       /* FIXME: set proper channel type */
-       l1sched_cfg_pchan_comb_req(sched, tn, 1);
+       l1sched_cfg_pchan_comb_req(sched, tn, config);

        return 0;
 }
@@ -348,7 +347,7 @@
        }

        /* Notify transceiver about that */
-       l1sched_cfg_pchan_comb_req(sched, tn, 0);
+       l1sched_cfg_pchan_comb_req(sched, tn, GSM_PCHAN_NONE);

        return 0;
 }
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index b247064..9984e0e 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -273,9 +273,24 @@
  * RSP SETSLOT <status> <timeslot> <chantype>
  */

-int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, uint8_t type)
+int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn,
+                      enum gsm_phys_chan_config pchan)
 {
-       return trx_ctrl_cmd(trx, 1, "SETSLOT", "%u %u", tn, type);
+       /* Values correspond to 'enum ChannelCombination' in osmo-trx.git */
+       static const uint8_t chan_types[_GSM_PCHAN_MAX] = {
+               [GSM_PCHAN_UNKNOWN]             = 0,
+               [GSM_PCHAN_NONE]                = 0,
+               [GSM_PCHAN_CCCH]                = 4,
+               [GSM_PCHAN_CCCH_SDCCH4]         = 5,
+               [GSM_PCHAN_CCCH_SDCCH4_CBCH]    = 5,
+               [GSM_PCHAN_TCH_F]               = 1,
+               [GSM_PCHAN_TCH_H]               = 3,
+               [GSM_PCHAN_SDCCH8_SACCH8C]      = 7,
+               [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 7,
+               [GSM_PCHAN_PDCH]                = 13,
+       };
+
+       return trx_ctrl_cmd(trx, 1, "SETSLOT", "%u %u", tn, chan_types[pchan]);
 }

 /*

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/28566
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I42f5620b50beb7df0a3463d70c1f48d041006371
Gerrit-Change-Number: 28566
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to