aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-04-08oc2gbts_mgr_calib: do not return NULL on integer functionPhilipp Maier1-2/+2
The functions oc2gbts_par_get_uptime() and oc2gbts_par_set_uptime() try to return with NULL, but both functions are declared as int. Lets return -EINVAL instead. Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a
2019-04-08oc2gbts_mgr_calib: don't use fsync() on *FILE pointerPhilipp Maier1-1/+1
fsync() takes an integer file descriptor but we have a *FILE pointer here. Lets use fileno() first to convert the integer file descriptor to a FILE pointer. Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87
2019-04-08l1_if: add include for missing header filePhilipp Maier1-0/+1
the function bts_cbch_get() is used in l1_if.c. The function is declared in cbch.h. Lets include this header file in order to be complete. Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
2019-04-01common/oml.c: fix: properly push abis_nm_ipa_magicVadim Yanitskiy1-3/+3
In oml_send_msg() we optionally push the A-bis IPA magic string ("com.ipaccess") to a given message buffer as LV (Length Value), including the terminating null byte ('\0'). There was a mix of both sizeof() and strlen() calls, and worse luck, memcpy() has been used in a wrong way, skipping the '\0': memcpy(dest, src, strlen(src)); In general, this is not critical because the headroom of a given message buffer would most likely be zero-initialized, so the '\0' is already there. However, msgb_push() gives no such guarantee. Let's use the libosmocore's TLV API (in particular, lv_put()), and stick to sizeof(), so the null byte will always be included. Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Closes: OS#3022
2019-03-27Forward GPRS SUSPEND REQ from DCCH to PCU socketHarald Welte2-9/+63
As specified in 3GPP TS 03.60 Section 16.2.1 and 44.018 Section 3.4.15, a Class B MS is sending a "RR GPRS SUSPEND REQ" via a DCCH to the BTS if it wants to suspend GPRS services. The BSS is now responsible to somehow forward this to the SGSN. As the Gs interface between BSC and SGSN is both optional and doesn't have any provision to forward this message, we have to send it over to the PCU so it can use regular BSSGP signaling to inform the SGSN of the SUSPEND REQUEST. This patch requires libosmocore Change-Id I90113044460a6c511ced14f588876c4280d1cac7 for the related definition of struct gsm48_gprs_susp_req. Change-Id: I3c1af662c8f0d3d22da200638480f6ef05c3ed1f Closes: OS#2249
2019-03-27oml: use oml_tx_failure_event_rep() instead of signals to SS_FAILPhilipp Maier3-16/+10
At some locations in the code a signal to SS_FAIL is dispatched in order to trigger the sending of an OML failure event report in oml.c. This is a bit overcomplicated for the task. Lets use oml_tx_failure_event_rep() to send the failure event reports and lets remove the signal handler for SS_FAIL. Change-Id: Ie4fce1273a19cc14f37ff6fc7582b2945c7e7c47 Related: OS#3843
2019-03-27oml: use oml_tx_failure_event_rep() instead of oml_fail_rep()Philipp Maier5-32/+26
The function oml_tx_failure_event_rep() replaces oml_fail_rep(), so lets use only oml_tx_failure_event_rep() and remove oml_fail_rep() Change-Id: I83c4fa9ebd519299fd54b37b5d95d6d7c1da24f6 Related: OS#3843
2019-03-27main: remove wrong call to oml_fail_rep() on SIGUSR1/2 and SIGABRTPhilipp Maier1-3/+0
SIGUSR1/2 and SIGABRT should not trigger a failure event report on OML since we only use it to get an intermediate talloc report. (In case of SIGUSR1/2 without leaving the process.) Change-Id: I99e637496afff2530425b89c6e9befc76db24906
2019-03-27rsl.c: Add missing #include of gsm0808.hHarald Welte1-0/+1
This fixes the below compile error: rsl.c:900:43: error: ‘gsm0808_chosen_enc_alg_names’ undeclared (first use in this function) Change-Id: I4aed0242737602e61b785862e3c37c963bf48455
2019-03-27oc2g: change log level for calibration file errors to FATALPhilipp Maier1-3/+3
The log level of the messages that notify calibration file loading problems is NOTICE, but since it is a severe problem when calibration can not be loaded lets change it to FATAL Change-Id: I32aed25ca7925f1c776f00b37f404a58a85ddbc7 Related: OS#3823
2019-03-27oc2g: generate failure event report in case of bad calibrationPhilipp Maier1-30/+7
When the TX/RX calibration files can not be loaded a failure event report should be sent to the BSC. Lets send a failure event report when calbration data is either bad or can not be loaded (see also remvoed TODOs). Change-Id: I3318470518b34807a443f7cb78c7091b4a3d4481 Related OS#3823
2019-03-20oc2gbts_mgr: use msgb_talloc_ctx_init() instead of msgb_set_talloc_ctx()Philipp Maier1-1/+1
The function msgb_set_talloc_ctx() is deprecated. Lets use msgb_talloc_ctx_init() as suggested. Change-Id: I61f80a7b11e9117e8b71c49b7d81d2f959f3150d
2019-03-19oc2g: l1if: delay trx initialization to avoid race conditionPhilipp Maier1-2/+14
On links with high latency it can happen that RADIO CARRIER OPSTART is carried out to early, even before SET BTS ATTRIBUTES is carried out. This means that important parameters for the initalization are not yet set and the TRX initalization failed. Lets delay the TRX initalization a bit in order to be sure that all BTS attributes are set before the initalization is carried out. Change-Id: Id3bdc88d28417e422d2c0c33b03be06f1a4706c2 Related: OS#3782
2019-03-18Constify pcu_rx_*() parametersMax2-4/+4
Use const for data parameter where appropriate. Change-Id: Ia228c001ca07cfde61b540bec6257b62aec93517
2019-03-18Make gsm_pchan2chan_nr() staticMax1-1/+1
It's only used inside of gsm_data_shared.c so let's mark it as such. Change-Id: I83f1783efe9dc07c8bf9901ebc94774aef1cd472
2019-03-18oc2gbts_mgr_vty: remove calls to vty_install_default()Philipp Maier1-15/+0
The function vty_install_default() is deprecated and throws a compiler warning that suggests to remove it, so lets remove it. Change-Id: I1a4afb6e352bed9a5af794b39b984a7ddef36e08
2019-03-18oml: make oml_tx_failure_event_rep() publicPhilipp Maier1-2/+2
The static function oml_tx_failure_event_rep() is a lot easier to use than the currently implemented signal scheme. Lets make it public so that we can quickly generate failure event reports. Change-Id: I9c4601840a06119f35cfe4da453fff3b293fe615 Related: OS#3823
2019-03-18lc15: remove unused define constant FACTORY_ROM_PATHPhilipp Maier1-1/+0
Change-Id: I76d47471a8480da5a7cb4a11655d5150d4f33508 Related: OS#3823
2019-03-18oc2g: remove unused define constant FACTORY_ROM_PATHPhilipp Maier1-1/+0
Change-Id: I5eb12332568c85bfd2dd83eb5ef1d9c1c9bbfd27 Related: OS#3823
2019-03-05OC-2G: Nominal transmit power is 25 dBm, not 40Harald Welte2-4/+4
According to the OC-2G product specifiacation, the maximum output power is 25 dBm. This should be reflected in the code, there's no point in claiming to be able to trnasmit 40 dBm - which just creates confusion on all levels (such as the logs, where Tx power is claimed to be ramped up to 40 dBm right now). Closes: OS#3823 Change-Id: Ia6b3476ab2f9279f8905b8c7cfd07ef7b0a939ed
2019-02-23OML: Don't advertise baseband transceiver as UNLOCKED at startupHarald Welte1-2/+0
For some strange historical reason, the baseband transceiver MO was brought up in state "UNLOCKED". The object should come up in "locked" state until it's explicitly unlocked by the BSC. See Section 6.8.2 of TS 12.21: "If there is yet no administrative state value explicitly set by the BSC (e.g., at an initialization time), the object shall be presumed to be administratively locked by default" Change-Id: Id505594b9f224567566caac84dae2e2ae4477fae Closes: OS#3790
2019-02-23OML: Store merged attributes of IPA OML Managed ObjectsHarald Welte1-2/+10
For the TS 12.21 standard OML attributes, we store a copy of the most-recently set value for each attribute in "mo->nm_attr". This somehow was missed when adding support for the IPA specific MOs like those relevant for GPRS. Change-Id: I75ebda46da9c1fcecc484311bf3833f31c536ee1
2019-02-20oc2g: vty: Compilation error fixes due to commented codePau Espin Pedrol1-2/+5
Change-Id: Id2b16b9acd15d0c80085fac0fdc2a57173ebb0a0
2019-02-20oc2g: Remove unused static functionPau Espin Pedrol1-12/+0
Change-Id: I4d0a476f84bc9e92e02f94c3990daddeeaa3c5d5
2019-02-20oc2g: Remove unused variablesPau Espin Pedrol4-5/+0
Change-Id: I6738adb6b0ae50905351c67c259d7a77cb250624
2019-02-19oc2g: fsync requires fd instead of file streamPau Espin Pedrol1-3/+3
Similar fix was done for lc15 in a8041edb. Change-Id: Idcd9dc48ea2e1f80bfdf5cf8b6bf55d8150fe0d2
2019-02-19oc2g: led_sleep_cb: pass correct ptr to llist_move_tailPau Espin Pedrol1-1/+1
Fix compilation warning. At runtime it's not a big issue because the "list" field is the first field of the led_list (struct lc15bts_led_timer_list) variable. Hence, the address passed is the same. Similar to commit fixing same issue in lc15 in 080302f8. Change-Id: Ie393a21bc3a725520343c70941cb4f591b313420
2019-02-19oc2g: Cleanup of get_hwversion_descPau Espin Pedrol1-8/+3
Remove unused variables, wrong return type values, etc. Change-Id: I5565b904c72a9ac1775818416f05c64722d366b2
2019-02-19oc2g: Add get_hwversion_desc to header filePau Espin Pedrol1-0/+1
it's used in oc2g/main.c and it needs to be in a header file. Similar as previously done for lc15 in 19795c5a. Change-Id: Ic6826d8c8ff5c648158493454a80704bb956b51d
2019-02-19oc2g: Fix compilation error (comment mark inside comment)Pau Espin Pedrol4-18/+19
Change-Id: Ib27b31825744ea397b5b4eb258da78f5f834895c
2019-02-18Enable statsd supportMax2-0/+4
Change-Id: I9112d9fd527cdc29d89868df40c6845a751c4865
2019-02-15scheduler_trx: use stored fn for pdtch data indicationsPhilipp Maier1-1/+1
When the ph-data indications for the PDTCH are passed up to l1sap, then a forumla is used to calculate the frame number of the beginning of the block that is just passed up. This is not necessary since the start frame number of the block is stored in *first_fn when the block arrives. We should use this frame number instead. (For the measurement indication it is already done this way). Change-Id: I6c01987be78203acfa689c6decb2c806f8fff3d6 Related: OS#2977
2019-02-14Log lchan kind on PCU-related errorMax1-2/+2
Change-Id: Iadb464e7040dd11e4a8cabfc96d6d90f32594109
2019-02-14osmo-bts-trx: add extended (11-bit) RACH supportMax1-10/+38
Attempt to decode incoming RACH burst as 11-bit first and fallback to 8-bit if unsuccessful. Change-Id: Ia28741603636406744e5e22ffff1fb7a9689955a Related: OS#1854
2019-02-12OML: Work around OsmoBSC sending "GET ATTRIBUTES" with short lengthHarald Welte1-4/+11
OsmoBSC used to have a bug in encoding the "GET ATTRIBUTES" OML message, resulting in the actual message length being three bytes longer than the encoded length value. As in Ib98f0d7c2cff9172714ed18667c02564540d65d7 we have introduced proper consistency checks on length values, all "GET ATTRIBUTES" from OsmoBSC version suntil today will fail. This patch introduces a work-around to remain compatible with old OsmoBSC while still keeping the consistency checks for all other messages. Change-Id: Ifa24e9e2c71feb2c597557807d675438c2825b2d Related: OS#3799
2019-02-12OML: Properly reject short messages and truncate over-long messagesHarald Welte1-0/+23
For OML, what matters is the length indicated in the OML message header. If we don't have sufficient bytes, reject the message and send a failure event report. If we have more bytes, truncate the message at the number of bytes indicated in the OML length header. Change-Id: Ib98f0d7c2cff9172714ed18667c02564540d65d7
2019-02-12OML: Reject segmented OML messagesHarald Welte1-1/+9
TS 12.21 describes segmenting of OML messages using placement fist/middle/last and the "sequence' number of the OML header. We don't implement this and hence must ignore or reject any related messages. Before this patch however, we simply treated such segments as if they were a complete OML message. Let's fix that. Change-Id: Idd42cf4edc1bf9ab366853bd9b0f7afd9c060910 Closes: OS#3795
2019-02-12OML: Use 'const struct abis_oml_mo *' whenever users only readHarald Welte1-14/+14
Try to constrain the code a bit further by making all read-only accesses use 'const *'. Change-Id: I5a61e6d1b4e5e083bb24017166186dc87d035cd0
2019-02-12OML: Report short messages even for invalid TRX numbers in down_fom()Harald Welte1-5/+3
Change-Id: I65b57d3fc714814db3ae3fd34398f307413fece8
2019-02-12OML: Reduce code duplication in down_mom/down_fomHarald Welte1-18/+10
Simply use a "mo" variable on the stack rather than having duplicate but otherwise identical calls to oml_tx_failure_event_rep() Change-Id: Ibe6c79e95405b13d041047549d2ffa39aa355eb2
2019-02-12OML: send proper OML alerts in case of errorsHarald Welte1-9/+21
Change-Id: I5b19b82a4874617c7c584cf3eac55eb9c756710a
2019-02-09OML: remove double-logging on oml_tx_failure_event_rep()Harald Welte1-6/+0
When we send an OML failure event report using oml_tx_failure_event_rep(), the function itself will not only send the report to the BSC but also log it. So there's no need to both have an explicit LOGP() and a call to oml_tx_failure_event_rep(). Change-Id: Ib3fd06b3266d896aebeed4ebe42ac71ff173bb5c
2019-02-09OML: Don't overwrite MO instance before oml_tx_failure_event_rep()Harald Welte1-11/+1
In Change-Id Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e we introduced several additional calls to oml_tx_failure_event_rep() during OML messaeg processing. However, for some reason, we *overwrite* the bts_nt/trx_nr/ts_nr of the TRX MO. This is clearly wrong. The "address" of a managed object doesn't change at runtime! Change-Id: Idfb80ccd6dd485d52dc006867fae3dde3fb005f3
2019-02-09OML: Ensure MOs are initialized with valid "Administrative State'Harald Welte1-1/+4
When osmo-bts connects to the BSC, it sends a ton of "State Change Event Report" messages indicating the Operational State (NULL), Availability status (power off) and [as an osmocom extension] also the Administrative State. However, the value of the administrative state is "0", which is not defined in TS 12.21 Section 9.4.4 Change-Id: I03f8a4b08b266cd40036076c76f9dc7e8bf08da2 Closes: OS#3785
2019-02-09OML: Return attributes in ACK/NACK messagesHarald Welte1-11/+8
As per 3GPP TS 12.21 Section 8.2 "ACK messages shall return all the attributes in the original message". OsmoBTS fails to do so but simply sends no attributes at all in the ACK. TS 12.21 is a bit vague whether or not the attributes shall also be achoed in the NACK. Let's do it and append the CAUSE in this case. Closes: OS#3788 Change-Id: Ifb305fe75f8305bb04872f26492b8b1bb8c27f49
2019-02-08OML: some more comments on what functions doHarald Welte1-0/+6
Change-Id: I5f30f6c556968fab60283ff1948966af28dc6e83
2019-02-05scheduler_trx: Fix erroneous multiply-by-fourHarald Welte1-4/+4
Commit acefd0586e5d463b2e7a6a039131994bc12573fc introduced the "toa256" resolution change. Before the change, _sched_compose_ph_data_ind() used quarter-bits as units, so multiplying the old "toa" value by four made sense. However, after said change, the value is in 1/256th of bits, and hence we need to report the toa256 value without any multiply-by-four. Change-Id: I9f980236ea1cd635cb229290e187747cc8c86d8d Related: OS#2977
2019-01-27common/vty.c: fix 'cfg_phy_no_inst_cmd' command descriptionVadim Yanitskiy1-2/+2
A comma is needed to separate a command definition from its description, not the parts of description. Let's fix this. Before this patch: OsmoBTS# configure terminal OsmoBTS(config)# phy 0 OsmoBTS(phy)# no? no PHY Instance number OsmoBTS(phy)# no ? instance osmotrx OsmoTRX Transceiver configuration After this patch: OsmoBTS# configure terminal OsmoBTS(config)# phy 0 OsmoBTS(phy)# no? no Negate a command or set its defaults OsmoBTS(phy)# no ? instance Select a PHY instance to remove osmotrx OsmoTRX Transceiver configuration Change-Id: If10d85abc6506118ba08c37e8101f423d6f838ea
2018-12-23osmo-bts-trx/loops.c: Make code control flow more readableHarald Welte1-20/+9
Use the 'else' construct where applicable to avoid too many return paths from functions Change-Id: I819f0c80e90855e8b3252795c837f8e3053b6e87 Related: OS#1622, OS#1851
2018-12-23osmo-bts-trx/loops.c: Use lchan name based loggingHarald Welte1-56/+36
The loops.c code dates back to ancient times when we printed the TRX number and the raw channel number to identify a logical channel. We meanwhile have gsm_lchan_name() and should use it to log messages related to this lchan in a common format. This commit introduces the LOGPLCHAN() helper macro [similar to osmo-bsc], and uses it from loops.c. As a result, some functions don't need a chan_nr argument anymore, while some need to add a new lchan argument. Change-Id: I6976dd7444c26b1f52741bc367b0311ebbef1718 Related: OS#1622, OS#1851