summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/l1ctl.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-04-21 19:22:21 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-04-22 09:17:23 +0000
commit4dd92e2520d228a80cde10c439ad041ddfc93fdd (patch)
tree5aee60fade5faa1c8dba44f1fcbd2e3e9fdcdc07 /src/host/trxcon/l1ctl.c
parent5e473cb4785074a8ad2da8f327050bc0890ed80b (diff)
trxcon: introduce extended (11-bit) RACH support
According to 3GPP TS 05.03, section 5.3, two coding schemes are specified for access bursts: one for regular 8-bit bursts, another - for extended 11-bit packet access bursts. According to 3GPP TS 05.02, section 5.2.7, there are two additional training (synchronization) sequences for RACH bursts: TS1 & TS2. By default, TS0 synch. sequence is used, unless explicitly stated otherwise (see 3GPP TS 04.60). According to 3GPP TS 04.60, section 11.2.5a, the EGPRS capability can be indicated by the MS using an alternative training sequence (i.e. TS1 or TS2) and the 11-bit RACH coding scheme. Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8
Diffstat (limited to 'src/host/trxcon/l1ctl.c')
-rw-r--r--src/host/trxcon/l1ctl.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 97c24966..653ddf34 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -500,8 +500,9 @@ exit:
return rc;
}
-static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg)
+static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg, bool ext)
{
+ struct l1ctl_ext_rach_req *ext_req;
struct l1ctl_rach_req *req;
struct l1ctl_info_ul *ul;
struct trx_ts_prim *prim;
@@ -510,11 +511,25 @@ static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg)
int rc;
ul = (struct l1ctl_info_ul *) msg->l1h;
- req = (struct l1ctl_rach_req *) ul->payload;
- len = sizeof(struct l1ctl_rach_req);
- /* Convert offset value to host format */
- req->offset = ntohs(req->offset);
+ /* Is it extended (11-bit) RACH or not? */
+ if (ext) {
+ ext_req = (struct l1ctl_ext_rach_req *) ul->payload;
+ ext_req->offset = ntohs(ext_req->offset);
+ ext_req->ra11 = ntohs(ext_req->ra11);
+ len = sizeof(*ext_req);
+
+ LOGP(DL1C, LOGL_NOTICE, "Received extended (11-bit) RACH request "
+ "(offset=%u, synch_seq=%u, ra11=0x%02hx)\n",
+ ext_req->offset, ext_req->synch_seq, ext_req->ra11);
+ } else {
+ req = (struct l1ctl_rach_req *) ul->payload;
+ req->offset = ntohs(req->offset);
+ len = sizeof(*req);
+
+ LOGP(DL1C, LOGL_NOTICE, "Received regular (8-bit) RACH request "
+ "(offset=%u, ra=0x%02x)\n", req->offset, req->ra);
+ }
/**
* FIXME: l1ctl_info_ul doesn't provide channel description
@@ -523,9 +538,6 @@ static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg)
chan_nr = 0x88;
link_id = 0x00;
- LOGP(DL1C, LOGL_NOTICE, "Received RACH request "
- "(offset=%u ra=0x%02x)\n", req->offset, req->ra);
-
/* Init a new primitive */
rc = sched_prim_init(l1l->trx, &prim, len, chan_nr, link_id);
if (rc)
@@ -544,7 +556,7 @@ static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg)
}
/* Fill in the payload */
- memcpy(prim->payload, req, len);
+ memcpy(prim->payload, ul->payload, len);
exit:
msgb_free(msg);
@@ -845,7 +857,9 @@ int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg)
case L1CTL_CCCH_MODE_REQ:
return l1ctl_rx_ccch_mode_req(l1l, msg);
case L1CTL_RACH_REQ:
- return l1ctl_rx_rach_req(l1l, msg);
+ return l1ctl_rx_rach_req(l1l, msg, false);
+ case L1CTL_EXT_RACH_REQ:
+ return l1ctl_rx_rach_req(l1l, msg, true);
case L1CTL_DM_EST_REQ:
return l1ctl_rx_dm_est_req(l1l, msg);
case L1CTL_DM_REL_REQ: