summaryrefslogtreecommitdiffstats
path: root/include/osmocom/abis/e1_input.h
Commit message (Collapse)AuthorAgeFilesLines
* e1_input: move the lapd_instance pointer out of dahdi specificsHarald Welte2011-08-211-1/+4
| | | | ... and create a new e1inp_rx_ts_lapd() from dahdi as well
* e1_input: rework configuration of virtual E1 line operationsPablo Neira Ayuso2011-08-191-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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);
* input: add rs232 driver for virtual E1 linesPablo Neira Ayuso2011-08-191-0/+3
| | | | | This patch adds the rs232 driver which is used by then bs11_config utility available in openBSC.
* E1 input: rename signal_input by e1inp_signal_inputPablo Neira Ayuso2011-08-161-1/+1
| | | | | Comestical change required by patches that port openBSC upon libosmo-abis.
* src: replace S_INP_* signals by S_L_INP_* according to naming policyPablo Neira Ayuso2011-08-161-7/+7
|
* E1 Input: Add rate counters for events related to E1 linesHarald Welte2011-08-161-0/+9
|
* LAPD: Propagate lapd_receive() errors to the E1 driverPablo Neira Ayuso2011-08-161-0/+1
| | | | | | | | | | Scenario: BTS are configured and working, then the BSC stops working for some reason (crash or administrative stop). If the BSC comes back to life, LAPD among other things does not know about the previous existing TEIs. Instead of ignoring these frames, we notify the driver that we are seeing frames with unknown TEIs, so it can try to recover, e.g. by resending the SABM message.
* update to comply with libosmocore namespace fixesHarald Welte2011-07-191-1/+1
| | | | | This updates the code and brings it in sync to libosmocore git commit 892e621fec571c7cba3573caa0d328ed1b25d8ee
* e1_input: add new refcounting scheme to avoid leaking E1 linesPablo Neira Ayuso2011-07-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch 's/e1inp_line_get/e1inp_line_find/g' since we need this function name for the new refcounting scheme. Basically, I have added a new function to clone lines that is used by the ipaccess driver: struct e1inp_line *e1inp_line_clone(void *ctx, struct e1inp_line *line); And two functions to bump and decrement the refcount: void e1inp_line_get(struct e1inp_line *line); void e1inp_line_put(struct e1inp_line *line); This is useful to avoid leaking virtual E1 lines in the ipaccess case, since we have two sockets for OML and RSL respectively, we have to release the line *once* both sockets have been closed. Without this patch, there are cases in which we don't know if it's time to release the virtual E1 line. This patch also includes a fix to avoid crashing if we open a connection with OML/RSL port without sending any ID_RESP message (in that case, we have no chance to set the signal link). I tested these situations with netcat.
* src: add e1_input_vty.c to libosmo-abisPablo Neira Ayuso2011-07-051-0/+2
| | | | | This file provides the VTY interface for E1 lines, I have moved it to libosmo-abis since it belongs here.
* e1_input: change prototype of ->sign_link(...)Pablo Neira Ayuso2011-07-051-1/+1
| | | | | This patch removes the struct e1inp_sign_link parameter since this is already available in the msgb->dst field of the message.
* e1_input: change prototype of close hook in e1inp_driverPablo Neira Ayuso2011-07-051-1/+1
| | | | | This patch changes `close' so we can make the e1inp_event inside this hook.
* ipaccess: put the ID_GET logic for the BTS mode into the driverPablo Neira Ayuso2011-07-021-0/+1
| | | | | This patch moves the ID_GET logic from the example file to the ipaccess driver in BTS mode.
* major updates in e1_input callback ops and IPA infrastructuresPablo Neira Ayuso2011-06-301-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a major update of the callback infrastructure, now the e1input_ops looks like the following: 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); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); The sign_link_up and sign_link_down will be used by the A-bis over IP input drivers. The sign_link_up callback is used if we receive a ID_RESP message, in that case, we have to set up the sign link for the corresponding new OML/RSL signal link. The pointer to unit_info provides a data structure that contains the BTS device details if we run as BSC, and the requested device information from the BSC if we run as BTS. The sign_link_up callback must return the new sign_link created. The sign_link_down callback is invoked if the line does down, which means that the counterpart has closed the socket. The sign_link callback is used to handle all RSL/OML messages. I have also added the following callback to the e1inp_driver: + void (*close)(struct e1inp_ts *ts); Which is invoked if you call e1inp_sign_link_destroy(). This callback is used to close the socket that is linked to that timeslot. This is useful for A-bis over IP drivers since sockets are closed if the OML/RSL signalling link is destroyed. As you can notice, I have also added all the ID_RESP parsing into libosmo-abis for both ipaccess and hsl drivers. This patch also contains a rework of the ipa_client_link whose integration with the e1_input infrastructure was broken (the transmission path was broken). This patch also contains more develop examples that act as BSC and BTS for the ipaccess driver. Sorry, I know it would be better to split all these changes into logical pieces but many of them are tightly related. This is under heavy development stage, it's anyway hard to track changes until this becomes more stable.
* e1_input: add abis_sendmsg(...)Pablo Neira Ayuso2011-06-261-0/+2
| | | | | | | 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.
* include: remove unused prototype _abis_nm_sendmsg(...) definitionPablo Neira Ayuso2011-06-251-2/+0Star
| | | | This function does not live in this tree.
* e1_input: minor API changes to adapt it to openbscPablo Neira Ayuso2011-06-251-6/+12
| | | | | While working on the openbsc over libosmo-abis port, I noticed several API changes that we need to perform for better adaptation.
* e1input: add address as parameter to e1inp_line_update(...)Pablo Neira Ayuso2011-06-211-2/+2
| | | | | This patch adds a new parameter to e1inp_line_update that allows to specific the address for A-bis over IP BSC/BTS.
* e1input: rework generic (virtual and real) E1 line operationsPablo Neira Ayuso2011-06-071-3/+8
| | | | | | | | | | | | | | | | | | | | | | 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.
* e1input: fix TRAU frame handlingPablo Neira Ayuso2011-06-071-3/+5
| | | | | | | With this patch, we pass TRAU frames to the callback that e1inp_ts_config_trau(...) takes as parameter. Instead of passing it to the line->rx(...) callback. The function e1inp_ts_config_trau(...) should only be used by ISDN drivers.
* src: add libosmo_abis_init(void *ctx) to set the talloc contextPablo Neira Ayuso2011-06-071-3/+0Star
| | | | | This function is called during initialization, so we can set what's the talloc context for the application and the library.
* src: use include/osmocom/abis instead of include/osmocom/gsm/abisPablo Neira Ayuso2011-06-071-0/+225
Harald prefers short paths. This patch also remove commented includes in several files.