[o&m] Dispatch a signal for nacked O&M messages
When trying to operate a nanoBTS900 on channels for 1800 or the other way around the "SET BTS ATTRIBUTES" message will be nacked. Dispatch all nacked messages from abis_nm via signals. Handle this in bsc_hack.c, print a small hint and exit the application as this is considered a fatal unrecoverable error (the exit is in the app, so a library can be more robust).
This commit is contained in:
parent
e91f57879d
commit
500f3ca19d
|
@ -54,6 +54,7 @@ enum signal_abisip {
|
||||||
enum signal_nm {
|
enum signal_nm {
|
||||||
S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */
|
S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */
|
||||||
S_NM_FAIL_REP, /* GSM 12.21 failure event report */
|
S_NM_FAIL_REP, /* GSM 12.21 failure event report */
|
||||||
|
S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SS_LCHAN signals */
|
/* SS_LCHAN signals */
|
||||||
|
|
|
@ -893,6 +893,9 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
||||||
nack_cause_name(*TLVP_VAL(&tp, NM_ATT_NACK_CAUSES)));
|
nack_cause_name(*TLVP_VAL(&tp, NM_ATT_NACK_CAUSES)));
|
||||||
else
|
else
|
||||||
DEBUGPC(DNM, "\n");
|
DEBUGPC(DNM, "\n");
|
||||||
|
|
||||||
|
dispatch_signal(SS_NM, S_NM_NACK, (void*) ((long)mt));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
/* check if last message is to be acked */
|
/* check if last message is to be acked */
|
||||||
|
|
|
@ -454,6 +454,18 @@ static int sw_activ_rep(struct msgb *mb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Callback function for NACK on the OML NM */
|
||||||
|
static int oml_msg_nack(int mt)
|
||||||
|
{
|
||||||
|
if (mt == NM_MT_SET_BTS_ATTR_NACK) {
|
||||||
|
fprintf(stderr, "Failed to set BTS attributes. That is fatal. "
|
||||||
|
"Was the bts type and frequency properly specified?\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Callback function to be called every time we receive a signal from NM */
|
/* Callback function to be called every time we receive a signal from NM */
|
||||||
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
|
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
|
||||||
void *handler_data, void *signal_data)
|
void *handler_data, void *signal_data)
|
||||||
|
@ -461,6 +473,8 @@ static int nm_sig_cb(unsigned int subsys, unsigned int signal,
|
||||||
switch (signal) {
|
switch (signal) {
|
||||||
case S_NM_SW_ACTIV_REP:
|
case S_NM_SW_ACTIV_REP:
|
||||||
return sw_activ_rep(signal_data);
|
return sw_activ_rep(signal_data);
|
||||||
|
case S_NM_NACK:
|
||||||
|
return oml_msg_nack((int)signal_data);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue