[layer23] Several minor changes and minor fixes

This commit is contained in:
Andreas.Eversberg 2010-07-20 10:43:12 +00:00
parent 7b89bb8a84
commit 1f1e867edc
7 changed files with 44 additions and 45 deletions

View File

@ -14,6 +14,7 @@
#define FREQ_TYPE_REP_5 0x20 /* sub channel of SI 5 */ #define FREQ_TYPE_REP_5 0x20 /* sub channel of SI 5 */
#define FREQ_TYPE_REP_5bis 0x40 /* sub channel of SI 5bis */ #define FREQ_TYPE_REP_5bis 0x40 /* sub channel of SI 5bis */
#define FREQ_TYPE_REP_5ter 0x80 /* sub channel of SI 5ter */ #define FREQ_TYPE_REP_5ter 0x80 /* sub channel of SI 5ter */
#define FREQ_TYPE_SI_2_5 0xfc /* both SI 2 and SI 5 */
/* structure of one frequency */ /* structure of one frequency */
struct gsm_sysinfo_freq { struct gsm_sysinfo_freq {

View File

@ -1901,6 +1901,7 @@ int mncc_send(struct osmocom_ms *ms, int msg_type, void *arg)
/* check for SETUP message */ /* check for SETUP message */
if (msg_type != MNCC_SETUP_REQ) { if (msg_type != MNCC_SETUP_REQ) {
/* Invalid call reference */ /* Invalid call reference */
LOGP(DCC, LOGL_NOTICE, "transaction not found\n");
return mncc_release_ind(ms, NULL, data->callref, return mncc_release_ind(ms, NULL, data->callref,
GSM48_CAUSE_LOC_PRN_S_LU, GSM48_CAUSE_LOC_PRN_S_LU,
GSM48_CC_CAUSE_INVAL_TRANS_ID); GSM48_CC_CAUSE_INVAL_TRANS_ID);
@ -1922,6 +1923,12 @@ int mncc_send(struct osmocom_ms *ms, int msg_type, void *arg)
} }
} }
switch (msg_type) {
case GSM_TCHF_FRAME:
printf("TCH/F frame ignored!\n");
return -EINVAL;
}
/* Find function for current state and message */ /* Find function for current state and message */
for (i = 0; i < DOWNSLLEN; i++) for (i = 0; i < DOWNSLLEN; i++)
if ((msg_type == downstatelist[i].type) if ((msg_type == downstatelist[i].type)

View File

@ -3102,9 +3102,6 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms)
uint16_t ma[64]; uint16_t ma[64];
uint8_t ma_len; uint8_t ma_len;
/* 3.3.1.1.3.1 */
stop_rr_t3126(rr);
if (rr->cd_now.h) { if (rr->cd_now.h) {
gsm48_decode_mobile_alloc(s, rr->cd_now.mob_alloc_lv + 1, gsm48_decode_mobile_alloc(s, rr->cd_now.mob_alloc_lv + 1,
rr->cd_now.mob_alloc_lv[0], ma, &ma_len, 0); rr->cd_now.mob_alloc_lv[0], ma, &ma_len, 0);
@ -3114,6 +3111,9 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms)
} }
} }
/* 3.3.1.1.3.1 */
stop_rr_t3126(rr);
/* send DL_EST_REQ */ /* send DL_EST_REQ */
if (rr->rr_est_msg) { if (rr->rr_est_msg) {
/* use queued message */ /* use queued message */

View File

@ -1047,7 +1047,7 @@ for (i = 0; i < (dl->tx_hist[0][2] >> 2); i++)
printf(" == SENT\n"); printf(" == SENT\n");
for (i = 0; i < length; i++) for (i = 0; i < length; i++)
printf(" %02x", msg->l2h[3+i]); printf(" %02x", msg->l2h[3+i]);
printf(" == RECEIVED\n"); printf(" == RECEIVED (len=%d,%d)\n", msg->l2h[2] >> 2, length);
rc = send_rll_simple(RSL_MT_REL_IND, mctx); rc = send_rll_simple(RSL_MT_REL_IND, mctx);
msgb_free(msg); msgb_free(msg);
/* go to idle state */ /* go to idle state */

View File

@ -216,24 +216,23 @@ int mncc_recv_mobile(struct osmocom_ms *ms, int msg_type, void *arg)
if (!first_call && !ms->settings.cw) { if (!first_call && !ms->settings.cw) {
vty_notify(ms, "Incomming call rejected while busy\n"); vty_notify(ms, "Incomming call rejected while busy\n");
LOGP(DMNCC, LOGL_INFO, "Incomming call but busy\n"); LOGP(DMNCC, LOGL_INFO, "Incomming call but busy\n");
cause = GSM48_CC_CAUSE_NORM_CALL_CLEAR; cause = GSM48_CC_CAUSE_USER_BUSY;
goto release; goto release;
} }
/* presentation allowed if present == 0 */ /* presentation allowed if present == 0 */
if (data->calling.present || !data->calling.number[0]) if (data->calling.present || !data->calling.number[0])
vty_notify(ms, "Incomming call (callref %x)\n", vty_notify(ms, "Incomming call (anonymous)\n");
call->callref);
else if (data->calling.type == 1) else if (data->calling.type == 1)
vty_notify(ms, "Incomming call from +%s (callref %x)\n", vty_notify(ms, "Incomming call (from +%s)\n",
data->calling.number, call->callref); data->calling.number);
else if (data->calling.type == 2) else if (data->calling.type == 2)
vty_notify(ms, "Incomming call from 0-%s (callref " vty_notify(ms, "Incomming call (from 0-%s)\n",
"%x)\n", data->calling.number, call->callref); data->calling.number);
else else
vty_notify(ms, "Incomming call from %s (callref %x)\n", vty_notify(ms, "Incomming call (from %s)\n",
data->calling.number, call->callref); data->calling.number);
LOGP(DMNCC, LOGL_INFO, "Incomming call (callref %x)\n", LOGP(DMNCC, LOGL_INFO, "Incomming call (from %s callref %x)\n",
call->callref); data->calling.number, call->callref);
memset(&mncc, 0, sizeof(struct gsm_mncc)); memset(&mncc, 0, sizeof(struct gsm_mncc));
mncc.callref = call->callref; mncc.callref = call->callref;
mncc_send(ms, MNCC_CALL_CONF_REQ, &mncc); mncc_send(ms, MNCC_CALL_CONF_REQ, &mncc);

View File

@ -66,28 +66,26 @@ void gsm_support_init(struct osmocom_ms *ms)
sup->a5_6 = 0; sup->a5_6 = 0;
sup->a5_7 = 0; sup->a5_7 = 0;
/* radio support */ /* radio support */
sup->p_gsm = 1; /* P-GSM only */ sup->p_gsm = 1; /* P-GSM */
sup->e_gsm = 1; /* E-GSM */ sup->e_gsm = 1; /* E-GSM */
sup->r_gsm = 1; /* R-GSM */ sup->r_gsm = 1; /* R-GSM */
sup->r_capa = 0; sup->r_capa = 0;
sup->low_capa = 4; /* p,e,r power class */ sup->low_capa = 4; /* p,e,r power class */
sup->dcs_1800 = 1; sup->dcs_1800 = 1;
/* set supported frequencies */ /* set supported frequencies */
if (sup->e_gsm || sup->r_gsm) if (sup->p_gsm)
sup->freq_map[0] |= 1;
if (sup->p_gsm || sup->e_gsm || sup->r_gsm)
for(i = 1; i <= 124; i++) for(i = 1; i <= 124; i++)
sup->freq_map[i >> 3] |= (1 << (i & 7)); sup->freq_map[i >> 3] |= (1 << (i & 7));
if (sup->dcs_1800) if (sup->dcs_1800)
for(i = 512; i <= 885; i++) for(i = 512; i <= 885; i++)
sup->freq_map[i >> 3] |= (1 << (i & 7)); sup->freq_map[i >> 3] |= (1 << (i & 7));
if (sup->e_gsm) if (sup->e_gsm) {
for(i = 975; i <= 1023; i++) for(i = 975; i <= 1023; i++)
sup->freq_map[i >> 3] |= (1 << (i & 7)); sup->freq_map[i >> 3] |= (1 << (i & 7));
// for(i = 978; i <= 978; i++) sup->freq_map[0] |= 1;
// sup->freq_map[i >> 3] |= (1 << (i & 7)); }
if (sup->r_gsm) if (sup->r_gsm)
for(i = 955; i <= 1023; i++) for(i = 955; i <= 974; i++)
sup->freq_map[i >> 3] |= (1 << (i & 7)); sup->freq_map[i >> 3] |= (1 << (i & 7));
sup->dcs_capa = 1; /* dcs power class */ sup->dcs_capa = 1; /* dcs power class */
/* multi slot support */ /* multi slot support */
@ -113,7 +111,7 @@ struct gsm_support_scan_max gsm_sup_smax[] = {
{ 306, 340, 15, 0 }, /* GSM 480 */ { 306, 340, 15, 0 }, /* GSM 480 */
{ 438, 511, 25, 0 }, { 438, 511, 25, 0 },
{ 128, 251, 30, 0 }, { 128, 251, 30, 0 },
{ 955, 124, 30, 0 }, { 955, 124, 30, 0 }, /* P,E,R GSM */
{ 512, 885, 40, 0 }, /* DCS 1800 */ { 512, 885, 40, 0 }, /* DCS 1800 */
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
@ -124,14 +122,14 @@ void gsm_support_dump(struct gsm_support *sup,
{ {
print(priv, "Supported features of MS '%s':\n", sup->ms->name); print(priv, "Supported features of MS '%s':\n", sup->ms->name);
if (sup->r_gsm) if (sup->r_gsm)
print(priv, " R-GSM"); print(priv, " R-GSM (Channels 955-974)\n");
if (sup->e_gsm || sup->r_gsm) if (sup->e_gsm)
print(priv, " E-GSM"); print(priv, " E-GSM (Channels 975-1023,0)\n");
if (sup->p_gsm || sup->p_gsm || sup->r_gsm) if (sup->p_gsm)
print(priv, " P-GSM"); print(priv, " P-GSM (Channels 1-124)\n");
if (sup->dcs_1800) if (sup->dcs_1800)
print(priv, " DCS1800"); print(priv, " DCS1800 (Channels 512-885)\n");
print(priv, " (Phase %d mobile station)\n", sup->rev_lev + 1); print(priv, " Phase %d mobile station\n", sup->rev_lev + 1);
print(priv, " CECS : %s\n", (sup->es_ind) ? "yes" : "no"); print(priv, " CECS : %s\n", (sup->es_ind) ? "yes" : "no");
print(priv, " VGCS : %s\n", (sup->vgcs) ? "yes" : "no"); print(priv, " VGCS : %s\n", (sup->vgcs) ? "yes" : "no");
print(priv, " VBS : %s\n", (sup->vbs) ? "yes" : "no"); print(priv, " VBS : %s\n", (sup->vbs) ? "yes" : "no");

View File

@ -71,26 +71,20 @@ int gsm48_sysinfo_dump(struct gsm48_sysinfo *s, uint16_t arfcn,
buffer[j + 5] = 'S'; buffer[j + 5] = 'S';
else if ((s->freq[i+j].mask & FREQ_TYPE_HOPP)) else if ((s->freq[i+j].mask & FREQ_TYPE_HOPP))
buffer[j + 5] = 'H'; buffer[j + 5] = 'H';
else if ((s->freq[i+j].mask & FREQ_TYPE_NCELL_2)) else if ((s->freq[i+j].mask & FREQ_TYPE_NCELL))
buffer[j + 5] = 'N'; buffer[j + 5] = 'n';
else if ((s->freq[i+j].mask & FREQ_TYPE_NCELL_2bis)) else if ((s->freq[i+j].mask & FREQ_TYPE_REP))
buffer[j + 5] = 'b'; buffer[j + 5] = 'r';
else if ((s->freq[i+j].mask & FREQ_TYPE_NCELL_2ter)) else if ((s->freq[i+j].mask & FREQ_TYPE_SI_2_5))
buffer[j + 5] = 't'; buffer[j + 5] = '*';
else if ((s->freq[i+j].mask & FREQ_TYPE_REP_5))
buffer[j + 5] = 'R';
else if ((s->freq[i+j].mask & FREQ_TYPE_REP_5bis))
buffer[j + 5] = 'b';
else if ((s->freq[i+j].mask & FREQ_TYPE_REP_5ter))
buffer[j + 5] = 't';
else else
buffer[j + 5] = '.'; buffer[j + 5] = '.';
} }
sprintf(buffer + 69, " %d", i + 63); sprintf(buffer + 69, " %d", i + 63);
print(priv, "%s\n", buffer); print(priv, "%s\n", buffer);
} }
print(priv, " S = serv. cell H = hopping seq. N,b,t = neigh. cells " print(priv, " S = serv. cell H = hopping seq. n = SI2 (neigh.) "
"R,b,t = cells to rep.\n\n"); "r = SI5 (rep.) * = SI2+SI5\n\n");
/* serving cell */ /* serving cell */
print(priv, "Serving Cell:\n"); print(priv, "Serving Cell:\n");