TRX: Fixed typos tranceiver -> transceiver

This commit is contained in:
Andreas Eversberg 2013-04-09 10:55:37 +02:00 committed by Harald Welte
parent 82676c13ee
commit 05597a7ddb
8 changed files with 96 additions and 96 deletions

View File

@ -40,7 +40,7 @@
#include "scheduler.h"
static const uint8_t tranceiver_chan_types[_GSM_PCHAN_MAX] = {
static const uint8_t transceiver_chan_types[_GSM_PCHAN_MAX] = {
[GSM_PCHAN_NONE] = 8,
[GSM_PCHAN_CCCH] = 6,
[GSM_PCHAN_CCCH_SDCCH4] = 5,
@ -95,13 +95,13 @@ void l1if_reset(struct trx_l1h *l1h)
{
}
static void check_tranceiver_availability_trx(struct trx_l1h *l1h, int avail)
static void check_transceiver_availability_trx(struct trx_l1h *l1h, int avail)
{
struct gsm_bts_trx *trx = l1h->trx;
uint8_t tn;
/* HACK, we should change state when we receive first clock from
* tranceiver */
* transceiver */
if (avail) {
/* signal availability */
oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK);
@ -126,27 +126,27 @@ static void check_tranceiver_availability_trx(struct trx_l1h *l1h, int avail)
}
}
int check_tranceiver_availability(struct gsm_bts *bts, int avail)
int check_transceiver_availability(struct gsm_bts *bts, int avail)
{
struct gsm_bts_trx *trx;
struct trx_l1h *l1h;
llist_for_each_entry(trx, &bts->trx_list, list) {
l1h = trx_l1h_hdl(trx);
check_tranceiver_availability_trx(l1h, avail);
check_transceiver_availability_trx(l1h, avail);
}
return 0;
}
/*
* tranceiver provisioning
* transceiver provisioning
*/
int l1if_provision_tranceiver_trx(struct trx_l1h *l1h)
int l1if_provision_transceiver_trx(struct trx_l1h *l1h)
{
uint8_t tn;
if (!tranceiver_available)
if (!transceiver_available)
return -EIO;
if (l1h->config.poweron
@ -210,7 +210,7 @@ int l1if_provision_tranceiver_trx(struct trx_l1h *l1h)
return 0;
}
int l1if_provision_tranceiver(struct gsm_bts *bts)
int l1if_provision_transceiver(struct gsm_bts *bts)
{
struct gsm_bts_trx *trx;
struct trx_l1h *l1h;
@ -227,13 +227,13 @@ int l1if_provision_tranceiver(struct gsm_bts *bts)
l1h->config.maxdly_sent = 0;
for (tn = 0; tn < 8; tn++)
l1h->config.slottype_sent[tn] = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
return 0;
}
/*
* activation/configuration/deactivation of tranceiver's TRX
* activation/configuration/deactivation of transceiver's TRX
*/
/* initialize the layer1 */
@ -241,11 +241,11 @@ static int trx_init(struct gsm_bts_trx *trx)
{
struct trx_l1h *l1h = trx_l1h_hdl(trx);
/* power on tranceiver, if not already */
/* power on transceiver, if not already */
if (!l1h->config.poweron) {
l1h->config.poweron = 1;
l1h->config.poweron_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
if (trx == trx->bts->c0)
@ -258,7 +258,7 @@ static int trx_init(struct gsm_bts_trx *trx)
return oml_mo_opstart_ack(&trx->mo);
}
/* deactivate tranceiver */
/* deactivate transceiver */
static int trx_close(struct gsm_bts_trx *trx)
{
struct trx_l1h *l1h = trx_l1h_hdl(trx);
@ -266,15 +266,15 @@ static int trx_close(struct gsm_bts_trx *trx)
/* close all logical channels and reset timeslots */
trx_sched_reset(l1h);
/* power off tranceiver, if not already */
/* power off transceiver, if not already */
if (l1h->config.poweron) {
l1h->config.poweron = 0;
l1h->config.poweron_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
/* Set to Operational State: Disabled */
check_tranceiver_availability_trx(l1h, 0);
check_transceiver_availability_trx(l1h, 0);
return 0;
}
@ -298,10 +298,10 @@ static uint8_t trx_set_bts(struct gsm_bts *bts, struct tlv_parsed *new_attr)
l1h->config.bsic = bsic;
l1h->config.bsic_valid = 1;
l1h->config.bsic_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
}
check_tranceiver_availability(bts, tranceiver_available);
check_transceiver_availability(bts, transceiver_available);
return 0;
@ -317,7 +317,7 @@ static uint8_t trx_set_trx(struct gsm_bts_trx *trx)
l1h->config.arfcn = arfcn;
l1h->config.arfcn_valid = 1;
l1h->config.arfcn_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
return 0;
@ -333,14 +333,14 @@ static uint8_t trx_set_ts(struct gsm_bts_trx_ts *ts)
uint8_t slottype;
int rc;
/* all TSC of all timeslots must be equal, because tranceiver only
/* all TSC of all timeslots must be equal, because transceiver only
* supports one TSC per TRX */
if (l1h->config.tsc != tsc || !l1h->config.tsc_valid) {
l1h->config.tsc = tsc;
l1h->config.tsc_valid = 1;
l1h->config.tsc_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
/* set physical channel */
@ -348,14 +348,14 @@ static uint8_t trx_set_ts(struct gsm_bts_trx_ts *ts)
if (rc)
return NM_NACK_RES_NOTAVAIL;
slottype = tranceiver_chan_types[pchan];
slottype = transceiver_chan_types[pchan];
if (l1h->config.slottype[tn] != slottype
|| !l1h->config.slottype_valid[tn]) {
l1h->config.slottype[tn] = slottype;
l1h->config.slottype_valid[tn] = 1;
l1h->config.slottype_sent[tn] = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
}
return 0;
@ -584,7 +584,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
switch (mo->obj_class) {
case NM_OC_RADIO_CARRIER:
/* activate tranceiver */
/* activate transceiver */
rc = trx_init(obj);
break;
case NM_OC_CHANNEL:

View File

@ -144,7 +144,7 @@ struct trx_l1h {
struct osmo_timer_list trx_ctrl_timer;
struct osmo_fd trx_ofd_data;
/* tranceiver config */
/* transceiver config */
struct trx_config config;
uint8_t mf_index[8]; /* selected multiframe index */
@ -160,9 +160,9 @@ struct trx_l1h {
struct trx_l1h *l1if_open(struct gsm_bts_trx *trx);
void l1if_close(struct trx_l1h *l1h);
void l1if_reset(struct trx_l1h *l1h);
int check_tranceiver_availability(struct gsm_bts *bts, int avail);
int l1if_provision_tranceiver_trx(struct trx_l1h *l1h);
int l1if_provision_tranceiver(struct gsm_bts *bts);
int check_transceiver_availability(struct gsm_bts *bts, int avail);
int l1if_provision_transceiver_trx(struct trx_l1h *l1h);
int l1if_provision_transceiver(struct gsm_bts *bts);
int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn);
#endif /* L1_IF_H_TRX */

View File

@ -155,8 +155,8 @@ static void print_help()
" -t --trx-num Set number of TRX (default=%d)\n"
" -i --gsmtap-ip The destination IP used for GSMTAP.\n"
" -H --high-prio Set realtime scheduler with maximum prio\n"
" -I --tranceiver-ip Set IP of tranceiver (default=%s)\n"
,trx_num, tranceiver_ip);
" -I --local-trx-ip Local IP for transceiver to connect (default=%s)\n"
,trx_num, transceiver_ip);
}
/* FIXME: finally get some option parsing code into libosmocore */
@ -177,7 +177,7 @@ static void handle_options(int argc, char **argv)
{ "trx-num", 1, 0, 't' },
{ "gsmtap-ip", 1, 0, 'i' },
{ "high-prio", 0, 0, 'H' },
{ "tranceiver-ip", 1, 0, 'I' },
{ "local-trx-ip", 1, 0, 'I' },
{ 0, 0, 0, 0 }
};
@ -225,7 +225,7 @@ static void handle_options(int argc, char **argv)
high_prio = 1;
break;
case 'I':
tranceiver_ip = strdup(optarg);
transceiver_ip = strdup(optarg);
break;
default:
break;

View File

@ -53,12 +53,12 @@ void *tall_bts_ctx;
static struct gsm_bts *bts;
/* clock states */
static uint32_t tranceiver_lost;
uint32_t tranceiver_last_fn;
static struct timeval tranceiver_clock_tv;
static struct osmo_timer_list tranceiver_clock_timer;
static uint32_t transceiver_lost;
uint32_t transceiver_last_fn;
static struct timeval transceiver_clock_tv;
static struct osmo_timer_list transceiver_clock_timer;
/* clock advance for the tranceiver */
/* clock advance for the transceiver */
uint32_t trx_clock_advance = 20;
/* advance RTS to give some time for data processing. (especially PCU) */
@ -2729,7 +2729,7 @@ static int trx_sched_fn(uint32_t fn)
/* send time indication */
l1if_mph_time_ind(bts, fn);
/* advance frame number, so the tranceiver has more time until
/* advance frame number, so the transceiver has more time until
* it must be transmitted. */
fn = (fn + trx_clock_advance) % 2715648;
@ -2777,17 +2777,17 @@ extern int quit;
/* this timer fires for every FN to be processed */
static void trx_ctrl_timer_cb(void *data)
{
struct timeval tv_now, *tv_clock = &tranceiver_clock_tv;
struct timeval tv_now, *tv_clock = &transceiver_clock_tv;
int32_t elapsed;
/* check if tranceiver is still alive */
if (tranceiver_lost++ == TRX_LOSS_FRAMES) {
/* check if transceiver is still alive */
if (transceiver_lost++ == TRX_LOSS_FRAMES) {
struct gsm_bts_trx *trx;
LOGP(DL1C, LOGL_NOTICE, "No more clock from traneiver\n");
no_clock:
tranceiver_available = 0;
transceiver_available = 0;
/* flush pending messages of transceiver */
/* close all logical channels and reset timeslots */
@ -2799,7 +2799,7 @@ no_clock:
}
/* tell BSC */
check_tranceiver_availability(bts, 0);
check_transceiver_availability(bts, 0);
return;
}
@ -2823,19 +2823,19 @@ no_clock:
tv_clock->tv_sec++;
tv_clock->tv_usec -= 1000000;
}
tranceiver_last_fn = (tranceiver_last_fn + 1) % 2715648;
trx_sched_fn(tranceiver_last_fn);
transceiver_last_fn = (transceiver_last_fn + 1) % 2715648;
trx_sched_fn(transceiver_last_fn);
elapsed -= FRAME_DURATION_uS;
}
osmo_timer_schedule(&tranceiver_clock_timer, 0,
osmo_timer_schedule(&transceiver_clock_timer, 0,
FRAME_DURATION_uS - elapsed);
}
/* receive clock from tranceiver */
/* receive clock from transceiver */
int trx_sched_clock(uint32_t fn)
{
struct timeval tv_now, *tv_clock = &tranceiver_clock_tv;
struct timeval tv_now, *tv_clock = &transceiver_clock_tv;
int32_t elapsed;
int32_t elapsed_fn;
@ -2843,54 +2843,54 @@ int trx_sched_clock(uint32_t fn)
return 0;
/* reset lost counter */
tranceiver_lost = 0;
transceiver_lost = 0;
gettimeofday(&tv_now, NULL);
/* clock becomes valid */
if (!tranceiver_available) {
if (!transceiver_available) {
LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n",
fn);
tranceiver_available = 1;
transceiver_available = 1;
/* start provisioning tranceiver */
l1if_provision_tranceiver(bts);
/* start provisioning transceiver */
l1if_provision_transceiver(bts);
/* tell BSC */
check_tranceiver_availability(bts, 1);
check_transceiver_availability(bts, 1);
new_clock:
tranceiver_last_fn = fn;
trx_sched_fn(tranceiver_last_fn);
transceiver_last_fn = fn;
trx_sched_fn(transceiver_last_fn);
/* schedule first FN clock */
memcpy(tv_clock, &tv_now, sizeof(struct timeval));
memset(&tranceiver_clock_timer, 0,
sizeof(tranceiver_clock_timer));
tranceiver_clock_timer.cb = trx_ctrl_timer_cb;
tranceiver_clock_timer.data = bts;
osmo_timer_schedule(&tranceiver_clock_timer, 0,
memset(&transceiver_clock_timer, 0,
sizeof(transceiver_clock_timer));
transceiver_clock_timer.cb = trx_ctrl_timer_cb;
transceiver_clock_timer.data = bts;
osmo_timer_schedule(&transceiver_clock_timer, 0,
FRAME_DURATION_uS);
return 0;
}
osmo_timer_del(&tranceiver_clock_timer);
osmo_timer_del(&transceiver_clock_timer);
/* calculate elapsed time since last_fn */
elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000
+ (tv_now.tv_usec - tv_clock->tv_usec);
/* how much frames have been elapsed since last fn processed */
elapsed_fn = (fn + 2715648 - tranceiver_last_fn) % 2715648;
elapsed_fn = (fn + 2715648 - transceiver_last_fn) % 2715648;
if (elapsed_fn >= 135774)
elapsed_fn -= 2715648;
/* check for max clock skew */
if (elapsed_fn > MAX_FN_SKEW || elapsed_fn < -MAX_FN_SKEW) {
LOGP(DL1C, LOGL_NOTICE, "GSM clock skew: old fn=%u, "
"new fn=%u\n", tranceiver_last_fn, fn);
"new fn=%u\n", transceiver_last_fn, fn);
goto new_clock;
}
@ -2909,21 +2909,21 @@ new_clock:
tv_clock->tv_usec -= 1000000;
}
/* set time to the time our next FN hast to be transmitted */
osmo_timer_schedule(&tranceiver_clock_timer, 0,
osmo_timer_schedule(&transceiver_clock_timer, 0,
FRAME_DURATION_uS * (1 - elapsed_fn));
return 0;
}
/* transmit what we still need to transmit */
while (fn != tranceiver_last_fn) {
tranceiver_last_fn = (tranceiver_last_fn + 1) % 2715648;
trx_sched_fn(tranceiver_last_fn);
while (fn != transceiver_last_fn) {
transceiver_last_fn = (transceiver_last_fn + 1) % 2715648;
trx_sched_fn(transceiver_last_fn);
}
/* schedule next FN to be transmitted */
memcpy(tv_clock, &tv_now, sizeof(struct timeval));
osmo_timer_schedule(&tranceiver_clock_timer, 0, FRAME_DURATION_uS);
osmo_timer_schedule(&transceiver_clock_timer, 0, FRAME_DURATION_uS);
return 0;
}

View File

@ -2,7 +2,7 @@
#define TRX_SCHEDULER_H
extern uint32_t trx_clock_advance;
extern uint32_t tranceiver_last_fn;
extern uint32_t transceiver_last_fn;
int trx_sched_init(struct trx_l1h *l1h);

View File

@ -44,8 +44,8 @@
/* enable to print RSSI level graph */
//#define TOA_RSSI_DEBUG
int tranceiver_available = 0;
const char *tranceiver_ip = "127.0.0.1";
int transceiver_available = 0;
const char *transceiver_ip = "127.0.0.1";
int settsc_enabled = 0;
int setbsic_enabled = 0;
@ -71,7 +71,7 @@ static int trx_udp_open(void *priv, struct osmo_fd *ofd, uint16_t port,
ofd->data = priv;
/* Listen / Binds */
rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, tranceiver_ip,
rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, transceiver_ip,
port, OSMO_SOCK_F_BIND);
if (rc < 0)
return rc;
@ -175,7 +175,7 @@ static void trx_ctrl_timer_cb(void *data)
{
struct trx_l1h *l1h = data;
LOGP(DTRX, LOGL_NOTICE, "No response from tranceiver\n");
LOGP(DTRX, LOGL_NOTICE, "No response from transceiver\n");
trx_ctrl_send(l1h);
}
@ -188,9 +188,9 @@ static int trx_ctrl_cmd(struct trx_l1h *l1h, int critical, const char *cmd,
va_list ap;
int l, pending = 0;
if (!tranceiver_available && !!strcmp(cmd, "POWEROFF")) {
if (!transceiver_available && !!strcmp(cmd, "POWEROFF")) {
LOGP(DTRX, LOGL_ERROR, "CTRL ignored: No clock from "
"tranceiver, please fix!\n");
"transceiver, please fix!\n");
return -EIO;
}
@ -348,7 +348,7 @@ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what)
sscanf(p + 1, "%d", &resp);
if (resp) {
LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE,
"Tranceiver rejected TRX command with "
"transceiver rejected TRX command with "
"response: '%s'\n", buf);
rsp_error:
if (tcm->critical) {
@ -453,10 +453,10 @@ int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr,
/* we must be sure that we have clock, and we have sent all control
* data */
if (tranceiver_available && llist_empty(&l1h->trx_ctrl_list)) {
if (transceiver_available && llist_empty(&l1h->trx_ctrl_list)) {
send(l1h->trx_ofd_data.fd, buf, 154, 0);
} else
LOGP(DTRX, LOGL_DEBUG, "Ignoring TX data, tranceiver "
LOGP(DTRX, LOGL_DEBUG, "Ignoring TX data, transceiver "
"offline.\n");
return 0;
@ -471,7 +471,7 @@ int trx_if_open(struct trx_l1h *l1h)
{
int rc;
LOGP(DTRX, LOGL_NOTICE, "Open tranceiver for trx=%u\n", l1h->trx->nr);
LOGP(DTRX, LOGL_NOTICE, "Open transceiver for trx=%u\n", l1h->trx->nr);
/* initialize ctrl queue */
INIT_LLIST_HEAD(&l1h->trx_ctrl_list);
@ -482,7 +482,7 @@ int trx_if_open(struct trx_l1h *l1h)
trx_clk_read_cb);
if (rc < 0)
return rc;
LOGP(DTRX, LOGL_NOTICE, "Waiting for tranceiver send clock\n");
LOGP(DTRX, LOGL_NOTICE, "Waiting for transceiver send clock\n");
}
rc = trx_udp_open(l1h, &l1h->trx_ofd_ctrl,
base_port_local + (l1h->trx->nr << 1) + 1, trx_ctrl_read_cb);
@ -522,7 +522,7 @@ void trx_if_flush(struct trx_l1h *l1h)
void trx_if_close(struct trx_l1h *l1h)
{
LOGP(DTRX, LOGL_NOTICE, "Close tranceiver for trx=%u\n", l1h->trx->nr);
LOGP(DTRX, LOGL_NOTICE, "Close transceiver for trx=%u\n", l1h->trx->nr);
trx_if_flush(l1h);

View File

@ -1,8 +1,8 @@
#ifndef TRX_IF_H
#define TRX_IF_H
extern int tranceiver_available;
extern const char *tranceiver_ip;
extern int transceiver_available;
extern const char *transceiver_ip;
extern int settsc_enabled;
extern int setbsic_enabled;

View File

@ -47,19 +47,19 @@
static struct gsm_bts *vty_bts;
DEFUN(show_tranceiver, show_tranceiver_cmd, "show tranceiver",
SHOW_STR "Display information about tranceivers\n")
DEFUN(show_transceiver, show_transceiver_cmd, "show transceiver",
SHOW_STR "Display information about transceivers\n")
{
struct gsm_bts *bts = vty_bts;
struct gsm_bts_trx *trx;
struct trx_l1h *l1h;
uint8_t tn;
if (!tranceiver_available) {
vty_out(vty, "Tranceiver is not connected%s", VTY_NEWLINE);
if (!transceiver_available) {
vty_out(vty, "transceiver is not connected%s", VTY_NEWLINE);
} else {
vty_out(vty, "Tranceiver is connected, current fn=%u%s",
tranceiver_last_fn, VTY_NEWLINE);
vty_out(vty, "transceiver is connected, current fn=%u%s",
transceiver_last_fn, VTY_NEWLINE);
}
llist_for_each_entry(trx, &bts->trx_list, list) {
@ -129,7 +129,7 @@ DEFUN(cfg_bts_fn_advance, cfg_bts_fn_advance_cmd,
DEFUN(cfg_bts_ms_power_loop, cfg_bts_ms_power_loop_cmd,
"ms-power-loop <-127-127>",
"Enable MS power control loop\nTarget RSSI value (tranceiver specific, "
"Enable MS power control loop\nTarget RSSI value (transceiver specific, "
"should be 6dB or more above noise floor)\n")
{
trx_ms_power_loop = 1;
@ -219,7 +219,7 @@ DEFUN(cfg_trx_rxgain, cfg_trx_rxgain_cmd,
l1h->config.rxgain = atoi(argv[0]);
l1h->config.rxgain_valid = 1;
l1h->config.rxgain_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
return CMD_SUCCESS;
}
@ -235,7 +235,7 @@ DEFUN(cfg_trx_power, cfg_trx_power_cmd,
l1h->config.power = atoi(argv[0]);
l1h->config.power_valid = 1;
l1h->config.power_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
return CMD_SUCCESS;
}
@ -251,7 +251,7 @@ DEFUN(cfg_trx_maxdly, cfg_trx_maxdly_cmd,
l1h->config.maxdly = atoi(argv[0]);
l1h->config.maxdly_valid = 1;
l1h->config.maxdly_sent = 0;
l1if_provision_tranceiver_trx(l1h);
l1if_provision_transceiver_trx(l1h);
return CMD_SUCCESS;
}
@ -359,7 +359,7 @@ int bts_model_vty_init(struct gsm_bts *bts)
{
vty_bts = bts;
install_element_ve(&show_tranceiver_cmd);
install_element_ve(&show_transceiver_cmd);
install_element(BTS_NODE, &cfg_bts_fn_advance_cmd);
install_element(BTS_NODE, &cfg_bts_ms_power_loop_cmd);