mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
Revert "abis_nm: Band aid on OML initialisation by queuing messages"
This has not fixed the init issue and we will need to figure out
an alternative to this.
This reverts commit a68f139820
.
This commit is contained in:
@@ -170,6 +170,4 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
|
|||||||
const char *nm_opstate_name(u_int8_t os);
|
const char *nm_opstate_name(u_int8_t os);
|
||||||
const char *nm_avail_name(u_int8_t avail);
|
const char *nm_avail_name(u_int8_t avail);
|
||||||
int nm_is_running(struct gsm_nm_state *s);
|
int nm_is_running(struct gsm_nm_state *s);
|
||||||
void abis_nm_clear_queue(struct gsm_bts *bts);
|
|
||||||
|
|
||||||
#endif /* _NM_H */
|
#endif /* _NM_H */
|
||||||
|
@@ -81,7 +81,6 @@ enum bts_gprs_mode {
|
|||||||
BTS_GPRS_EGPRS = 2,
|
BTS_GPRS_EGPRS = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
|
|
||||||
struct msgb;
|
struct msgb;
|
||||||
typedef int gsm_cbfn(unsigned int hooknum,
|
typedef int gsm_cbfn(unsigned int hooknum,
|
||||||
unsigned int event,
|
unsigned int event,
|
||||||
@@ -541,10 +540,6 @@ struct gsm_bts {
|
|||||||
/* transceivers */
|
/* transceivers */
|
||||||
int num_trx;
|
int num_trx;
|
||||||
struct llist_head trx_list;
|
struct llist_head trx_list;
|
||||||
|
|
||||||
/* Abis NM queue */
|
|
||||||
struct llist_head abis_queue;
|
|
||||||
int abis_nm_pend;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Some statistics of our network */
|
/* Some statistics of our network */
|
||||||
|
@@ -410,31 +410,11 @@ static struct msgb *nm_msgb_alloc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send a OML NM Message from BSC to BTS */
|
/* 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;
|
msg->trx = bts->c0;
|
||||||
|
|
||||||
/* queue OML messages */
|
return _abis_nm_sendmsg(msg);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int abis_nm_rcvmsg_sw(struct msgb *mb);
|
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;
|
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 */
|
/* Receive a OML NM Message from BTS */
|
||||||
static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
||||||
{
|
{
|
||||||
struct abis_om_hdr *oh = msgb_l2(mb);
|
struct abis_om_hdr *oh = msgb_l2(mb);
|
||||||
struct abis_om_fom_hdr *foh = msgb_l3(mb);
|
struct abis_om_fom_hdr *foh = msgb_l3(mb);
|
||||||
u_int8_t mt = foh->msg_type;
|
u_int8_t mt = foh->msg_type;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/* check for unsolicited message */
|
/* check for unsolicited message */
|
||||||
if (is_report(mt))
|
if (is_report(mt))
|
||||||
@@ -1019,7 +981,6 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|||||||
LOGPC(DNM, LOGL_ERROR, "\n");
|
LOGPC(DNM, LOGL_ERROR, "\n");
|
||||||
|
|
||||||
dispatch_signal(SS_NM, S_NM_NACK, (void*) &mt);
|
dispatch_signal(SS_NM, S_NM_NACK, (void*) &mt);
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1041,13 +1002,13 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|||||||
|
|
||||||
switch (mt) {
|
switch (mt) {
|
||||||
case NM_MT_CHG_ADM_STATE_ACK:
|
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;
|
break;
|
||||||
case NM_MT_SW_ACT_REQ:
|
case NM_MT_SW_ACT_REQ:
|
||||||
ret = abis_nm_rx_sw_act_req(mb);
|
return abis_nm_rx_sw_act_req(mb);
|
||||||
break;
|
break;
|
||||||
case NM_MT_BS11_LMT_SESSION:
|
case NM_MT_BS11_LMT_SESSION:
|
||||||
ret = abis_nm_rx_lmt_event(mb);
|
return abis_nm_rx_lmt_event(mb);
|
||||||
break;
|
break;
|
||||||
case NM_MT_CONN_MDROP_LINK_ACK:
|
case NM_MT_CONN_MDROP_LINK_ACK:
|
||||||
DEBUGP(DNM, "CONN MDROP LINK ACK\n");
|
DEBUGP(DNM, "CONN MDROP LINK ACK\n");
|
||||||
@@ -1060,8 +1021,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
return 0;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int abis_nm_rx_ipacc(struct msgb *mb);
|
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) {
|
switch (bts_type) {
|
||||||
case GSM_BTS_TYPE_NANOBTS:
|
case GSM_BTS_TYPE_NANOBTS:
|
||||||
rc = abis_nm_rx_ipacc(mb);
|
rc = abis_nm_rx_ipacc(mb);
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGP(DNM, LOGL_ERROR, "don't know how to parse OML for this "
|
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[0], sw->obj_instance[1],
|
||||||
sw->obj_instance[2]);
|
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 */
|
/* 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);
|
sw->cb_data, NULL);
|
||||||
rc = sw_fill_window(sw);
|
rc = sw_fill_window(sw);
|
||||||
sw->state = SW_STATE_WAIT_SEGACK;
|
sw->state = SW_STATE_WAIT_SEGACK;
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
case NM_MT_LOAD_INIT_NACK:
|
case NM_MT_LOAD_INIT_NACK:
|
||||||
if (sw->forced) {
|
if (sw->forced) {
|
||||||
@@ -1532,7 +1490,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|||||||
sw->cb_data, NULL);
|
sw->cb_data, NULL);
|
||||||
sw->state = SW_STATE_ERROR;
|
sw->state = SW_STATE_ERROR;
|
||||||
}
|
}
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1553,7 +1510,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|||||||
sw->state = SW_STATE_WAIT_ENDACK;
|
sw->state = SW_STATE_WAIT_ENDACK;
|
||||||
rc = sw_load_end(sw);
|
rc = sw_load_end(sw);
|
||||||
}
|
}
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
case NM_MT_LOAD_ABORT:
|
case NM_MT_LOAD_ABORT:
|
||||||
if (sw->cbfn)
|
if (sw->cbfn)
|
||||||
@@ -1575,7 +1531,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|||||||
NM_MT_LOAD_END_ACK, mb,
|
NM_MT_LOAD_END_ACK, mb,
|
||||||
sw->cb_data, NULL);
|
sw->cb_data, NULL);
|
||||||
rc = 0;
|
rc = 0;
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
case NM_MT_LOAD_END_NACK:
|
case NM_MT_LOAD_END_NACK:
|
||||||
if (sw->forced) {
|
if (sw->forced) {
|
||||||
@@ -1595,7 +1550,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|||||||
NM_MT_LOAD_END_NACK, mb,
|
NM_MT_LOAD_END_NACK, mb,
|
||||||
sw->cb_data, NULL);
|
sw->cb_data, NULL);
|
||||||
}
|
}
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SW_STATE_WAIT_ACTACK:
|
case SW_STATE_WAIT_ACTACK:
|
||||||
@@ -1609,7 +1563,6 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
|
|||||||
sw->cbfn(GSM_HOOK_NM_SWLOAD,
|
sw->cbfn(GSM_HOOK_NM_SWLOAD,
|
||||||
NM_MT_ACTIVATE_SW_ACK, mb,
|
NM_MT_ACTIVATE_SW_ACK, mb,
|
||||||
sw->cb_data, NULL);
|
sw->cb_data, NULL);
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
case NM_MT_ACTIVATE_SW_NACK:
|
case NM_MT_ACTIVATE_SW_NACK:
|
||||||
DEBUGP(DNM, "Activate Software NACK\n");
|
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,
|
sw->cbfn(GSM_HOOK_NM_SWLOAD,
|
||||||
NM_MT_ACTIVATE_SW_NACK, mb,
|
NM_MT_ACTIVATE_SW_NACK, mb,
|
||||||
sw->cb_data, NULL);
|
sw->cb_data, NULL);
|
||||||
abis_nm_queue_send_next(mb->trx->bts);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SW_STATE_NONE:
|
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)
|
if (nack)
|
||||||
msgb_tv_put(msg, NM_ATT_NACK_CAUSES, NM_NACK_OBJCLASS_NOTSUPP);
|
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)
|
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;
|
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;
|
|
||||||
}
|
|
||||||
|
@@ -979,8 +979,6 @@ void input_event(int event, enum e1inp_sign_type type, struct gsm_bts_trx *trx)
|
|||||||
trx->nm_state.availability = 0;
|
trx->nm_state.availability = 0;
|
||||||
trx->bb_transc.nm_state.operational = 0;
|
trx->bb_transc.nm_state.operational = 0;
|
||||||
trx->bb_transc.nm_state.availability = 0;
|
trx->bb_transc.nm_state.availability = 0;
|
||||||
|
|
||||||
abis_nm_clear_queue(trx->bts);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -234,8 +234,6 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
|
|||||||
bts->rach_b_thresh = -1;
|
bts->rach_b_thresh = -1;
|
||||||
bts->rach_ldavg_slots = -1;
|
bts->rach_ldavg_slots = -1;
|
||||||
|
|
||||||
INIT_LLIST_HEAD(&bts->abis_queue);
|
|
||||||
|
|
||||||
llist_add_tail(&bts->list, &net->bts_list);
|
llist_add_tail(&bts->list, &net->bts_list);
|
||||||
|
|
||||||
return bts;
|
return bts;
|
||||||
|
@@ -573,7 +573,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
|
|||||||
e1i_ts->sign.tx_timer.data = e1i_ts;
|
e1i_ts->sign.tx_timer.data = e1i_ts;
|
||||||
|
|
||||||
/* Reducing this might break the nanoBTS 900 init. */
|
/* Reducing this might break the nanoBTS 900 init. */
|
||||||
bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 0);
|
bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user