aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-03-21OC-2G: Properly handle initial TA for data transfer initiated from networkdaniel/oc2gMinh-Quang Nguyen1-1/+1
Problem: 1. The network can not initiate data transfer when the MS is in idle mode (after T3314 in MS expired and ms-idle-timer in PCU expired). This is because the PCU does not know valid location of the MS in servicing cell, i.e. valid TA at the initiation of downlink data transfer. Fixes: 1. We use CONTROL_ACK_TYPE of 4 access bursts specified in SI13 in order to extract valid TA when the MS sends UPLINK PACKET CONTROL ACK message to the PCU. At the begining of data transfer initiated by network, the PCU sends a first PACKET DOWNLINK ASSIGNMENT message with an invalid TA and polling flag is set. After that PCU sends a second PACKET DOWNLINK ASSIGNMENT message with valid TA extracted from responsed UPLINK PACKET CONTROL ACK as 4 access bursts from MS to continue data transfer procedure. This fix works only for CONTROL_ACK_TYPE is configured as 4 access bursts in GPRS CELL OPTION of SI13. Change-Id: I3c76e5e1b8339ddb20da23b85ba267026a0ebf34
2019-03-21oc2g: Change log type (Litecell15->Oc2g)Daniel Willmann1-1/+1
Change-Id: I95ced5da1c89dae5a16963b10b005747277f320b
2019-03-21Add missing includeDaniel Willmann1-0/+1
Change-Id: Ib39e4424f73c677b34f921917440f211e400e14f
2019-03-21Remove custom alarmsDaniel Willmann1-7/+0
Change-Id: I51de826aa732a3875d75396b46b7d2821ef7417c
2019-03-21OC-2G: Always use positive TA information provided in PH-RA-INDMinh-Quang Nguyen1-2/+3
Change-Id: Ia526f712b95eb7bba99252f2a348d9fb5d2f3838
2019-03-21OC-2G: Fix TA adjustmentMinh-Quang Nguyen1-2/+2
Problem: TA provided from L1 PH-DATA-IND is a relative amount of TA adjustment to actual TA being used for given TBF. The current TA update algorithm in PCU simply applies the relative amount of TA to given TBF but does not take into account of current TA. As a result, the PCU will request wrong TA jump for given TBF if the MS is moving away from BTS more than 2 km. Related issue: http://osmocom.org/issues/2611 Fixes: - The PCU needs increase or decrease current TA of given TBF on receiving of relative amount of TA adjustment provided by PH-DATA-IND from L1. - The PCU needs to set absolute TA of given TBF on receiving absolute TA provided by PH-RA-IND from L1. Change-Id: I7665586dd5722bbe04632ee5673d3033bc082324
2019-03-21OC-2G: Fix missing headerMinh-Quang Nguyen1-0/+2
Change-Id: Ida0592c9da74588a57d9d2d5be40fcf79edcb596
2019-03-21Initial commit for OC-2G support.Jean-Francois Dionne6-0/+1126
Change-Id: I7cd89a549c9463e81893ca7dd925299f728e4453
2019-03-19Explicitly clean up BTS singletonMax3-3/+22
Add method to explicitly cleanup BTS singleton similar to GprsMsStorage class and use it from main(). The destructor becomes trivial wrapper around cleanup() method. This prevents annoying SIGABRT on exit of OsmoPCU caused by rate_ctr_group_free() being called after talloc_free() which removes the context in which counter group is allocated. Change-Id: I796d56a7de3f3a1f9d59708995c8e3e9b05a2747
2019-03-19MS store: move test helper to unit testMax2-18/+0
It's confusing to have test-specific helper with the same name as tested function directly inside the GprsMsStorage class. Let's convert it into static function and move to the unit test. Change-Id: Ia2a5b90779051af894fe15d957c1d26f0a142f33
2019-03-13MCS: remove unused functionMax2-6/+0
Change-Id: I32ab5ac36a0db90f2bea670b7684784b83a90b6b
2019-03-12Make get_retx_mcs() into regular functionMax2-18/+14
Moving from header-defined inline function allows us to hide egprs_mcs_retx_tbl definition and simplify further changes. Change-Id: I95258d1558a3b918ae83f1a69e7c3de2b97e5627
2019-03-12MCS: move Coding Scheme enum outside of class definitionMax9-151/+168
Move generic MCS enum to C header file to simplify further modifications to GprsCodingScheme class in follow-up patches. This also allows us to use standard libosmocore value_sting functions in upcoming patches for IA Rest Octet encoding/decoding. Related: OS#3014 Change-Id: I993b49d9a82b8c7ad677d52d11003794aeabe117
2019-03-11encoding: Fixes TMSI vs MI bit selection in repeated page infoJF Dionne1-1/+15
Change-Id: Iddb00b9133f523f4ba09c8f1fc5694e62dc46fbf
2019-03-07Log (M)CS UL update errorsMax1-2/+13
Previously some of the errors in update_cs_ul() call were silently ignored. Let's log all those as errors with appropriate message. Note: test output needs updating because we do not (yet) set proper meas struct in TBF tests. That's likely wrong but it's better to update tests in a separate commit. Change-Id: I4084fb281dd9dad04a2a3a68cac2a8f7b462548e
2019-03-06Tighten lqual table limits checkMax3-9/+13
Previously MAX_GPRS_CS was used for both EDGE and GPRS which means that we waste extra memory in GPRS case. It also leads to misleading name. Let's fix this by introducing separate definitions for GPRS and EDGE cases and use them as appropriate in limit checks. Change-Id: I3ae1ee64ec8e80247b8fe669cc79505b4dadf58f
2019-03-05EDGE tests: remove no-op checkMax1-6/+0
The headerTypeControl() function always return constant and is only used inside OSMO_ASSERT() which compares it to the very same constant which makes it no-op. Let's remove this clutter. Change-Id: Ie0f81fe05a2b3f432de7d1f3446e8115d7524ff4
2019-03-04MCS: remove dead codeMax1-14/+0
As a preparation for (M)CS fixes in follow-up patches, remove unused operators from GprsCodingScheme class. Change-Id: Ieef3b095a6732300e5efa395b989843112b9ca78
2019-02-26MCS: internalize 'family' parameterMax2-30/+24
There's no need to expose it in header file as it's only used internally for consistency checks. Change-Id: Ic705615cd2a8ca077efef9ea62a2a676f70b4aed
2019-02-26Optionally Use the NS Sub-Network-Service (SNS) on GbHarald Welte3-7/+50
This change add support for the recently-introduced GPRS Gb interface auto-configuration using the NS IP Sub-Network Service (SNS) procedures. It requires a Change-Id I84786c3b43a8ae34ef3b3ba84b33c90042d234ea of libosmocore. Related: OS#3372 Depends: I84786c3b43a8ae34ef3b3ba84b33c90042d234ea (libosmcore) Change-Id: I256b40ac592d3b6e75dd581bf7b9512f69b11e83
2019-02-26Rewrite EGPRS Packet Uplink IA Rest Octets for SBAMax1-26/+58
Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 §10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. That's partially based on reverted commit 529ce885450946d85d1920fb3d1a994c3efe5849. Change-Id: I143b3dd02aa54b9ce206d9e780a5554f6d9fd118 Related: OS#3014
2019-02-26Mark gprs_ns_reconnect() as static (not used outside of C file)Harald Welte2-2/+2
Change-Id: I95138adedacdc2d953284cff57f79ecb33616f0f
2019-02-19Rewrite EGPRS Packet Uplink IA Rest Octets for MBAMax1-15/+11
Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 §10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. That's partially based on reverted commit 529ce885450946d85d1920fb3d1a994c3efe5849. Change-Id: I19cc4226e7e831e7d7f70212b2078f5589a87ff0 Related: OS#3014
2019-02-19Rewrite Packet Downlink AssignmentMax1-33/+112
Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 §10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. That's updated version of commit with the same topic reverted earlier. Change-Id: Ie180733d2584ebb16fb80b84526d0dbc70e3d441 Related: OS#3014
2019-02-19Restructure IA Rest Octets encodersMax1-123/+132
In preparation for upcoming patches with 11 bit RACH and TA support, let's restructure existing encoders to simplify further modifications: * move consistency checks to top-level Imm. Ass. encoder * use consistent formatting * constify pointers where appropriate * split SBA and MBA encoders into separate functions Those changes also make it obvious which parameters are necessary for Rest Octets in each specific case (DL, UL-SBA, UL-MBA, UL-SBA-EGPRS, UL-MBA-EGPRS). There're no functional code changes so there's no need to adjust tests. Change-Id: I0ad1bc786c3a8055ea9666f64ae82c512bd01603 Related: OS#1548
2019-02-19Clarify write_immediate_assignment() signatureMax6-22/+20
* remove unused variable * use bool for boolean types * add clarification comments Change-Id: I363445063e2d873d9194b2a5924b9e59b8b7ea53
2019-02-19Add define for dummy burst stringMax4-9/+6
Change-Id: I464920b3d6d47bb1c797a4ce06230f005a2e06a0
2019-02-19Move C include to proper placeMax1-2/+1
Change-Id: Id58d1820b94d54ce73ed40edb7747ef975890a7b
2019-02-14Don't install pcuif_proto.h headerMax1-3/+0
Both OsmoBTS and OsmoBSC use their own copies of this header nowadays so we can simplify our installation slightly by making it local only. Change-Id: I4a87395d4ab7212fe2fc055dae0a737e10d20c69
2019-01-29Added support for daemonize to osmo-pcu.Rafael Diniz1-1/+16
Change-Id: Ia889544e0a350b6bab55da4e4201a617e0241ea2
2018-10-21gprs_rlcmac_received_lost(): Fix regression / uninitialized now_tvHarald Welte1-0/+1
In Change-Id I7d22e7b5902c230efeae66eb20c17026a4037887 we introduced the use of timespecsub(). Unfortuantely, we also accidentially removed the call to osmo_clock_gettime() along with it, leaving now_tv completely uninitialized. Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b Related: OS#3225 Fixes: Coverity CID#188872
2018-09-20check for overlong unix socket pathsStefan Sperling1-2/+5
In pcu_l1if_open(), use osmo_strlcpy() instead of strncpy() and check for overflow. This catches overlong and non-NUL-terminated socket paths. Change-Id: I825190cbb34d052b797e9fb5208884d6f5992839 Related: OS#2673
2018-07-11tbf: Replace '.' in counter names with ':'Pau Espin Pedrol1-32/+32
The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15
2018-07-11tbf: Use incrementing id for rate_ctr_group_allocPau Espin Pedrol1-8/+18
Wrap-around of var handling next id will luckly happen long after initially assigned TBFs are already released. Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad
2018-06-25check bssgp_tlv_parse() return code in gprs_bssgp_pcu_rcvmsg()Stefan Sperling1-0/+7
The return code from bssgp_tlv_parse() was not checked for a parsing error. In case of a parsing error the stored return code could have been overwritten later in this function. Explicitly check for a parsing error, log corresponding packets, and return an "invalid mandatory information" error status to the sender. To avoid loops, do not respond with an error status to STATUS PDUs. Change-Id: I56e10a97cda7fd2d40bc7b4b2e6202f97772e1b3 Related: OS#3178
2018-06-05change log level of "DL packet loss" log messagesStefan Sperling1-1/+1
The TBF tests are failing on some machines due to unexpected log output: "DL packet loss of IMSI= / TLLI=0xffeeddcc: 0%" These messages are printed if >= 1 second has passed between loss reports. This timing is machine-dependent so the test is unstable as a result. Only print these messages at log level debug to (hopefully) make TBF tests pass consistently. Update expected test output accordingly. Change-Id: Ie43f0e3a8740f0fc132809a09a153886c51fadf9
2018-05-31fix time-delta calculations for measurement reportsStefan Sperling1-17/+14
The previous implementation unconditionally subtracted nanosecond values from different time measurements, causing overflow if the current measurement was taken in less of a fraction of a second than the past measurement. Use timespecsub() instead, which accounts for nanoseconds correctly. Also, fix calculations of KBit/s throughtput. It was not being calculated correctly, since it was actually accounting for one KB per 128th-part-of-a-second. Change-Id: I7d22e7b5902c230efeae66eb20c17026a4037887 Related: OS#3225
2018-05-25read monotonic clock with clock_gettime() instead of gettimeofday()Stefan Sperling3-21/+22
There have been test failures on the osmo-pcu Jenkins builders due to apparent clock drift. Switch relevant code from gettimeofday() to clock_gettime() with CLOCK_MONOTONIC to prevent time from going backwards and causing negative time deltas in calculations. Change-Id: I775d85d0d3ac740330879e588bdab6fce7f0b46c Related: OS#3225
2018-05-25fix a one-byte stack buffer overrun in osmo-pcuStefan Sperling1-1/+2
Address sanitizer uncovered a one-byte stack overrun due to an off-by-one in the size of the 'data' buffer in pcu_l1if_tx_pch(). Fix the problem and add an assertion which triggers before the overrun can occur. Change-Id: I08a879d72fcb916f78f175612fd90467d7bdd57c Related: OS#3289
2018-05-16rlc: Fix memset(0) on object with no trivial copy-assignmentPau Espin Pedrol1-3/+10
As warned by gcc 8.1.0, the cs field is a class (GprsCodingScheme) and should not be memset. Change-Id: Id742f82aa856e696b5fb414991dfd0883d0ac7fe
2018-05-16tbf: Fix memset(0) on object with no trivial copy-assignmentPau Espin Pedrol2-1/+8
As warned by gcc 8.1.0: osmo-pcu/src/tbf.cpp: In constructor ‘gprs_rlcmac_tbf::gprs_rlcmac_tbf(BTS*, gprs_rlcmac_tbf_direction)’: osmo-pcu/src/tbf.cpp:222:33: error: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct gprs_rlc’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&m_rlc, 0, sizeof(m_rlc)); ^ In file included from osmo-pcu/src/tbf.h:24, from osmo-pcu/src/bts.h:37, from osmo-pcu/src/tbf.cpp:22: osmo-pcu/src/rlc.h:234:8: note: ‘struct gprs_rlc’ declared here struct gprs_rlc { ^~~~~~~~ Change-Id: Ifb0529b9ae6cd4300e5cbbd9151054792edbfe06
2018-05-15Don't register SIGHUP handler without actually handling SIGHUPHarald Welte1-3/+2
In libosmocore, we normally register a SIGHUP handler for log file rotation. However, the osmo-pcu code so far installed its own signal handler, which did exactly nothing in the SIGHUP case. Let's fix this by removing SIGHUP handling here, letting libosmocore take care about this. Change-Id: Ifa20d79770bc4d88d40601b008a3a2a79d083c04 Closes: OS#3265
2018-05-02improve documentation of Encoding::write_paging_request()Stefan Sperling1-3/+3
Add pointers to relevant parts of the spec. Tweak comments to be more specific about the values being written and abbreviations used. Change-Id: Ia5bf3f7f8846198b7b4e25ff1accf6206764be74
2018-04-12tbf: add frame number to log outputPhilipp Maier1-7/+11
Currently, the TBF timer log messages lack the frame number in the logoutput - Add frame number to TBF timer related log-statements Change-Id: I5a744dc5cd7c1de1baea13fffac026c83d091429 Related: SYS#4139 Patch-by: Octasic inc.
2018-04-10pcu_l1_if: add frame number to log outputPhilipp Maier3-10/+21
Currently, the log output lacks the frame number. - make get_current_fn() public - add frame number to the log statements in pcu_l1_if.cpp Change-Id: Idce994dbf86a2bbf861907d75418a2a3867244db Related: SYS#4139 Patch-by: Octasic inc.
2018-04-10cosmetic: remove runaway semicolonPhilipp Maier1-1/+1
Change-Id: I33c335dc8d564a8357ffb5b1163c2c4b1a578b49 Related: SYS#4139 Patch-by: Octasic inc.
2018-04-01use osmo_init_logging2() with proper talloc ctxNeels Hofmeyr2-6/+12
There is a duality of initialization: early_init() in bts.cpp wants to init logging even before static instances get initialized. Make sure that tall_pcu_ctx is initialized during early_init() as well. There is a build context that does not seem to include bts.cpp (osmo-pcu-remote), so to be sure, init tall_pcu_ctx as NULL and both in early_init() as well as pcu_main.cpp, init both tall_pcu_ctx and logging if it is still NULL. Change-Id: I2199b62d0270bd35dec2283e8f5b364b7c63915b
2018-03-30Revert "Rewrite EGPRS Packet Uplink Assignment"Neels Hofmeyr1-117/+55
This reverts commit 529ce885450946d85d1920fb3d1a994c3efe5849, I2139fb347b3290621bbc3f6a031f7f213d372e65. Commit I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 / 896574e92bea09ed8d39688b6fdf504e84521746 was found (empirically) to be a regression, rendering GPRS service fatally unreliable. This reverted commit seems to be related to the regression and is reverted along with it. Related: OS#3013 Change-Id: I3e8cc0e8ba3ba5bd444124fd4cb95ef92a71fdfb
2018-03-28Revert "Rewrite Packet Downlink Assignment"Neels Hofmeyr1-73/+48
This reverts commit 896574e92bea09ed8d39688b6fdf504e84521746, I52ec9b07413daabba8cd5f1fba5c7b3af6a33389. This commit was found (empirically) to be a regression, rendering GPRS service fatally unreliable. Related: OS#3013 Change-Id: Idcba0381f70eb7f7c9aefdee9dfeafd5de96a9be
2018-03-28Revert "Rewrite Packet Uplink Assignment"Neels Hofmeyr1-48/+48
This reverts commit 93d947f5e8a30acc9250c124bf9d5bb6a8863526, I44db2eeea7448ff67e688ae716487bc6dbfc96a3. Commit I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 / 896574e92bea09ed8d39688b6fdf504e84521746 was found (empirically) to be a regression, rendering GPRS service fatally unreliable. This reverted commit seems to follow after the regression and is reverted along with it. Related: OS#3013 Change-Id: If7038127e9a663c93006475b3add961adc0b1922