aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-23wip.. forward the ta..zecke/channel-ho-wipHolger Hans Peter Freyther1-8/+22
2014-01-23wip: Continue with hacks to support handover...Holger Hans Peter Freyther1-0/+17
it appears to work without encryption... using the E71
2014-01-21sysmobts: Specify TRX nominal maximum tx power as fMaxTxPowerHarald Welte1-0/+6
In the MPH ACTIVATE-RF.req, we need to specify the nominal maximum transmit power, i.e. >= what we later request during MPH-INIT.req. This field was first introduced in API version 2.2, but we never used it so far. It may help fixing a bug related to excessive power consumption of the sysmoBTS 2050.
2013-11-05sysmobts: Notify the BSC about all muted lchansJacob Erlbeck1-0/+30
Currently it takes some time (around 30s) until it is detected that the radio link is down after mute. Not till then the BSC is informed and the call terminated. This patch modifies this behaviour by sending a RSL_MT_CONN_FAIL message with cause RSL_ERR_RADIO_LINK_FAIL for each muted and active lchan immediately after the corresponding Change Administrative State Request has been acknowledged. Ticket: OW#976 Sponsored-by: On-Waves ehf
2013-11-05sysmobts: Use status flags instead of direct LED accessJacob Erlbeck1-3/+3
Currently the LEDs are being accessed directly from within the l1_if.c file. So the handling of rf mute and activate/deactivate both access LED_RF_ACTIVE directly. This may lead to an inconsistent LED status. This patch replaces these calls to sysmobts_led_set() by an abstract equivalent bts_update_status(), that uses a set of independant status ids. The associated values can than be combined into a visible LED status. Currently LED_RF_ACTIVE is on iff BTS_STATUS_RF_ACTIVE is set and BTS_STATUS_RF_MUTE is not set. Sponsored-by: On-Waves ehf
2013-11-05sysmobts: Add L1 support for the new RF mute requestJacob Erlbeck1-0/+50
This adds a new function l1if_mute_rf(femtol1_hdl, ch_mute[8]) to set the mute state for each radio channel. On completion and iff l1if_mute_rf() returned 0 the callback oml_mo_rf_lock_chg(mo, ch_mute_state[8], success) is invoked when the response from the superfemto DSP is received. Ticket: OW#976 Sponsored-by: On-Waves ehf
2013-10-10sysmobts: Attempt to fix the compilation for the v1 hardwareHolger Hans Peter Freyther1-0/+4
2013-10-09sysmobts: Don't use the clock calibration value on external clocksHarald Welte1-3/+21
If the clock is provided by an external (like GPS) clock, we should not use the calibration value. The latter is only used in context of the OCXO or VCTCXO.
2013-10-09sysmobts: Read supported bands from EEPROMHarald Welte1-2/+21
...rather than assuming that any v2 hardware supports all bands.
2013-10-04Use GPS as default clock source on sysmoBTS 2050Harald Welte1-2/+35
2013-07-16sysmobts: Set the clock calibration to the value read from the eepromNicolas J. Bouliane1-0/+1
By default read the clock calibration from the EEPROM. It is still possible to set it using the cli. Signed-off-by: Nicolas J. Bouliane <nicolas.bouliane@nutaq.com>
2013-06-24sysmobts: Fix potential memory leaks in the prim callback handlingHolger Hans Peter Freyther1-0/+2
Make sure the l1msg is always freed in the callback. There were several error conditions were the msgb would not have been freed, in the case of the calib data and the system information the message was not freed even in normal condition. I will modify this code to __use a msgb. This allows to re-use the allocated msgb across read operations.
2013-06-22calib: Fix for new EEPROM Mode; better log msgsHarald Welte1-4/+8
2013-06-22calib: Add fixup for incompatible calib data / firmware versionHarald Welte1-8/+8
For certain sysmoBTS units, a fixup to the calibration table is needed, if the firmware is >= 3.3.0.
2013-05-01sysmobts: Use msgb_free instead of talloc_free to free the messageHolger Hans Peter Freyther1-2/+2
Currently msgb_free is calling talloc_free but we might introduce a msgb pool in the future. So make sure to use the designated free method for the msgb.
2013-05-01sysmobts: Print the lchan name for the S counter.Holger Hans Peter Freyther1-5/+8
2013-03-24sysmobts: Prepare to address the documented limitation of this codeHolger Hans Peter Freyther1-3/+12
2013-03-17Add VTY option to define minimum C/I level for RACH and normal burstAndreas Eversberg1-3/+4
2013-03-17Get RSSI from received uplink data and send to PCUAndreas Eversberg1-2/+4
This bumps the PCU API version and thus requires a new version of the code on the sysmoBTS side!
2013-03-15Fix: Stop RADIO LINK TIMEOUT couter S from counting, if it has reached 0Andreas Eversberg1-19/+31
In case that the counter S reached 0, it will stay 0. Subsequent received good and bad SACCH frames must not cause to trigger radio link failure again. Once the BSC has been indicated about link failure, it will release channel. The counting of S has been moved to a seperate function. This patch will ensure that the link failure is indicated only once. But even if the link failure would be sent multiple times, the BSC should ignore it. The BSC releases the channel and may only reuse it after confirm from BTS. (There cannot be any link failure indications after confirm of channel release.) The allowed timeout value range is 4..64, as defined in TS 05.08, so if the BSC sends an attribute with value out of range or other failure criterion, the Set BTS Attributes message is NACKed.
2013-03-11Added radio link timeout procedure according to TS 05.08 Chapter 5.2Andreas Eversberg1-2/+25
Chapter 5.2 applies to MS procedure, but 5.3 (BSS procedure) defines no exact criterion, so I decided to use the procedure equivalent to MS. The criterion is based on a counter S, which is initialized to a preset RADIO_LINK_TIMEOUT, which can be configured via VTY. Whenever a received SACCH block is bad, S is counted down by one. If SACCH block is successfully decoded, S is counted up by two, but never above initial RADIO_LINK_TIMEOUT value. If S reaches 0, an RSL Connection Failure Indication with cause RF Radio Link Failure is sent to BSC, which then aborts channel. Use link timeout value from BSC via OML attribute. How to test: - Set "debug" for "meas" logging. - Start silent call to an attached mobile. - Remove battery from mobile or shield mobile. - Watch S count down.
2013-03-07l1_if: if ul_power_target==0, hard-code MS power to what RSL saysHarald Welte1-0/+4
RSL CHAN ACT contains a MS_POWER IE which is intended to be used as the initial power level for the MS, before the UL power control loop is starting. In our case, if ul_power_target != 0, then the DSP takes care of power control. If ul_power_target == 0, then we instruct the phone to constantly use the value specified by the BSC in the MS_POWER IE. FIXME: Actually implement a proper power control algoritihm inside osmo-bts so we don't have to rely on the DSP implementation.
2013-03-06gsmtap: Put the RxLevel and RxQual in uplink GSMTAPHarald Welte1-1/+3
2013-02-27calib: Use 2.4.0 as cut-off for the firmware, log errorsHolger Hans Peter Freyther1-1/+1
In case opening a calibration file is failing an error will will be logged, the caller and implementation were inconsistent about the API version that is supported for the calibration data, attempt to make the cut-off at 2.4.0.
2013-02-27sysmobts: Fix a memory leak when no callback is setHolger Hans Peter Freyther1-2/+6
The TxPower handled used to call the requestion function without a callback. In that case the msgb is leaked. The code still allows the callback to be NULL so we will just delete the message in that case.
2013-02-27sysmobts: Remove the is_system_primitive from l1if_req_complHolger Hans Peter Freyther1-6/+12
All users (but the gsm_compl) of the l1if_req_compl use it with is_system_primitive=1. We can now remove this parameter from the method. Introduce _l1if_req_compl that will insert the item into the queue for us.
2013-02-27sysmobts: We can now pass the trx to the callback change the signaturesHolger Hans Peter Freyther1-8/+5
2013-02-27sysmobts: Remove the trx parameter from the signatureHolger Hans Peter Freyther1-8/+8
l1if_gsm_req_compl everyone is passing the trx as data pointer right now, remove it from the request procedure right now as it can be deducted from the femtol1_hdl.
2013-02-27sysmobts: Use the hdl->priv in l1if_req_compl for all callersHolger Hans Peter Freyther1-9/+8
2013-02-27sysmobts: Remove the data parameter from the l1if_gsm_req_complHolger Hans Peter Freyther1-2/+2
Pass in the trx argument at the lower level as everyone is using the fl1h->priv now.
2013-02-04Make sure SACCH fill frame is correctly aligned for L1 headerHarald Welte1-1/+1
When we send a fill frame on SACCH, we need to have two bytes for the L1 header at the beginning (inserted by the DSP). Thanks for Andreas Eversberg for pointing it out.
2013-01-23sysmobts: Send GSM requests using the l1if_gsm_req_compl methodHolger Hans Peter Freyther1-0/+6
Prepare to change the queue and callback handling. For the TX power VTY command it is still possible that it will conflict with other callbacks and the easiest way is to beging with sending these requests through another method that allows us a more strict test.
2013-01-23sysmobts: Rename the hLayer2<->lchan to hLayer<->lchanHolger Hans Peter Freyther1-6/+6
We are using this conversion for both hLayer2 and hLayer3. Make the function name more generic to indicate that this function can be used with the hLayer3. The functions that call the methods were updated using spatch and @rule1@ expression E; expression F; @@ - l1if_hLayer2_to_lchan(E, F) + l1if_hLayer_to_lchan(E, F) @rule2@ expression E; expression F; @@ - l1if_lchan_to_hLayer2(E) + l1if_lchan_to_hLayer(E)
2013-01-23sysmobts: Ignore too short messages on the FACCH (but also the SDCCH)Holger Hans Peter Freyther1-0/+8
During call testing using an E71 and dialing a number of an expired (lac set to 0) subscribe the CC Release and other messages are sent after or during the channel modification. This appears to lead to some reception issues in the DSP code and giving use empty (u8size == 0) FACCH frames. The real issue might be inside the MNCC code of NITB and the lack of a size check inside the LAPDm code (our msgb has enough data though). Passing the empty FACCH frame into the LAPDm code lead to the generation of RSL ERROR INDICATION with cause FRAME_UNIMPL as some bits were zero. Add a check for 0 into the FACCH code. As the code path is shared with SDCCH it is also discarding zero sized SDCCH frames. These have not been observed during my testing. The lacking size check in LAPDm will be addressed separately. During call testing the IPA CRCX was also failing due the BTS trying to bind to an unassigned IP address.
2013-01-23l1_if: don't print measurements a second time in case of errorHarald Welte1-1/+0
2013-01-17sysmobts: Use a newline at the end of the SACCH u8Size < 2 messageHolger Hans Peter Freyther1-1/+1
The other message in this method is using a \n as well and the line is generally now followed with a LOGPC. It looked like this: <0006> l1_if.c:672 SACCH with size 0<2 !?!<0006> tch.c:540 (bts=0,trx=0,ts=2,ss=0) Rx Payload size 0
2013-01-03sysmobts: Fix the comment referring to the value of the timeoutHolger Hans Peter Freyther1-1/+1
Right now it is 30 seconds and not 10.
2012-12-29l1_if: Fix typo... call it femtobtsHolger Hans Peter Freyther1-1/+1
2012-12-26tch: Do not print that there is no audio data on a TCH/HHolger Hans Peter Freyther1-1/+1
When only signalling is used on the TCH/H it is normal that there is no TCH data. Save CPU time by not printing the message. This needs to be moved to be edge triggered.
2012-11-26sysmobts: Transmit the UI idle frame as a LAPDm CommandHolger Hans Peter Freyther1-1/+1
When transmitting an idle frame the BTS should transmit it as a command and not a response. This is unbreaking the mobile application of osmocomBB.
2012-11-18Ensure osmo-bts builds agsainst sysmobts-v1 headers (again)Harald Welte1-1/+8
2012-11-10VTY: make target uplink Rx level VTY-configurableHarald Welte1-0/+1
We used to have -75 dBm as the target value for the uplink receive level. Now this is configurable. The parameter is used as input into the power control loop that adjusts the MS transmit power in order to achieve the target rx value on the BTS Rx input.
2012-11-10l1_if: Dump measurement data in case we receive SACCH without dataHarald Welte1-1/+5
On the uplink SACCH, we should at least receive the two bytes SACCH uplink header from the phone. But sometimes we don't. Log this more verbosely.
2012-11-10l1_if: add 'log level' to dump_meas_res() functionHarald Welte1-4/+4
2012-11-10Measurement: Correctly report L1 SACCH uplink header in RSLHarald Welte1-1/+6
For whatever reason, the order of fields in the L1 SACCH header is different from 04.04 (Um) and 08.58 (A-bis). Please note that it's not just a different bit order, but actually logically re-ordering the fields within the byte, while keeping the bit-order/-endian. We now correctly report the L1 transmit power up the stack.
2012-10-28sysmobts: Add support for reading calibration tables0.1.0Harald Welte1-0/+8
'trx-calibration-path' is the new VTY command indicating the path name where the calibration files can be found. Calibration is only implemented for SUPERFEMTO API version 2.4.0 or later.
2012-10-28properly display the header file versionsHarald Welte1-2/+3
2012-10-27make it build against sysmobts v2 APO 0.1, 0.2, 1.0, 2.0, 2.1, 2.2, 2.4 and 3.0Harald Welte1-3/+17
2012-10-22Fix: Remove Bad frame Indicator from PDCH blocks before sending via GSMTAPAndreas Eversberg1-2/+10
2012-09-29Set correct GSMTAP channel type for PDTCH/PACCHAndreas Eversberg1-4/+4