Fix Ericsson RBS2000 support after libosmo-abis merge

The libosmo-abis merge broke Ericsson RBS support, as it didn't get the
part right where the per-TRX OML sign_link is determined while
transmitting OM2000 messages.

As a result of this fix, we can remove the 'to_trx_oml' parameter to
_abis_nm_sendmsg(), which is a nice cleanup.
This commit is contained in:
Harald Welte 2011-09-26 23:43:23 +02:00
parent 4f8ad5350a
commit 15eae8dcaf
3 changed files with 12 additions and 22 deletions

View File

@ -160,7 +160,7 @@ int abis_nm_vty_init(void);
void abis_nm_clear_queue(struct gsm_bts *bts); void abis_nm_clear_queue(struct gsm_bts *bts);
int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml); int _abis_nm_sendmsg(struct msgb *msg);
void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */ void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */

View File

@ -114,10 +114,8 @@ static struct msgb *nm_msgb_alloc(void)
"OML"); "OML");
} }
int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) int _abis_nm_sendmsg(struct msgb *msg)
{ {
struct e1inp_sign_link *sign_link = msg->dst;
msg->l2h = msg->data; msg->l2h = msg->data;
if (!msg->dst) { if (!msg->dst) {
@ -125,12 +123,6 @@ int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml)
return -EINVAL; return -EINVAL;
} }
/* Check for TRX-specific OML link first */
if (to_trx_oml) {
if (!sign_link->trx->oml_link)
return -ENODEV;
msg->dst = sign_link->trx->oml_link;
}
return abis_sendmsg(msg); return abis_sendmsg(msg);
} }
@ -142,7 +134,7 @@ static int abis_nm_queue_msg(struct gsm_bts *bts, struct msgb *msg)
/* queue OML messages */ /* queue OML messages */
if (llist_empty(&bts->abis_queue) && !bts->abis_nm_pend) { if (llist_empty(&bts->abis_queue) && !bts->abis_nm_pend) {
bts->abis_nm_pend = OBSC_NM_W_ACK_CB(msg); bts->abis_nm_pend = OBSC_NM_W_ACK_CB(msg);
return _abis_nm_sendmsg(msg, 0); return _abis_nm_sendmsg(msg);
} else { } else {
msgb_enqueue(&bts->abis_queue, msg); msgb_enqueue(&bts->abis_queue, msg);
return 0; return 0;
@ -508,7 +500,7 @@ void abis_nm_queue_send_next(struct gsm_bts *bts)
while (!llist_empty(&bts->abis_queue)) { while (!llist_empty(&bts->abis_queue)) {
msg = msgb_dequeue(&bts->abis_queue); msg = msgb_dequeue(&bts->abis_queue);
wait = OBSC_NM_W_ACK_CB(msg); wait = OBSC_NM_W_ACK_CB(msg);
_abis_nm_sendmsg(msg, 0); _abis_nm_sendmsg(msg);
if (wait) if (wait)
break; break;

View File

@ -799,8 +799,8 @@ static void signal_op_state(struct gsm_bts *bts, struct abis_om2k_mo *mo)
static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg) static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg)
{ {
struct e1inp_sign_link *sign_link = (struct e1inp_sign_link *)msg;
struct abis_om2k_hdr *o2h; struct abis_om2k_hdr *o2h;
struct gsm_bts_trx *trx;
int to_trx_oml; int to_trx_oml;
msg->l2h = msg->data; msg->l2h = msg->data;
@ -814,9 +814,8 @@ static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg)
case OM2K_MO_CLS_TX: case OM2K_MO_CLS_TX:
case OM2K_MO_CLS_RX: case OM2K_MO_CLS_RX:
/* Route through per-TRX OML Link to the appropriate TRX */ /* Route through per-TRX OML Link to the appropriate TRX */
to_trx_oml = 1; trx = gsm_bts_trx_by_nr(bts, o2h->mo.inst);
sign_link->trx = gsm_bts_trx_by_nr(bts, o2h->mo.inst); if (!trx) {
if (!sign_link->trx) {
LOGP(DNM, LOGL_ERROR, "MO=%s Tx Dropping msg to " LOGP(DNM, LOGL_ERROR, "MO=%s Tx Dropping msg to "
"non-existing TRX\n", om2k_mo_name(&o2h->mo)); "non-existing TRX\n", om2k_mo_name(&o2h->mo));
return -ENODEV; return -ENODEV;
@ -824,9 +823,8 @@ static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg)
break; break;
case OM2K_MO_CLS_TS: case OM2K_MO_CLS_TS:
/* Route through per-TRX OML Link to the appropriate TRX */ /* Route through per-TRX OML Link to the appropriate TRX */
to_trx_oml = 1; trx = gsm_bts_trx_by_nr(bts, o2h->mo.assoc_so);
sign_link->trx = gsm_bts_trx_by_nr(bts, o2h->mo.assoc_so); if (!trx) {
if (!sign_link->trx) {
LOGP(DNM, LOGL_ERROR, "MO=%s Tx Dropping msg to " LOGP(DNM, LOGL_ERROR, "MO=%s Tx Dropping msg to "
"non-existing TRX\n", om2k_mo_name(&o2h->mo)); "non-existing TRX\n", om2k_mo_name(&o2h->mo));
return -ENODEV; return -ENODEV;
@ -834,12 +832,12 @@ static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg)
break; break;
default: default:
/* Route through the IXU/DXU OML Link */ /* Route through the IXU/DXU OML Link */
sign_link->trx = bts->c0; trx = bts->c0;
to_trx_oml = 0;
break; break;
} }
msg->dst = trx->oml_link;
return _abis_nm_sendmsg(msg, to_trx_oml); return _abis_nm_sendmsg(msg);
} }
static void fill_om2k_hdr(struct abis_om2k_hdr *o2h, const struct abis_om2k_mo *mo, static void fill_om2k_hdr(struct abis_om2k_hdr *o2h, const struct abis_om2k_mo *mo,