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


Change subject: trxcon: handle RACH.cnf via TRXCON_EV_TX_ACCESS_BURST_CNF
......................................................................

trxcon: handle RACH.cnf via TRXCON_EV_TX_ACCESS_BURST_CNF

Change-Id: I64de7d4e8137041b373a9920296553fbfe8386d4
Related: OS#5599
---
M src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h
M src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
M src/host/trxcon/src/l1ctl.c
M src/host/trxcon/src/trxcon.c
M src/host/trxcon/src/trxcon_fsm.c
5 files changed, 33 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/60/29960/1

diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h 
b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h
index eb67bee..deeb318 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h
@@ -22,4 +22,4 @@
 int l1ctl_tx_dt_conf(struct l1ctl_client *l1c,
                    const struct trxcon_param_tx_data_cnf *cnf);
 int l1ctl_tx_rach_conf(struct l1ctl_client *l1c,
-       uint16_t band_arfcn, uint32_t fn);
+                      const struct trxcon_param_tx_access_burst_cnf *cnf);
diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h 
b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
index 5af2122..117f3fd 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
@@ -26,6 +26,7 @@
        TRXCON_EV_SET_TCH_MODE_REQ,
        TRXCON_EV_SET_PHY_CONFIG_REQ,
        TRXCON_EV_TX_ACCESS_BURST_REQ,
+       TRXCON_EV_TX_ACCESS_BURST_CNF,
        TRXCON_EV_UPDATE_SACCH_CACHE_REQ,
        TRXCON_EV_DEDICATED_ESTABLISH_REQ,
        TRXCON_EV_DEDICATED_RELEASE_REQ,
@@ -126,6 +127,12 @@
        bool is_11bit;
 };

+/* param of TRXCON_EV_TX_ACCESS_BURST_CNF */
+struct trxcon_param_tx_access_burst_cnf {
+       uint16_t band_arfcn;
+       uint32_t frame_nr;
+};
+
 /* param of TRXCON_EV_DEDICATED_ESTABLISH_REQ */
 struct trxcon_param_dedicated_establish_req {
        uint8_t chan_nr;
diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c
index b9805eb..890e4d2 100644
--- a/src/host/trxcon/src/l1ctl.c
+++ b/src/host/trxcon/src/l1ctl.c
@@ -263,20 +263,20 @@
 }

 int l1ctl_tx_rach_conf(struct l1ctl_client *l1c,
-       uint16_t band_arfcn, uint32_t fn)
+                      const struct trxcon_param_tx_access_burst_cnf *cnf)
 {
-       struct l1ctl_info_dl *dl;
        struct msgb *msg;

        msg = l1ctl_alloc_msg(L1CTL_RACH_CONF);
        if (msg == NULL)
                return -ENOMEM;

-       dl = put_dl_info_hdr(msg, NULL);
-       memset(dl, 0x00, sizeof(*dl));
+       const struct l1ctl_info_dl dl_hdr = {
+               .band_arfcn = htons(cnf->band_arfcn),
+               .frame_nr = htonl(cnf->frame_nr),
+       };

-       dl->band_arfcn = htons(band_arfcn);
-       dl->frame_nr = htonl(fn);
+       put_dl_info_hdr(msg, &dl_hdr);

        return l1ctl_client_send(l1c, msg);
 }
diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c
index b6bd56d..9522a49 100644
--- a/src/host/trxcon/src/trxcon.c
+++ b/src/host/trxcon/src/trxcon.c
@@ -278,10 +278,14 @@
        case L1SCHED_DT_OTHER:
                if (L1SCHED_PRIM_IS_RACH(lchan->prim)) {
                        const struct l1sched_ts_prim_rach *rach;
+                       struct trxcon_param_tx_access_burst_cnf cnf = {
+                               .band_arfcn = trxcon->l1p.band_arfcn,
+                               .frame_nr = fn,
+                       };
+
+                       rc = osmo_fsm_inst_dispatch(trxcon->fi, 
TRXCON_EV_TX_ACCESS_BURST_CNF, &cnf);

                        rach = (struct l1sched_ts_prim_rach 
*)lchan->prim->payload;
-
-                       rc = l1ctl_tx_rach_conf(trxcon->l2if, 
trxcon->l1p.band_arfcn, fn);
                        if (lchan->prim->type == L1SCHED_PRIM_RACH11) {
                                ra_buf[0] = (uint8_t)(rach->ra >> 3);
                                ra_buf[1] = (uint8_t)(rach->ra & 0x07);
diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c
index 676c060..4ee824c 100644
--- a/src/host/trxcon/src/trxcon_fsm.c
+++ b/src/host/trxcon/src/trxcon_fsm.c
@@ -256,6 +256,9 @@
        case TRXCON_EV_TX_ACCESS_BURST_REQ:
                handle_tx_access_burst_req(fi, data);
                break;
+       case TRXCON_EV_TX_ACCESS_BURST_CNF:
+               l1ctl_tx_rach_conf(trxcon->l2if, (const struct 
trxcon_param_tx_access_burst_cnf *)data);
+               break;
        case TRXCON_EV_SET_CCCH_MODE_REQ:
        {
                struct trxcon_param_set_ccch_tch_mode_req *req = data;
@@ -356,6 +359,9 @@
        case TRXCON_EV_TX_ACCESS_BURST_REQ:
                handle_tx_access_burst_req(fi, data);
                break;
+       case TRXCON_EV_TX_ACCESS_BURST_CNF:
+               l1ctl_tx_rach_conf(trxcon->l2if, (const struct 
trxcon_param_tx_access_burst_cnf *)data);
+               break;
        case TRXCON_EV_DEDICATED_RELEASE_REQ:
                l1sched_reset(trxcon->sched, false);
                osmo_fsm_inst_state_chg(fi, TRXCON_ST_RESET, 0, 0);
@@ -463,6 +469,9 @@
        case TRXCON_EV_TX_ACCESS_BURST_REQ:
                handle_tx_access_burst_req(fi, data);
                break;
+       case TRXCON_EV_TX_ACCESS_BURST_CNF:
+               l1ctl_tx_rach_conf(trxcon->l2if, (const struct 
trxcon_param_tx_access_burst_cnf *)data);
+               break;
        case TRXCON_EV_RX_DATA_IND:
        {
                const struct trxcon_param_rx_data_ind *ind = data;
@@ -540,6 +549,7 @@
                .in_event_mask  = S(TRXCON_EV_RX_DATA_IND)
                                | S(TRXCON_EV_SET_CCCH_MODE_REQ)
                                | S(TRXCON_EV_TX_ACCESS_BURST_REQ)
+                               | S(TRXCON_EV_TX_ACCESS_BURST_CNF)
                                | S(TRXCON_EV_DEDICATED_ESTABLISH_REQ),
                .action = &trxcon_st_bcch_ccch_action,
        },
@@ -550,6 +560,7 @@
                                | S(TRXCON_ST_BCCH_CCCH),
                .in_event_mask  = S(TRXCON_EV_DEDICATED_RELEASE_REQ)
                                | S(TRXCON_EV_TX_ACCESS_BURST_REQ)
+                               | S(TRXCON_EV_TX_ACCESS_BURST_CNF)
                                | S(TRXCON_EV_SET_TCH_MODE_REQ)
                                | S(TRXCON_EV_TX_DATA_REQ)
                                | S(TRXCON_EV_TX_DATA_CNF)
@@ -564,6 +575,7 @@
                                | S(TRXCON_ST_BCCH_CCCH),
                .in_event_mask  = S(TRXCON_EV_DEDICATED_RELEASE_REQ)
                                | S(TRXCON_EV_TX_ACCESS_BURST_REQ)
+                               | S(TRXCON_EV_TX_ACCESS_BURST_CNF)
                                | S(TRXCON_EV_RX_DATA_IND),
                .action = &trxcon_st_packet_data_action,
        },
@@ -582,6 +594,7 @@
        OSMO_VALUE_STRING(TRXCON_EV_SET_TCH_MODE_REQ),
        OSMO_VALUE_STRING(TRXCON_EV_SET_PHY_CONFIG_REQ),
        OSMO_VALUE_STRING(TRXCON_EV_TX_ACCESS_BURST_REQ),
+       OSMO_VALUE_STRING(TRXCON_EV_TX_ACCESS_BURST_CNF),
        OSMO_VALUE_STRING(TRXCON_EV_UPDATE_SACCH_CACHE_REQ),
        OSMO_VALUE_STRING(TRXCON_EV_DEDICATED_ESTABLISH_REQ),
        OSMO_VALUE_STRING(TRXCON_EV_DEDICATED_RELEASE_REQ),

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I64de7d4e8137041b373a9920296553fbfe8386d4
Gerrit-Change-Number: 29960
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to