summaryrefslogtreecommitdiffstats
path: root/src/input/hsl.c
Commit message (Collapse)AuthorAgeFilesLines
* input: fix multiple BTS attached to single line scenarioPablo Neira Ayuso2011-08-311-0/+20
| | | | | | | | | | | | With multiple BTS attached to a single line, we have to call ->line_update() multiple times. I broke this myself while avoiding that A-bis over IP drivers bind to the socket several times. To fix this situation, Harald prefers that this case is internally handled by the ipaccess and hsl drivers by means of the driver_data field in the e1inp_line structure. Reported-by: Gus Bourg <gus@bourg.net>
* e1_input: rework configuration of virtual E1 line operationsPablo Neira Ayuso2011-08-191-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 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);
* hsl: use PRIx64 / inttypes.h for uint64_t format stringHarald Welte2011-08-191-1/+2
|
* hsl: remove unsued 'proto' variableHarald Welte2011-08-191-3/+0Star
|
* src: replace S_INP_* signals by S_L_INP_* according to naming policyPablo Neira Ayuso2011-08-161-1/+1
|
* update to comply with libosmocore namespace fixesHarald Welte2011-07-191-21/+21
| | | | | This updates the code and brings it in sync to libosmocore git commit 892e621fec571c7cba3573caa0d328ed1b25d8ee
* talloc: revert to use talloc inside libosmocoreHarald Welte2011-07-181-1/+1
| | | | | | It's not a good idea to confuse the two changes with each other. Moving the Abis part into a separate library is independent from the question whether we have talloc inside libosmocore or use a stand-alone talloc library.
* hsl: close socket if we destroy the signalling linkPablo Neira Ayuso2011-07-081-0/+14
| | | | | As we do in ipaccess driver, the socket is not useful anymore if the BSC/BTS decides to close the signalling link.
* hsl: BTS supportPablo Neira Ayuso2011-07-081-9/+107
| | | | | | This patch adds the BTS support for the hsl driver. It includes two examples under the tests/ directory.
* hsl: remove unused hsl_setup functionPablo Neira Ayuso2011-07-071-6/+0Star
| | | | This function lives in openBSC not here.
* logging: use new harald's logging infrastructure in libosmocorePablo Neira Ayuso2011-07-051-1/+0Star
| | | | | I can send patches to improve it later, better not to waste much time at it by now so port libosmo-abis upon it.
* 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.
* input: close socket if no signal link was createdPablo Neira Ayuso2011-07-021-6/+19
| | | | | | | | | If the ->sign_link_up callback does not returns (or if it's NULL) a valid new signal link, we inmediately close the socket. If no signal link is set, there is nothing we can do with this socket, so keeping it open is useless otherwise.
* major updates in e1_input callback ops and IPA infrastructuresPablo Neira Ayuso2011-06-301-24/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: minor API changes to adapt it to openbscPablo Neira Ayuso2011-06-251-8/+9
| | | | | While working on the openbsc over libosmo-abis port, I noticed several API changes that we need to perform for better adaptation.
* ipa: extend ipa_*link_create() to take one generic data pointerPablo Neira Ayuso2011-06-231-1/+2
| | | | | With this patch we can attach generic data to some IPA link. This will be useful for the IPA proxy support.
* ipa: rename `struct ipa_link' by `struct ipa_client_link'Pablo Neira Ayuso2011-06-211-2/+2
| | | | | And IPA_LINK_STATE_* by IPA_CLIENT_LINK_STATE_* to prepare the addition of the ipa_server_link abstraction.
* ipaccess: initial works to get BTS mode workingPablo Neira Ayuso2011-06-211-1/+8
| | | | | | | | | | | | | | This patch adds the initial support to get BTS mode working with the ipaccess driver. Now, the driver handles IPA ping, pong and id_ack messages internally in BTS modes, and it passes the signalling messages to the client application by invoking the callback line operations. Moreover, with this patch, each IPA link object always has one E1 line object associated. Still HSL BTS-mode remains unimplemented.
* input: use generic ipa_msg_recv() instead of ipaccess_read_msg()Pablo Neira Ayuso2011-06-211-2/+2
| | | | | | | | We use the new generic function to receive messages, instead of ipaccess_read_msg. It's a mere renaming, but it's the first step before the rework that will happen soon to avoid calling read() twice.
* hsl: add support for BTS-modePablo Neira Ayuso2011-06-211-3/+24
| | | | This patch adds support for BTS-mode for the hsl input driver.
* e1input: add address as parameter to e1inp_line_update(...)Pablo Neira Ayuso2011-06-211-3/+4
| | | | | This patch adds a new parameter to e1inp_line_update that allows to specific the address for A-bis over IP BSC/BTS.
* include: remove internal definition that are now in libosmocorePablo Neira Ayuso2011-06-091-0/+1
| | | | | Still in one separate patch for libosmocore, but they may become part of mainline soon.
* hsl: use include/abis/ipaccess.hPablo Neira Ayuso2011-06-071-1/+1
| | | | instead of deprecated include/gsm/protocol/ipaccess.h
* e1input: rework generic (virtual and real) E1 line operationsPablo Neira Ayuso2011-06-071-5/+51
| | | | | | | | | | | | | | | | | | | | | | 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.
* src: add libosmo_abis_init(void *ctx) to set the talloc contextPablo Neira Ayuso2011-06-071-2/+4
| | | | | 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-10/+1Star
| | | | | | Harald prefers short paths. This patch also remove commented includes in several files.
* src: use new socket API in libosmocorePablo Neira Ayuso2011-06-071-2/+15
| | | | | get rid of internal copy of openbsc/libcommon/socket.c, we now use the new socket API available in libosmocore.
* initial commit of libosmo-abisPablo Neira Ayuso2011-06-051-0/+296
still many things to get fixed