aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-11-04Move EGPRS MS mode set to gprs_ms.cppPau Espin Pedrol7-78/+77
Some tests were wrong (TypesTest) and required modification, since they were setting a EGPRS MS but then expecting a GPRS assignment. Change-Id: I9d3ee21c765054a36bd22352e48bde5ffca9225a
2020-11-04pcuif: Improve BTS-supported CS/MCS handlingPau Espin Pedrol5-40/+50
Take into account the MCS values supported by the BTS. In osmo-bts, in general all MCS are enabled if "mode egprs" is selected in BSC, and none otherwise. Change-Id: Ie8f0215ba17da1e545e98bec9325c02f1e8efaea
2020-11-04Move BTS initial values inside bts.cppPau Espin Pedrol7-340/+148
This way everytime any program or test initiates a BTS object, the bts_data structure has the same values. Change-Id: Iffd6eecb1f08bda0091f45e2ef7c9c63b42e10b3
2020-11-03NS2: follow the change of ownershipAlexander Couzens1-1/+5
When receiving a primitive from the NS2 layer the PCU must free the msg buffer if given. Change-Id: I180433735bfbb3375c41318d7a7709d5845199ba
2020-11-02BSSGP: constify argument 'tp' of gprs_bssgp_pcu_rx_paging_{cs,ps}Vadim Yanitskiy1-2/+2
Change-Id: I24e48964a0ff86c2ca962ab3928d07b1c9200390
2020-11-02BSSGP: use tlvp_val8() in gprs_bssgp_pcu_rx_paging_cs()Vadim Yanitskiy1-2/+1
Change-Id: Ic1e37cb9938323c9b9f0466be5cf7251a6db1008
2020-10-30gprs_ms: Use proper function to get CSPau Espin Pedrol1-2/+2
Change-Id: I161e733991ac4fa7bd25a0f12b20e5701c76fc52
2020-10-30cosmetic: tests: pcu_emu: fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I889498c75a78fd8aa406cff5600e4773785782de
2020-10-29tbf_dl: Update (egprs_)ms_class for already known MSPau Espin Pedrol3-33/+20
If SGSN provides us with MS class information upon DL data, let's use it and set it in an already existing MS object if not yet known. Also remove all unneeded code passing ms_class to append_data() which would simply try to (again) set the ms_class. Change-Id: I4979c9344bffd3ba7657bbab94981d233eab801f
2020-10-29cosmetic: Fix ws between if keyword and parenthesisPau Espin Pedrol5-11/+11
Change-Id: I5932f21c58e76552f7187a175b8e281c5846536c
2020-10-29bts: define egprs_enabled as boolPau Espin Pedrol3-15/+16
Change-Id: I66a8254ee392ad75226c58b7df5746f409463f0f
2020-10-29alloc_algo_b: Select TRX with least assigned TFIs during TBF allocPau Espin Pedrol3-132/+100
Before this patch, it would always allocate all TBFs on the first TRX until all TFIs were filled, then second, and so on. But it would actually fail around 8th MS requesting an UL TBF because despite a TFI was successfuly assigned, because all USFs were already exhausted for that PDCH. Related: OS#1775 Change-Id: Iccfc8acfbfdc258ed16cc5af01f12b376fe73b72
2020-10-29tbf: Clean up gprs_rlcmac_dl_tbf::handle()Pau Espin Pedrol7-334/+283
Avoid passing tons of params to internal helper function tbf_nel_dl_assignment() in order to either fetch again the ms object or create a new one. Let's instead create the ms function earlier if needed and fill it with all the discovered information prior to calling the helper function. This provides cleaner code and also better log output. This way we also avoid trying to fill the MS twice and unneeded getter+setter for TA. tbf::imsi(): There' always an ms, so simply forward call to ms()->imsi(). We can also get rid of assign_imsi, since the modified code is the only place where it's used and there's already some code in place there to update the MS. We instead merge it with set_imsi and keep the duplication code to catch possible bugs from callers. Move merge_and_clear_ms from tbf class to GprsMS, where it really belongs. Change-Id: Id18098bac3cff26fc4a8d2f419e21641a1f4c83b
2020-10-27pcu_l1_if: fix misaligned assignment of remote addressAlexander Couzens1-2/+5
Found-by: asan Change-Id: I9c87d3fc1b6f03d79b53f1da3a146630061c3459
2020-10-26tests: ms: Pass correct pointer in constructor instead of NULLPau Espin Pedrol1-1/+1
The BTS field will be used in code paths after next patch changes, otherwise the test fails accessing the NULL pointer. Change-Id: I5098292bdafa9f4f70fef1a053b80a33deca722c
2020-10-25tbf: Drop unused function disable_egprs()Pau Espin Pedrol1-6/+0
Change-Id: I8e3e1d9e70d46c7ca65ce67c408830f8bd20ce3b
2020-10-24Move dl_tbf allocation code to correct filePau Espin Pedrol4-111/+116
Change-Id: I50d41b1c6f244edcfb78646d0fac4e47c2e3e561
2020-10-24Move ul_tbf allocation code to correct filePau Espin Pedrol5-167/+170
Change-Id: Ifd98abbcce49e4605c764267965903fbf9f35867
2020-10-24tbf: Set MS during constructor timePau Espin Pedrol10-13083/+13050
This is another step forward towards a more clear data model where a TBF always has a MS object (which may be lacking some information, and at a later point when more information is found, it may actually be a duplicated MS object and hence one duplicate removed and the TBF moved to the object being kept). This helps for instance in removing duplicated information stored in the TBF which is really per MS, like ms_class, ta, etc. Since there's always a MS object there's no need to keep a duplicate in both classes in case there's no MS object. It can already be seen looking at unit test logging that this kind of data model already provides better information. Some unit test parts were needed to adapt to the new model too. Change-Id: I3cdf4d53e222777d5a2bf4c5aad3a7414105f14c
2020-10-24tbf: Implement enable_egprs() oncePau Espin Pedrol3-15/+2
There's no real need for having different copies of this method in each children. Furthermore, having the method implemented in the base class made me shoot my foot while trying to move this to the tbf constructor (see next commit), so let's simplify this and avoid other people following into the same issue. enable_egprs() in tbf.h is moved to be public since it needed (as it was for the duplicated children mehtods with same name), but anyway it will be moved to private in next commit. Change-Id: Id7de060318201a42e51f277f898463f4b9a84eba
2020-10-24tbf: Make window() available to tbf base classPau Espin Pedrol11-27/+38
Return an interface to the window base class so that the tbf base class can access the common window methods, such as set_ws(). It will be used in next commit to get rid of duplicated function enable_egprs in both dl_tbf and ul_tbf subclasses. The user of the function can then decide to access more specific functionaltiites of the window class by static casting it to the specific direction (which is known by the caller since it operates on a ul_tbf or a dl_tbf). Change-Id: Ia2e1decf91be1184668e28297c2126affb9c7ae4
2020-10-24Move constructor gprs_rlcmac_dl_tbf::BandWidth to correct filePau Espin Pedrol2-10/+10
Change-Id: I7587fd2ee97424020a099a8513f95544d6635f3d
2020-10-24Move gprs_rlcmac_ul_tbf::window to correct filePau Espin Pedrol2-5/+5
It wasn't move when all the UL specific code was moved to a separate file. Change-Id: I6f8c2d568ffdea3826ec1e11358d24eea6c9335b
2020-10-24main: add --vty-ref-mode, use vty_dump_xml_ref_mode()Vadim Yanitskiy1-10/+32
Change-Id: If82208ecb931a6024f1a83c8648c5855b15dcc96 Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40 Related: SYS#4910
2020-10-24main: remove line breaks in print_help(), increase spacingVadim Yanitskiy1-15/+10
Change-Id: I07010afec3bb85d875926813772a6504f3bdb7b5 Related: SYS#4910
2020-10-23Fix several calls to LOGPALPau Espin Pedrol3-28/+28
In those cases since a string pointer was passed, it always printed "single" instead of whatever really was being used, since the string pointer was not NULL. Change-Id: Idab7d18e8f519e10fc3df4007634661c46f9256d
2020-10-23Improve debug logging for alloc algosPau Espin Pedrol2-109/+115
In general we want to see explicitly the kind of requested allocation at the start. The MS class is not needed since it's printed in the previous log line in any case. Change-Id: I9eb0a592c15be96da9d140ff373c1afead76b18c
2020-10-19Use osmo_fd_setup() whenever applicableHarald Welte4-31/+7
Change-Id: I8abd4c50b172f6b312bb4ba3c29e74396f6e6b93
2020-10-16fix tbf_select_slot_set(): use LOGP() instead of LOGPC()Vadim Yanitskiy1-2/+2
Change-Id: I8e9ae854d147735357921f71d9a02862376a50b2
2020-10-16doc/manuals: (re-)generate XML VTY reference automaticallyVadim Yanitskiy2-2042/+6
Change-Id: I0818be314e36d5fb848c9248be6b8cd7fe20fb39 Related: SYS#4937
2020-10-13Rework NS configuration over the info indicationAlexander Couzens5-85/+212
Add support of the second NSVC in the info indication. Add support to update a previous NS configuration. Allow to update of a NS-VC while the NSE is still available over the second. Depends-on: I917f25ebd1239eae5855d973ced15b93731e33a0 (libosmocore) Depends-on: I3a0cd305fd73b3cb9ec70246ec15ac70b83e57f2 (libosmocore) Depends-on: I5a2bb95d05d06d909347e2fb084a446ead888cb3 (libosmocore) Depends-on: I54f110acc3acccb362f6e554324d08cc42b7c328 (libosmocore) Depends-on: Ia00753a64b7622a0864341f51ea49b6963543755 (libosmocore) Depends-on: Ic8f6f8aca10da23a18fab8870be7806065a34b47 (libosmocore) Depends-on: I5f67e6a9bf4cb322bd169061fee0a528012ed54d (libosmocore) Change-Id: I589ebaa2a2b7de55b7e4e975d8fd6412dd5f214b
2020-10-13contrib/jenkins: Enable parallel make in make distcheckPau Espin Pedrol1-2/+2
Change-Id: Ie3f5b6063167875ecb2f25e194806a2476aec984 Related: OS#4421
2020-10-10gprs_bssgp_pcu: fix: do not crash on receipt of subsequent INFO.indVadim Yanitskiy1-10/+15
It's expected to receive subsequent INFO.ind messages at run-time, e.g. when a dynamic TCH/F_TCH/H_PDCH timeslot is switched from PDCH to TCH/F or TCH/H, osmo-bts would send us INFO.ind with the updated PDCH slot-mask indicating that this timeslot is disabled. In gprs_nsvc_create_and_connect(), do not bind() on the received NSVC address unconditionally - we may already be bound to it. Instead, return early and keep everything unchanged. I don't know how the PCU is supposed to handle NSVC address change, at least the new NS2 library does not handle this internally, nor it provides any API for that. Let's leave it for later. Change-Id: I159138e41e147cd30212da548b0ccd3f81d61b4e Related: I4c3bc883d795e5d1ee5ab175ac03684924692a7c Fixes: Ib389925cf5c9f18951af6242c31ea70476218e9a Related: SYS#5108
2020-10-10struct gprs_rlcmac_bts: remove unused 'nsei' fieldVadim Yanitskiy2-2/+0
The code in gprs_nsvc_create_and_connect() stores NSEI there for no reason, despite it's already stored in struct gprs_ns2_nse. Change-Id: Ib30152a12384cf0448104a1ee1cfb949f4a27553
2020-10-10gprs_bssgp_pcu: fix possible memleak in gprs_nsvc_create_and_connect()Vadim Yanitskiy1-0/+1
Change-Id: I9f44cd22b1353ded6eeb2fe9f8dd4818de758003
2020-10-09gprs_bssgp_pcu: make osmo_sockaddr local/sgsn arguments constVadim Yanitskiy2-8/+8
Change-Id: I40e51de300533cfcbb3c9f90a0858a489a3c2b6b Depends: I0df6a00ac1830bd64a10b9336b827e113fa772bb
2020-10-09pcu_main: add commandline option --vty-ref-xmlPhilipp Maier1-0/+12
The commandline option --vty-ref-xml is needed to enable automatic generation of the VTY reference manual. Change-Id: Ie1829a06b83f69f4cd8256adbf9437388ca3d7e0 Related: SYS#4937, OS#1601
2020-10-09pcu_l1_if: print NSVC address in more common formatVadim Yanitskiy1-3/+2
Change-Id: I5aac1b0624d127ef92a7b9c791f6b409e9e6055a
2020-10-09pcu_l1_if: use proper format string specifiers: %d -> %uVadim Yanitskiy1-5/+5
Change-Id: Ieb81dcb4096acbc7a308d003c9e653800071e149
2020-10-09pcu_l1_if: cosmetic: make {local,remote}_sockaddr scoped variablesVadim Yanitskiy1-1/+2
Change-Id: Ib5ddf3622226ac9c612a03ca32d373bcc9b208cf
2020-10-08pcu_l1_if: correct logging level in pcu_rx_info_ind()Vadim Yanitskiy1-1/+1
Change-Id: Ib4bb9b907fc2bf279cf22a3bb9b95ea1a0fb3db6
2020-10-08pcu_l1_if: cosmetic: use ARRAY_SIZE() in pcu_rx_info_ind()Vadim Yanitskiy1-1/+1
Change-Id: Iff11c854b1687f75c1125a5bcd616da95ade69ee
2020-10-08vty: add attributes to VTY commands indicating when they applyPhilipp Maier2-260/+327
Change-Id: I63978ce3ea87593c9a41e503ed3b761c64e1e80f Related: SYS#4937, OS#1601
2020-10-06Use the new NS2 libAlexander Couzens9-189/+248
Depends: Id7edb8feb96436ba170383fc62d43ceb16955d53 (libosmocore) Depends: I2a9dcd14f4ad16211c0f6d98812ad4a13e910c2a (libosmocore) Change-Id: Ib389925cf5c9f18951af6242c31ea70476218e9a
2020-10-01bts.cpp: Increase constructor priorityHarald Welte1-1/+1
It seems that some gcc versions do not consider the priority of "C" __attribute__((constructor)) definitions in the same order as they do C++ static initializers, which are called in the order in which they appear in the compile unit (source file). The problem has been observed at least in a environment based on T2 SDE with GCC 6.3.0 and binutils 2.28. Let's work around this by making sure the __attribute__((constructor)) function always gets the highest priority value permitted by gcc (101). Closes: SYS#5093 Change-Id: I65de69a32ac929e6ddd4e58980027f9e76813153
2020-09-22Fix crash accessing NULL tbf->pdch[first_ts]Pau Espin Pedrol1-2/+1
Fixes consistent crash under some specific scenarios explained in OS#4756. The crash was caused due to a bug in channel allocator algorithm incorrectly populating tbf->pdch[] array as a result of mismatching first_ts and resulting pdch selected slot bitmask. The issue happens because when allocating a UL TBF in allocator B, the subset is always further forced into allocating one single TS. As a result, on that branch several variables are updated, but first_ts was not. The field used to be updated in older versions, but a bug was introduced during code refactoring in commit listed below (31 Jan 2018). Fixes: 0cc7212cfdfd40e87b531ecf14e76356185f4036 Related: OS#4756 Change-Id: I79596803f7dab6f21b58bfe39c2af65d9c5b39d5
2020-09-22cosmetic: Fix typo in commentPau Espin Pedrol1-2/+2
Change-Id: I6567065b8ec0082b21c371bbd0c2e85fecc96c90
2020-09-22cosmetic: Fix indentation of for loopsPau Espin Pedrol1-48/+48
Change-Id: Id7087bd00d9003235688ff34f2b039d525caa777
2020-09-22vty: Add 'show bts pdch' commandPau Espin Pedrol3-1/+38
This allows to see which channels have been enabled according to PCU. Change-Id: If72e67ba80aab4e0c68408e6996d74d2ff70c322
2020-09-22cosmetic: fix indentation alignmentPau Espin Pedrol1-8/+8
Change-Id: I105cf184a478cf178d69e16cd35fa36c51133a18