aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
AgeCommit message (Collapse)AuthorFilesLines
2017-07-10octphy: remap frame number in MEAS_INDPhilipp Maier1-1/+52
The octasic phy stamps the SACCH channel that carries the measurmenet indication with the frame number of the last SACCH that falls within the measurement period. The higher layers expect the frame number to be aligned to the SACCH channel after, which marks also the beginning of the next measurement period. Make the octphy code compatible to the higher layers by remapping the measurement indication frame number. Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1
2017-07-10octphy: do not send empty frames to phyPhilipp Maier1-34/+5
ph_data_req() and ph_tch_req() are generating empty (idle) frames when no data (msg == NULL) is available. Since the phy is able to generate idle frames internally, there is no need to waste Host CPU cycles by doing this in software. Remove the empty frame generation and exit the function cleanly. (Patch by Octasic Inc.) Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838
2017-07-10Allow passing low link quality buffers to upper layersPau Espin Pedrol2-6/+14
We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. This patch assumes that we are not lossing data events from the physical layer and that we receive an event every 20ms, even if the MS is not transmitting due to DTX. Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82 Change-Id: If5df8940fab833eb4e3ed851880b66987d356031
2017-07-04Fix annoying trailing whitespacePau Espin Pedrol1-1/+1
This whitespace keeps being automatically fixed by editor, polluting my patches. Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a
2017-07-04Use L1P instead of L1C for TCH logging and allocationPau Espin Pedrol1-9/+9
L1C is for L1-Control primitives, while TCH channels are L1 Data channels. Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b
2017-07-04octphy: complete value strings (octphy_cid_vals)Philipp Maier2-2/+5
The value string table octphy_cid_vals lacks the strings for cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID and cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID (Patch by Octasic Inc.) Change-Id: I9843137b55534a29938d5c2308244a6950de788f
2017-06-28octphy: remove log outputPhilipp Maier1-2/+0
When handle_ph_data_ind() runs BER and RSSI is logged. Remove this log output by removing the call to dump_meas_res (Patch by Octasic Inc.) Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a
2017-06-28octphy: initalize nmsg only when neededPhilipp Maier1-5/+6
nmsg is initalized every time the function runs, even when it is not needed. Move the initalization into the if (msg) body so that nmsg is only initalized when we really need it. (Patch by Octasic Inc.) Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0
2017-06-28octphy: initalize l1msg and only when neededPhilipp Maier1-1/+9
l1msg is initalized when the variable is declared. This means the allocation always runs right on the beginning. Even when the buffer is not needed at all. do a prober l1msg initalization only when needed and check the return code. (Patch by Octasic Inc.) Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c
2017-06-28octphy: improve log outputPhilipp Maier1-1/+1
Printing the RX payload size is strictly informative, so the loglevel LOGL_ERROR is wrong. This commit changes it to LOGL_DEBUG (Patch by Octasic Inc.) Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897
2017-06-15Set and report BTS featuresMax1-0/+3
Set (possibly incomplete) list of BTS model-specific features and report them in response to attribute request via OML. Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Related: OS#1614
2017-06-09octphy: fix segfaultPhilipp Maier1-5/+6
The priv pointer of the callback function app_info_compl_cb() is set to null by the pointer. It should be set to pinst instead. Besides of that there is a memory violation while accessing the local variable ver_hdr using osmo_strlcpy(). Both is fixed with this commit. Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806
2017-06-09Re-add version to phy_instanceMax1-2/+3
This is resubmission of 9eeb0b1a136fc8c24a86cb4d832c264674c10db0 with errorneous use of talloc_asprintf() removed which should fix OS#2316. Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Related: OS#1614
2017-06-02Revert "Add version to phy_instance"Neels Hofmeyr1-3/+2
This reverts commit 9eeb0b1a136fc8c24a86cb4d832c264674c10db0. This commit caused osmo-gsm-tester test runs for the sysmoBTS to fail with SIGABRT consistently. See below redmine issues. In osmo-bts-sysmo/l1_if.c, it uses talloc_asprintf to write to the char version[MAX_VERSION_LENGTH]; talloc_asprintf() however is intended to work on string buffers allocated by talloc, and attempts to reallocate version[]. Furthermore, it is not clear why the patch passes a 'data' arg to app_info_sys_compl_cb() that is not used. Hence I will revert this instead of trying to fix. Please resolve issues and re-submit. Related: OS#2316 OS#1614 Change-Id: I2c9fd5e6739c1750365c0241476ce4b1aa2df3d4
2017-05-29Add version to phy_instanceMax1-2/+3
Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693 Related: OS#1614
2017-05-29octphy: remove old event control codePhilipp Maier1-83/+1
Event handling is done internally in the Octasic BTS. When the TRX is opened, events are enabled automatically and when TRX is closed events are disabled. The change is valid for the recent firmware version and for the last couple of previous releases. Change-Id: I0652627495f6a9bcb0da2431b8beb839bc22062b
2017-05-29octphy: integrate channel measurement handlingPhilipp Maier2-15/+50
recent octphy firmware versions do support proper channel measurement handling. The new implementation replaces the old, and for osmo-bts non functional implementation. This commit introduces the necessary adjustments. Older firmeware releses will still work. However, the measurement computation results will still be wrong. Change-Id: I0f053bb10b1cb112a8814ee591969d607888e686
2017-05-17octphy: ensure that 11 bit rach flag is not setPhilipp Maier1-0/+2
The l1 interface does not explicitly set the flag for 11 bit rach when a rach request is received. Since the current and previous octphy firmwares do not support 11 bit rach requests, the flag should be explicitly set to zero. Change-Id: Ifa165c56e54d272caafa45d1bf0e177848fcdfbd
2017-05-17octphy: align frame number for new firmware versionsPhilipp Maier1-0/+15
Firmware releases OCTSDR-2G-02.07.00-B1314-BETA and newer require to align the GPRS frame number (fn-3) for ph_data indications. To preserve compatibility the header version is checked during compile time and the right method is compiled in. Change-Id: Ib93d5fb3b34ff92f10021a0e9ce9c8aa3044b7ff
2017-05-17octphy: activate CBCH after all physical channels are activatedPhilipp Maier1-1/+1
CBCH is activated when the SAPI for TS0 is activated. Since the CBCH can be configured on any physical TS, we wait until all (TS7 is the last) physical timeslots are configured. Change-Id: Ie307bf9f370a346686e3bd8c8a8483953a1bc279
2017-05-10Set BTS variant while initializing BTS modelMax1-0/+1
This will allow proper BTS attribute reporting via OML in follow-up patches. Change-Id: I1c49d6c39fb4dac7a46ee25ceacf4c6ef0f0b736 Related: OS#1614
2017-04-13octphy: set tx/rx antenne IDs via VTYPhilipp Maier2-0/+53
add support for the TX/RX antenna-id feature that has been introduced with release OCTSDR-2G-02.07.00-B1314-BETA. The user can now set individual ID numbers for the TX and for the RX antenna. Change-Id: I872fe3c4d7b593358a4ce2f02cf0726611b9f3aa
2017-04-13octphy: add conditional compilation to support latest octasic header releasePhilipp Maier2-2/+37
With octasics latest release (octsdr-2g-02.07.01-B1351-beta), some struct members are moved or renamed. This patch adds ifdef-logic and configure checks to restore compatibilty. Change-Id: I73287983e8bed8bf64b2ab87e6b810c2c59ea6fd
2017-04-13octphy: print log message for multi-trx supportPhilipp Maier1-0/+6
Some header file versions support multi-trx and some do not. After to compiling it is very difficult to find out if the binary is multi-trx capable por not. This patch adds a log line that should rule out any doubts. Change-Id: I257c0a5e7c5ff5df2f0a603d1ede6db5679382e0
2017-04-13octphy: add CBCH supportPhilipp Maier2-1/+19
add Support for CBCH channels in osmo-bts-octphy Change-Id: Ic5c8363b4dd8ba78ab22bd5527c08d1162331540
2017-04-13octphy: fix usage of wrong define constantPhilipp Maier1-1/+1
octphy_hw_get_rf_ant_tx_config() uses define constant cOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_RX_CONFIG_CID instead of cOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_CID. This commit replaces exchanges the wrong constant with the correct one. Change-Id: Ie4de23daf79bb07ca0c0b818eefe350d18d27e4d
2017-02-22octphy: Fix VTY commandsPhilipp Maier3-45/+139
The VTY commands show phy 0 rf-port-stats and show phy 0 clk-sync-stats do not output their results on the VTY console. If one of those commands is entered the user is prompted to view the logtext, which is an uncomfortable solution. This commit adds the missing functionality to print the information in the VTY as well. octphy_hw_api.c contains two value_string structs (radio_std_vals and clocksync_state_vals) which are now exported in octphy_hw_api.h in order to access them from octphy_vty.c Change-Id: Iae5aa91fe2ebba7c2874eed88b15ed66e8c9cd61
2017-02-10all models: fix vty write: bts_model_config_write_phyNeels Hofmeyr1-0/+4
The vty write for phy/inst is broken, leading to a written-out config being unparsable; fix all of these: - in common/vty.c, actually call bts_model_config_write_phy_inst(). - in sysmo and lc15 write the phy instance elements in bts_model_config_write_phy_inst() and not in bts_model_config_write_phy(), which lead to writing the members above their parent 'instance'. - sysmo, lc15 and oct omit the bts_model_config_write_phy_inst() implementation. This did not cause a compilation problem because it was in fact never called. - sysmo writes 'clock-source None' when clk_src is zero, leading to unparsable config (related: OS#1944). Instead omit the 'clock-source' when zero. - osmo-bts-trx seems to be the only part that lacks nothing, yet it also didn't work properly because bts_model_config_write_phy_inst() was never called. This problem existed since commit d784e50747b8cf0ce505489e1451f75be5ccbd4b "Introduce new phy_link and phy_instance abstraction" Change-Id: Icc54fa70045c8fa58e78cf9f788c21a437edfbd4
2017-02-01octphy: Improve OML ADM state handlingPhilipp1-2/+59
Improve state handling for for lock/unlock of OC_RADIO_CARRIER obj class. in bts_model_chg_adm_state() Change-Id: I034114beca95210169429d8ac1eb8648df12fc6c
2017-01-31cosmetic: remove stray newline in octphy's l1_oml.cPhilipp Maier1-2/+1
Change-Id: I6b60e5ee03b9afe6595bf44c4a963d23d03a4eb7
2017-01-31cosmetic: Remove stray newlines in octphy_vty.cPhilipp Maier1-5/+0
Change-Id: I33f5c4a3f40c0299a7cdb9c62094f0f914edfc98
2017-01-31octphy VTY: fix vty write output for octphy's phy sectionPhilipp Maier1-7/+7
Fix invalid configuration generated by VTY 'write' command for the 'phy' section of osmo-bts-octphy. The problem was introduced during refactoring commit d784e50747b8cf0ce505489e1451f75be5ccbd4b (Sat Jan 9 13:13:37 2016 +0100, "Introduce new phy_link and phy_instance abstraction") Change-Id: Ib018e07e332aa8a6144fb2d87889032bd5fc2533
2017-01-23octphy: set tx attenuation via VTYPhilipp2-7/+29
add code to configure the transmision power via VTY Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
2016-12-01Remove duplicated codeMax1-4/+3
Remove lchan deactivation related code duplication to facilitate future use for dynamic CCCH re-activation. Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-11-11Replace link_id constant with defineMax1-4/+4
Instead of using constant for link_id directly, use shared define value. Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-08Add libosmocodec for octphy buildMax1-2/+2
Similar to 45822227577cba5c6c4a4d4d61a7a9e8b4992c25 fix build by linking with libosmocodec explicitly. Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0
2016-10-18Replace magic number with defineMax1-2/+3
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've always used lchan[4] - replace it with CCCH_LCHAN define and add comment. Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
2016-10-12octphy: prevent mismatch between dsp-firmware and octphy headersPhilipp1-6/+20
in its current statue l1_oml.c does not check if the version number in the header files (octvc1_main_version.h) matches up the version that is reported from the DSP during startip. This patch ads a check to make sure that the currently loaded firmware and the headers used during compile time match. If a mismatch is detected, osmo-bts exits immediately. Change-Id: Icba5756517d632d53b129c5ce1a1dab4936dab91
2016-10-06octopy: fixing renamed constantPhilipp2-0/+15
The constant cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED in header file octvc1/hw/octvc1_hw_api.h has been renamed to cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE. This commit adds an ifdef decision in to code to ensure that older header files will still work. Change-Id: I4c0b976d29689ace06741c5943434fc33ee2df14
2016-10-06octphy: reintroducing multi-trx supportPhilipp1-1/+19
The multi-trx had to be removed because of build conflicts with octphy header that lack the struct members for needed to support multi-trx. For details see the following revert-commits: ed6b48e4a5fba07c3ecccf689991799ae13a2aaa c9a1f284acf518cb4e62c3898e20398ed53807c3 This commit reintroduces multi trx support and ads an ifdef decision to ensure that header files without multi-trx support still work. Change-Id: I7f9b2906cc149c817183745b4c96bcc7f9ebdad0
2016-09-24octphy: Fixing band selection for ARFCN 0Philipp1-1/+3
There is now an exception for ARFCN 0 in osmocom_to_octphy_band to distingush ARFCN 0 (E-GSM) and 1-124 (P-GSM). Change-Id: If012f31121e9d0d45b36459807c5f290aa17374f
2016-09-24octphy: Fixing missing payload type in ph. chan. activationPhilipp1-0/+1
in l1_oml.c:ts_connect() the payload type (ulPayloadType) was not configured to full-rate for PDTCHF PACCHF and PTCCHF. Older octasic firmwares (below octsdr-2g-02.06.00-B964-alpha) will tolerate this, newer versions will crash during channel initalitation. Change-Id: Id2f6a439ceb063b10efc7b9d1d70bb5b29a01033
2016-09-06octphy: fix build with OCTSDR-OPENBSC-02.07.00-B708: name changedNeels Hofmeyr2-2/+2
There was an apparent change of name from cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE to cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED in: git://git.osmocom.org/octphy-2g-headers commit 953a258aadf18c05e8128a339f15b1c5bb377cfd "Import headers from OCTSDR-OPENBSC-02.07.00-B708.tgz" In order to build octphy with these headers, apply the same rename in osmo-bts-octphy/*. Change-Id: Ic07055860035a7c1b83ab923817423eeb39f33d3
2016-09-06octphy: fix build: Revert "octphy: add support for multiple trx ids"Neels Hofmeyr1-3/+2
This reverts commit c4fc00d8515ddc9990dfaf700c501cb8fe490cab, except: we keep the part that sets the trx_id in bts_model_phy_instance_set_defaults(). Theoretically, this patch makes a lot of sense, but in order to be able to build osmo-bts-octphy until the headers version is clarified, revert use of usCentreArfcn: Above commit uses an usCentreArfcn member that is never defined in the history of our octphy-2g-headers.git. This usCentreArfcn does exist in a code snapshot OCTSDR-2G-02.05.00-B780-DEBUG, which is not (yet?) publicly available. Also, the current headers version is apparently 02.07, though the octasic version numbers have been known to cause confusion among osmocom folks. This along with one other revert fixes this build problem: make[3]: Entering directory '/n/s/octphy/git/osmo-bts/src/osmo-bts-octphy' CC l1_oml.o l1_oml.c: In function ‘l1if_trx_open’: l1_oml.c:1350:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’ oc->Config.usCentreArfcn = plink->u.octphy.center_arfcn; ^ l1_oml.c:1352:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’ oc->Config.usCentreArfcn = trx->arfcn; ^ In file included from ../../include/osmo-bts/logging.h:5:0, from l1_oml.c:33: l1_oml.c:1365:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’ oc->Config.usCentreArfcn, oc->Config.usTsc, oc->RfConfig.ulRxGainDb, ^ Change-Id: Ic643709e8fb3df2d66337190ed1f07fd230d7dca
2016-09-06octphy: fix build: Revert "octphy: fix for multiple trx with more than 1 dsp"Neels Hofmeyr1-8/+1
This reverts commit 06968beab90806cba94c8b331276e4dc209c152b. Theoretically, this patch makes a lot of sense, but in order to be able to build osmo-bts-octphy until the headers version is clarified, revert use of usCentreArfcn: Above commit uses an usCentreArfcn member that is never defined in the history of our octphy-2g-headers.git. This usCentreArfcn does exist in a code snapshot OCTSDR-2G-02.05.00-B780-DEBUG, which is not (yet?) publicly available. Also, the current headers version is apparently 02.07, though the octasic version numbers have been known to cause confusion among osmocom folks. This along with one other revert fixes this build problem: make[3]: Entering directory '/n/s/octphy/git/osmo-bts/src/osmo-bts-octphy' CC l1_oml.o l1_oml.c: In function ‘l1if_trx_open’: l1_oml.c:1350:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’ oc->Config.usCentreArfcn = plink->u.octphy.center_arfcn; ^ l1_oml.c:1352:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’ oc->Config.usCentreArfcn = trx->arfcn; ^ In file included from ../../include/osmo-bts/logging.h:5:0, from l1_oml.c:33: l1_oml.c:1365:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’ oc->Config.usCentreArfcn, oc->Config.usTsc, oc->RfConfig.ulRxGainDb, ^ Change-Id: I222766f6961f5f35aa3651e2907e3e908fe9a66e
2016-08-08Fill measurements data for L1SAPMax1-1/+12
Fill in values for BER, BTO, Link quality in L1SAP and send them to PCU. Note: this increases the version of BTS <-> PCU protocol. It also requires corresponding changes in libosmocore. All BTS models provide measurements data unless direct DSP access for PCU is enabled. For BTS-specific notes see below. Octphy: conversion from sSNRDb to Link Quality uses formulae which works in practice instead of what's documented for sSNRDb value. Subject to change in future revisions. TRX: C / I link quality estimator is not computed. Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c Related: OS#1616
2016-07-28octphy: fix buildMax1-1/+1
The error was introduced in 61372a20de695a151611753689ee9a3018b101f6. Change-Id: I9585eec018b88c5d0548a0a55fa4130bb26aa5b6
2016-06-24Remove duplicated nibble shift codeMax1-38/+0
Those functions are now part of libosmocore. Change-Id: Iab3206e3b41caff23f656a727605032df9798953
2016-06-23Make get_lchan_by_chan_nr globally availableMax1-11/+5
* Remove static qualifier * Remove duplicated code - use generic function instead Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d
2016-06-18Move copy-pasted code into common partMax1-25/+3
Related: OS#1750 Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9