aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-11-12gsm/sms: Moved utility functions of SMS processing to new gsm0411_utils.cAndreas.Eversberg2-0/+308
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/sms: Added DLSMS debuggingAndreas Eversberg1-0/+6
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/lapdm: Display SAPI in debug message for easier debugAndreas.Eversberg1-2/+2
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/lapdm: Fix UI frames from BTS->MS have length (B4 format)Andreas.Eversberg1-7/+11
This is part of a set of commit to fix LAPDm to handle datalink connection on ACCH (SAPI 3) This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4). Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/lapdm: Fix TA and power level handling in the ACCH headerAndreas.Eversberg1-6/+14
Timing advance and power level indicated by MS (measurement reports) and BTS (SI 5/6) are now stored for use at ACCH data link connection. This is part of a set of commit to fix LAPDm to handle datalink connection on ACCH (SAPI 3) This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4). Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/lapdm: Set N201 depending on the frame typeAndreas.Eversberg1-5/+5
This is part of a set of commit to fix LAPDm to handle datalink connection on ACCH (SAPI 3) This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4). Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/lapdm: Make T200 timer depends on the link type (SACCH is slower)Andreas.Eversberg1-5/+6
This is part of a set of commit to fix LAPDm to handle datalink connection on ACCH (SAPI 3) This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4). Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12gsm/lapdm: Add missing msgb_free in rslms_rx_rll error casesAndreas.Eversberg1-0/+2
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12lapd: Fixed possible double free buf in lapd_core.cAndreas Eversberg1-2/+3
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12vty: Fixed vty_down_level to move down from config nodesAndreas.Eversberg1-3/+5
When using ^D at config nodes above the CONFIG_NODE, the go_parent_cb function is used to go down by one node. This is equivalent to "exit" command. Written-by: Andreas.Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12vty/telnet_interface: Add telnet_exit functionAndreas.Eversberg1-0/+12
This frees socket and pending connections Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12core/timer: Allow an already scheduled timer to be re-scheduled at a new timeSylvain Munaut1-2/+6
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12core/rbtree: remove redundant if()-condition in rb_erase()Sylvain Munaut1-4/+4
See kernel commit 4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee ---- Furthermore, notice that the initial checks: if (!node->rb_left) child = node->rb_right; else if (!node->rb_right) child = node->rb_left; else { ... } guarantee that old->rb_right is set in the final else branch, therefore we can omit checking that again. Signed-off-by: Wolfram Strepp <wstrepp@gmx.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ---- Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12core/rbtree: make clear distinction between two different cases in rb_erase()Sylvain Munaut1-4/+4
See kernel commit 4c60117811171d867d4f27f17ea07d7419d45dae ---- There are two cases when a node, having 2 childs, is erased: 'normal case': the successor is not the right-hand-child of the node to be erased 'special case': the successor is the right-hand child of the node to be erased Here some ascii-art, with following symbols (referring to the code): O: node to be deleted N: the successor of O P: parent of N C: child of N L: some other node normal case: O N / \ / \ / \ / \ L \ L \ / \ P ----> / \ P / \ / \ / / N C \ / \ \ C / \ special case: O|P N / \ / \ / \ / \ L \ L \ / \ N ----> / C \ / \ \ C / \ Notice that for the special case we don't have to reconnect C to N. Signed-off-by: Wolfram Strepp <wstrepp@gmx.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ---- Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12core/rbtree: reorganize code in rb_erase() for additional changesSylvain Munaut1-9/+9
See kernel commit 16c047add3ceaf0ab882e3e094d1ec904d02312d ---- First, move some code around in order to make the next change more obvious. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Wolfram Strepp <wstrepp@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ---- Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12core/rbtree: optimize rb_erase()Sylvain Munaut1-10/+4
See kernel commit 55a63998b8967615a15e2211ba0ff3a84a565824 ---- Tfour 4 redundant if-conditions in function __rb_erase_color() in lib/rbtree.c are removed. In pseudo-source-code, the structure of the code is as follows: if ((!A || B) && (!C || D)) { . . . } else { if (!C || D) {//if this is true, it implies: (A == true) && (B == false) if (A) {//hence this always evaluates to 'true'... . } . //at this point, C always becomes true, because of: __rb_rotate_right/left(); //and: other = parent->rb_right/left; } . . if (C) {//...and this too ! . } } Signed-off-by: Wolfram Strepp <wstrepp@gmx.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Andrea Arcangeli <andrea@qumranet.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ---- Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12core/rbtree: add const qualifier to some functionsSylvain Munaut1-6/+6
See kernel commit f4b477c47332367d35686bd2b808c2156b96d7c7 ---- The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls take a pointer to an RB node or RB root. They do not change the pointed objects, so add a 'const' qualifier in order to make life of the users of these functions easier. Indeed, if I have my own constant pointer &const struct my_type *p, and I call 'rb_next(&p->rb)', I get a GCC warning: warning: passing argument 1 of ?~@~Xrb_next?~@~Y discards qualifiers from pointer target type Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ---- Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-11core/utils: Add a symbol alias for a previous typo for compatibilitySylvain Munaut1-0/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-10utils: Fix a bad double osmo_ prefix for osmo_hexdump_nospcSylvain Munaut1-1/+1
Hopefully no project where using them it seems Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-09freebsd: Provide a dummy backtrace implementation that does nothingHolger Hans Peter Freyther1-0/+4
2011-11-09freebsd: Fixes for the compilation of libosmocore on FreeBSDHolger Hans Peter Freyther3-2/+6
alloca.h is not available on FreeBSD, use the default autoconf function to check for it, there is a complete list[1] of what to do for using alloca but let us see how far we get with this test. Include netinet/in.h for the IPv4 and IPv6 socket address. Check for dlopen in libraries and use this instead of linking -dl. [1] http://www.gnu.org/s/hello/manual/autoconf/Particular-Functions.html
2011-10-21timer: Add compatibility header with timer helpersSylvain Munaut1-0/+1
Some of these are not always present, especially when cross compiling Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-21core: Fix include path to use top_builddir as well for generated headersSylvain Munaut1-1/+1
With the new generated headers for the CRC code, we need to include the builddir as well in case we're building out of tree. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-18timer: Simplify osmo_timers_nearest even moreSylvain Munaut1-4/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-17timer: Fix implementation of osmo_timers_nearest causing high CPU loadSylvain Munaut1-4/+2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-17bump major library version / breaking the ABI with the rb_tree timersHarald Welte1-1/+1
2011-10-17timer: add scalable RB-tree based timer infrastructurePablo Neira Ayuso1-81/+95
This patch adds RB-tree based timers which scales better than the previous list-based implementation. It does not require any API changes. It breaks ABI because the osmo_timer_list structure has changed though (to avoid this in the future, we can put internal data in some private structure). The following table summarizes the worst-case computational complexity of this new implementation versus the previous one: rb-tree list-based ------- ---------- calculate next timer to expire O(1) O(n) insertion of new timer O(log n) O(n) deletion of timer O(log n) O(1) timer-fired scheduler O(log n) O(3n) The most repeated cases are: * the calculation of the next timer to expire, that happens in every loop of our select function. * the timer-fired scheduler execution. This new implementation only loses in the deletion of timer scenario, this happens because we may need to rebalance the tree after the removal. So I think there is some real gain if we have some situation in which we have to handle lots of timers.
2011-10-17add rb-tree implementation to libosmocorePablo Neira Ayuso2-1/+390
This patch adds red black trees implementation to libosmocore. This data structure is very useful to search for elements in ordered sets in O(log n) instead of O(n) that lists provide. The first client of this code will be one follow up patch that implements rbtree-based timer scheduler.
2011-10-10build: resolve link failure when --disable-talloc is usedJan Engelhardt1-0/+2
2011-10-10update LIBVERSION to reflect new API additions0.3.10Harald Welte2-2/+2
2011-10-10Added defines to use primitive/operation tuples in switch/case statementsAndreas Eversberg1-58/+20
2011-10-10LAPD: Moved timer handling into seperate functionsAndreas Eversberg1-72/+87
2011-10-10Split of LAPDm into a core part and a GSM specific partroot3-1621/+2456
Instead of mixing together the GSM layer 1 interface and RSL interface with the implementation of LAPD, the core function of LAPD is now extracted from LAPDm. The core implementation is now in lapd_core.c and lapd_core.h respectively. The lapd_core.c implements exactly one datalink instance for one SAP. The surrounding implementation "lapdm.c" codes/decodes the layer 2 headers and handles multiplexing and datalink instances, as well as translates primitives from/to RSL layer. lapd_core.c can now be used for other LAPD implementations. (ISDN/ABIS)
2011-10-10Changed logging of LAPD from DLLAPDM to DLLAPDroot1-3/+3
2011-10-03vty: Provide documentation for all logging facilitiesHolger Hans Peter Freyther1-1/+10
Document all facilities in the log syslog command.
2011-10-03vty: Provide logging set-log-mask, deprecate set log maskHolger Hans Peter Freyther1-2/+12
There are no other commands on the set, log and mask level, create a simple set-log-mask command and deprecate the old way.
2011-09-28core/serial: Fix typoSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-28core/serial: support custom baud rates on OS XSylvain Munaut1-2/+22
Thanks to Richard James <xyzzy@mm.st> for the patch Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-26gsmtap: Fix doxygen doc for the recent additionsSylvain Munaut1-2/+22
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-26gsmtap: Add a _ex version of gsmtap_{makemsg,send} to specify content typeSylvain Munaut1-4/+21
From: iZsh <izsh@fail0verflow.com> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-16core: Add generic CRC functions (templates expended to 8 16 32 64 bits)Sylvain Munaut2-1/+126
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-03LAPDm: Fix encoding of RLL ERROR IE0.3.8Harald Welte1-1/+0
2011-09-02core/serial: Add utilities to deal with serial portsSylvain Munaut2-0/+213
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02gsm/gsm48_ie: Fix other range format decodingAndreas.Eversberg1-66/+63
As it turns out, the other range were affected too, so Anreas wrote the fix for them as well. Written-by: Andreas.Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02RSL: add rsl_ipac_msg_name() for ipa specific RSL extension namesHarald Welte1-0/+36
2011-09-01gsm/gsm48_ie: Fix Range 256 format decodingSylvain Munaut1-20/+35
From the mail: --- appended is another patch for fixing a bug in the calculation of the frequency lists. This time the patch is for the "Range 256 format". The problem is that the operand for the "smod" operation might be negative, in this case the simplified version won't work as expected. In the patch I introduced a separate function for "smod" which takes care of the sign. I have not yet checked if the other formats are also affected, this would be the case if the "smod" operand can be negative. There might be other solutions to fix the problem without the need for a separate function, however I have not thought further about it. A test vector is the following frequency list ("Range 256 format", first byte is the length): 09 8b 1c 83 8c 15 ef 02 2d 30 The correct ARFCNs are 569 571 576 578 586 608 712 715 719 The uncorrected version would instead return: 444 457 460 464 569 576 578 586 608 This means four ARFCNs are wrong which will cause problems if for example the frequency list contains the ARFCNs for hopping. ---- Written-by: Dieter Spaar <spaar@mirider.augusta.de> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-01add functions for bit-reversalHarald Welte1-0/+57
Sometimes we need stuff like reversing every bit in each byte (but not the byte-order).
2011-08-31logging: add osmo_vlogp() as vararg / va_list compatible functionHarald Welte1-4/+5
2011-08-30doxygen: Add main page for all three librariesHarald Welte3-0/+113
2011-08-17doxygen: Add documentation for Abis OMLHarald Welte1-4/+29