Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 1 | #ifndef _E1_INPUT_H |
| 2 | #define _E1_INPUT_H |
| 3 | |
| 4 | #include <stdlib.h> |
| 5 | #include <netinet/in.h> |
| 6 | |
| 7 | #include <osmocom/core/linuxlist.h> |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 8 | #include <osmocom/core/timer.h> |
| 9 | #include <osmocom/core/msgb.h> |
| 10 | #include <osmocom/core/select.h> |
Pablo Neira Ayuso | 177094b | 2011-06-07 12:21:51 +0200 | [diff] [blame] | 11 | #include <osmocom/abis/subchan_demux.h> |
Andreas Eversberg | a7ff001 | 2011-09-26 11:29:30 +0200 | [diff] [blame] | 12 | #include <osmocom/abis/lapd.h> |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 13 | |
| 14 | #define NUM_E1_TS 32 |
Jacob Erlbeck | 86dae84 | 2014-01-16 18:10:37 +0100 | [diff] [blame] | 15 | #define E1INP_USE_DEFAULT (-1) |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 16 | |
Harald Welte | b5af099 | 2020-01-12 12:59:52 +0100 | [diff] [blame] | 17 | #define LOGPITS(e1ts, ss, level, fmt, args ...) \ |
| 18 | LOGP(ss, level, "E1TS(%u:%u) " fmt, (e1ts)->line->num, (e1ts)->num, ## args) |
| 19 | |
| 20 | #define LOGPIL(e1l, ss, level, fmt, args ...) \ |
| 21 | LOGP(ss, level, "E1L(%u) " fmt, (e1l)->num, ## args) |
| 22 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 23 | enum e1inp_sign_type { |
| 24 | E1INP_SIGN_NONE, |
| 25 | E1INP_SIGN_OML, |
| 26 | E1INP_SIGN_RSL, |
Harald Welte | 46fc7e2 | 2014-08-18 19:04:26 +0200 | [diff] [blame] | 27 | E1INP_SIGN_OSMO, /* IPA CCM OSMO sub-type */ |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 28 | }; |
| 29 | const char *e1inp_signtype_name(enum e1inp_sign_type tp); |
Arran Cudbard-Bell | 67b81eb | 2016-11-02 11:48:24 -0400 | [diff] [blame] | 30 | extern const struct value_string e1inp_sign_type_names[5]; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 31 | |
Harald Welte | f2737fc | 2011-08-16 14:30:10 +0200 | [diff] [blame] | 32 | enum e1inp_ctr { |
| 33 | E1I_CTR_HDLC_ABORT, |
| 34 | E1I_CTR_HDLC_BADFCS, |
| 35 | E1I_CTR_HDLC_OVERR, |
| 36 | E1I_CTR_ALARM, |
| 37 | E1I_CTR_REMOVED, |
| 38 | }; |
| 39 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 40 | struct e1inp_ts; |
Harald Welte | fe05cf5 | 2011-09-26 23:18:41 +0200 | [diff] [blame] | 41 | struct vty; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 42 | |
| 43 | struct e1inp_sign_link { |
| 44 | /* list of signalling links */ |
| 45 | struct llist_head list; |
| 46 | |
| 47 | /* to which timeslot do we belong? */ |
| 48 | struct e1inp_ts *ts; |
| 49 | |
| 50 | enum e1inp_sign_type type; |
| 51 | |
| 52 | /* trx for msg->trx of received msgs */ |
| 53 | struct gsm_bts_trx *trx; |
| 54 | |
| 55 | /* msgb queue of to-be-transmitted msgs */ |
| 56 | struct llist_head tx_list; |
| 57 | |
| 58 | /* SAPI and TEI on the E1 TS */ |
| 59 | uint8_t sapi; |
| 60 | uint8_t tei; |
| 61 | |
| 62 | union { |
| 63 | struct { |
| 64 | uint8_t channel; |
| 65 | } misdn; |
| 66 | } driver; |
| 67 | }; |
| 68 | |
| 69 | enum e1inp_ts_type { |
| 70 | E1INP_TS_TYPE_NONE, |
| 71 | E1INP_TS_TYPE_SIGN, |
| 72 | E1INP_TS_TYPE_TRAU, |
Harald Welte | a0108e7 | 2016-07-27 21:44:50 +0200 | [diff] [blame] | 73 | E1INP_TS_TYPE_RAW, |
Harald Welte | 7a228eb | 2016-07-28 11:09:31 +0200 | [diff] [blame] | 74 | E1INP_TS_TYPE_HDLC, |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 75 | }; |
| 76 | const char *e1inp_tstype_name(enum e1inp_ts_type tp); |
Arran Cudbard-Bell | 67b81eb | 2016-11-02 11:48:24 -0400 | [diff] [blame] | 77 | extern const struct value_string e1inp_ts_type_names[6]; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 78 | |
| 79 | /* A timeslot in the E1 interface */ |
| 80 | struct e1inp_ts { |
| 81 | enum e1inp_ts_type type; |
| 82 | int num; |
| 83 | |
| 84 | /* to which line do we belong ? */ |
| 85 | struct e1inp_line *line; |
| 86 | |
Harald Welte | fd44a5f | 2011-08-21 00:48:54 +0200 | [diff] [blame] | 87 | /* LAPD instance, if any */ |
| 88 | struct lapd_instance *lapd; |
| 89 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 90 | union { |
| 91 | struct { |
| 92 | /* list of all signalling links on this TS */ |
| 93 | struct llist_head sign_links; |
| 94 | /* delay for the queue */ |
| 95 | int delay; |
| 96 | /* timer when to dequeue next frame */ |
| 97 | struct osmo_timer_list tx_timer; |
| 98 | } sign; |
| 99 | struct { |
| 100 | /* subchannel demuxer for frames from E1 */ |
| 101 | struct subch_demux demux; |
| 102 | /* subchannel muxer for frames to E1 */ |
| 103 | struct subch_mux mux; |
| 104 | } trau; |
Harald Welte | a0108e7 | 2016-07-27 21:44:50 +0200 | [diff] [blame] | 105 | struct { |
| 106 | /* call-back for every received frame */ |
| 107 | void (*recv_cb)(struct e1inp_ts *ts, struct msgb *msg); |
| 108 | /* queue of pending to-be-transmitted msgbs */ |
| 109 | struct llist_head tx_queue; |
| 110 | } raw; |
Harald Welte | 7a228eb | 2016-07-28 11:09:31 +0200 | [diff] [blame] | 111 | struct { |
| 112 | /* call-back for every received frame */ |
| 113 | void (*recv_cb)(struct e1inp_ts *ts, struct msgb *msg); |
| 114 | /* queue of pending to-be-transmitted msgbs */ |
| 115 | struct llist_head tx_queue; |
| 116 | } hdlc; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 117 | }; |
| 118 | union { |
| 119 | struct { |
| 120 | /* mISDN driver has one fd for each ts */ |
| 121 | struct osmo_fd fd; |
| 122 | } misdn; |
| 123 | struct { |
| 124 | /* ip.access driver has one fd for each ts */ |
| 125 | struct osmo_fd fd; |
| 126 | } ipaccess; |
| 127 | struct { |
| 128 | /* DAHDI driver has one fd for each ts */ |
| 129 | struct osmo_fd fd; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 130 | } dahdi; |
Pablo Neira Ayuso | 7e0d006 | 2011-08-19 11:36:15 +0200 | [diff] [blame] | 131 | struct { |
Sylvain Munaut | b559a53 | 2019-05-09 11:14:26 +0200 | [diff] [blame^] | 132 | /* osmo-e1d driver has one fd for each ts */ |
| 133 | struct osmo_fd fd; |
| 134 | } e1d; |
| 135 | struct { |
Pablo Neira Ayuso | 7e0d006 | 2011-08-19 11:36:15 +0200 | [diff] [blame] | 136 | struct osmo_fd fd; |
| 137 | } rs232; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 138 | } driver; |
Jacob Erlbeck | 98af3c3 | 2014-03-31 10:53:32 +0200 | [diff] [blame] | 139 | |
| 140 | struct msgb *pending_msg; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 141 | }; |
| 142 | |
| 143 | struct gsm_e1_subslot { |
| 144 | /* Number of E1 link */ |
| 145 | uint8_t e1_nr; |
| 146 | /* Number of E1 TS inside E1 link */ |
| 147 | uint8_t e1_ts; |
| 148 | /* Sub-slot within the E1 TS, 0xff if full TS */ |
| 149 | uint8_t e1_ts_ss; |
| 150 | }; |
| 151 | |
| 152 | enum e1inp_line_role { |
| 153 | E1INP_LINE_R_NONE, |
| 154 | E1INP_LINE_R_BSC, |
| 155 | E1INP_LINE_R_BTS, |
| 156 | E1INP_LINE_R_MAX |
| 157 | }; |
| 158 | |
| 159 | struct e1inp_driver { |
| 160 | struct llist_head list; |
| 161 | const char *name; |
| 162 | int (*want_write)(struct e1inp_ts *ts); |
Pablo Neira Ayuso | 4e862cb | 2011-08-19 18:43:38 +0200 | [diff] [blame] | 163 | int (*line_update)(struct e1inp_line *line); |
Pablo Neira Ayuso | add3ec8 | 2011-07-05 14:45:46 +0200 | [diff] [blame] | 164 | void (*close)(struct e1inp_sign_link *link); |
Harald Welte | fe05cf5 | 2011-09-26 23:18:41 +0200 | [diff] [blame] | 165 | void (*vty_show)(struct vty *vty, struct e1inp_line *line); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 166 | int default_delay; |
Jacob Erlbeck | 86dae84 | 2014-01-16 18:10:37 +0100 | [diff] [blame] | 167 | int has_keepalive; |
Neels Hofmeyr | 0db1d43 | 2016-02-22 13:29:09 +0100 | [diff] [blame] | 168 | const char *bind_addr; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 169 | }; |
| 170 | |
Pablo Neira Ayuso | 5a4b7c5 | 2011-06-07 14:07:48 +0200 | [diff] [blame] | 171 | struct e1inp_line_ops { |
Pablo Neira Ayuso | 4e862cb | 2011-08-19 18:43:38 +0200 | [diff] [blame] | 172 | union { |
| 173 | struct { |
| 174 | enum e1inp_line_role role; /* BSC or BTS mode. */ |
| 175 | const char *addr; /* IP address .*/ |
| 176 | void *dev; /* device parameters. */ |
| 177 | } ipa; |
| 178 | struct { |
| 179 | const char *port; /* e.g. /dev/ttyUSB0 */ |
| 180 | unsigned int delay; |
| 181 | } rs232; |
| 182 | } cfg; |
Pablo Neira Ayuso | f163d23 | 2011-06-25 18:42:55 +0200 | [diff] [blame] | 183 | |
Pablo Neira Ayuso | c9c4fd3 | 2011-06-30 12:19:42 +0200 | [diff] [blame] | 184 | struct e1inp_sign_link * (*sign_link_up)(void *unit_info, struct e1inp_line *line, enum e1inp_sign_type type); |
| 185 | void (*sign_link_down)(struct e1inp_line *line); |
Pau Espin Pedrol | ed122f3 | 2018-08-28 18:25:02 +0200 | [diff] [blame] | 186 | /* Called when a new message arrives. -EBADF must be returned if the osmo_fd in link (msg->dst) is destroyed. */ |
Pablo Neira Ayuso | dbd82fb | 2011-07-05 15:29:23 +0200 | [diff] [blame] | 187 | int (*sign_link)(struct msgb *msg); |
Pablo Neira Ayuso | 5a4b7c5 | 2011-06-07 14:07:48 +0200 | [diff] [blame] | 188 | }; |
| 189 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 190 | struct e1inp_line { |
| 191 | struct llist_head list; |
| 192 | int refcnt; |
| 193 | |
| 194 | unsigned int num; |
| 195 | const char *name; |
Harald Welte | c288951 | 2011-09-13 23:49:04 +0100 | [diff] [blame] | 196 | unsigned int port_nr; |
Alexander Couzens | beb10ef | 2016-11-01 22:05:13 +0100 | [diff] [blame] | 197 | char *sock_path; |
Harald Welte | f2737fc | 2011-08-16 14:30:10 +0200 | [diff] [blame] | 198 | struct rate_ctr_group *rate_ctr; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 199 | |
Jacob Erlbeck | 86dae84 | 2014-01-16 18:10:37 +0100 | [diff] [blame] | 200 | /* keepalive configuration */ |
| 201 | int keepalive_num_probes; /* 0: disable, num, or E1INP_USE_DEFAULT */ |
| 202 | int keepalive_idle_timeout; /* secs, or E1INP_USE_DEFAULT */ |
| 203 | int keepalive_probe_interval; /* secs or E1INP_USE_DEFAULT */ |
| 204 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 205 | /* array of timestlots */ |
| 206 | struct e1inp_ts ts[NUM_E1_TS]; |
Harald Welte | c288951 | 2011-09-13 23:49:04 +0100 | [diff] [blame] | 207 | unsigned int num_ts; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 208 | |
Pablo Neira Ayuso | f163d23 | 2011-06-25 18:42:55 +0200 | [diff] [blame] | 209 | const struct e1inp_line_ops *ops; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 210 | |
| 211 | struct e1inp_driver *driver; |
| 212 | void *driver_data; |
| 213 | }; |
Pau Espin Pedrol | b5cfc6b | 2018-10-02 21:22:18 +0200 | [diff] [blame] | 214 | #define e1inp_line_ipa_oml_ts(line) (&line->ts[0]) |
| 215 | #define e1inp_line_ipa_rsl_ts(line, trx_id) (&line->ts[1 + (trx_id)]) |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 216 | |
Harald Welte | cc2241b | 2011-07-19 16:06:06 +0200 | [diff] [blame] | 217 | /* SS_L_INPUT signals */ |
Pablo Neira Ayuso | 332a357 | 2011-08-16 17:31:20 +0200 | [diff] [blame] | 218 | enum e1inp_signal_input { |
Pablo Neira Ayuso | de66891 | 2011-08-16 17:26:23 +0200 | [diff] [blame] | 219 | S_L_INP_NONE, |
| 220 | S_L_INP_TEI_UP, |
| 221 | S_L_INP_TEI_DN, |
| 222 | S_L_INP_TEI_UNKNOWN, |
| 223 | S_L_INP_LINE_INIT, |
| 224 | S_L_INP_LINE_ALARM, |
| 225 | S_L_INP_LINE_NOALARM, |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 226 | }; |
| 227 | |
Harald Welte | cac78fe | 2017-05-25 19:13:13 +0200 | [diff] [blame] | 228 | extern const struct value_string e1inp_signal_names[]; |
| 229 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 230 | /* register a driver with the E1 core */ |
| 231 | int e1inp_driver_register(struct e1inp_driver *drv); |
| 232 | |
| 233 | /* fine a previously registered driver */ |
| 234 | struct e1inp_driver *e1inp_driver_find(const char *name); |
| 235 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 236 | /* get a line by its ID */ |
Pablo Neira Ayuso | 3832c4f | 2011-07-07 17:47:26 +0200 | [diff] [blame] | 237 | struct e1inp_line *e1inp_line_find(uint8_t e1_nr); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 238 | |
| 239 | /* create a line in the E1 input core */ |
Pablo Neira Ayuso | f163d23 | 2011-06-25 18:42:55 +0200 | [diff] [blame] | 240 | struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name); |
| 241 | |
Pablo Neira Ayuso | 3832c4f | 2011-07-07 17:47:26 +0200 | [diff] [blame] | 242 | /* clone one existing E1 input line */ |
| 243 | struct e1inp_line *e1inp_line_clone(void *ctx, struct e1inp_line *line); |
| 244 | |
| 245 | /* increment refcount use of E1 input line */ |
| 246 | void e1inp_line_get(struct e1inp_line *line); |
| 247 | |
| 248 | /* decrement refcount use of E1 input line, release if unused */ |
| 249 | void e1inp_line_put(struct e1inp_line *line); |
| 250 | |
Pablo Neira Ayuso | f163d23 | 2011-06-25 18:42:55 +0200 | [diff] [blame] | 251 | /* bind operations to one E1 input line */ |
| 252 | void e1inp_line_bind_ops(struct e1inp_line *line, const struct e1inp_line_ops *ops); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 253 | |
| 254 | /* find a sign_link for given TEI and SAPI in a TS */ |
| 255 | struct e1inp_sign_link * |
| 256 | e1inp_lookup_sign_link(struct e1inp_ts *ts, uint8_t tei, |
| 257 | uint8_t sapi); |
| 258 | |
| 259 | /* create a new signalling link in a E1 timeslot */ |
| 260 | struct e1inp_sign_link * |
| 261 | e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type, |
| 262 | struct gsm_bts_trx *trx, uint8_t tei, |
| 263 | uint8_t sapi); |
| 264 | |
Pablo Neira Ayuso | 211d2ca | 2011-06-07 17:15:10 +0200 | [diff] [blame] | 265 | /* configure and initialize one signalling e1inp_ts */ |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 266 | int e1inp_ts_config_sign(struct e1inp_ts *ts, struct e1inp_line *line); |
Pablo Neira Ayuso | 211d2ca | 2011-06-07 17:15:10 +0200 | [diff] [blame] | 267 | |
| 268 | /* configure and initialize one timeslot dedicated to TRAU frames. */ |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 269 | int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line, |
Pablo Neira Ayuso | 211d2ca | 2011-06-07 17:15:10 +0200 | [diff] [blame] | 270 | int (*trau_rcv_cb)(struct subch_demux *dmx, int ch, |
| 271 | uint8_t *data, int len, void *_priv)); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 272 | |
Harald Welte | a0108e7 | 2016-07-27 21:44:50 +0200 | [diff] [blame] | 273 | /* configure and initialize one timeslot dedicated to RAW frames */ |
| 274 | int e1inp_ts_config_raw(struct e1inp_ts *ts, struct e1inp_line *line, |
| 275 | void (*raw_recv_cb)(struct e1inp_ts *ts, |
| 276 | struct msgb *msg)); |
| 277 | |
Harald Welte | 7a228eb | 2016-07-28 11:09:31 +0200 | [diff] [blame] | 278 | /* configure and initialize one timeslot dedicated to HDLC frames */ |
| 279 | int e1inp_ts_config_hdlc(struct e1inp_ts *ts, struct e1inp_line *line, |
| 280 | void (*hdlc_recv_cb)(struct e1inp_ts *ts, |
| 281 | struct msgb *msg)); |
| 282 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 283 | /* Receive a packet from the E1 driver */ |
| 284 | int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, |
| 285 | uint8_t tei, uint8_t sapi); |
Harald Welte | fd44a5f | 2011-08-21 00:48:54 +0200 | [diff] [blame] | 286 | int e1inp_rx_ts_lapd(struct e1inp_ts *e1i_ts, struct msgb *msg); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 287 | |
| 288 | /* called by driver if it wants to transmit on a given TS */ |
| 289 | struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts, |
| 290 | struct e1inp_sign_link **sign_link); |
| 291 | |
| 292 | /* called by driver in case some kind of link state event */ |
| 293 | int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi); |
| 294 | |
Andreas Eversberg | a7ff001 | 2011-09-26 11:29:30 +0200 | [diff] [blame] | 295 | /* L2->L3 */ |
| 296 | void e1inp_dlsap_up(struct osmo_dlsap_prim *odp, uint8_t tei, uint8_t sapi, |
| 297 | void *rx_cbdata); |
| 298 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 299 | /* Write LAPD frames to the fd. */ |
Pablo Neira Ayuso | 2e11f5c | 2013-07-05 15:08:18 +0200 | [diff] [blame] | 300 | int e1_set_pcap_fd(int fd); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 301 | |
| 302 | /* called by TRAU muxer to obtain the destination mux entity */ |
| 303 | struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr); |
| 304 | |
Harald Welte | 84f67b2 | 2013-06-30 13:13:59 +0200 | [diff] [blame] | 305 | /* on an IPA BTS, the BTS needs to establish the RSL connection much |
| 306 | * later than the OML connection. */ |
| 307 | int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line, |
| 308 | const char *rem_addr, uint16_t rem_port); |
| 309 | |
Andreas Eversberg | f422a75 | 2014-01-21 14:54:41 +0100 | [diff] [blame] | 310 | int e1inp_ipa_bts_rsl_connect_n(struct e1inp_line *line, |
| 311 | const char *rem_addr, uint16_t rem_port, |
| 312 | uint8_t trx_id); |
| 313 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 314 | void e1inp_sign_link_destroy(struct e1inp_sign_link *link); |
Pablo Neira Ayuso | f163d23 | 2011-06-25 18:42:55 +0200 | [diff] [blame] | 315 | int e1inp_line_update(struct e1inp_line *line); |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 316 | |
Pablo Neira Ayuso | 262aee8 | 2011-07-05 19:17:08 +0200 | [diff] [blame] | 317 | int e1inp_vty_init(void); |
| 318 | |
Alexander Couzens | beb10ef | 2016-11-01 22:05:13 +0100 | [diff] [blame] | 319 | /* activate superchannel or deactive to use timeslots. only valid for unixsocket driver */ |
| 320 | void e1inp_ericsson_set_altc(struct e1inp_line *unixlinue, int superchannel); |
| 321 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 322 | extern struct llist_head e1inp_driver_list; |
| 323 | extern struct llist_head e1inp_line_list; |
| 324 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 325 | /* XXX */ |
| 326 | struct input_signal_data { |
Pau Espin Pedrol | 4179207 | 2018-10-03 13:18:37 +0200 | [diff] [blame] | 327 | enum e1inp_sign_type link_type; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 328 | uint8_t tei; |
| 329 | uint8_t sapi; |
Harald Welte | f35d889 | 2016-10-16 15:33:52 +0200 | [diff] [blame] | 330 | uint8_t ts_nr; |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 331 | struct gsm_bts_trx *trx; |
| 332 | struct e1inp_line *line; |
| 333 | }; |
| 334 | |
Pablo Neira Ayuso | 96e7263 | 2011-06-26 19:08:05 +0200 | [diff] [blame] | 335 | int abis_sendmsg(struct msgb *msg); |
Holger Hans Peter Freyther | 180ce7e | 2012-02-03 20:06:15 +0100 | [diff] [blame] | 336 | int abis_rsl_sendmsg(struct msgb *msg); |
Pablo Neira Ayuso | 96e7263 | 2011-06-26 19:08:05 +0200 | [diff] [blame] | 337 | |
Pablo Neira Ayuso | 0ba77d5 | 2011-06-05 18:32:44 +0200 | [diff] [blame] | 338 | #endif /* _E1_INPUT_H */ |