diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-02 11:54:55 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-04 07:20:43 +0200 |
commit | a2ca4ed96073328c33cc6fd8fdf626b2685463f8 (patch) | |
tree | 41fee5e812f531cf581414f42ca0d118692f7a10 /openbsc/src | |
parent | 8f9a3ee67bf25b62936ffbcd88936936916ad0e9 (diff) |
[gprs] pass BSSGP UL-UNITDATA Cell ID up into GMM layer
BSSGP stores a pointer to the Cell Identifier IE in msgb->cb, which
is later used by the GMM layer to identify the cell that has sent a
given message.
This now also means that the gsm_04_08_gprs.c code is free of any
legacy references to msg->trx or struct gsm_bts.
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/gprs_bssgp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/openbsc/src/gprs_bssgp.c b/openbsc/src/gprs_bssgp.c index a3fa3ecc..aceedb58 100644 --- a/openbsc/src/gprs_bssgp.c +++ b/openbsc/src/gprs_bssgp.c @@ -205,13 +205,12 @@ int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg) return gprs_ns_sendmsg(bssgp_nsi, msg); } -static void bssgp_parse_cell_id(struct gprs_ra_id *raid, uint16_t *cid, - const uint8_t *buf) +uint16_t bssgp_parse_cell_id(struct gprs_ra_id *raid, const uint8_t *buf) { /* 6 octets RAC */ gsm48_parse_ra(raid, buf); /* 2 octets CID */ - *cid = ntohs(*(uint16_t *) (buf+6)); + return ntohs(*(uint16_t *) (buf+6)); } /* Chapter 8.4 BVC-Reset Procedure */ @@ -241,8 +240,8 @@ static int bssgp_rx_bvc_reset(struct msgb *msg, struct tlv_parsed *tp, return -EINVAL; } /* actually extract RAC / CID */ - bssgp_parse_cell_id(&bctx->ra_id, &bctx->cell_id, - TLVP_VAL(tp, BSSGP_IE_CELL_ID)); + bctx->cell_id = bssgp_parse_cell_id(&bctx->ra_id, + TLVP_VAL(tp, BSSGP_IE_CELL_ID)); LOGP(DGPRS, LOGL_NOTICE, "Cell %u-%u-%u-%u CI %u on BVCI %u\n", bctx->ra_id.mcc, bctx->ra_id.mnc, bctx->ra_id.lac, bctx->ra_id.rac, bctx->cell_id, bvci); @@ -275,7 +274,9 @@ static int bssgp_rx_ul_ud(struct msgb *msg) /* FIXME: lookup bssgp_bts_ctx based on BVCI + NSEI */ + /* store pointer to LLC header and CELL ID in msgb->cb */ msgb_llch(msg) = TLVP_VAL(&tp, BSSGP_IE_LLC_PDU); + msgb_bcid(msg) = TLVP_VAL(&tp, BSSGP_IE_CELL_ID); return gprs_llc_rcvmsg(msg, &tp); } |