diff options
-rw-r--r-- | include/osmocom/pcu/pcuif_proto.h | 9 | ||||
-rw-r--r-- | src/pcu_l1_if.cpp | 18 |
2 files changed, 27 insertions, 0 deletions
diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h index b06077c3..144fba68 100644 --- a/include/osmocom/pcu/pcuif_proto.h +++ b/include/osmocom/pcu/pcuif_proto.h @@ -12,6 +12,7 @@ #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_SUSP_REQ 0x03 /* BTS forwards GPRS SUSP REQ to PCU */ #define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ #define PCU_IF_MSG_DATA_CNF_DT 0x11 /* confirm (with direct tlli) */ #define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ @@ -171,6 +172,13 @@ struct gsm_pcu_if_pag_req { uint8_t identity_lv[9]; } __attribute__ ((packed)); +/* BTS tells PCU about a GPRS SUSPENSION REQUEST received on DCCH */ +struct gsm_pcu_if_susp_req { + uint32_t tlli; + uint8_t ra_id[6]; + uint8_t cause; +} __attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -182,6 +190,7 @@ struct gsm_pcu_if { struct gsm_pcu_if_data data_cnf; struct gsm_pcu_if_data_cnf_dt data_cnf_dt; struct gsm_pcu_if_data data_ind; + struct gsm_pcu_if_susp_req susp_req; struct gsm_pcu_if_rts_req rts_req; struct gsm_pcu_if_rach_ind rach_ind; struct gsm_pcu_if_txt_ind txt_ind; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 27e86dd5..90429ac2 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -605,6 +605,21 @@ static int pcu_rx_pag_req(struct gsm_pcu_if_pag_req *pag_req) pag_req->identity_lv); } +static int pcu_rx_susp_req(struct gsm_pcu_if_susp_req *susp_req) +{ + struct bssgp_bvc_ctx *bctx = gprs_bssgp_pcu_current_bctx(); + struct gprs_ra_id ra_id; + + gsm48_parse_ra(&ra_id, susp_req->ra_id); + + LOGP(DL1IF, LOGL_DEBUG, "GPRS Suspent request received: tlli=0x%08x\n", susp_req->tlli); + + if (!bctx) + return -1; + + return bssgp_tx_suspend(bctx->nsei, susp_req->tlli, &ra_id); +} + int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { int rc = 0; @@ -631,6 +646,9 @@ int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim) case PCU_IF_MSG_PAG_REQ: rc = pcu_rx_pag_req(&pcu_prim->u.pag_req); break; + case PCU_IF_MSG_SUSP_REQ: + rc = pcu_rx_susp_req(&pcu_prim->u.susp_req); + break; default: LOGP(DL1IF, LOGL_ERROR, "Received unknwon PCU msg type %d\n", msg_type); |