2010-04-25 16:28:24 +00:00
|
|
|
/*
|
|
|
|
* (C) 2010 by Andreas Eversberg <jolly@eversberg.eu>
|
|
|
|
*
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-04-29 18:46:11 +00:00
|
|
|
#include <stdio.h>
|
2010-04-25 16:28:24 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <osmocom/osmocom_data.h>
|
2010-04-29 18:46:11 +00:00
|
|
|
#include <osmocom/networks.h>
|
2010-04-25 16:28:24 +00:00
|
|
|
|
2010-06-12 16:11:35 +00:00
|
|
|
int gsm48_sysinfo_dump(struct gsm48_sysinfo *s, uint16_t arfcn,
|
2010-05-09 16:01:49 +00:00
|
|
|
void (*print)(void *, const char *, ...), void *priv)
|
2010-04-25 16:28:24 +00:00
|
|
|
{
|
2010-04-29 18:46:11 +00:00
|
|
|
char buffer[80];
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
/* available sysinfos */
|
2010-06-12 17:45:47 +00:00
|
|
|
print(priv, "ARFCN = %d\n", arfcn);
|
|
|
|
print(priv, "Available SYSTEM INFORMATIONS =");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si1)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 1");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si2)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 2");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si2bis)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 2bis");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si2ter)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 2ter");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si3)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 3");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si4)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 4");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si5)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 5");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si5bis)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 5bis");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si5ter)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 5ter");
|
2010-04-29 18:46:11 +00:00
|
|
|
if (s->si6)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " 6");
|
|
|
|
print(priv, "\n");
|
|
|
|
print(priv, "\n");
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
/* frequency map */
|
|
|
|
for (i = 0; i < 1024; i += 64) {
|
|
|
|
if (i < 10)
|
|
|
|
sprintf(buffer, " %d ", i);
|
|
|
|
else if (i < 100)
|
|
|
|
sprintf(buffer, " %d ", i);
|
|
|
|
else
|
|
|
|
sprintf(buffer, " %d ", i);
|
|
|
|
for (j = 0; j < 64; j++) {
|
|
|
|
if ((s->freq[i+j].mask & FREQ_TYPE_SERV))
|
|
|
|
buffer[j + 5] = 'S';
|
|
|
|
else if ((s->freq[i+j].mask & FREQ_TYPE_HOPP))
|
|
|
|
buffer[j + 5] = 'H';
|
2010-07-20 10:43:12 +00:00
|
|
|
else if ((s->freq[i+j].mask & FREQ_TYPE_NCELL))
|
|
|
|
buffer[j + 5] = 'n';
|
|
|
|
else if ((s->freq[i+j].mask & FREQ_TYPE_REP))
|
|
|
|
buffer[j + 5] = 'r';
|
|
|
|
else if ((s->freq[i+j].mask & FREQ_TYPE_SI_2_5))
|
|
|
|
buffer[j + 5] = '*';
|
2010-04-29 18:46:11 +00:00
|
|
|
else
|
|
|
|
buffer[j + 5] = '.';
|
|
|
|
}
|
|
|
|
sprintf(buffer + 69, " %d", i + 63);
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "%s\n", buffer);
|
2010-04-29 18:46:11 +00:00
|
|
|
}
|
2010-07-20 10:43:12 +00:00
|
|
|
print(priv, " S = serv. cell H = hopping seq. n = SI2 (neigh.) "
|
|
|
|
"r = SI5 (rep.) * = SI2+SI5\n\n");
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
/* serving cell */
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "Serving Cell:\n");
|
|
|
|
print(priv, " MCC = %03d MNC = %02d LAC = 0x%04x Cell ID = 0x%04x "
|
2010-04-29 18:46:11 +00:00
|
|
|
"(%s, %s)\n", s->mcc, s->mnc, s->lac, s->cell_id,
|
|
|
|
gsm_get_mcc(s->mcc), gsm_get_mnc(s->mcc, s->mnc));
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " MAX_RETRANS = %d TX_INTEGER = %d re-establish = %s\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->max_retrans, s->tx_integer,
|
|
|
|
(s->reest_denied) ? "denied" : "allowed");
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " Cell barred = %s barred classes =",
|
2010-04-29 18:46:11 +00:00
|
|
|
(s->cell_barr ? "yes" : "no"));
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
if ((s->class_barr & (1 << i)))
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " C%d", i);
|
2010-04-29 18:46:11 +00:00
|
|
|
}
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "\n");
|
2010-05-09 09:40:41 +00:00
|
|
|
if (s->sp)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " CBQ = %d CRO = %d TEMP_OFFSET = %d "
|
|
|
|
"PENALTY_TIME = %d\n", s->sp_cbq, s->sp_cro, s->sp_to,
|
|
|
|
s->sp_pt);
|
|
|
|
print(priv, "\n");
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
/* neighbor cell */
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "Neighbor Cell:\n");
|
|
|
|
print(priv, " MAX_RETRANS = %d TX_INTEGER = %d re-establish = %s\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->nb_max_retrans, s->nb_tx_integer,
|
|
|
|
(s->nb_reest_denied) ? "denied" : "allowed");
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " Cell barred = %s barred classes =",
|
2010-04-29 18:46:11 +00:00
|
|
|
(s->nb_cell_barr ? "yes" : "no"));
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
if ((s->nb_class_barr & (1 << i)))
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " C%d", i);
|
2010-04-29 18:46:11 +00:00
|
|
|
}
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "\n");
|
|
|
|
print(priv, "\n");
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
/* cell selection */
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "MX_TXPWR_MAX_CCCH = %d CRH = %d RXLEV_MIN = %d "
|
2010-07-13 14:14:54 +00:00
|
|
|
"NECI = %d ACS = %d\n", s->ms_txpwr_max_cch,
|
2010-05-09 16:01:49 +00:00
|
|
|
s->cell_resel_hyst_db, s->rxlev_acc_min_db, s->neci, s->acs);
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
/* bcch options */
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "BCCH link timeout = %d DTX = %d PWRC = %d\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->bcch_radio_link_timeout, s->bcch_dtx, s->bcch_pwrc);
|
|
|
|
|
|
|
|
/* sacch options */
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "SACCH link timeout = %d DTX = %d PWRC = %d\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->sacch_radio_link_timeout, s->sacch_dtx, s->sacch_pwrc);
|
|
|
|
|
|
|
|
/* control channel */
|
|
|
|
switch(s->ccch_conf) {
|
|
|
|
case 0:
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "CCCH Config = 1 CCCH");
|
2010-04-29 18:46:11 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "CCCH Config = 1 CCCH + SDCCH");
|
2010-04-29 18:46:11 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "CCCH Config = 2 CCCH");
|
2010-04-29 18:46:11 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "CCCH Config = 3 CCCH");
|
2010-04-29 18:46:11 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "CCCH Config = 4 CCCH");
|
2010-04-29 18:46:11 +00:00
|
|
|
break;
|
|
|
|
default:
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "CCCH Config = reserved");
|
2010-04-29 18:46:11 +00:00
|
|
|
}
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, " BS-PA-MFMS = %d Attachment = %s\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->pag_mf_periods, (s->att_allowed) ? "allowed" : "denied");
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "BS-AG_BLKS_RES = %d\n", s->bs_ag_blks_res);
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
/* channel description */
|
|
|
|
if (s->h)
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "chan_nr = 0x%02x TSC = %d MAIO = %d HSN = %d\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->chan_nr, s->tsc, s->maio, s->hsn);
|
|
|
|
else
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "chan_nr = 0x%02x TSC = %d ARFCN = %d\n",
|
2010-04-29 18:46:11 +00:00
|
|
|
s->chan_nr, s->tsc, s->arfcn);
|
2010-05-09 16:01:49 +00:00
|
|
|
print(priv, "\n");
|
2010-04-29 18:46:11 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|