aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_bssgp_pcu.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-10-30bts: Move struct gprs_rlcmac_bts and other structs into a bts.hHolger Hans Peter Freyther1-0/+1
Begin to make the BTS a real C++ object with real responsibilities. The biggest issue will be the pcu_vty.c that might not like C++ at all.
2013-10-18tbf: Begin to add some structure to the tbf codeHolger Hans Peter Freyther1-118/+3
The TBF should use the IMSI to identify a block flow but all handling is spread across the entire code. Start to clean this up by moving relevant code into the tbf file. Afterwards one can clean up and add more internal structure.
2013-10-02tfi: The tfi_alloc doesn't allocate anything, rename the functionHolger Hans Peter Freyther1-1/+1
Call things by what they do and this function doesn't allocate anything but it is searching for the first unallocated tbf index.
2013-09-04bssgp: Add callback UNITDATA.DL messaes with the dataHolger Hans Peter Freyther1-0/+3
2013-09-04bssgp: Add callbacks for certain BSSGP eventsHolger Hans Peter Freyther1-0/+2
Add a callback called when Unblock Ack is received. This can be used by a supervisor or the emulation test.
2013-09-04bssgp: Return the gprs_bssgp_pcu instance from create/connectHolger Hans Peter Freyther1-24/+9
This can be used to install handlers/testcases to register callbacks and other data.
2013-09-04rlcmac: Reduce the depedency on the global gprs_rlcmac_bts variableHolger Hans Peter Freyther1-9/+11
For mocking/unit-testing/emulation (and a dual trx-systems) having global state is quite bad. Cut back on the usage of the global struct gprs_rlcmac_bts. It also makes the complexity of certain routines more clear.
2013-09-04bssgp: These routines are not public API.. make them static for nowHolger Hans Peter Freyther1-4/+4
2013-09-04bssgp: Re-indent the switch/case statementHolger Hans Peter Freyther1-45/+45
2013-08-02bssgp: The method creates and the connects.. reflect that in the nameHolger Hans Peter Freyther1-1/+1
Call things by what they do. This method is creating and then connecting a BSSGP..
2013-07-30misc: Move the parsing of the ms_class from RA Capabilities to a methodHolger Hans Peter Freyther1-32/+43
Decrease the number of lines of a single method by splitting things up. The fewer lines of code, branches and side-effects in a method, the easier it will be to understand. The other benefit is that one can start creating unit tests for the some parts of the code.
2013-07-30bssgp: Remove commented out code that is currently not used.Holger Hans Peter Freyther1-4/+0
2013-07-30bssgp: Reset the BVC and NSVC state in the destroy routineHolger Hans Peter Freyther1-0/+4
This might explain the issue of the BVCI > 1 not being unblocked as the internal state has not been re-set when destroying the bssgp.
2013-07-30misc: Move the nsvc_unblocked into the struct osmo_pcuHolger Hans Peter Freyther1-5/+6
2013-07-30misc: Move the bvc_timer into the struct osmo_pcuHolger Hans Peter Freyther1-9/+9
This continues with the previous changes to reduce the global state.
2013-07-30misc: Remove the unused sgsn pointer from the compilation unitHolger Hans Peter Freyther1-1/+0
2013-07-30misc: Move the struct bssgp_bvc_ctx into the struct osmo_pcuHolger Hans Peter Freyther1-21/+26
2013-07-30misc: Introduce a struct osmo_pcu and move things into it.Holger Hans Peter Freyther1-24/+32
One of the issues with not properly re-setting everything is that due the global state it is not clear which variables belong together and how long it exists. Begin with creating a osmo_pcu and moving things into this class. Think of an organic cell, this commit is introducing the cell wall around it... and defines what is inside and what is outside of it.
2013-07-27misc: Add an option exit/quit when the BSSGP is supposed to be destroyedHolger Hans Peter Freyther1-1/+12
The PCU does not properly re-set the state when the connection to the BTS is lost (and the SGSN potentially is re-started during that). This results in the BSSGP BVCI > 1 remaining blocked and no data will be accepted by the SGSN. Add the '-e' option and exit the PCU when the BSSGP/NS are getting destroyed.
2013-07-27misc: Remove if (timer_pending) stop_timer idiom from the codeHolger Hans Peter Freyther1-4/+2
osmo_timer_del is an idempotent operation. There is no requirement to check if it is running. If you don't want a timer to run, delete it. Maybe one should have called the method _unschedule, _cancel to make this more clear.
2013-05-13Added timing advance support for up and downlink TBFsAndreas Eversberg1-1/+14
The timing advance of any TBF is stored when it ends. Whenever a new TBF with the same TLLI is created (downlink TBF), the stored TA is recalled. This algorithm assumes that the mobile does not move too fast during transfer. Also the mobile must start a connection in order to get correct initial timing advance. This algorithm does not implement the timing advance procedure as defined in TS 04.60. To implement the standard timing advance procedure, the BTS must decode RACH on certain bursts, the mobile is expected to send them. This requires much more complexity to a transceiver like USRP/UmTRX or Calypso BTS. The algorithm was tested at TA >= 8 and works quite well.
2013-03-17Introduce new file for various measurementsAndreas Eversberg1-0/+3
The measurements include: - DL bandwidth usage - DL packet loss rate - DL measurements by mobile - UL measurements by BTS In order to receive DL measurements from mobile, it must be enabled via system information message at BSC.
2013-03-10PCU: respect the PCU-side "local port" as configured via L1 IFHarald Welte1-3/+5
This makes sure that the UDP local port of the Gb link is actually set to what is configured via OML from OpenBSC.
2013-01-16Use PCU's talloc context to allocate libosmogb instancesAndreas Eversberg1-2/+2
This is usefull to identifiy memory leaks while using libosmogb.
2013-01-16Fixed memory leaks caused by not freeing bitvectorAndreas Eversberg1-0/+1
Especially each data message from SGSN caused two memory leaks, which resulted in increasing memory usage while receiving date from SGSN.
2013-01-15Get rid of allocating first timeslot at tfi_allocAndreas Eversberg1-5/+4
This simpliefies the allocation process. tfi_alloc is responsible to allocate a TFI, not a time slot. The first time slot available depends on multislot class and on other ongoing TBF (concurrent TBFs), so it is part of the allocation algorithm to select it.
2013-01-11make sure to register NS protocol to the VTYHarald Welte1-0/+1
Without calling gprs_ns_vty_init(), the NS specific VTY commands are not activated.
2012-12-18Added paging PS support by Ivan KluchnikovAndreas Eversberg1-2/+26
Original code: c7e7f6868b6f24346424dee904f4e76d3f216ff4 (The code was committed earlier, but got lost somehow.) I added IMSI, so the paging request is sent in correct paging group. Also I excluded rest octets from pseudo length. It is tested and it work.
2012-12-18Use seperate function to parse IMSI from BSSGP messageAndreas Eversberg1-20/+31
2012-12-18Fix: Removed potential double free bug when receiving NS messagesAndreas Eversberg1-2/+0
2012-10-05Merge branch 'jolly'Ivan Kluchnikov1-16/+207
Conflicts: src/gprs_bssgp_pcu.cpp src/gprs_rlcmac.cpp src/gprs_rlcmac_data.cpp src/gprs_rlcmac_sched.cpp
2012-09-28Fix: Cleanly open and close NS instanceAndreas Eversberg1-1/+8
2012-09-27Use PCH confirm from BTS to start downlink packet flowAndreas Eversberg1-1/+3
Since we don't know when the IMM.ASS message is sent on it's paging group on PCH, we will wait for confirm from BTS and start packet flow then.
2012-09-27Fix: Dump correct NSVCI value at debug lineAndreas Eversberg1-1/+1
2012-09-23Fix: Correctly interpret MCC, MNC, CELL ID from BTSAndreas Eversberg1-0/+4
2012-09-23Statefull reset and unblock BVCs and sending flow control messagesAndreas Eversberg1-4/+78
The flow control interval can be set via VTY.
2012-08-06Adding flags for debugging assignment and polling timeoutAndreas Eversberg1-0/+1
2012-07-26Use final_ack_sent and contention_resolution_done to define ongoing UL TBFAndreas Eversberg1-3/+2
Both flags can be used to determine wether assignment must be sent on PCH or on AGCH. Before contention resolution is done, mobile will ignore downlink assinment. When final uplink acknowledge was sent, the mobile will go back to PCH after reception of akcnowledge.
2012-07-25Fixed two issues found by clang, pointed out by HolgerAndreas Eversberg1-0/+3
2012-07-24misc: Fix typos in the commentsHolger Hans Peter Freyther1-1/+1
ressource -> resorce
2012-07-23Fix: gprs_rlcmac_trigger_downlink_assignment() selects correct channelAndreas Eversberg1-3/+9
In order to select correct channel (PCH or PACCH), a tbf pointer is set in case of PACCH. The tbf pointer points to TBF whose PACCH is used.
2012-07-21Add check of lifetime of LLC frameAndreas Eversberg1-2/+35
If lifetime expires of queued LLC frames, they are discarded. The number of discarded frames and the sum of their octets are reported to SGSN via LLC-DISCARDED message. The lifetime can be overridden via VTY. The value can be centi-seconds or "infinite".
2012-07-15Added missing TA value assignmentAndreas Eversberg1-0/+1
2012-07-15multislot: Rework of handling control channel / pollingAndreas Eversberg1-2/+13
In order to send control blocks to MS and receive control blocks from MS (polling), it is required to select one timeslot that the MS must be able to send and receive. The allocation algorithm must take care of selecting that slot.
2012-07-13Added parsing of multislot class inside BSSGP PDUAndreas Eversberg1-3/+35
2012-07-13Changed data structures for TBF and PDCH instances, to allow multislotAndreas Eversberg1-7/+23
The new data structure is required to define slot/TFI assigment for MS with multislot capability. Now there are two lists for TBFs: uplink and downlink. It is possible to have different TBFs with same TFI in the same direction, as long as they are assigned on different timeslots. See tbf.txt for description. Note: This does not implement any multislot support. It defines the new data structure. Currently only the first slot is assigned.
2012-07-13Removed unnecessary test for tbf.Ivan Kluchnikov1-5/+0
2012-07-13Removed obsolete if-conditionAndreas Eversberg1-4/+0
2012-07-12Merge branch 'jolly_new'Ivan Kluchnikov1-52/+239
Merge is based on jolly_new branch with two modifications. 1. Modified PCU L1 interface. pcu_l1_if.cpp - common functions for tx and rx messages on L1 interface. sysmo_sock.cpp - SYSMO-PCU socket functions. openbts_sock.cpp - OpenBTS-PCU socket functions. pcuif_proto.h - L1 interface's primitives. 2. Modified encoding of RLC/MAC Control messages, now we use structures and encode_gsm_rlcmac_downlink() function for encode control blocks (without hand-coding).
2012-07-09Send downlink IMMEDIATE ASSIGNMENT on PCH and not on AGCHAndreas Eversberg1-13/+21
The IMSI is used to define paging group on which it is sent. This is tested with MS that requires correct paging group.