From 4e862cbf4b3b438a07ea89438f4384bd10468ea9 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 19 Aug 2011 18:43:38 +0200 Subject: e1_input: rework configuration of virtual E1 line operations struct e1inp_line_ops { - enum e1inp_line_role role; - char *addr; - void *data; + union { + struct { + enum e1inp_line_role role; /* BSC or BTS mode. */ + const char *addr; /* IP address .*/ + void *dev; /* device parameters. */ + } ipa; + struct { + const char *port; /* e.g. /dev/ttyUSB0 */ + unsigned int delay; + } rs232; + } cfg; Now this structure contains the configuration details for the virtual E1 line, instead of using a pointer. This also get the line_update callback to its original layout: + int (*line_update)(struct e1inp_line *line); --- include/osmocom/abis/e1_input.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'include/osmocom/abis') diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index 9562928..757f3f2 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -126,15 +126,23 @@ struct e1inp_driver { struct llist_head list; const char *name; int (*want_write)(struct e1inp_ts *ts); - int (*line_update)(struct e1inp_line *line, enum e1inp_line_role role, const char *addr); + int (*line_update)(struct e1inp_line *line); void (*close)(struct e1inp_sign_link *link); int default_delay; }; struct e1inp_line_ops { - enum e1inp_line_role role; - char *addr; - void *data; + union { + struct { + enum e1inp_line_role role; /* BSC or BTS mode. */ + const char *addr; /* IP address .*/ + void *dev; /* device parameters. */ + } ipa; + struct { + const char *port; /* e.g. /dev/ttyUSB0 */ + unsigned int delay; + } rs232; + } cfg; struct e1inp_sign_link * (*sign_link_up)(void *unit_info, struct e1inp_line *line, enum e1inp_sign_type type); void (*sign_link_down)(struct e1inp_line *line); -- cgit v1.2.3-55-g7522