summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-06-26 19:08:05 +0200
committerPablo Neira Ayuso2011-06-26 19:08:05 +0200
commit96e7263c85f526f790b4688dfad90247de5a8fac (patch)
tree866faffb516f66f060fe03c1a3c353aca673de73
parentinclude: remove unused prototype _abis_nm_sendmsg(...) definition (diff)
downloadlibosmo-abis-96e7263c85f526f790b4688dfad90247de5a8fac.tar.gz
libosmo-abis-96e7263c85f526f790b4688dfad90247de5a8fac.tar.xz
libosmo-abis-96e7263c85f526f790b4688dfad90247de5a8fac.zip
e1_input: add abis_sendmsg(...)
This patch adds generic abis_sendmsg to send NM messages (both OML and RSL). abis_rsl_sendmsg(...) is basically the same, we'll remove it from libosmo-abis once we can propagate changes to openbsc.
-rw-r--r--include/osmocom/abis/e1_input.h2
-rw-r--r--src/e1_input.c30
2 files changed, 6 insertions, 26 deletions
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index 72656dd..a9b6178 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -230,4 +230,6 @@ struct input_signal_data {
struct e1inp_line *line;
};
+int abis_sendmsg(struct msgb *msg);
+
#endif /* _E1_INPUT_H */
diff --git a/src/e1_input.c b/src/e1_input.c
index 78b593b..057633c 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -203,7 +203,7 @@ const char *e1inp_tstype_name(enum e1inp_ts_type tp)
return ts_types[tp];
}
-int abis_rsl_sendmsg(struct msgb *msg)
+int abis_sendmsg(struct msgb *msg)
{
struct e1inp_sign_link *sign_link = msg->dst;
struct e1inp_driver *e1inp_driver;
@@ -213,7 +213,7 @@ int abis_rsl_sendmsg(struct msgb *msg)
/* don't know how to route this message. */
if (sign_link == NULL) {
- LOGP(DRSL, LOGL_ERROR, "rsl_sendmsg: msg->trx == NULL: %s\n",
+ LOGP(DRSL, LOGL_ERROR, "abis_sendmsg: msg->dst == NULL: %s\n",
osmo_hexdump(msg->data, msg->len));
talloc_free(msg);
return -EINVAL;
@@ -232,31 +232,9 @@ int abis_rsl_sendmsg(struct msgb *msg)
return 0;
}
-int abis_nm_sendmsg(struct msgb *msg)
+int abis_rsl_sendmsg(struct msgb *msg)
{
- struct e1inp_sign_link *sign_link = msg->dst;
- struct e1inp_driver *e1inp_driver;
- struct e1inp_ts *e1i_ts;
-
- msg->l2h = msg->data;
-
- if (!sign_link) {
- LOGP(DNM, LOGL_ERROR, "nm_sendmsg: msg->trx == NULL\n");
- return -EINVAL;
- }
-
- e1i_ts = sign_link->ts;
- if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) {
- /* notify the driver we have something to write */
- e1inp_driver = sign_link->ts->line->driver;
- e1inp_driver->want_write(e1i_ts);
- }
- msgb_enqueue(&sign_link->tx_list, msg);
-
- /* dump it */
- write_pcap_packet(PCAP_OUTPUT, sign_link->sapi, sign_link->tei, msg);
-
- return 0;
+ return abis_sendmsg(msg);
}
/* Timeslot */