diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-05-21 01:14:24 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-05-24 00:02:34 +0200 |
commit | b07e271994f91c410930e09b8c504ae1a8df531f (patch) | |
tree | fdc9b9ba827f19caa8a211ef950c29a78bfed5b5 /src/common/handover.c | |
parent | 482564b422096115aa9eaa2c6599fea9168b49e2 (diff) |
Use LOGPLCHAN whenever possible
There's no point in open-coding what LOGPLCHAN was created to do:
Log some event while stating the name of the logical channel.
Change-Id: I6913ac8fb543811126b85a54118333155c03bc03
Diffstat (limited to 'src/common/handover.c')
-rw-r--r-- | src/common/handover.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/src/common/handover.c b/src/common/handover.c index 54b131ff..63a98324 100644 --- a/src/common/handover.c +++ b/src/common/handover.c @@ -44,9 +44,7 @@ static int ho_tx_phys_info(struct gsm_lchan *lchan) if (!msg) return -ENOMEM; - LOGP(DHO, LOGL_INFO, - "%s Sending PHYSICAL INFORMATION to MS.\n", - gsm_lchan_name(lchan)); + LOGPLCHAN(lchan, DHO, LOGL_INFO, "Sending PHYSICAL INFORMATION to MS.\n"); /* Build RSL UNITDATA REQUEST message with 04.08 PHYS INFO */ msg->l3h = msg->data; @@ -68,20 +66,18 @@ static void ho_t3105_cb(void *data) struct gsm_lchan *lchan = data; struct gsm_bts *bts = lchan->ts->trx->bts; - LOGP(DHO, LOGL_INFO, "%s T3105 timeout (%d resends left)\n", - gsm_lchan_name(lchan), bts->ny1 - lchan->ho.phys_info_count); + LOGPLCHAN(lchan, DHO, LOGL_INFO, "T3105 timeout (%d resends left)\n", + bts->ny1 - lchan->ho.phys_info_count); if (lchan->state != LCHAN_S_ACTIVE) { - LOGP(DHO, LOGL_NOTICE, - "%s is in not active. It is in state %s. Ignoring\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + LOGPLCHAN(lchan, DHO, LOGL_NOTICE, "is in not active. It is in state %s. Ignoring\n", + gsm_lchans_name(lchan->state)); return; } if (lchan->ho.phys_info_count >= bts->ny1) { /* HO Abort */ - LOGP(DHO, LOGL_NOTICE, "%s NY1 reached, sending CONNection " - "FAILure to BSC.\n", gsm_lchan_name(lchan)); + LOGPLCHAN(lchan, DHO, LOGL_NOTICE, "NY1 reached, sending CONNection FAILure to BSC.\n"); rsl_tx_conn_fail(lchan, RSL_ERR_HANDOVER_ACC_FAIL); return; } @@ -98,23 +94,21 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay) /* Ignore invalid handover ref */ if (lchan->ho.ref != ra) { - LOGP(DHO, LOGL_INFO, "%s RACH on dedicated channel received, but " - "ra=0x%02x != expected ref=0x%02x. (This is no bug)\n", - gsm_lchan_name(lchan), ra, lchan->ho.ref); + LOGPLCHAN(lchan, DHO, LOGL_INFO, "RACH on dedicated channel received, but " + "ra=0x%02x != expected ref=0x%02x. (This is no bug)\n", ra, lchan->ho.ref); return; } /* Ignore handover on channels other than DCCH and SACCH */ if (lchan->type != GSM_LCHAN_SDCCH && lchan->type != GSM_LCHAN_TCH_H && lchan->type != GSM_LCHAN_TCH_F) { - LOGP(DHO, LOGL_ERROR, "%s handover RACH received on %s?!\n", - gsm_lchan_name(lchan), gsm_lchant_name(lchan->type)); + LOGPLCHAN(lchan, DHO, LOGL_ERROR, "handover RACH received on %s?!\n", + gsm_lchant_name(lchan->type)); return; } - LOGP(DHO, LOGL_NOTICE, - "%s RACH on dedicated channel type %s received with TA=%u, ref=%u\n", - gsm_lchan_name(lchan), gsm_lchant_name(lchan->type), acc_delay, ra); + LOGPLCHAN(lchan, DHO, LOGL_NOTICE, "RACH on dedicated channel type %s received with " + "TA=%u, ref=%u\n", gsm_lchant_name(lchan->type), acc_delay, ra); /* Set timing advance */ lchan->rqd_ta = acc_delay; @@ -122,9 +116,7 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay) /* Stop handover detection, wait for valid frame */ lchan->ho.active = HANDOVER_WAIT_FRAME; if (l1sap_chan_modify(lchan->ts->trx, gsm_lchan2chan_nr(lchan)) != 0) { - LOGP(DHO, LOGL_ERROR, - "%s failed to modify channel after handover\n", - gsm_lchan_name(lchan)); + LOGPLCHAN(lchan, DHO, LOGL_ERROR, "failed to modify channel after handover\n"); rsl_tx_conn_fail(lchan, RSL_ERR_HANDOVER_ACC_FAIL); return; } @@ -137,9 +129,7 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay) ho_tx_phys_info(lchan); /* Start T3105 */ - LOGP(DHO, LOGL_DEBUG, - "%s Starting T3105 with %u ms\n", - gsm_lchan_name(lchan), bts->t3105_ms); + LOGPLCHAN(lchan, DHO, LOGL_DEBUG, "Starting T3105 with %u ms\n", bts->t3105_ms); lchan->ho.t3105.cb = ho_t3105_cb; lchan->ho.t3105.data = lchan; osmo_timer_schedule(&lchan->ho.t3105, 0, bts->t3105_ms * 1000); @@ -148,8 +138,7 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay) /* received frist valid data frame on dedicated channel */ void handover_frame(struct gsm_lchan *lchan) { - LOGP(DHO, LOGL_INFO, - "%s First valid frame detected\n", gsm_lchan_name(lchan)); + LOGPLCHAN(lchan, DHO, LOGL_INFO, "First valid frame detected\n"); handover_reset(lchan); } |