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().
This commit is contained in:
parent
96e479645f
commit
e91d8a934c
|
@ -19,7 +19,7 @@ int tx_ph_rach_req(struct osmocom_ms *ms);
|
||||||
/* Transmit L1CTL_DM_EST_REQ */
|
/* Transmit L1CTL_DM_EST_REQ */
|
||||||
int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr);
|
int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr);
|
||||||
/* Transmit NEW_CCCH_REQ */
|
/* 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);
|
int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ struct osmol2_entity {
|
||||||
struct osmocom_ms {
|
struct osmocom_ms {
|
||||||
struct write_queue wq;
|
struct write_queue wq;
|
||||||
enum gsm_band band;
|
enum gsm_band band;
|
||||||
int arfcn;
|
uint16_t test_arfcn;
|
||||||
|
|
||||||
struct osmol2_entity l2_entity;
|
struct osmol2_entity l2_entity;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int signal_cb(unsigned int subsys, unsigned int signal,
|
||||||
switch (signal) {
|
switch (signal) {
|
||||||
case S_L1CTL_RESET:
|
case S_L1CTL_RESET:
|
||||||
ms = signal_data;
|
ms = signal_data;
|
||||||
return l1ctl_tx_ccch_req(ms);
|
return l1ctl_tx_ccch_req(ms, ms->test_arfcn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -154,15 +154,14 @@ static int _cinfo_start_arfcn(unsigned int band_arfcn)
|
||||||
|
|
||||||
/* ask L1 to try to tune to new ARFCN */
|
/* ask L1 to try to tune to new ARFCN */
|
||||||
/* FIXME: decode band */
|
/* FIXME: decode band */
|
||||||
fps.ms->arfcn = band_arfcn;
|
rc = l1ctl_tx_ccch_req(fps.ms, band_arfcn);
|
||||||
rc = l1ctl_tx_ccch_req(fps.ms);
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
/* allocate new cell info structure */
|
/* allocate new cell info structure */
|
||||||
fps.cur_cell = cell_info_alloc();
|
fps.cur_cell = cell_info_alloc();
|
||||||
fps.cur_arfcn = fps.ms->arfcn;
|
fps.cur_arfcn = band_arfcn;
|
||||||
fps.cur_cell->band_arfcn = fps.ms->arfcn;
|
fps.cur_cell->band_arfcn = band_arfcn;
|
||||||
/* FIXME: start timer in case we never get a sync */
|
/* FIXME: start timer in case we never get a sync */
|
||||||
fps.state = BSCAN_S_WAIT_DATA;
|
fps.state = BSCAN_S_WAIT_DATA;
|
||||||
bsc_schedule_timer(&fps.timer, 2, 0);
|
bsc_schedule_timer(&fps.timer, 2, 0);
|
||||||
|
|
|
@ -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 */
|
/* TODO: Include the band */
|
||||||
return ms->arfcn;
|
return arfcn;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rx_l1_ccch_resp(struct osmocom_ms *ms, struct msgb *msg)
|
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 */
|
/* 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 msgb *msg;
|
||||||
struct l1ctl_sync_new_ccch_req *req;
|
struct l1ctl_sync_new_ccch_req *req;
|
||||||
|
@ -224,7 +224,7 @@ int l1ctl_tx_ccch_req(struct osmocom_ms *ms)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
req = (struct l1ctl_sync_new_ccch_req *) msgb_put(msg, sizeof(*req));
|
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);
|
return osmo_send_l1(ms, msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ static void handle_options(int argc, char **argv)
|
||||||
socket_path = talloc_strdup(l2_ctx, optarg);
|
socket_path = talloc_strdup(l2_ctx, optarg);
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
ms->arfcn = atoi(optarg);
|
ms->test_arfcn = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if (!inet_aton(optarg, &gsmtap.sin_addr)) {
|
if (!inet_aton(optarg, &gsmtap.sin_addr)) {
|
||||||
|
@ -209,7 +209,7 @@ int main(int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ms->arfcn = 871;
|
ms->test_arfcn = 871;
|
||||||
|
|
||||||
handle_options(argc, argv);
|
handle_options(argc, argv);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue