From e91d8a934c685f9d89f10d3e2fd927102f022cd3 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 25 Apr 2010 17:31:35 +0200 Subject: [PATCH] l1ctl_tx_ccch_req() now uses arfcn as parameter. The arfcn variable is renamed to test_arfcn. I think that arfcn and other frequency parameters should be stored at the process which sets it and using it when calling l1ctl_tx_ccch_req(). --- src/host/layer23/include/osmocom/l1ctl.h | 2 +- src/host/layer23/include/osmocom/osmocom_data.h | 2 +- src/host/layer23/src/app_phone.c | 2 +- src/host/layer23/src/bcch_scan.c | 7 +++---- src/host/layer23/src/l1ctl.c | 8 ++++---- src/host/layer23/src/main.c | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/host/layer23/include/osmocom/l1ctl.h b/src/host/layer23/include/osmocom/l1ctl.h index b56a9315c..fa0e9c1ff 100644 --- a/src/host/layer23/include/osmocom/l1ctl.h +++ b/src/host/layer23/include/osmocom/l1ctl.h @@ -19,7 +19,7 @@ int tx_ph_rach_req(struct osmocom_ms *ms); /* Transmit L1CTL_DM_EST_REQ */ int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr); /* Transmit NEW_CCCH_REQ */ -int l1ctl_tx_ccch_req(struct osmocom_ms *ms); +int l1ctl_tx_ccch_req(struct osmocom_ms *ms, uint16_t arfcn); int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len); diff --git a/src/host/layer23/include/osmocom/osmocom_data.h b/src/host/layer23/include/osmocom/osmocom_data.h index ea4474f79..9b9455d92 100644 --- a/src/host/layer23/include/osmocom/osmocom_data.h +++ b/src/host/layer23/include/osmocom/osmocom_data.h @@ -20,7 +20,7 @@ struct osmol2_entity { struct osmocom_ms { struct write_queue wq; enum gsm_band band; - int arfcn; + uint16_t test_arfcn; struct osmol2_entity l2_entity; }; diff --git a/src/host/layer23/src/app_phone.c b/src/host/layer23/src/app_phone.c index 2393f45c1..6b0df5095 100644 --- a/src/host/layer23/src/app_phone.c +++ b/src/host/layer23/src/app_phone.c @@ -44,7 +44,7 @@ static int signal_cb(unsigned int subsys, unsigned int signal, switch (signal) { case S_L1CTL_RESET: ms = signal_data; - return l1ctl_tx_ccch_req(ms); + return l1ctl_tx_ccch_req(ms, ms->test_arfcn); break; } return 0; diff --git a/src/host/layer23/src/bcch_scan.c b/src/host/layer23/src/bcch_scan.c index 5a7ca09b2..69fa5e6b0 100644 --- a/src/host/layer23/src/bcch_scan.c +++ b/src/host/layer23/src/bcch_scan.c @@ -154,15 +154,14 @@ static int _cinfo_start_arfcn(unsigned int band_arfcn) /* ask L1 to try to tune to new ARFCN */ /* FIXME: decode band */ - fps.ms->arfcn = band_arfcn; - rc = l1ctl_tx_ccch_req(fps.ms); + rc = l1ctl_tx_ccch_req(fps.ms, band_arfcn); if (rc < 0) return rc; /* allocate new cell info structure */ fps.cur_cell = cell_info_alloc(); - fps.cur_arfcn = fps.ms->arfcn; - fps.cur_cell->band_arfcn = fps.ms->arfcn; + fps.cur_arfcn = 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); diff --git a/src/host/layer23/src/l1ctl.c b/src/host/layer23/src/l1ctl.c index d6aa17638..a9608290a 100644 --- a/src/host/layer23/src/l1ctl.c +++ b/src/host/layer23/src/l1ctl.c @@ -64,10 +64,10 @@ static struct msgb *osmo_l1_alloc(uint8_t msg_type) } -static int osmo_make_band_arfcn(struct osmocom_ms *ms) +static int osmo_make_band_arfcn(struct osmocom_ms *ms, uint16_t arfcn) { /* TODO: Include the band */ - return ms->arfcn; + return arfcn; } static int rx_l1_ccch_resp(struct osmocom_ms *ms, struct msgb *msg) @@ -214,7 +214,7 @@ int tx_ph_data_req(struct osmocom_ms *ms, struct msgb *msg, } /* Transmit NEW_CCCH_REQ */ -int l1ctl_tx_ccch_req(struct osmocom_ms *ms) +int l1ctl_tx_ccch_req(struct osmocom_ms *ms, uint16_t arfcn) { struct msgb *msg; struct l1ctl_sync_new_ccch_req *req; @@ -224,7 +224,7 @@ int l1ctl_tx_ccch_req(struct osmocom_ms *ms) return -1; req = (struct l1ctl_sync_new_ccch_req *) msgb_put(msg, sizeof(*req)); - req->band_arfcn = osmo_make_band_arfcn(ms); + req->band_arfcn = osmo_make_band_arfcn(ms, arfcn); return osmo_send_l1(ms, msg); } diff --git a/src/host/layer23/src/main.c b/src/host/layer23/src/main.c index 7709e9e72..66a9f490c 100644 --- a/src/host/layer23/src/main.c +++ b/src/host/layer23/src/main.c @@ -173,7 +173,7 @@ static void handle_options(int argc, char **argv) socket_path = talloc_strdup(l2_ctx, optarg); break; case 'a': - ms->arfcn = atoi(optarg); + ms->test_arfcn = atoi(optarg); break; case 'i': if (!inet_aton(optarg, &gsmtap.sin_addr)) { @@ -209,7 +209,7 @@ int main(int argc, char **argv) exit(1); } - ms->arfcn = 871; + ms->test_arfcn = 871; handle_options(argc, argv);