summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg2010-04-25 17:31:35 +0200
committerAndreas Eversberg2010-04-25 17:31:35 +0200
commite91d8a934c685f9d89f10d3e2fd927102f022cd3 (patch)
tree808b5053ab5dde2f43d4d8af67da8cf460817fab /src
parentWrapper for file access. (diff)
downloadosmocom-e91d8a934c685f9d89f10d3e2fd927102f022cd3.tar.gz
osmocom-e91d8a934c685f9d89f10d3e2fd927102f022cd3.tar.xz
osmocom-e91d8a934c685f9d89f10d3e2fd927102f022cd3.zip
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().
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/include/osmocom/l1ctl.h2
-rw-r--r--src/host/layer23/include/osmocom/osmocom_data.h2
-rw-r--r--src/host/layer23/src/app_phone.c2
-rw-r--r--src/host/layer23/src/bcch_scan.c7
-rw-r--r--src/host/layer23/src/l1ctl.c8
-rw-r--r--src/host/layer23/src/main.c4
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 b56a931..fa0e9c1 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 ea4474f..9b9455d 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 2393f45..6b0df50 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 5a7ca09..69fa5e6 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 d6aa176..a960829 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 7709e9e..66a9f49 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);