aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-09-27 07:42:36 +0200
committerHarald Welte <laforge@gnumonks.org>2012-09-29 20:31:40 +0200
commitc1ad2ac20f4066aacbbb8e6482a10fe64edddbbb (patch)
tree21035625f6e5d48852565bc5183e3b2d7f1758be
parent0efca9a1f99462326aea321d1660723c8ff64db1 (diff)
PCU: Add PCH confirm, raise PCU interface version to 4
The confirm is required, so PCU knows when an IMMEDIATE ASSIGN message has has been sent on PCH. The PCU will start packet flow after that confirm.
-rw-r--r--include/osmo-bts/pcu_if.h1
-rw-r--r--include/osmo-bts/pcuif_proto.h4
-rw-r--r--src/common/paging.c3
-rw-r--r--src/common/pcu_sock.c27
4 files changed, 34 insertions, 1 deletions
diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index c5578131..d5ac58db 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -9,6 +9,7 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn);
int pcu_tx_time_ind(uint32_t fn);
int pcu_tx_pag_req(uint8_t *identity_lv, uint8_t chan_needed);
+int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len);
int pcu_sock_init(void);
void pcu_sock_exit(void);
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index 493f058c..c27bb7dc 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -1,10 +1,11 @@
#ifndef _PCUIF_PROTO_H
#define _PCUIF_PROTO_H
-#define PCU_IF_VERSION 0x03
+#define PCU_IF_VERSION 0x04
/* msg_type */
#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */
+#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */
#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */
#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */
#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */
@@ -137,6 +138,7 @@ struct gsm_pcu_if {
union {
struct gsm_pcu_if_data data_req;
+ struct gsm_pcu_if_data data_cnf;
struct gsm_pcu_if_data data_ind;
struct gsm_pcu_if_rts_req rts_req;
struct gsm_pcu_if_rach_ind rach_ind;
diff --git a/src/common/paging.c b/src/common/paging.c
index b71b7bb7..a4514de7 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -41,6 +41,7 @@
#include <osmo-bts/logging.h>
#include <osmo-bts/paging.h>
#include <osmo-bts/signal.h>
+#include <osmo-bts/pcu_if.h>
#define MAX_PAGING_BLOCKS_CCCH 9
#define MAX_BS_PA_MFRMS 9
@@ -414,6 +415,8 @@ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *g
/* get message and free record */
memcpy(out_buf, pr[num_pr]->u.imm_ass.msg,
GSM_MACBLOCK_LEN);
+ pcu_tx_pch_data_cnf(gt->fn, pr[num_pr]->u.imm_ass.msg,
+ GSM_MACBLOCK_LEN);
talloc_free(pr[num_pr]);
return GSM_MACBLOCK_LEN;
}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index d9ea73ee..da5a95ec 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -422,6 +422,33 @@ int pcu_tx_pag_req(uint8_t *identity_lv, uint8_t chan_needed)
return pcu_sock_send(&bts_gsmnet, msg);
}
+int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len)
+{
+ struct gsm_network *net = &bts_gsmnet;
+ struct gsm_bts *bts;
+ struct msgb *msg;
+ struct gsm_pcu_if *pcu_prim;
+ struct gsm_pcu_if_data *data_cnf;
+
+ /* FIXME: allow multiple BTS */
+ bts = llist_entry(net->bts_list.next, struct gsm_bts, list);
+
+ LOGP(DPCU, LOGL_INFO, "Sending PCH confirm\n");
+
+ msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_CNF, bts->nr);
+ if (!msg)
+ return -ENOMEM;
+ pcu_prim = (struct gsm_pcu_if *) msg->data;
+ data_cnf = &pcu_prim->u.data_cnf;
+
+ data_cnf->sapi = PCU_IF_SAPI_PCH;
+ data_cnf->fn = fn;
+ memcpy(data_cnf->data, data, len);
+ data_cnf->len = len;
+
+ return pcu_sock_send(&bts_gsmnet, msg);
+}
+
static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
struct gsm_pcu_if_data *data_req)
{