From 15a36434e9d51e57514b2b9357a41293b063e970 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 17 Jun 2012 12:16:31 +0800 Subject: libgb: don't call directly into GMM / LLC layer Instead of direct function calls to individual functions, we now generate primitives (osmo_prim) and send them to one application-provided function "bssgp_prim_cb()" --- openbsc/include/osmocom/gprs/gprs_bssgp.h | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'openbsc/include') diff --git a/openbsc/include/osmocom/gprs/gprs_bssgp.h b/openbsc/include/osmocom/gprs/gprs_bssgp.h index 4fcdfb56..e060fc03 100644 --- a/openbsc/include/osmocom/gprs/gprs_bssgp.h +++ b/openbsc/include/osmocom/gprs/gprs_bssgp.h @@ -144,6 +144,7 @@ enum gprs_bssgp_cause { /* Our implementation */ #include +#include /* gprs_bssgp_util.c */ extern struct gprs_ns_inst *bssgp_nsi; @@ -155,6 +156,40 @@ int bssgp_tx_simple_bvci(uint8_t pdu_type, uint16_t nsei, /* Chapter 10.4.14: Status */ int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg); +enum bssgp_prim { + PRIM_BSSGP_DL_UD, + PRIM_BSSGP_UL_UD, + PRIM_BSSGP_PTM_UD, + + PRIM_BSSGP_GMM_SUSPEND, + PRIM_BSSGP_GMM_RESUME, + PRIM_BSSGP_GMM_PAGING, + + PRIM_NM_FLUSH_LL, + PRIM_NM_LLC_DISCARDED, + PRIM_NM_BVC_RESET, + PRIM_NM_BVC_BLOCK, + PRIM_NM_BVC_UNBLOCK, +}; + +struct osmo_bssgp_prim { + struct osmo_prim_hdr oph; + + /* common fields */ + uint16_t nsei; + uint16_t bvci; + uint32_t tlli; + struct tlv_parsed *tp; + struct gprs_ra_id *ra_id; + + /* specific fields */ + union { + struct { + uint8_t *suspend_ref; + } resume; + } u; +}; + /* gprs_bssgp.c */ #define BVC_S_BLOCKED 0x0001 @@ -264,4 +299,6 @@ int gprs_bssgp_tx_paging(uint16_t nsei, uint16_t ns_bvci, int gprs_bssgp_vty_init(void); void gprs_bssgp_set_log_ss(int ss); +int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx); + #endif /* _GPRS_BSSGP_H */ -- cgit v1.2.3