diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-06 12:01:38 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-23 20:18:18 +0100 |
commit | 5ca825e431e837b95f7db9057792e5a66de97a89 (patch) | |
tree | ff85786c7ef00345eb4b05fb48a5782eb5f3edc7 | |
parent | 1411c066cc3ddaa46437cac7c580a04a1fe95eb1 (diff) |
rsl: Rename the reason to release_mode and use the enum value
The API with 0 and 1 as legal values is hard to understand. Use the
recently introduced enum values instead.
-rw-r--r-- | openbsc/include/openbsc/abis_rsl.h | 3 | ||||
-rw-r--r-- | openbsc/include/openbsc/chan_alloc.h | 2 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_data_shared.h | 4 | ||||
-rw-r--r-- | openbsc/src/libbsc/abis_rsl.c | 7 | ||||
-rw-r--r-- | openbsc/src/libbsc/chan_alloc.c | 4 |
5 files changed, 11 insertions, 9 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index f7e2e2aac..c34492e09 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -67,7 +67,8 @@ int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act); int abis_rsl_rcvmsg(struct msgb *msg); uint64_t str_to_imsi(const char *imsi_str); -int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason); +int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, + enum rsl_rel_mode release_mode); int rsl_lchan_set_state(struct gsm_lchan *lchan, int); diff --git a/openbsc/include/openbsc/chan_alloc.h b/openbsc/include/openbsc/chan_alloc.h index f1c890e9d..f2d3c781d 100644 --- a/openbsc/include/openbsc/chan_alloc.h +++ b/openbsc/include/openbsc/chan_alloc.h @@ -46,7 +46,7 @@ void lchan_free(struct gsm_lchan *lchan); void lchan_reset(struct gsm_lchan *lchan); /* Release the given lchan */ -int lchan_release(struct gsm_lchan *lchan, int sacch_deact, int release_mode); +int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode release_mode); struct load_counter { unsigned int total; diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index fda3b097b..f81280f92 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -196,8 +196,8 @@ struct gsm_lchan { uint8_t sapis[8]; int sacch_deact; - /** GSM 08.58 9.3.20 */ - int release_mode; + /* Release handling */ + enum rsl_rel_mode release_mode; struct { uint32_t bound_ip; diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index d365a9718..95d5c1ea7 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -833,7 +833,8 @@ int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id) RELEASE CONFIRM, which we in turn use to trigger RSL CHANNEL RELEASE, which in turn is acknowledged by RSL CHANNEL RELEASE ACK, which calls lchan_free() */ -int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason) +int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, + enum rsl_rel_mode release_mode) { struct msgb *msg; @@ -841,14 +842,14 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason msg = rsl_rll_simple(RSL_MT_REL_REQ, gsm_lchan2chan_nr(lchan), link_id, 0); /* 0 is normal release, 1 is local end */ - msgb_tv_put(msg, RSL_IE_RELEASE_MODE, reason); + msgb_tv_put(msg, RSL_IE_RELEASE_MODE, release_mode); /* FIXME: start some timer in case we don't receive a REL ACK ? */ msg->dst = lchan->ts->trx->rsl_link; DEBUGP(DRLL, "%s RSL RLL RELEASE REQ (link_id=0x%02x, reason=%u)\n", - gsm_lchan_name(lchan), link_id, reason); + gsm_lchan_name(lchan), link_id, release_mode); return abis_rsl_sendmsg(msg); } diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 69b2625c5..fa369a2cd 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -345,7 +345,7 @@ void lchan_free(struct gsm_lchan *lchan) } lchan->sacch_deact = 0; - lchan->release_mode = 0; + lchan->release_mode = RSL_REL_NORMAL; /* FIXME: ts_free() the timeslot, if we're the last logical * channel using it */ @@ -424,7 +424,7 @@ int rsl_lchan_rll_release(struct gsm_lchan *lchan, uint8_t link_id) } /* Consider releasing the channel now */ -int lchan_release(struct gsm_lchan *lchan, int sacch_deact, int mode) +int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode mode) { DEBUGP(DRLL, "%s starting release sequence\n", gsm_lchan_name(lchan)); rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ); |