dl = (struct l1ctl_info_dl *) msg->l1h;
sb = (struct l1ctl_fbsb_conf *) dl->payload;
- printf("snr=%04x, arfcn=%u result=%u\n", dl->snr, ntohs(dl->band_arfcn),
- sb->result);
+ LOGP(DL1C, LOGL_INFO, "snr=%04x, arfcn=%u result=%u\n", dl->snr,
+ ntohs(dl->band_arfcn), sb->result);
if (sb->result != 0) {
LOGP(DL1C, LOGL_ERROR, "FBSB RESP: result=%u\n", sb->result);
struct msgb *msg;
struct l1ctl_fbsb_req *req;
- printf("Sync Req\n");
+ LOGP(DL1C, LOGL_INFO, "Sync Req\n");
msg = osmo_l1_alloc(L1CTL_FBSB_REQ);
if (!msg)
struct msgb *msg;
struct l1ctl_ccch_mode_req *req;
- printf("CCCH Mode Req\n");
+ LOGP(DL1C, LOGL_INFO, "CCCH Mode Req\n");
msg = osmo_l1_alloc(L1CTL_CCCH_MODE_REQ);
if (!msg)
struct msgb *msg;
struct l1ctl_tch_mode_req *req;
- printf("TCH Mode Req\n");
+ LOGP(DL1C, LOGL_INFO, "TCH Mode Req\n");
msg = osmo_l1_alloc(L1CTL_TCH_MODE_REQ);
if (!msg)
if (!msg)
return -1;
- printf("Tx Dedic.Mode Est Req (arfcn=%u, chan_nr=0x%02x)\n",
- band_arfcn, chan_nr);
+ LOGP(DL1C, LOGL_INFO, "Tx Dedic.Mode Est Req (arfcn=%u, "
+ "chan_nr=0x%02x)\n", band_arfcn, chan_nr);
memset(&ms->meas, 0, sizeof(ms->meas));
if (!msg)
return -1;
- printf("Tx Dedic.Mode Est Req (maio=%u, hsn=%u, "
+ LOGP(DL1C, LOGL_INFO, "Tx Dedic.Mode Est Req (maio=%u, hsn=%u, "
"chan_nr=0x%02x)\n", maio, hsn, chan_nr);
memset(&ms->meas, 0, sizeof(ms->meas));
if (!msg)
return -1;
- printf("Tx Dedic.Mode Freq Req (arfcn=%u, fn=%d)\n",
+ LOGP(DL1C, LOGL_INFO, "Tx Dedic.Mode Freq Req (arfcn=%u, fn=%d)\n",
band_arfcn, fn);
ul = (struct l1ctl_info_ul *) msgb_put(msg, sizeof(*ul));
if (!msg)
return -1;
- printf("Tx Dedic.Mode Freq Req (maio=%u, hsn=%u, "
+ LOGP(DL1C, LOGL_INFO, "Tx Dedic.Mode Freq Req (maio=%u, hsn=%u, "
"fn=%d)\n", maio, hsn, fn);
ul = (struct l1ctl_info_ul *) msgb_put(msg, sizeof(*ul));
if (!msg)
return -1;
- printf("Tx Dedic.Mode Rel Req\n");
+ LOGP(DL1C, LOGL_INFO, "Tx Dedic.Mode Rel Req\n");
memset(&ms->meas, 0, sizeof(ms->meas));
uint16_t len = msg->len - sizeof(struct l1ctl_hdr);
uint8_t *data = msg->data + sizeof(struct l1ctl_hdr);
- printf("SIM %s\n", hexdump(data, len));
+ LOGP(DL1C, LOGL_INFO, "SIM %s\n", hexdump(data, len));
/* pull the L1 header from the msgb */
msgb_pull(msg, sizeof(struct l1ctl_hdr));
if (!msg)
return -1;
- printf("Tx PM Req (%u-%u)\n", arfcn_from, arfcn_to);
+ LOGP(DL1C, LOGL_INFO, "Tx PM Req (%u-%u)\n", arfcn_from, arfcn_to);
pm = (struct l1ctl_pm_req *) msgb_put(msg, sizeof(*pm));
pm->type = 1;
pm->range.band_arfcn_from = htons(arfcn_from);
if (!msg)
return -1;
- printf("Tx Reset Req (%u)\n", type);
+ LOGP(DL1C, LOGL_INFO, "Tx Reset Req (%u)\n", type);
res = (struct l1ctl_reset *) msgb_put(msg, sizeof(*res));
res->type = type;
/* Receive L1CTL_RESET_IND */
static int rx_l1_reset(struct osmocom_ms *ms)
{
- printf("Layer1 Reset indication\n");
+ LOGP(DL1C, LOGL_INFO, "Layer1 Reset indication\n");
dispatch_signal(SS_L1CTL, S_L1CTL_RESET, ms);
return 0;
struct l1ctl_ccch_mode_conf *conf;
if (msgb_l3len(msg) < sizeof(*conf)) {
- LOGP(DL1C, LOGL_ERROR, "MODE CONF: MSG too short %u\n",
+ LOGP(DL1C, LOGL_ERROR, "CCCH MODE CONF: MSG too short %u\n",
msgb_l3len(msg));
return -1;
}
conf = (struct l1ctl_ccch_mode_conf *) msg->l1h;
- printf("mode=%u\n", conf->ccch_mode);
+ LOGP(DL1C, LOGL_INFO, "CCCH MODE CONF: mode=%u\n", conf->ccch_mode);
mc.ccch_mode = conf->ccch_mode;
mc.ms = ms;
struct l1ctl_tch_mode_conf *conf;
if (msgb_l3len(msg) < sizeof(*conf)) {
- LOGP(DL1C, LOGL_ERROR, "MODE CONF: MSG too short %u\n",
+ LOGP(DL1C, LOGL_ERROR, "TCH MODE CONF: MSG too short %u\n",
msgb_l3len(msg));
return -1;
}
conf = (struct l1ctl_tch_mode_conf *) msg->l1h;
- printf("mode=%u\n", conf->tch_mode);
+ LOGP(DL1C, LOGL_INFO, "TCH MODE CONF: mode=%u\n", conf->tch_mode);
mc.tch_mode = conf->tch_mode;
mc.ms = ms;
rc = rx_l1_sim_conf(ms, msg);
break;
default:
- fprintf(stderr, "Unknown MSG: %u\n", l1h->msg_type);
+ LOGP(DL1C, LOGL_ERROR, "Unknown MSG: %u\n", l1h->msg_type);
msgb_free(msg);
break;
}