|
|
|
@@ -410,31 +410,11 @@ static struct msgb *nm_msgb_alloc(void)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Send a OML NM Message from BSC to BTS */
|
|
|
|
|
static int abis_nm_queue_msg(struct gsm_bts *bts, struct msgb *msg)
|
|
|
|
|
int abis_nm_sendmsg(struct gsm_bts *bts, struct msgb *msg)
|
|
|
|
|
{
|
|
|
|
|
msg->trx = bts->c0;
|
|
|
|
|
|
|
|
|
|
/* queue OML messages */
|
|
|
|
|
if (llist_empty(&bts->abis_queue) && !bts->abis_nm_pend) {
|
|
|
|
|
bts->abis_nm_pend = OBSC_NM_W_ACK_CB(msg);
|
|
|
|
|
return _abis_nm_sendmsg(msg);
|
|
|
|
|
} else {
|
|
|
|
|
msgb_enqueue(&bts->abis_queue, msg);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int abis_nm_sendmsg(struct gsm_bts *bts, struct msgb *msg)
|
|
|
|
|
{
|
|
|
|
|
OBSC_NM_W_ACK_CB(msg) = 1;
|
|
|
|
|
return abis_nm_queue_msg(bts, msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int abis_nm_sendmsg_direct(struct gsm_bts *bts, struct msgb *msg)
|
|
|
|
|
{
|
|
|
|
|
OBSC_NM_W_ACK_CB(msg) = 0;
|
|
|
|
|
return abis_nm_queue_msg(bts, msg);
|
|
|
|
|
return _abis_nm_sendmsg(msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int abis_nm_rcvmsg_sw(struct msgb *mb);
|
|
|
|
@@ -972,30 +952,12 @@ static int abis_nm_rx_lmt_event(struct msgb *mb)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void abis_nm_queue_send_next(struct gsm_bts *bts)
|
|
|
|
|
{
|
|
|
|
|
int wait = 0;
|
|
|
|
|
struct msgb *msg;
|
|
|
|
|
/* the queue is empty */
|
|
|
|
|
while (!llist_empty(&bts->abis_queue)) {
|
|
|
|
|
msg = msgb_dequeue(&bts->abis_queue);
|
|
|
|
|
wait = OBSC_NM_W_ACK_CB(msg);
|
|
|
|
|
_abis_nm_sendmsg(msg);
|
|
|
|
|
|
|
|
|
|
if (wait)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bts->abis_nm_pend = wait;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Receive a OML NM Message from BTS */
|
|
|
|
|
static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|
|
|
|
{
|
|
|
|
|
struct abis_om_hdr *oh = msgb_l2(mb);
|
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(mb);
|
|
|
|
|
u_int8_t mt = foh->msg_type;
|
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
|
|
/* check for unsolicited message */
|
|
|
|
|
if (is_report(mt))
|
|
|
|
@@ -1019,7 +981,6 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|
|
|
|
LOGPC(DNM, LOGL_ERROR, "\n");
|
|
|
|
|
|
|
|
|
|
dispatch_signal(SS_NM, S_NM_NACK, (void*) &mt);
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#if 0
|
|
|
|
@@ -1041,13 +1002,13 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|
|
|
|
|
|
|
|
|
switch (mt) {
|
|
|
|
|
case NM_MT_CHG_ADM_STATE_ACK:
|
|
|
|
|
ret = abis_nm_rx_chg_adm_state_ack(mb);
|
|
|
|
|
return abis_nm_rx_chg_adm_state_ack(mb);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_SW_ACT_REQ:
|
|
|
|
|
ret = abis_nm_rx_sw_act_req(mb);
|
|
|
|
|
return abis_nm_rx_sw_act_req(mb);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_BS11_LMT_SESSION:
|
|
|
|
|
ret = abis_nm_rx_lmt_event(mb);
|
|
|
|
|
return abis_nm_rx_lmt_event(mb);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_CONN_MDROP_LINK_ACK:
|
|
|
|
|
DEBUGP(DNM, "CONN MDROP LINK ACK\n");
|
|
|
|
@@ -1060,8 +1021,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
return ret;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int abis_nm_rx_ipacc(struct msgb *mb);
|
|
|
|
@@ -1074,7 +1034,6 @@ static int abis_nm_rcvmsg_manuf(struct msgb *mb)
|
|
|
|
|
switch (bts_type) {
|
|
|
|
|
case GSM_BTS_TYPE_NANOBTS:
|
|
|
|
|
rc = abis_nm_rx_ipacc(mb);
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
LOGP(DNM, LOGL_ERROR, "don't know how to parse OML for this "
|
|
|
|
@@ -1318,7 +1277,7 @@ static int sw_load_segment(struct abis_nm_sw *sw)
|
|
|
|
|
sw->obj_instance[0], sw->obj_instance[1],
|
|
|
|
|
sw->obj_instance[2]);
|
|
|
|
|
|
|
|
|
|
return abis_nm_sendmsg_direct(sw->bts, msg);
|
|
|
|
|
return abis_nm_sendmsg(sw->bts, msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 6.2.4 / 8.3.4 Load Data End */
|
|
|
|
@@ -1511,7 +1470,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
sw->cb_data, NULL);
|
|
|
|
|
rc = sw_fill_window(sw);
|
|
|
|
|
sw->state = SW_STATE_WAIT_SEGACK;
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_LOAD_INIT_NACK:
|
|
|
|
|
if (sw->forced) {
|
|
|
|
@@ -1532,7 +1490,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
sw->cb_data, NULL);
|
|
|
|
|
sw->state = SW_STATE_ERROR;
|
|
|
|
|
}
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@@ -1553,7 +1510,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
sw->state = SW_STATE_WAIT_ENDACK;
|
|
|
|
|
rc = sw_load_end(sw);
|
|
|
|
|
}
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_LOAD_ABORT:
|
|
|
|
|
if (sw->cbfn)
|
|
|
|
@@ -1575,7 +1531,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
NM_MT_LOAD_END_ACK, mb,
|
|
|
|
|
sw->cb_data, NULL);
|
|
|
|
|
rc = 0;
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_LOAD_END_NACK:
|
|
|
|
|
if (sw->forced) {
|
|
|
|
@@ -1595,7 +1550,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
NM_MT_LOAD_END_NACK, mb,
|
|
|
|
|
sw->cb_data, NULL);
|
|
|
|
|
}
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SW_STATE_WAIT_ACTACK:
|
|
|
|
@@ -1609,7 +1563,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
sw->cbfn(GSM_HOOK_NM_SWLOAD,
|
|
|
|
|
NM_MT_ACTIVATE_SW_ACK, mb,
|
|
|
|
|
sw->cb_data, NULL);
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
case NM_MT_ACTIVATE_SW_NACK:
|
|
|
|
|
DEBUGP(DNM, "Activate Software NACK\n");
|
|
|
|
@@ -1619,7 +1572,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|
|
|
|
sw->cbfn(GSM_HOOK_NM_SWLOAD,
|
|
|
|
|
NM_MT_ACTIVATE_SW_NACK, mb,
|
|
|
|
|
sw->cb_data, NULL);
|
|
|
|
|
abis_nm_queue_send_next(mb->trx->bts);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SW_STATE_NONE:
|
|
|
|
@@ -2062,7 +2014,7 @@ int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1,
|
|
|
|
|
if (nack)
|
|
|
|
|
msgb_tv_put(msg, NM_ATT_NACK_CAUSES, NM_NACK_OBJCLASS_NOTSUPP);
|
|
|
|
|
|
|
|
|
|
return abis_nm_sendmsg_direct(bts, msg);
|
|
|
|
|
return abis_nm_sendmsg(bts, msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *rawmsg)
|
|
|
|
@@ -3064,15 +3016,3 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void abis_nm_clear_queue(struct gsm_bts *bts)
|
|
|
|
|
{
|
|
|
|
|
struct msgb *msg;
|
|
|
|
|
|
|
|
|
|
while (!llist_empty(&bts->abis_queue)) {
|
|
|
|
|
msg = msgb_dequeue(&bts->abis_queue);
|
|
|
|
|
msgb_free(msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bts->abis_nm_pend = 0;
|
|
|
|
|
}
|
|
|
|
|