From 5a4b7c54c699889b3255e578ef75c0989622b541 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 7 Jun 2011 14:07:48 +0200 Subject: e1input: rework generic (virtual and real) E1 line operations struct e1inp_line_ops { int (*sign_link_up)(struct msgb *msg, struct e1inp_line *line); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); int (*error)(struct msgb *msg, int error); }; The description of the operations is the following: * sign_link_up is invoked if the signalling link becomes up. In A-bis over IP, we have to wait until the other peer identifies itself as a BTS/BSC device, then this function is invoked. This function is not used by ISDN drivers, the signalling link can be set up just after the line is created. * sign_link is called if we receive OML/RSL message. This function is used both by ISDN and A-bis over IP drivers. * error is called if we receive a malformed message. It is used both by ISDN and A-bis over IP drivers. --- include/osmocom/abis/e1_input.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/osmocom/abis/e1_input.h') diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index 24af27a..c401baa 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -119,6 +119,12 @@ struct e1inp_driver { int default_delay; }; +struct e1inp_line_ops { + int (*sign_link_up)(struct msgb *msg, struct e1inp_line *line); + int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); + int (*error)(struct msgb *msg, int error); +}; + struct e1inp_line { struct llist_head list; int refcnt; @@ -129,8 +135,7 @@ struct e1inp_line { /* array of timestlots */ struct e1inp_ts ts[NUM_E1_TS]; - int (*rx)(struct msgb *msg, struct e1inp_ts *ts); - int (*rx_err)(int error); + struct e1inp_line_ops ops; struct e1inp_driver *driver; void *driver_data; @@ -159,7 +164,7 @@ int e1inp_line_register(struct e1inp_line *line); struct e1inp_line *e1inp_line_get(uint8_t e1_nr); /* create a line in the E1 input core */ -struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name, int (*rx)(struct msgb *msg, struct e1inp_ts *ts), int (*rx_err)(int error)); +struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name, const struct e1inp_line_ops *ops); /* find a sign_link for given TEI and SAPI in a TS */ struct e1inp_sign_link * -- cgit v1.2.3-55-g7522