From: Pablo Neira Ayuso pablo@gnumonks.org
This patchset gets osmocom-bb in sync with the namespace fixes for libosmocore.
You can find them in pablo/namespace branch. Please, merge it.
BTW: I had to temporarily disable mtk62xx compilation since I hit a linking error. This problem occurs in the current git tree. I already contacted Wolfram to let him know.
diff --git a/src/Makefile b/src/Makefile index d6f556f..6ff4dc4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,7 +17,7 @@ OSMOCORE_CONFIGURE_ENV= LIBOSMOCORE_LIBS=$(TOPDIR)/shared/libosmocore/build-host LIBOSMOVTY_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include \ LIBOSMOGSM_CFLAGS=-I$(TOPDIR)/shared/libosmocore/include
-all: libosmocore-target nofirmware firmware mtk-firmware +all: libosmocore-target nofirmware firmware nofirmware: libosmocore-host layer23 osmocon gsmmap
libosmocore-host: shared/libosmocore/build-host/src/.libs/libosmocore.la
Pablo Neira Ayuso (6): src: use namespace prefix osmo_timer* src: use namespace prefix osmo_fd* and osmo_select* src: use namespace prefix osmo_signal* src: use namespace prefix osmo_wqueue* src: use namespace prefix osmo_* for utils src: use namespace prefix osmo_* for crc16 functions
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g --- src/host/layer23/include/osmocom/bb/common/lapdm.h | 2 +- .../layer23/include/osmocom/bb/mobile/gsm322.h | 4 +- .../layer23/include/osmocom/bb/mobile/gsm48_mm.h | 4 +- .../layer23/include/osmocom/bb/mobile/gsm48_rr.h | 16 +++--- src/host/layer23/include/osmocom/bb/mobile/mncc.h | 2 +- .../include/osmocom/bb/mobile/transaction.h | 4 +- src/host/layer23/src/common/lapdm.c | 42 ++++++++-------- src/host/layer23/src/misc/app_echo_test.c | 6 +- src/host/layer23/src/misc/bcch_scan.c | 4 +- src/host/layer23/src/misc/cell_log.c | 8 ++-- src/host/layer23/src/mobile/gsm322.c | 12 ++-- src/host/layer23/src/mobile/gsm48_cc.c | 6 +- src/host/layer23/src/mobile/gsm48_mm.c | 48 +++++++++--------- src/host/layer23/src/mobile/gsm48_rr.c | 50 ++++++++++---------- src/host/layer23/src/mobile/mnccms.c | 6 +- src/host/osmocon/osmocon.c | 18 ++++---- src/host/osmocon/osmoload.c | 8 ++-- src/target/firmware/comm/timer.c | 16 +++--- src/target/firmware/include/comm/timer.h | 12 ++-- 19 files changed, 134 insertions(+), 134 deletions(-)
diff --git a/src/host/layer23/include/osmocom/bb/common/lapdm.h b/src/host/layer23/include/osmocom/bb/common/lapdm.h index 2d0e2fd..b502ffd 100644 --- a/src/host/layer23/include/osmocom/bb/common/lapdm.h +++ b/src/host/layer23/include/osmocom/bb/common/lapdm.h @@ -42,7 +42,7 @@ struct lapdm_datalink { uint32_t state; int seq_err_cond; /* condition of sequence error */ uint8_t own_busy, peer_busy; - struct timer_list t200; + struct osmo_timer_list t200; uint8_t retrans_ctr; struct llist_head send_queue; /* frames from L3 */ struct msgb *send_buffer; /* current frame transmitting */ diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm322.h b/src/host/layer23/include/osmocom/bb/mobile/gsm322.h index 467ff39..c93e8fa 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/gsm322.h +++ b/src/host/layer23/include/osmocom/bb/mobile/gsm322.h @@ -119,7 +119,7 @@ struct gsm322_plmn { struct llist_head sorted_plmn; /* list of sorted PLMN */ struct llist_head forbidden_la; /* forbidden LAs */
- struct timer_list timer; + struct osmo_timer_list timer;
int plmn_curr; /* current index in sorted_plmn */ uint16_t mcc, mnc; /* current network selected */ @@ -140,7 +140,7 @@ struct gsm322_cellsel { struct llist_head event_queue; /* event messages */ struct llist_head ba_list; /* BCCH Allocation per PLMN */
- struct timer_list timer; + struct osmo_timer_list timer;
uint16_t mcc, mnc; /* current network to search for */ struct gsm322_cs_list list[1024]; /* cell selection list per freq. */ diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h index 447dc95..021b78d 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h +++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h @@ -163,8 +163,8 @@ struct gsm48_mmlayer { struct llist_head event_queue;
/* timers */ - struct timer_list t3210, t3211, t3212, t3213; - struct timer_list t3220, t3230, t3240; + struct osmo_timer_list t3210, t3211, t3212, t3213; + struct osmo_timer_list t3220, t3230, t3240; int t3212_value; int start_t3211; /* remember to start timer */
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h index b140c18..cccf279 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h +++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h @@ -118,15 +118,15 @@ struct gsm48_rrlayer { struct llist_head downqueue;
/* timers */ - struct timer_list t_starting; /* starting time for chan. access */ - struct timer_list t_rel_wait; /* wait for L2 to transmit UA */ - struct timer_list t3110; - struct timer_list t3122; - struct timer_list t3124; - struct timer_list t3126; + struct osmo_timer_list t_starting; /* starting time for chan. access */ + struct osmo_timer_list t_rel_wait; /* wait for L2 to transmit UA */ + struct osmo_timer_list t3110; + struct osmo_timer_list t3122; + struct osmo_timer_list t3124; + struct osmo_timer_list t3126; int t3126_value; #ifndef TODO - struct timer_list temp_rach_ti; /* temporary timer */ + struct osmo_timer_list temp_rach_ti; /* temporary timer */ #endif
/* states if RR-EST-REQ was used */ @@ -169,7 +169,7 @@ struct gsm48_rrlayer { uint32_t ba_range[16];
/* measurements */ - struct timer_list t_meas; + struct osmo_timer_list t_meas; struct gsm48_rr_meas meas; uint8_t monitor; }; diff --git a/src/host/layer23/include/osmocom/bb/mobile/mncc.h b/src/host/layer23/include/osmocom/bb/mobile/mncc.h index e378ecc..a2b48cf 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/mncc.h +++ b/src/host/layer23/include/osmocom/bb/mobile/mncc.h @@ -40,7 +40,7 @@ struct gsm_call { uint8_t hold; /* call on hold */ uint8_t ring; /* call ringing/knocking */
- struct timer_list dtmf_timer; + struct osmo_timer_list dtmf_timer; uint8_t dtmf_state; uint8_t dtmf_index; char dtmf[32]; /* dtmf sequence */ diff --git a/src/host/layer23/include/osmocom/bb/mobile/transaction.h b/src/host/layer23/include/osmocom/bb/mobile/transaction.h index 6cbc25b..aa62f46 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/transaction.h +++ b/src/host/layer23/include/osmocom/bb/mobile/transaction.h @@ -35,7 +35,7 @@ struct gsm_trans { /* current timer and message queue */ int Tcurrent; /* current CC timer */ int T308_second; /* used to send release again */ - struct timer_list timer; + struct osmo_timer_list timer; struct gsm_mncc msg; /* stores setup/disconnect/release message */ } cc; #if 0 @@ -43,7 +43,7 @@ struct gsm_trans { uint8_t link_id; /* RSL Link ID to be used for this trans */ int is_mt; /* is this a MO (0) or MT (1) transfer */ enum gsm411_cp_state cp_state; - struct timer_list cp_timer; + struct osmo_timer_list cp_timer;
enum gsm411_rp_state rp_state;
diff --git a/src/host/layer23/src/common/lapdm.c b/src/host/layer23/src/common/lapdm.c index 61e2287..974c34c 100644 --- a/src/host/layer23/src/common/lapdm.c +++ b/src/host/layer23/src/common/lapdm.c @@ -538,7 +538,7 @@ static void lapdm_t200_cb(void *data) /* increment re-transmission counter */ dl->retrans_ctr++; /* restart T200 (PH-READY-TO-SEND) */ - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); break; case LAPDm_STATE_DISC_SENT: /* 5.4.4.3 */ @@ -562,7 +562,7 @@ static void lapdm_t200_cb(void *data) /* increment re-transmission counter */ dl->retrans_ctr++; /* restart T200 (PH-READY-TO-SEND) */ - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); break; case LAPDm_STATE_MF_EST: /* 5.5.7 */ @@ -608,7 +608,7 @@ static void lapdm_t200_cb(void *data) } } /* restart T200 (PH-READY-TO-SEND) */ - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); } else { /* send MDL ERROR INIDCATION to L3 */ rsl_rll_error(RLL_CAUSE_T200_EXPIRED, &dl->mctx); @@ -652,7 +652,7 @@ static void lapdm_acknowledge(struct lapdm_msg_ctx *mctx) || (rej && nr == dl->V_ack)) { LOGP(DLAPDM, LOGL_INFO, "reset t200\n"); t200_reset = 1; - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* 5.5.3.1 Note 1 + 2 imply timer recovery cond. */ } /* 5.7.4: N(R) sequence error @@ -674,7 +674,7 @@ static void lapdm_acknowledge(struct lapdm_msg_ctx *mctx) if (dl->tx_length[dl->V_send - 1]) { LOGP(DLAPDM, LOGL_INFO, "start T200, due to unacked I " "frame(s)\n"); - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); } } } @@ -748,7 +748,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) /* 5.4.6.2 send DM with F=P */ lapdm_send_dm(mctx); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); msgb_free(msg); return send_rll_simple(RSL_MT_REL_CONF, mctx); default: @@ -821,7 +821,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) break; case LAPDm_STATE_DISC_SENT: /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* go to idle state */ lapdm_dl_newstate(dl, LAPDm_STATE_IDLE); rc = send_rll_simple(RSL_MT_REL_CONF, mctx); @@ -836,7 +836,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) return 0; } /* reset T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); rc = send_rll_simple(RSL_MT_REL_IND, mctx); msgb_free(msg); break; @@ -933,7 +933,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) /* 5.4.6.2 send DM with F=P */ lapdm_send_dm(mctx); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); return send_rll_simple(RSL_MT_REL_IND, mctx); case LAPDm_STATE_MF_EST: case LAPDm_STATE_TIMER_RECOV: @@ -950,7 +950,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) /* send UA response */ lapdm_send_ua(mctx, length, msg->l2h + 3); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* enter idle state */ lapdm_dl_newstate(dl, LAPDm_STATE_IDLE); /* send notification to L3 */ @@ -999,7 +999,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) case LAPDm_STATE_DISC_SENT: LOGP(DLAPDM, LOGL_INFO, "UA in disconnect state\n"); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* go to idle state */ lapdm_dl_newstate(dl, LAPDm_STATE_IDLE); rc = send_rll_simple(RSL_MT_REL_CONF, mctx); @@ -1015,7 +1015,7 @@ static int lapdm_rx_u(struct msgb *msg, struct lapdm_msg_ctx *mctx) } LOGP(DLAPDM, LOGL_INFO, "UA in SABM state\n"); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* compare UA with SABME if contention resolution is applied */ if (dl->tx_hist[0][2] >> 2) { rc = check_length_ind(mctx, msg->l2h[2]); @@ -1135,7 +1135,7 @@ static int lapdm_rx_s(struct msgb *msg, struct lapdm_msg_ctx *mctx) /* V(S) to the N(R) in the RR frame */ dl->V_send = LAPDm_CTRL_Nr(mctx->ctrl); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* 5.5.7 Clear timer recovery condition */ lapdm_dl_newstate(dl, LAPDm_STATE_MF_EST); } @@ -1198,7 +1198,7 @@ static int lapdm_rx_s(struct msgb *msg, struct lapdm_msg_ctx *mctx) /* V(S) and V(A) to the N(R) in the REJ frame */ dl->V_send = dl->V_ack = LAPDm_CTRL_Nr(mctx->ctrl); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* 5.5.3.2 */ if (LAPDm_ADDR_CR(mctx->addr) == CR_BS2MS_CMD && LAPDm_CTRL_PF_BIT(mctx->ctrl)) { @@ -1246,7 +1246,7 @@ static int lapdm_rx_s(struct msgb *msg, struct lapdm_msg_ctx *mctx) /* V(S) and V(A) to the N(R) in the REJ frame */ dl->V_send = dl->V_ack = LAPDm_CTRL_Nr(mctx->ctrl); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); } else { /* Clear an existing peer receiver busy condition */ dl->peer_busy = 0; @@ -1660,7 +1660,7 @@ static int rslms_rx_rll_est_req(struct msgb *msg, struct lapdm_datalink *dl) lapdm_dl_newstate(dl, LAPDm_STATE_SABM_SENT);
/* Tramsmit and start T200 */ - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); return tx_ph_data_enqueue(dl, msg, chan_nr, link_id, n201); }
@@ -1853,8 +1853,8 @@ static int rslms_send_i(struct lapdm_msg_ctx *mctx, int line) /* If timer T200 is not running at the time right before transmitting a * frame, when the PH-READY-TO-SEND primitive is received from the * physical layer., it shall be set. */ - if (!bsc_timer_pending(&dl->t200)) - bsc_schedule_timer(&dl->t200, T200); + if (!osmo_timer_pending(&dl->t200)) + osmo_timer_schedule(&dl->t200, T200);
tx_ph_data_enqueue(dl, msg, chan_nr, link_id, mctx->n201);
@@ -1957,7 +1957,7 @@ static int rslms_rx_rll_res_req(struct msgb *msg, struct lapdm_datalink *dl) lapdm_dl_newstate(dl, LAPDm_STATE_SABM_SENT);
/* Tramsmit and start T200 */ - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); return tx_ph_data_enqueue(dl, msg, chan_nr, link_id, n201); }
@@ -1979,7 +1979,7 @@ static int rslms_rx_rll_rel_req(struct msgb *msg, struct lapdm_datalink *dl) LOGP(DLAPDM, LOGL_INFO, "perform local release\n"); msgb_free(msg); /* reset Timer T200 */ - bsc_del_timer(&dl->t200); + osmo_timer_del(&dl->t200); /* enter idle state */ lapdm_dl_newstate(dl, LAPDm_STATE_IDLE); /* flush buffers */ @@ -2013,7 +2013,7 @@ static int rslms_rx_rll_rel_req(struct msgb *msg, struct lapdm_datalink *dl) lapdm_dl_newstate(dl, LAPDm_STATE_DISC_SENT);
/* Tramsmit and start T200 */ - bsc_schedule_timer(&dl->t200, T200); + osmo_timer_schedule(&dl->t200, T200); return tx_ph_data_enqueue(dl, msg, chan_nr, link_id, dl->mctx.n201); }
diff --git a/src/host/layer23/src/misc/app_echo_test.c b/src/host/layer23/src/misc/app_echo_test.c index 0adab7f..3d937d2 100644 --- a/src/host/layer23/src/misc/app_echo_test.c +++ b/src/host/layer23/src/misc/app_echo_test.c @@ -34,7 +34,7 @@
static struct { - struct timer_list timer; + struct osmo_timer_list timer; } test_data;
static void test_tmr_cb(void *data) @@ -42,7 +42,7 @@ static void test_tmr_cb(void *data) struct osmocom_ms *ms = data;
l1ctl_tx_echo_req(ms, 62); - bsc_schedule_timer(&test_data.timer, 1, 0); + osmo_timer_schedule(&test_data.timer, 1, 0); }
int l23_app_init(struct osmocom_ms *ms) @@ -50,7 +50,7 @@ int l23_app_init(struct osmocom_ms *ms) test_data.timer.cb = &test_tmr_cb; test_data.timer.data = ms;
- bsc_schedule_timer(&test_data.timer, 1, 0); + osmo_timer_schedule(&test_data.timer, 1, 0);
return 0; } diff --git a/src/host/layer23/src/misc/bcch_scan.c b/src/host/layer23/src/misc/bcch_scan.c index 351da52..fc88254 100644 --- a/src/host/layer23/src/misc/bcch_scan.c +++ b/src/host/layer23/src/misc/bcch_scan.c @@ -105,7 +105,7 @@ struct full_power_scan { struct llist_head cell_list; struct cell_info *cur_cell; uint16_t cur_arfcn; - struct timer_list timer; + struct osmo_timer_list timer; };
static struct full_power_scan fps; @@ -164,7 +164,7 @@ static int _cinfo_start_arfcn(unsigned int band_arfcn) fps.cur_cell->band_arfcn = band_arfcn; /* FIXME: start timer in case we never get a sync */ fps.state = BSCAN_S_WAIT_DATA; - bsc_schedule_timer(&fps.timer, 2, 0); + osmo_timer_schedule(&fps.timer, 2, 0);
return 0; } diff --git a/src/host/layer23/src/misc/cell_log.c b/src/host/layer23/src/misc/cell_log.c index 7980082..a1a764b 100644 --- a/src/host/layer23/src/misc/cell_log.c +++ b/src/host/layer23/src/misc/cell_log.c @@ -71,7 +71,7 @@ static uint16_t band_range[][2] = {{0, 124}, {512, 885}, {955, 1023}, {0, 0}}; #define INFO_FLG_SI4 128
static struct osmocom_ms *ms; -static struct timer_list timer; +static struct osmo_timer_list timer;
static struct pm_info { uint16_t flags; @@ -233,8 +233,8 @@ static void timeout_cb(void *arg)
static void stop_timer(void) { - if (bsc_timer_pending(&timer)) - bsc_del_timer(&timer); + if (osmo_timer_pending(&timer)) + osmo_timer_del(&timer); }
static void start_timer(int sec, int micro) @@ -242,7 +242,7 @@ static void start_timer(int sec, int micro) stop_timer(); timer.cb = timeout_cb; timer.data = ms; - bsc_schedule_timer(&timer, sec, micro); + osmo_timer_schedule(&timer, sec, micro); }
static void start_rach(void) diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index c05469d..2bd4f9c 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -426,15 +426,15 @@ static void start_plmn_timer(struct gsm322_plmn *plmn, int secs) secs / 60); plmn->timer.cb = plmn_timer_timeout; plmn->timer.data = plmn; - bsc_schedule_timer(&plmn->timer, secs, 0); + osmo_timer_schedule(&plmn->timer, secs, 0); }
/* stop plmn search timer */ static void stop_plmn_timer(struct gsm322_plmn *plmn) { - if (bsc_timer_pending(&plmn->timer)) { + if (osmo_timer_pending(&plmn->timer)) { LOGP(DPLMN, LOGL_INFO, "Stopping pending timer.\n"); - bsc_del_timer(&plmn->timer); + osmo_timer_del(&plmn->timer); } }
@@ -444,15 +444,15 @@ void start_cs_timer(struct gsm322_cellsel *cs, int sec, int micro) LOGP(DCS, LOGL_DEBUG, "Starting CS timer with %d seconds.\n", sec); cs->timer.cb = gsm322_cs_timeout; cs->timer.data = cs; - bsc_schedule_timer(&cs->timer, sec, micro); + osmo_timer_schedule(&cs->timer, sec, micro); }
/* stop cell selection timer */ static void stop_cs_timer(struct gsm322_cellsel *cs) { - if (bsc_timer_pending(&cs->timer)) { + if (osmo_timer_pending(&cs->timer)) { LOGP(DCS, LOGL_DEBUG, "stopping pending CS timer.\n"); - bsc_del_timer(&cs->timer); + osmo_timer_del(&cs->timer); } }
diff --git a/src/host/layer23/src/mobile/gsm48_cc.c b/src/host/layer23/src/mobile/gsm48_cc.c index b881205..5abf3f8 100644 --- a/src/host/layer23/src/mobile/gsm48_cc.c +++ b/src/host/layer23/src/mobile/gsm48_cc.c @@ -338,17 +338,17 @@ static void gsm48_start_cc_timer(struct gsm_trans *trans, int current, sec); trans->cc.timer.cb = gsm48_cc_timeout; trans->cc.timer.data = trans; - bsc_schedule_timer(&trans->cc.timer, sec, micro); + osmo_timer_schedule(&trans->cc.timer, sec, micro); trans->cc.Tcurrent = current; }
/* stop various timers */ static void gsm48_stop_cc_timer(struct gsm_trans *trans) { - if (bsc_timer_pending(&trans->cc.timer)) { + if (osmo_timer_pending(&trans->cc.timer)) { LOGP(DCC, LOGL_INFO, "stopping pending timer T%x\n", trans->cc.Tcurrent); - bsc_del_timer(&trans->cc.timer); + osmo_timer_del(&trans->cc.timer); trans->cc.Tcurrent = 0; } } diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index bf5bbc2..140750a 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -382,7 +382,7 @@ static void start_mm_t3210(struct gsm48_mmlayer *mm) "seconds\n", GSM_T3210_MS); mm->t3210.cb = timeout_mm_t3210; mm->t3210.data = mm; - bsc_schedule_timer(&mm->t3210, GSM_T3210_MS); + osmo_timer_schedule(&mm->t3210, GSM_T3210_MS); }
static void start_mm_t3211(struct gsm48_mmlayer *mm) @@ -391,7 +391,7 @@ static void start_mm_t3211(struct gsm48_mmlayer *mm) "%d.%d seconds\n", GSM_T3211_MS); mm->t3211.cb = timeout_mm_t3211; mm->t3211.data = mm; - bsc_schedule_timer(&mm->t3211, GSM_T3211_MS); + osmo_timer_schedule(&mm->t3211, GSM_T3211_MS); }
static void start_mm_t3212(struct gsm48_mmlayer *mm, int sec) @@ -404,7 +404,7 @@ static void start_mm_t3212(struct gsm48_mmlayer *mm, int sec) "%d seconds\n", sec); mm->t3212.cb = timeout_mm_t3212; mm->t3212.data = mm; - bsc_schedule_timer(&mm->t3212, sec, 0); + osmo_timer_schedule(&mm->t3212, sec, 0); }
static void start_mm_t3213(struct gsm48_mmlayer *mm) @@ -413,7 +413,7 @@ static void start_mm_t3213(struct gsm48_mmlayer *mm) "%d.%d seconds\n", GSM_T3213_MS); mm->t3213.cb = timeout_mm_t3213; mm->t3213.data = mm; - bsc_schedule_timer(&mm->t3213, GSM_T3213_MS); + osmo_timer_schedule(&mm->t3213, GSM_T3213_MS); }
static void start_mm_t3220(struct gsm48_mmlayer *mm) @@ -422,7 +422,7 @@ static void start_mm_t3220(struct gsm48_mmlayer *mm) "%d.%d seconds\n", GSM_T3220_MS); mm->t3220.cb = timeout_mm_t3220; mm->t3220.data = mm; - bsc_schedule_timer(&mm->t3220, GSM_T3220_MS); + osmo_timer_schedule(&mm->t3220, GSM_T3220_MS); }
static void start_mm_t3230(struct gsm48_mmlayer *mm) @@ -431,7 +431,7 @@ static void start_mm_t3230(struct gsm48_mmlayer *mm) "%d.%d seconds\n", GSM_T3230_MS); mm->t3230.cb = timeout_mm_t3230; mm->t3230.data = mm; - bsc_schedule_timer(&mm->t3230, GSM_T3230_MS); + osmo_timer_schedule(&mm->t3230, GSM_T3230_MS); }
static void start_mm_t3240(struct gsm48_mmlayer *mm) @@ -440,69 +440,69 @@ static void start_mm_t3240(struct gsm48_mmlayer *mm) "seconds\n", GSM_T3240_MS); mm->t3240.cb = timeout_mm_t3240; mm->t3240.data = mm; - bsc_schedule_timer(&mm->t3240, GSM_T3240_MS); + osmo_timer_schedule(&mm->t3240, GSM_T3240_MS); }
static void stop_mm_t3210(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3210)) { + if (osmo_timer_pending(&mm->t3210)) { LOGP(DMM, LOGL_INFO, "stopping pending (loc. upd. timeout) " "timer T3210\n"); - bsc_del_timer(&mm->t3210); + osmo_timer_del(&mm->t3210); } }
static void stop_mm_t3211(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3211)) { + if (osmo_timer_pending(&mm->t3211)) { LOGP(DMM, LOGL_INFO, "stopping pending (loc. upd. retry " "delay) timer T3211\n"); - bsc_del_timer(&mm->t3211); + osmo_timer_del(&mm->t3211); } }
static void stop_mm_t3212(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3212)) { + if (osmo_timer_pending(&mm->t3212)) { LOGP(DMM, LOGL_INFO, "stopping pending (periodic loc. upd. " "delay) timer T3212\n"); - bsc_del_timer(&mm->t3212); + osmo_timer_del(&mm->t3212); } }
static void stop_mm_t3213(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3213)) { + if (osmo_timer_pending(&mm->t3213)) { LOGP(DMM, LOGL_INFO, "stopping pending (delay after RA " "failure) timer T3213\n"); - bsc_del_timer(&mm->t3213); + osmo_timer_del(&mm->t3213); } }
static void stop_mm_t3220(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3220)) { + if (osmo_timer_pending(&mm->t3220)) { LOGP(DMM, LOGL_INFO, "stopping pending (IMSI detach keepalive) " "timer T3220\n"); - bsc_del_timer(&mm->t3220); + osmo_timer_del(&mm->t3220); } }
static void stop_mm_t3230(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3230)) { + if (osmo_timer_pending(&mm->t3230)) { LOGP(DMM, LOGL_INFO, "stopping pending (MM connection timeout) " "timer T3230\n"); - bsc_del_timer(&mm->t3230); + osmo_timer_del(&mm->t3230); } }
static void stop_mm_t3240(struct gsm48_mmlayer *mm) { - if (bsc_timer_pending(&mm->t3240)) { + if (osmo_timer_pending(&mm->t3240)) { LOGP(DMM, LOGL_INFO, "stopping pending (RR release timeout) " "timer T3240\n"); - bsc_del_timer(&mm->t3240); + osmo_timer_del(&mm->t3240); } }
@@ -920,7 +920,7 @@ static void new_mm_state(struct gsm48_mmlayer *mm, int state, int substate) && (substate == GSM48_MM_SST_NORMAL_SERVICE || substate == GSM48_MM_SST_ATTEMPT_UPDATE)) { /* start periodic location update timer */ - if (!bsc_timer_pending(&mm->t3212)) + if (!osmo_timer_pending(&mm->t3212)) start_mm_t3212(mm, mm->t3212_value); /* perform pending location update */ if (mm->lupd_retry) { @@ -1954,7 +1954,7 @@ static int gsm48_mm_sysinfo(struct osmocom_ms *ms, struct msgb *msg)
/* new periodic location update timer timeout */ if (s->t3212 && s->t3212 != mm->t3212_value) { - if (bsc_timer_pending(&mm->t3212)) { + if (osmo_timer_pending(&mm->t3212)) { int t; struct timeval current_time;
@@ -3865,7 +3865,7 @@ static int gsm48_mm_data_ind(struct osmocom_ms *ms, struct msgb *msg) stop_mm_t3212(mm); /* 4.4.2 */
/* 11.2 re-start pending RR release timer */ - if (bsc_timer_pending(&mm->t3240)) { + if (osmo_timer_pending(&mm->t3240)) { stop_mm_t3240(mm); start_mm_t3240(mm); } diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index b2ab2e1..c1c27f4 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -711,7 +711,7 @@ static void start_rr_t_meas(struct gsm48_rrlayer *rr, int sec, int micro) { rr->t_meas.cb = timeout_rr_meas; rr->t_meas.data = rr; - bsc_schedule_timer(&rr->t_meas, sec, micro); + osmo_timer_schedule(&rr->t_meas, sec, micro); }
static void start_rr_t_rel_wait(struct gsm48_rrlayer *rr, int sec, int micro) @@ -720,7 +720,7 @@ static void start_rr_t_rel_wait(struct gsm48_rrlayer *rr, int sec, int micro) micro / 1000); rr->t_rel_wait.cb = timeout_rr_t_rel_wait; rr->t_rel_wait.data = rr; - bsc_schedule_timer(&rr->t_rel_wait, sec, micro); + osmo_timer_schedule(&rr->t_rel_wait, sec, micro); }
static void start_rr_t_starting(struct gsm48_rrlayer *rr, int sec, int micro) @@ -729,7 +729,7 @@ static void start_rr_t_starting(struct gsm48_rrlayer *rr, int sec, int micro) micro / 1000); rr->t_starting.cb = timeout_rr_t_starting; rr->t_starting.data = rr; - bsc_schedule_timer(&rr->t_starting, sec, micro); + osmo_timer_schedule(&rr->t_starting, sec, micro); }
static void start_rr_t3110(struct gsm48_rrlayer *rr, int sec, int micro) @@ -738,7 +738,7 @@ static void start_rr_t3110(struct gsm48_rrlayer *rr, int sec, int micro) micro / 1000); rr->t3110.cb = timeout_rr_t3110; rr->t3110.data = rr; - bsc_schedule_timer(&rr->t3110, sec, micro); + osmo_timer_schedule(&rr->t3110, sec, micro); }
static void start_rr_t3122(struct gsm48_rrlayer *rr, int sec, int micro) @@ -747,7 +747,7 @@ static void start_rr_t3122(struct gsm48_rrlayer *rr, int sec, int micro) micro / 1000); rr->t3122.cb = timeout_rr_t3122; rr->t3122.data = rr; - bsc_schedule_timer(&rr->t3122, sec, micro); + osmo_timer_schedule(&rr->t3122, sec, micro); }
static void start_rr_t3124(struct gsm48_rrlayer *rr, int sec, int micro) @@ -756,7 +756,7 @@ static void start_rr_t3124(struct gsm48_rrlayer *rr, int sec, int micro) micro / 1000); rr->t3124.cb = timeout_rr_t3124; rr->t3124.data = rr; - bsc_schedule_timer(&rr->t3124, sec, micro); + osmo_timer_schedule(&rr->t3124, sec, micro); }
static void start_rr_t3126(struct gsm48_rrlayer *rr, int sec, int micro) @@ -765,62 +765,62 @@ static void start_rr_t3126(struct gsm48_rrlayer *rr, int sec, int micro) micro / 1000); rr->t3126.cb = timeout_rr_t3126; rr->t3126.data = rr; - bsc_schedule_timer(&rr->t3126, sec, micro); + osmo_timer_schedule(&rr->t3126, sec, micro); }
static void stop_rr_t_meas(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t_meas)) { + if (osmo_timer_pending(&rr->t_meas)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T_meas\n"); - bsc_del_timer(&rr->t_meas); + osmo_timer_del(&rr->t_meas); } }
static void stop_rr_t_starting(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t_starting)) { + if (osmo_timer_pending(&rr->t_starting)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T_starting\n"); - bsc_del_timer(&rr->t_starting); + osmo_timer_del(&rr->t_starting); } }
static void stop_rr_t_rel_wait(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t_rel_wait)) { + if (osmo_timer_pending(&rr->t_rel_wait)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T_rel_wait\n"); - bsc_del_timer(&rr->t_rel_wait); + osmo_timer_del(&rr->t_rel_wait); } }
static void stop_rr_t3110(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t3110)) { + if (osmo_timer_pending(&rr->t3110)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T3110\n"); - bsc_del_timer(&rr->t3110); + osmo_timer_del(&rr->t3110); } }
static void stop_rr_t3122(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t3122)) { + if (osmo_timer_pending(&rr->t3122)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T3122\n"); - bsc_del_timer(&rr->t3122); + osmo_timer_del(&rr->t3122); } }
static void stop_rr_t3124(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t3124)) { + if (osmo_timer_pending(&rr->t3124)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T3124\n"); - bsc_del_timer(&rr->t3124); + osmo_timer_del(&rr->t3124); } }
static void stop_rr_t3126(struct gsm48_rrlayer *rr) { - if (bsc_timer_pending(&rr->t3126)) { + if (osmo_timer_pending(&rr->t3126)) { LOGP(DRR, LOGL_INFO, "stopping pending timer T3126\n"); - bsc_del_timer(&rr->t3126); + osmo_timer_del(&rr->t3126); } }
@@ -1454,7 +1454,7 @@ fail: if (!rr->n_chan_req) { LOGP(DRR, LOGL_INFO, "Done with sending RANDOM ACCESS " "bursts\n"); - if (!bsc_timer_pending(&rr->t3126)) + if (!osmo_timer_pending(&rr->t3126)) start_rr_t3126(rr, 5, 0); /* TODO improve! */ return 0; } @@ -2494,7 +2494,7 @@ static int gsm48_rr_rx_imm_ass_rej(struct osmocom_ms *ms, struct msgb *msg) if (t3122_value) start_rr_t3122(rr, t3122_value, 0); /* start timer 3126 if not already */ - if (!bsc_timer_pending(&rr->t3126)) + if (!osmo_timer_pending(&rr->t3126)) start_rr_t3126(rr, 5, 0); /* TODO improve! */ /* stop assignmnet requests */ rr->n_chan_req = 0; @@ -4232,7 +4232,7 @@ static int gsm48_rr_est_req(struct osmocom_ms *ms, struct msgb *msg) uint16_t acc_class;
/* 3.3.1.1.3.2 */ - if (bsc_timer_pending(&rr->t3122)) { + if (osmo_timer_pending(&rr->t3122)) { if (rrh->cause != RR_EST_CAUSE_EMERGENCY) { LOGP(DRR, LOGL_INFO, "T3122 running, rejecting!\n"); cause = RR_REL_CAUSE_T3122; @@ -5044,7 +5044,7 @@ static int gsm48_rr_rand_acc_cnf_dedicated(struct osmocom_ms *ms, struct msgb *m }
/* start timer for sending next HANDOVER ACCESS bursts afterwards */ - if (!bsc_timer_pending(&rr->t3124)) { + if (!osmo_timer_pending(&rr->t3124)) { if (allocated channel is SDCCH) start_rr_t3124(rr, GSM_T3124_675); else diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c index 4d47be4..8d3abe6 100644 --- a/src/host/layer23/src/mobile/mnccms.c +++ b/src/host/layer23/src/mobile/mnccms.c @@ -51,14 +51,14 @@ static void start_dtmf_timer(struct gsm_call *call, uint16_t ms) LOGP(DCC, LOGL_INFO, "starting DTMF timer %d ms\n", ms); call->dtmf_timer.cb = timeout_dtmf; call->dtmf_timer.data = call; - bsc_schedule_timer(&call->dtmf_timer, 0, ms * 1000); + osmo_timer_schedule(&call->dtmf_timer, 0, ms * 1000); }
static void stop_dtmf_timer(struct gsm_call *call) { - if (bsc_timer_pending(&call->dtmf_timer)) { + if (osmo_timer_pending(&call->dtmf_timer)) { LOGP(DCC, LOGL_INFO, "stopping pending DTMF timer\n"); - bsc_del_timer(&call->dtmf_timer); + osmo_timer_del(&call->dtmf_timer); } }
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c index 2c42799..c8ea38a 100644 --- a/src/host/osmocon/osmocon.c +++ b/src/host/osmocon/osmocon.c @@ -164,7 +164,7 @@ struct dnload {
static struct dnload dnload; -static struct timer_list tick_timer; +static struct osmo_timer_list tick_timer;
/* Compal ramloader specific */ static const uint8_t phone_prompt1[] = { 0x1b, 0xf6, 0x02, 0x00, 0x41, 0x01, 0x40 }; @@ -290,7 +290,7 @@ static void beacon_timer_cb(void *p) if (!(rc == sizeof(romload_ident_cmd))) printf("Error sending identification beacon\n");
- bsc_schedule_timer(p, 0, dnload.beacon_interval); + osmo_timer_schedule(p, 0, dnload.beacon_interval); } }
@@ -305,7 +305,7 @@ static void mtk_timer_cb(void *p) if (!(rc == 1)) printf("Error sending identification beacon\n");
- bsc_schedule_timer(p, 0, dnload.beacon_interval); + osmo_timer_schedule(p, 0, dnload.beacon_interval); } }
@@ -889,7 +889,7 @@ static int handle_read(void) serial_set_baudrate(ROMLOAD_INIT_BAUDRATE); tick_timer.cb = &beacon_timer_cb; tick_timer.data = &tick_timer; - bsc_schedule_timer(&tick_timer, 0, dnload.beacon_interval); + osmo_timer_schedule(&tick_timer, 0, dnload.beacon_interval); } } else if (!memcmp(buffer, phone_nack, sizeof(phone_nack))) { printf("Received DOWNLOAD NACK from phone, something went" @@ -1004,7 +1004,7 @@ static int handle_read_romload(void) "something went wrong, aborting\n"); serial_set_baudrate(ROMLOAD_INIT_BAUDRATE); dnload.romload_state = WAITING_IDENTIFICATION; - bsc_schedule_timer(&tick_timer, 0, dnload.beacon_interval); + osmo_timer_schedule(&tick_timer, 0, dnload.beacon_interval); } break; case WAITING_CHECKSUM_ACK: @@ -1026,7 +1026,7 @@ static int handle_read_romload(void) "match ours, aborting\n", ~buffer[2]); serial_set_baudrate(ROMLOAD_INIT_BAUDRATE); dnload.romload_state = WAITING_IDENTIFICATION; - bsc_schedule_timer(&tick_timer, 0, dnload.beacon_interval); + osmo_timer_schedule(&tick_timer, 0, dnload.beacon_interval); bufptr -= 1; } break; @@ -1043,7 +1043,7 @@ static int handle_read_romload(void) printf("Received branch nack, aborting\n"); serial_set_baudrate(ROMLOAD_INIT_BAUDRATE); dnload.romload_state = WAITING_IDENTIFICATION; - bsc_schedule_timer(&tick_timer, 0, dnload.beacon_interval); + osmo_timer_schedule(&tick_timer, 0, dnload.beacon_interval); } break; default: @@ -1536,14 +1536,14 @@ int main(int argc, char **argv) serial_set_baudrate(ROMLOAD_INIT_BAUDRATE); tick_timer.cb = &beacon_timer_cb; tick_timer.data = &tick_timer; - bsc_schedule_timer(&tick_timer, 0, dnload.beacon_interval); + osmo_timer_schedule(&tick_timer, 0, dnload.beacon_interval); } else if (dnload.mode == MODE_MTK) { tmp_load_address = MTK_ADDRESS; serial_set_baudrate(MTK_INIT_BAUDRATE); tick_timer.cb = &mtk_timer_cb; tick_timer.data = &tick_timer; - bsc_schedule_timer(&tick_timer, 0, dnload.beacon_interval); + osmo_timer_schedule(&tick_timer, 0, dnload.beacon_interval); }
dnload.load_address[0] = (tmp_load_address >> 24) & 0xff; diff --git a/src/host/osmocon/osmoload.c b/src/host/osmocon/osmoload.c index 6663a1e..6a31dc1 100644 --- a/src/host/osmocon/osmoload.c +++ b/src/host/osmocon/osmoload.c @@ -84,7 +84,7 @@ static struct { uint8_t command;
/* general timeout */ - struct timer_list timeout; + struct osmo_timer_list timeout;
/* binary i/o for firmware images */ FILE *binfile; @@ -661,7 +661,7 @@ loader_do_memload() { return; }
- bsc_schedule_timer(&osmoload.timeout, 0, 500000); + osmo_timer_schedule(&osmoload.timeout, 0, 500000);
uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
@@ -701,7 +701,7 @@ loader_do_fprogram() { return; }
- bsc_schedule_timer(&osmoload.timeout, 0, 10000000); + osmo_timer_schedule(&osmoload.timeout, 0, 10000000);
uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
@@ -1143,7 +1143,7 @@ loader_command(char *name, int cmdc, char **cmdv) {
if(osmoload.state == STATE_QUERY_PENDING) { osmoload.timeout.cb = &query_timeout; - bsc_schedule_timer(&osmoload.timeout, 0, 5000000); + osmo_timer_schedule(&osmoload.timeout, 0, 5000000); } if(osmoload.state == STATE_LOAD_IN_PROGRESS) { osmoload.timeout.cb = &memop_timeout; diff --git a/src/target/firmware/comm/timer.c b/src/target/firmware/comm/timer.c index 54abc79..6a649ae 100644 --- a/src/target/firmware/comm/timer.c +++ b/src/target/firmware/comm/timer.c @@ -41,9 +41,9 @@ unsigned long volatile jiffies; ((long)(b) - (long)(a) < 0)) #define time_before(a,b) time_after(b,a)
-void add_timer(struct timer_list *timer) +void add_timer(struct osmo_timer_list *timer) { - struct timer_list *list_timer; + struct osmo_timer_list *list_timer;
/* TODO: Optimize and remember the closest item... */ timer->active = 1; @@ -57,13 +57,13 @@ void add_timer(struct timer_list *timer) llist_add(&timer->entry, &timer_list); }
-void schedule_timer(struct timer_list *timer, int milliseconds) +void schedule_timer(struct osmo_timer_list *timer, int milliseconds) { timer->expires = jiffies + ((milliseconds * TIMER_HZ) / 1000); add_timer(timer); }
-void del_timer(struct timer_list *timer) +void del_timer(struct osmo_timer_list *timer) { if (timer->in_list) { timer->active = 0; @@ -72,7 +72,7 @@ void del_timer(struct timer_list *timer) } }
-int timer_pending(struct timer_list *timer) +int timer_pending(struct osmo_timer_list *timer) { return timer->active; } @@ -113,7 +113,7 @@ struct timeval *nearest_timer() */ void prepare_timers() { - struct timer_list *timer, *nearest_timer = NULL; + struct osmo_timer_list *timer, *nearest_timer = NULL; llist_for_each_entry(timer, &timer_list, entry) { if (!nearest_timer || time_before(timer->expires, nearest_timer->expires)) { nearest_timer = timer; @@ -133,7 +133,7 @@ void prepare_timers() */ int update_timers(void) { - struct timer_list *timer, *tmp; + struct osmo_timer_list *timer, *tmp; int work = 0;
/* @@ -178,7 +178,7 @@ restart:
int timer_check(void) { - struct timer_list *timer; + struct osmo_timer_list *timer; int i = 0;
llist_for_each_entry(timer, &timer_list, entry) { diff --git a/src/target/firmware/include/comm/timer.h b/src/target/firmware/include/comm/timer.h index 42bf734..db7d1a5 100644 --- a/src/target/firmware/include/comm/timer.h +++ b/src/target/firmware/include/comm/timer.h @@ -27,7 +27,7 @@
/** * Timer management: - * - Create a struct timer_list + * - Create a struct osmo_timer_list * - Fill out timeout and use add_timer or * use schedule_timer to schedule a timer in * x seconds and microseconds from now... @@ -41,7 +41,7 @@ * the timers. * */ -struct timer_list { +struct osmo_timer_list { struct llist_head entry; unsigned long expires;
@@ -58,10 +58,10 @@ extern unsigned long volatile jiffies; /** * timer management */ -void add_timer(struct timer_list *timer); -void schedule_timer(struct timer_list *timer, int miliseconds); -void del_timer(struct timer_list *timer); -int timer_pending(struct timer_list *timer); +void add_timer(struct osmo_timer_list *timer); +void schedule_timer(struct osmo_timer_list *timer, int miliseconds); +void del_timer(struct osmo_timer_list *timer); +int timer_pending(struct osmo_timer_list *timer);
/**
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g --- src/host/layer23/src/common/gps.c | 14 +++++++------- src/host/layer23/src/common/l1l2_interface.c | 8 ++++---- src/host/layer23/src/common/main.c | 2 +- src/host/layer23/src/common/sap_interface.c | 8 ++++---- src/host/layer23/src/mobile/main.c | 2 +- src/host/osmocon/osmocon.c | 24 ++++++++++++------------ src/host/osmocon/osmoload.c | 10 +++++----- 7 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/src/host/layer23/src/common/gps.c b/src/host/layer23/src/common/gps.c index dba93fb..38aae2c 100644 --- a/src/host/layer23/src/common/gps.c +++ b/src/host/layer23/src/common/gps.c @@ -52,13 +52,13 @@ struct osmo_gps g = { 0,0 };
-static struct bsc_fd gps_bfd; +static struct osmo_fd gps_bfd;
#ifdef _HAVE_GPSD
static struct gps_data_t* gdata;
-int osmo_gpsd_cb(struct bsc_fd *bfd, unsigned int what) +int osmo_gpsd_cb(struct osmo_fd *bfd, unsigned int what) { struct tm *tm; unsigned diff = 0; @@ -125,7 +125,7 @@ int osmo_gpsd_open(void) return -1; }
- bsc_register_fd(&gps_bfd); + osmo_fd_register(&gps_bfd);
return 0; } @@ -137,7 +137,7 @@ void osmo_gpsd_close(void)
LOGP(DGPS, LOGL_INFO, "Disconnecting from gpsd\n");
- bsc_unregister_fd(&gps_bfd); + osmo_fd_unregister(&gps_bfd);
gps_close(gdata); gps_bfd.fd = -1; /* -1 or 0 indicates: 'close' */ @@ -242,7 +242,7 @@ static int nmea_checksum(char *line) return (strtoul(line+1, NULL, 16) == checksum); }
-int osmo_serialgps_cb(struct bsc_fd *bfd, unsigned int what) +int osmo_serialgps_cb(struct osmo_fd *bfd, unsigned int what) { char buff[128]; static char line[128]; @@ -323,7 +323,7 @@ int osmo_serialgps_open(void) printf("Failed to set termios for GPS\n"); }
- bsc_register_fd(&gps_bfd); + osmo_fd_register(&gps_bfd);
return 0; } @@ -335,7 +335,7 @@ void osmo_serialgps_close(void)
LOGP(DGPS, LOGL_INFO, "Close GPS device\n");
- bsc_unregister_fd(&gps_bfd); + osmo_fd_unregister(&gps_bfd);
if (isatty(gps_bfd.fd)) tcsetattr(gps_bfd.fd, TCSANOW, &gps_old_termios); diff --git a/src/host/layer23/src/common/l1l2_interface.c b/src/host/layer23/src/common/l1l2_interface.c index 23e1ef2..3272359 100644 --- a/src/host/layer23/src/common/l1l2_interface.c +++ b/src/host/layer23/src/common/l1l2_interface.c @@ -42,7 +42,7 @@ #define GSM_L2_LENGTH 256 #define GSM_L2_HEADROOM 32
-static int layer2_read(struct bsc_fd *fd) +static int layer2_read(struct osmo_fd *fd) { struct msgb *msg; u_int16_t len; @@ -86,7 +86,7 @@ static int layer2_read(struct bsc_fd *fd) return 0; }
-static int layer2_write(struct bsc_fd *fd, struct msgb *msg) +static int layer2_write(struct osmo_fd *fd, struct msgb *msg) { int rc;
@@ -132,7 +132,7 @@ int layer2_open(struct osmocom_ms *ms, const char *socket_path) ms->l2_wq.read_cb = layer2_read; ms->l2_wq.write_cb = layer2_write;
- rc = bsc_register_fd(&ms->l2_wq.bfd); + rc = osmo_fd_register(&ms->l2_wq.bfd); if (rc != 0) { fprintf(stderr, "Failed to register fd.\n"); close(ms->l2_wq.bfd.fd); @@ -149,7 +149,7 @@ int layer2_close(struct osmocom_ms *ms)
close(ms->l2_wq.bfd.fd); ms->l2_wq.bfd.fd = -1; - bsc_unregister_fd(&ms->l2_wq.bfd); + osmo_fd_unregister(&ms->l2_wq.bfd);
return 0; } diff --git a/src/host/layer23/src/common/main.c b/src/host/layer23/src/common/main.c index 61513ea..40e6a07 100644 --- a/src/host/layer23/src/common/main.c +++ b/src/host/layer23/src/common/main.c @@ -278,7 +278,7 @@ int main(int argc, char **argv) while (!quit) { if (l23_app_work) l23_app_work(ms); - bsc_select_main(0); + osmo_select_main(0); }
return 0; diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c index 54aa635..4d465f0 100644 --- a/src/host/layer23/src/common/sap_interface.c +++ b/src/host/layer23/src/common/sap_interface.c @@ -42,7 +42,7 @@ #define GSM_SAP_LENGTH 300 #define GSM_SAP_HEADROOM 32
-static int sap_read(struct bsc_fd *fd) +static int sap_read(struct osmo_fd *fd) { struct msgb *msg; u_int16_t len; @@ -88,7 +88,7 @@ static int sap_read(struct bsc_fd *fd) return 0; }
-static int sap_write(struct bsc_fd *fd, struct msgb *msg) +static int sap_write(struct osmo_fd *fd, struct msgb *msg) { int rc;
@@ -133,7 +133,7 @@ int sap_open(struct osmocom_ms *ms, const char *socket_path) ms->sap_wq.read_cb = sap_read; ms->sap_wq.write_cb = sap_write;
- rc = bsc_register_fd(&ms->sap_wq.bfd); + rc = osmo_fd_register(&ms->sap_wq.bfd); if (rc != 0) { fprintf(stderr, "Failed to register fd.\n"); return rc; @@ -149,7 +149,7 @@ int sap_close(struct osmocom_ms *ms)
close(ms->sap_wq.bfd.fd); ms->sap_wq.bfd.fd = -1; - bsc_unregister_fd(&ms->sap_wq.bfd); + osmo_fd_unregister(&ms->sap_wq.bfd);
return 0; } diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 4765995..1f423a2 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -202,7 +202,7 @@ int main(int argc, char **argv) l23_app_work(&quit); if (quit && llist_empty(&ms_list)) break; - bsc_select_main(0); + osmo_select_main(0); }
l23_app_exit(); diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c index c8ea38a..ab977c1 100644 --- a/src/host/osmocon/osmocon.c +++ b/src/host/osmocon/osmocon.c @@ -69,14 +69,14 @@ struct tool_server *tool_server_for_dlci[256]; struct tool_connection { struct tool_server *server; struct llist_head entry; - struct bsc_fd fd; + struct osmo_fd fd; };
/** * server for a tool */ struct tool_server { - struct bsc_fd bfd; + struct osmo_fd bfd; uint8_t dlci; struct llist_head connections; }; @@ -129,7 +129,7 @@ struct dnload { enum romload_state romload_state; enum mtk_state mtk_state; enum dnload_mode mode; - struct bsc_fd serial_fd; + struct osmo_fd serial_fd; char *filename; char *chainload_filename;
@@ -1192,7 +1192,7 @@ static int handle_read_mtk(void) return nbytes; }
-static int serial_read(struct bsc_fd *fd, unsigned int flags) +static int serial_read(struct osmo_fd *fd, unsigned int flags) { int rc; if (flags & BSC_FD_READ) { @@ -1264,7 +1264,7 @@ static int version(const char *name) exit(2); }
-static int un_tool_read(struct bsc_fd *fd, unsigned int flags) +static int un_tool_read(struct osmo_fd *fd, unsigned int flags) { int rc, c; uint16_t length = 0xffff; @@ -1313,14 +1313,14 @@ static int un_tool_read(struct bsc_fd *fd, unsigned int flags) close:
close(fd->fd); - bsc_unregister_fd(fd); + osmo_fd_unregister(fd); llist_del(&con->entry); talloc_free(con); return -1; }
/* accept a new connection */ -static int tool_accept(struct bsc_fd *fd, unsigned int flags) +static int tool_accept(struct osmo_fd *fd, unsigned int flags) { struct tool_server *srv = (struct tool_server *)fd->data; struct tool_connection *con; @@ -1347,7 +1347,7 @@ static int tool_accept(struct bsc_fd *fd, unsigned int flags) con->fd.when = BSC_FD_READ; con->fd.cb = un_tool_read; con->fd.data = con; - if (bsc_register_fd(&con->fd) != 0) { + if (osmo_fd_register(&con->fd) != 0) { fprintf(stderr, "Failed to register the fd.\n"); return -1; } @@ -1363,7 +1363,7 @@ static int register_tool_server(struct tool_server *ts, const char *path, uint8_t dlci) { - struct bsc_fd *bfd = &ts->bfd; + struct osmo_fd *bfd = &ts->bfd; struct sockaddr_un local; unsigned int namelen; int rc; @@ -1415,7 +1415,7 @@ static int register_tool_server(struct tool_server *ts,
sercomm_register_rx_cb(dlci, hdlc_tool_cb);
- if (bsc_register_fd(bfd) != 0) { + if (osmo_fd_register(bfd) != 0) { fprintf(stderr, "Failed to register the bfd.\n"); return -1; } @@ -1503,7 +1503,7 @@ int main(int argc, char **argv) exit(1); }
- if (bsc_register_fd(&dnload.serial_fd) != 0) { + if (osmo_fd_register(&dnload.serial_fd) != 0) { fprintf(stderr, "Failed to register the serial.\n"); exit(1); } @@ -1552,7 +1552,7 @@ int main(int argc, char **argv) dnload.load_address[3] = tmp_load_address & 0xff;
while (1) - bsc_select_main(0); + osmo_select_main(0);
close(dnload.serial_fd.fd);
diff --git a/src/host/osmocon/osmoload.c b/src/host/osmocon/osmoload.c index 6a31dc1..1471a2e 100644 --- a/src/host/osmocon/osmoload.c +++ b/src/host/osmocon/osmoload.c @@ -48,7 +48,7 @@
#define DEFAULT_SOCKET "/tmp/osmocom_loader"
-static struct bsc_fd connection; +static struct osmo_fd connection;
enum { STATE_INIT, @@ -451,7 +451,7 @@ loader_handle_reply(struct msgb *msg) { }
static int -loader_read_cb(struct bsc_fd *fd, unsigned int flags) { +loader_read_cb(struct osmo_fd *fd, unsigned int flags) { struct msgb *msg; u_int16_t len; int rc; @@ -494,7 +494,7 @@ static void loader_connect(const char *socket_path) { int rc; struct sockaddr_un local; - struct bsc_fd *conn = &connection; + struct osmo_fd *conn = &connection;
local.sun_family = AF_UNIX; strncpy(local.sun_path, socket_path, sizeof(local.sun_path)); @@ -517,7 +517,7 @@ loader_connect(const char *socket_path) { conn->cb = loader_read_cb; conn->data = NULL;
- if (bsc_register_fd(conn) != 0) { + if (osmo_fd_register(conn) != 0) { fprintf(stderr, "Failed to register fd.\n"); exit(1); } @@ -1205,7 +1205,7 @@ main(int argc, char **argv) { loader_command(argv[0], argc - optind, argv + optind);
while(!osmoload.quit) { - bsc_select_main(0); + osmo_select_main(0); }
if(osmoload.binfile) {
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g --- src/host/layer23/src/common/l1ctl.c | 18 +++++++++--------- src/host/layer23/src/misc/app_bcch_scan.c | 2 +- src/host/layer23/src/misc/app_cbch_sniff.c | 2 +- src/host/layer23/src/misc/app_ccch_scan.c | 2 +- src/host/layer23/src/misc/bcch_scan.c | 2 +- src/host/layer23/src/misc/cell_log.c | 4 ++-- src/host/layer23/src/mobile/app_mobile.c | 12 ++++++------ src/host/layer23/src/mobile/main.c | 2 +- src/host/layer23/src/mobile/vty_interface.c | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c index f2714e6..a2fd865 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -92,7 +92,7 @@ static int rx_l1_fbsb_conf(struct osmocom_ms *ms, struct msgb *msg)
if (sb->result != 0) { LOGP(DL1C, LOGL_ERROR, "FBSB RESP: result=%u\n", sb->result); - dispatch_signal(SS_L1CTL, S_L1CTL_FBSB_ERR, ms); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_FBSB_ERR, ms); return 0; }
@@ -102,7 +102,7 @@ static int rx_l1_fbsb_conf(struct osmocom_ms *ms, struct msgb *msg) fr.ms = ms; fr.snr = dl->snr; fr.bsic = sb->bsic; - dispatch_signal(SS_L1CTL, S_L1CTL_FBSB_RESP, &fr); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_FBSB_RESP, &fr);
return 0; } @@ -177,7 +177,7 @@ static int rx_ph_data_ind(struct osmocom_ms *ms, struct msgb *msg) if (meas->dsc > 0) break; meas->ds_fail = 0; - dispatch_signal(SS_L1CTL, S_L1CTL_LOSS_IND, ms); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_LOSS_IND, ms); break; } } else { @@ -199,7 +199,7 @@ static int rx_ph_data_ind(struct osmocom_ms *ms, struct msgb *msg) if (meas->s > 0) break; meas->rl_fail = 0; - dispatch_signal(SS_L1CTL, S_L1CTL_LOSS_IND, ms); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_LOSS_IND, ms); break; } } @@ -656,7 +656,7 @@ int l1ctl_tx_reset_req(struct osmocom_ms *ms, uint8_t type) static int rx_l1_reset(struct osmocom_ms *ms) { LOGP(DL1C, LOGL_INFO, "Layer1 Reset indication\n"); - dispatch_signal(SS_L1CTL, S_L1CTL_RESET, ms); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_RESET, ms);
return 0; } @@ -674,7 +674,7 @@ static int rx_l1_pm_conf(struct osmocom_ms *ms, struct msgb *msg) mr.band_arfcn = ntohs(pmr->band_arfcn); mr.rx_lev = pmr->pm[0]; mr.ms = ms; - dispatch_signal(SS_L1CTL, S_L1CTL_PM_RES, &mr); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_PM_RES, &mr); } return 0; } @@ -697,7 +697,7 @@ static int rx_l1_ccch_mode_conf(struct osmocom_ms *ms, struct msgb *msg)
mc.ccch_mode = conf->ccch_mode; mc.ms = ms; - dispatch_signal(SS_L1CTL, S_L1CTL_CCCH_MODE_CONF, &mc); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_CCCH_MODE_CONF, &mc);
return 0; } @@ -720,7 +720,7 @@ static int rx_l1_tch_mode_conf(struct osmocom_ms *ms, struct msgb *msg)
mc.tch_mode = conf->tch_mode; mc.ms = ms; - dispatch_signal(SS_L1CTL, S_L1CTL_TCH_MODE_CONF, &mc); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_TCH_MODE_CONF, &mc);
return 0; } @@ -764,7 +764,7 @@ int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg) case L1CTL_PM_CONF: rc = rx_l1_pm_conf(ms, msg); if (l1h->flags & L1CTL_F_DONE) - dispatch_signal(SS_L1CTL, S_L1CTL_PM_DONE, ms); + osmo_signal_dispatch(SS_L1CTL, S_L1CTL_PM_DONE, ms); msgb_free(msg); break; case L1CTL_RACH_CONF: diff --git a/src/host/layer23/src/misc/app_bcch_scan.c b/src/host/layer23/src/misc/app_bcch_scan.c index 9a01694..3ad426d 100644 --- a/src/host/layer23/src/misc/app_bcch_scan.c +++ b/src/host/layer23/src/misc/app_bcch_scan.c @@ -54,7 +54,7 @@ int l23_app_init(struct osmocom_ms *ms) /* don't do layer3_init() as we don't want an actualy L3 */ fps_init(ms); l1ctl_tx_reset_req(ms, L1CTL_RES_T_FULL); - return register_signal_handler(SS_L1CTL, &signal_cb, NULL); + return osmo_signal_register_handler(SS_L1CTL, &signal_cb, NULL); }
static struct l23_app_info info = { diff --git a/src/host/layer23/src/misc/app_cbch_sniff.c b/src/host/layer23/src/misc/app_cbch_sniff.c index 77427fa..2df1e54 100644 --- a/src/host/layer23/src/misc/app_cbch_sniff.c +++ b/src/host/layer23/src/misc/app_cbch_sniff.c @@ -185,7 +185,7 @@ int l23_app_init(struct osmocom_ms *ms) /* FIXME: L1CTL_RES_T_FULL doesn't reset dedicated mode * (if previously set), so we release it here. */ l1ctl_tx_dm_rel_req(ms); - return register_signal_handler(SS_L1CTL, &signal_cb, NULL); + return osmo_signal_register_handler(SS_L1CTL, &signal_cb, NULL); }
static struct l23_app_info info = { diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c index 913ceca..02b5e47 100644 --- a/src/host/layer23/src/misc/app_ccch_scan.c +++ b/src/host/layer23/src/misc/app_ccch_scan.c @@ -465,7 +465,7 @@ static int signal_cb(unsigned int subsys, unsigned int signal,
int l23_app_init(struct osmocom_ms *ms) { - register_signal_handler(SS_L1CTL, &signal_cb, NULL); + osmo_signal_register_handler(SS_L1CTL, &signal_cb, NULL); l1ctl_tx_reset_req(ms, L1CTL_RES_T_FULL); return layer3_init(ms); } diff --git a/src/host/layer23/src/misc/bcch_scan.c b/src/host/layer23/src/misc/bcch_scan.c index fc88254..ddd0eea 100644 --- a/src/host/layer23/src/misc/bcch_scan.c +++ b/src/host/layer23/src/misc/bcch_scan.c @@ -314,5 +314,5 @@ int fps_start(struct osmocom_ms *ms)
int fps_init(void) { - return register_signal_handler(SS_L1CTL, &bscan_sig_cb, NULL); + return osmo_signal_register_handler(SS_L1CTL, &bscan_sig_cb, NULL); } diff --git a/src/host/layer23/src/misc/cell_log.c b/src/host/layer23/src/misc/cell_log.c index a1a764b..3f51f87 100644 --- a/src/host/layer23/src/misc/cell_log.c +++ b/src/host/layer23/src/misc/cell_log.c @@ -783,7 +783,7 @@ static int rcv_rsl(struct msgb *msg, struct osmocom_ms *ms) int scan_init(struct osmocom_ms *_ms) { ms = _ms; - register_signal_handler(SS_L1CTL, &signal_cb, NULL); + osmo_signal_register_handler(SS_L1CTL, &signal_cb, NULL); memset(&timer, 0, sizeof(timer)); osmol2_register_handler(ms, &rcv_rsl); g.enable = 1; @@ -812,7 +812,7 @@ int scan_exit(void) osmo_gps_close(); if (logfp) fclose(logfp); - unregister_signal_handler(SS_L1CTL, &signal_cb, NULL); + osmo_signal_unregister_handler(SS_L1CTL, &signal_cb, NULL); stop_timer();
return 0; diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 33fdde6..e37ac98 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -329,9 +329,9 @@ int l23_app_work(int *_quit) /* global exit */ int l23_app_exit(void) { - unregister_signal_handler(SS_L1CTL, &gsm322_l1_signal, NULL); - unregister_signal_handler(SS_L1CTL, &mobile_signal_cb, NULL); - unregister_signal_handler(SS_GLOBAL, &global_signal_cb, NULL); + osmo_signal_unregister_handler(SS_L1CTL, &gsm322_l1_signal, NULL); + osmo_signal_unregister_handler(SS_L1CTL, &mobile_signal_cb, NULL); + osmo_signal_unregister_handler(SS_GLOBAL, &global_signal_cb, NULL);
osmo_gps_close();
@@ -375,9 +375,9 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *), return rc; printf("VTY available on port %u.\n", vty_port);
- register_signal_handler(SS_GLOBAL, &global_signal_cb, NULL); - register_signal_handler(SS_L1CTL, &mobile_signal_cb, NULL); - register_signal_handler(SS_L1CTL, &gsm322_l1_signal, NULL); + osmo_signal_register_handler(SS_GLOBAL, &global_signal_cb, NULL); + osmo_signal_register_handler(SS_L1CTL, &mobile_signal_cb, NULL); + osmo_signal_register_handler(SS_L1CTL, &gsm322_l1_signal, NULL);
if (llist_empty(&ms_list)) { struct osmocom_ms *ms; diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 1f423a2..1f15669 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -140,7 +140,7 @@ void sighandler(int sigset) signal(SIGTERM, SIG_DFL); signal(SIGPIPE, SIG_DFL);
- dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); }
int main(int argc, char **argv) diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 418c3f6..debe36e 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2266,7 +2266,7 @@ gDEFUN(ournode_end, DEFUN(off, off_cmd, "off", "Turn mobiles off (shutdown) and exit") { - dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
return CMD_SUCCESS; }
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/struct write_queue/struct osmo_wqueue/g s/write_queue_init/osmo_wqueue_init/g s/void write_queue_clear/osmo_wqueue_clear/g s/write_queue_enqueue/osmo_wqueue_enqueue/g s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g --- .../include/osmocom/bb/common/osmocom_data.h | 2 +- src/host/layer23/src/common/l1l2_interface.c | 4 ++-- src/host/layer23/src/common/sap_interface.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h index 9d8a030..9ca4114 100644 --- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h +++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h @@ -50,7 +50,7 @@ struct rx_meas_stat { struct osmocom_ms { struct llist_head entity; char name[32]; - struct write_queue l2_wq, sap_wq; + struct osmo_wqueue l2_wq, sap_wq; uint16_t test_arfcn;
uint8_t deleting, shutdown, started; diff --git a/src/host/layer23/src/common/l1l2_interface.c b/src/host/layer23/src/common/l1l2_interface.c index 3272359..2abb660 100644 --- a/src/host/layer23/src/common/l1l2_interface.c +++ b/src/host/layer23/src/common/l1l2_interface.c @@ -126,7 +126,7 @@ int layer2_open(struct osmocom_ms *ms, const char *socket_path) return rc; }
- write_queue_init(&ms->l2_wq, 100); + osmo_wqueue_init(&ms->l2_wq, 100); ms->l2_wq.bfd.data = ms; ms->l2_wq.bfd.when = BSC_FD_READ; ms->l2_wq.read_cb = layer2_read; @@ -167,7 +167,7 @@ int osmo_send_l1(struct osmocom_ms *ms, struct msgb *msg) len = (uint16_t *) msgb_push(msg, sizeof(*len)); *len = htons(msg->len - sizeof(*len));
- if (write_queue_enqueue(&ms->l2_wq, msg) != 0) { + if (osmo_wqueue_enqueue(&ms->l2_wq, msg) != 0) { LOGP(DL1C, LOGL_ERROR, "Failed to enqueue msg.\n"); msgb_free(msg); return -1; diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c index 4d465f0..5d92840 100644 --- a/src/host/layer23/src/common/sap_interface.c +++ b/src/host/layer23/src/common/sap_interface.c @@ -127,7 +127,7 @@ int sap_open(struct osmocom_ms *ms, const char *socket_path) return rc; }
- write_queue_init(&ms->sap_wq, 100); + osmo_wqueue_init(&ms->sap_wq, 100); ms->sap_wq.bfd.data = ms; ms->sap_wq.bfd.when = BSC_FD_READ; ms->sap_wq.read_cb = sap_read; @@ -170,7 +170,7 @@ int osmosap_send(struct osmocom_ms *ms, struct msgb *msg) len = (uint16_t *) msgb_push(msg, sizeof(*len)); *len = htons(msg->len - sizeof(*len));
- if (write_queue_enqueue(&ms->sap_wq, msg) != 0) { + if (osmo_wqueue_enqueue(&ms->sap_wq, msg) != 0) { LOGP(DSAP, LOGL_ERROR, "Failed to enqueue msg.\n"); msgb_free(msg); return -1;
On 05/15/2011 03:14 PM, pablo@gnumonks.org wrote:
From: Pablo Neira Ayuso pablo@gnumonks.org
s/void write_queue_clear/osmo_wqueue_clear/g
I converted my OpenBSC (on-waves/bsc-master) branch with a sed script and I think the 'void ' here is wrong. :)
On 15/05/11 16:09, Holger Hans Peter Freyther wrote:
On 05/15/2011 03:14 PM, pablo@gnumonks.org wrote:
From: Pablo Neira Ayuso pablo@gnumonks.org
s/void write_queue_clear/osmo_wqueue_clear/g
I converted my OpenBSC (on-waves/bsc-master) branch with a sed script and I think the 'void ' here is wrong. :)
Indeed, this has slipped through :-).
I have fixed it in my osmocombb's pablo/namespace branch.
New patch attached with fixed description.
On 15/05/11 17:35, Pablo Neira Ayuso wrote:
On 15/05/11 16:09, Holger Hans Peter Freyther wrote:
On 05/15/2011 03:14 PM, pablo@gnumonks.org wrote:
From: Pablo Neira Ayuso pablo@gnumonks.org
s/void write_queue_clear/osmo_wqueue_clear/g
I converted my OpenBSC (on-waves/bsc-master) branch with a sed script and I think the 'void ' here is wrong. :)
Indeed, this has slipped through :-).
I have fixed it in my osmocombb's pablo/namespace branch.
New patch attached with fixed description.
woops, wrong patch, here it is.
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g --- src/host/layer23/src/common/l1ctl.c | 6 +++--- src/host/layer23/src/common/l1l2_interface.c | 2 +- src/host/layer23/src/common/sap_interface.c | 2 +- src/host/layer23/src/misc/app_cbch_sniff.c | 2 +- src/host/layer23/src/mobile/vty_interface.c | 4 ++-- src/host/osmocon/osmocon.c | 8 ++++---- src/host/osmocon/osmoload.c | 10 +++++----- 7 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c index a2fd865..2482c61 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -152,7 +152,7 @@ static int rx_ph_data_ind(struct osmocom_ms *ms, struct msgb *msg) DEBUGP(DL1C, "%s (%.4u/%.2u/%.2u) %d dBm: %s\n", rsl_chan_nr_str(dl->chan_nr), tm.t1, tm.t2, tm.t3, (int)dl->rx_level-110, - hexdump(ccch->data, sizeof(ccch->data))); + osmo_hexdump(ccch->data, sizeof(ccch->data)));
meas->last_fn = ntohl(dl->frame_nr); meas->frames++; @@ -266,7 +266,7 @@ int l1ctl_tx_data_req(struct osmocom_ms *ms, struct msgb *msg, uint8_t chan_type, chan_ts, chan_ss; uint8_t gsmtap_chan_type;
- DEBUGP(DL1C, "(%s)\n", hexdump(msg->l2h, msgb_l2len(msg))); + DEBUGP(DL1C, "(%s)\n", osmo_hexdump(msg->l2h, msgb_l2len(msg)));
if (msgb_l2len(msg) > 23) { LOGP(DL1C, LOGL_ERROR, "L1 cannot handle message length " @@ -604,7 +604,7 @@ static int rx_l1_sim_conf(struct osmocom_ms *ms, struct msgb *msg) uint16_t len = msg->len - sizeof(struct l1ctl_hdr); uint8_t *data = msg->data + sizeof(struct l1ctl_hdr); - LOGP(DL1C, LOGL_INFO, "SIM %s\n", hexdump(data, len)); + LOGP(DL1C, LOGL_INFO, "SIM %s\n", osmo_hexdump(data, len)); /* pull the L1 header from the msgb */ msgb_pull(msg, sizeof(struct l1ctl_hdr)); diff --git a/src/host/layer23/src/common/l1l2_interface.c b/src/host/layer23/src/common/l1l2_interface.c index 2abb660..abaa64f 100644 --- a/src/host/layer23/src/common/l1l2_interface.c +++ b/src/host/layer23/src/common/l1l2_interface.c @@ -158,7 +158,7 @@ int osmo_send_l1(struct osmocom_ms *ms, struct msgb *msg) { uint16_t *len;
- DEBUGP(DL1C, "Sending: '%s'\n", hexdump(msg->data, msg->len)); + DEBUGP(DL1C, "Sending: '%s'\n", osmo_hexdump(msg->data, msg->len));
if (msg->l1h != msg->data) LOGP(DL1C, LOGL_ERROR, "Message L1 header != Message Data\n"); diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c index 5d92840..fd5cdc3 100644 --- a/src/host/layer23/src/common/sap_interface.c +++ b/src/host/layer23/src/common/sap_interface.c @@ -161,7 +161,7 @@ int osmosap_send(struct osmocom_ms *ms, struct msgb *msg) if (ms->sap_wq.bfd.fd <= 0) return -EINVAL;
- DEBUGP(DSAP, "Sending: '%s'\n", hexdump(msg->data, msg->len)); + DEBUGP(DSAP, "Sending: '%s'\n", osmo_hexdump(msg->data, msg->len));
if (msg->l1h != msg->data) LOGP(DSAP, LOGL_ERROR, "Message SAP header != Message Data\n"); diff --git a/src/host/layer23/src/misc/app_cbch_sniff.c b/src/host/layer23/src/misc/app_cbch_sniff.c index 2df1e54..bda9aae 100644 --- a/src/host/layer23/src/misc/app_cbch_sniff.c +++ b/src/host/layer23/src/misc/app_cbch_sniff.c @@ -52,7 +52,7 @@ static int try_cbch(struct osmocom_ms *ms, struct gsm48_sysinfo *s) "HSN = %d hseq (%d): %s\n", s->chan_nr, s->tsc, s->maio, s->hsn, s->hopp_len, - hexdump((unsigned char *) s->hopping, s->hopp_len * 2)); + osmo_hexdump((unsigned char *) s->hopping, s->hopp_len * 2)); return l1ctl_tx_dm_est_req_h1(ms, s->maio, s->hsn, s->hopping, s->hopp_len, s->chan_nr, s->tsc, diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index debe36e..80a756c 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1170,11 +1170,11 @@ static void config_write_ms(struct vty *vty, struct osmocom_ms *ms) vty_out(vty, " imsi %s%s", set->test_imsi, VTY_NEWLINE); switch (set->test_ki_type) { case GSM_SIM_KEY_XOR: - vty_out(vty, " ki xor %s%s", hexdump(set->test_ki, 12), + vty_out(vty, " ki xor %s%s", osmo_hexdump(set->test_ki, 12), VTY_NEWLINE); break; case GSM_SIM_KEY_COMP128: - vty_out(vty, " ki comp128 %s%s", hexdump(set->test_ki, 16), + vty_out(vty, " ki comp128 %s%s", osmo_hexdump(set->test_ki, 16), VTY_NEWLINE); break; } diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c index ab977c1..7f8d3ac 100644 --- a/src/host/osmocon/osmocon.c +++ b/src/host/osmocon/osmocon.c @@ -447,7 +447,7 @@ int read_file(const char *filename) return 0; }
-static void osmocon_hexdump(const uint8_t *data, unsigned int len) +static void osmocon_osmo_hexdump(const uint8_t *data, unsigned int len) { int n;
@@ -754,7 +754,7 @@ static void hdlc_send_to_phone(uint8_t dlci, uint8_t *data, int len)
if(dnload.dump_tx) { printf("hdlc_send(dlci=%u): ", dlci); - osmocon_hexdump(data, len); + osmocon_osmo_hexdump(data, len); }
if (len > 512) { @@ -792,7 +792,7 @@ static void hdlc_tool_cb(uint8_t dlci, struct msgb *msg)
if(dnload.dump_rx) { printf("hdlc_recv(dlci=%u): ", dlci); - osmocon_hexdump(msg->data, msg->len); + osmocon_osmo_hexdump(msg->data, msg->len); }
if(srv) { @@ -832,7 +832,7 @@ static int handle_buffer(int buf_used_len) if (!dnload.expect_hdlc) { printf("got %i bytes from modem, ", nbytes); printf("data looks like: "); - osmocon_hexdump(bufptr, nbytes); + osmocon_osmo_hexdump(bufptr, nbytes); } else { for (i = 0; i < nbytes; ++i) if (sercomm_drv_rx_char(bufptr[i]) == 0) diff --git a/src/host/osmocon/osmoload.c b/src/host/osmocon/osmoload.c index 1471a2e..5848e56 100644 --- a/src/host/osmocon/osmoload.c +++ b/src/host/osmocon/osmoload.c @@ -146,7 +146,7 @@ static int version(const char *name) exit(2); }
-static void osmoload_hexdump(const uint8_t *data, unsigned int len) +static void osmoload_osmo_hexdump(const uint8_t *data, unsigned int len) { const uint8_t *bufptr = data; const uint8_t const *endptr = bufptr + len; @@ -190,7 +190,7 @@ loader_send_request(struct msgb *msg) {
if(osmoload.print_requests) { printf("Sending %d bytes:\n", msg->len); - osmoload_hexdump(msg->data, msg->len); + osmoload_osmo_hexdump(msg->data, msg->len); }
rc = write(connection.fd, &len, sizeof(len)); @@ -277,7 +277,7 @@ static void loader_handle_reply(struct msgb *msg) { if(osmoload.print_replies) { printf("Received %d bytes:\n", msg->len); - osmoload_hexdump(msg->data, msg->len); + osmoload_osmo_hexdump(msg->data, msg->len); }
uint8_t cmd = msgb_get_u8(msg); @@ -338,7 +338,7 @@ loader_handle_reply(struct msgb *msg) { break; default: printf("Received unknown reply %d:\n", cmd); - osmoload_hexdump(msg->data, msg->len); + osmoload_osmo_hexdump(msg->data, msg->len); osmoload.quit = 1; return; } @@ -364,7 +364,7 @@ loader_handle_reply(struct msgb *msg) { break; case LOADER_MEM_READ: printf("Received memory dump of %d bytes at 0x%x:\n", length, address); - osmoload_hexdump(data, length); + osmoload_osmo_hexdump(data, length); break; case LOADER_MEM_WRITE: printf("Confirmed memory write of %d bytes at 0x%x.\n", length, address);
From: Pablo Neira Ayuso pablo@gnumonks.org
Summary of changes:
s/crc16_table/osmo_crc16_table/g s/crc16/osmo_crc16/g s/crc16_byte/osmo_crc16_byte/g --- src/host/osmocon/osmoload.c | 8 ++++---- src/target/firmware/apps/loader/main.c | 6 +++--- src/target/firmware/apps/loader_mtk/main.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/host/osmocon/osmoload.c b/src/host/osmocon/osmoload.c index 5848e56..8a0b21c 100644 --- a/src/host/osmocon/osmoload.c +++ b/src/host/osmocon/osmoload.c @@ -575,7 +575,7 @@ loader_start_memput(uint8_t length, uint32_t address, void *data) { struct msgb *msg = msgb_alloc(MSGB_MAX, "loader"); msgb_put_u8(msg, LOADER_MEM_WRITE); msgb_put_u8(msg, length); - msgb_put_u16(msg, crc16(0, data, length)); + msgb_put_u16(msg, osmo_crc16(0, data, length)); msgb_put_u32(msg, address); memcpy(msgb_put(msg, length), data, length); loader_send_request(msg); @@ -603,7 +603,7 @@ loader_do_memdump(uint16_t crc, void *data, size_t length) { int rc;
if(data && length) { - osmoload.memcrc = crc16(0, data, length); + osmoload.memcrc = osmo_crc16(0, data, length); if(osmoload.memcrc != crc) { osmoload.memoff -= osmoload.memreq; printf("\nbad crc %4.4x (not %4.4x) at offset 0x%8.8x", crc, osmoload.memcrc, osmoload.memoff); @@ -665,7 +665,7 @@ loader_do_memload() {
uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
- osmoload.memcrc = crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes); + osmoload.memcrc = osmo_crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes); osmoload.memreq = reqbytes;
struct msgb *msg = msgb_alloc(MSGB_MAX, "loader"); @@ -705,7 +705,7 @@ loader_do_fprogram() {
uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
- osmoload.memcrc = crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes); + osmoload.memcrc = osmo_crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes); osmoload.memreq = reqbytes;
struct msgb *msg = msgb_alloc(MSGB_MAX, "loader"); diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c index a948934..2ff6f9c 100644 --- a/src/target/firmware/apps/loader/main.c +++ b/src/target/firmware/apps/loader/main.c @@ -253,7 +253,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg) nbytes = msgb_get_u8(msg); address = msgb_get_u32(msg);
- crc = crc16(0, (void *)address, nbytes); + crc = osmo_crc16(0, (void *)address, nbytes);
msgb_put_u8(reply, LOADER_MEM_READ); msgb_put_u8(reply, nbytes); @@ -274,7 +274,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes); + mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) { memcpy((void *)address, data, nbytes); @@ -392,7 +392,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes); + mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) { res = flash_program(&the_flash, address, data, nbytes); diff --git a/src/target/firmware/apps/loader_mtk/main.c b/src/target/firmware/apps/loader_mtk/main.c index 899d765..9bfaa7e 100644 --- a/src/target/firmware/apps/loader_mtk/main.c +++ b/src/target/firmware/apps/loader_mtk/main.c @@ -194,7 +194,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg) nbytes = msgb_get_u8(msg); address = msgb_get_u32(msg);
- crc = crc16(0, (void *)address, nbytes); + crc = osmo_crc16(0, (void *)address, nbytes);
msgb_put_u8(reply, LOADER_MEM_READ); msgb_put_u8(reply, nbytes); @@ -215,7 +215,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes); + mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) { memcpy((void *)address, data, nbytes); @@ -333,7 +333,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes); + mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) { res = flash_program(&the_flash, address, data, nbytes);
Hi Pablo,
On Sun, May 15, 2011 at 03:14:20PM +0200, pablo@gnumonks.org wrote:
This patchset gets osmocom-bb in sync with the namespace fixes for libosmocore.
sorry for the delays, I'm finally merging it right now.
baseband-devel@lists.osmocom.org