aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_l1_if.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-09-01Support receiving SI13 from BTSMax1-0/+24
* store SI13 in BTS struct * check and handle BCCH SAPI Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400
2017-09-01cosmetic: tighten direct-phy related codeMax1-11/+11
* move the code to related SAPI case * get rid of 'unused variable' warning if direct-phy is not used Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b
2017-08-17GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_tx_ptcchHarald Welte1-2/+2
We needto shift the PCU_GSMTAP_C_* constants before comparing against the mask of enabled GSMTAP categories. Change-Id: Ieb9332c65ed7bd57baf1aeab5ab722f92fc23b24
2017-07-29GSMTAP: Ad PTCCH as separate gsmtap categoryHarald Welte1-1/+2
This allows us to send GSMTAP for PTCCH only if requested by user/vty Change-Id: Id720f4bebdce7f6152fbddddbe05036638c5866e
2017-07-29GSMTAP: Fix logical channel of downlink PTCCHHarald Welte1-1/+1
Change-Id: I29ecc968d56d4d0165cffa206297c42d6fb02cf4
2017-07-21Introduce GSMTAP categoriesHarald Welte1-12/+9
When looking at GSMTAP output so far, one is easily overwhelmed by way too much information being presented. A lot of is consists of DUMMY frames, which are probably of lowest interest, ever. A concept similar to the "gsmtap-sapi" of OsmoBTS is introduced, by which the user can configure which particular categories (uplink or downlink control or data, gprs or egprs, ...) he actually wants to see in his logs. Change-Id: I297183690e98a7234dfc1608c18847d8981306e4
2017-06-26Remove comment warningMax1-3/+2
It's unclear why the warning was placed next to commented log statement to begin with, so let's just follow that warning's advice and drop it. Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae
2017-03-17Support sending OML Alerts via BTSMax1-0/+36
* extend BTS <-> PCU protocol with TXT messages * use it to implement OML alerts support * use it to implement version message * add function to transmit both of them them * send alerts for internal encoding problems as an example * send version when BTS socket is connected Note: requires corresponding change If57459c0610f2c7b36d599b13087c8deef8bdd9e in libosmocore. Related: OS#1614, 1615 Change-Id: If4ea5b3f7409df2fb030681ad468df6b711790a7
2016-11-17Install the pcuif_proto.h header fileHarald Welte1-1/+1
So far, we used to keep a copy of the header file around in both osmo-pcu and osmo-bts projects. Before we start introducing a third copy in openbsc, let's have the osmo-pcu install the header file and make the other programs use that. Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d
2016-11-17Fix GSMTAP logging in case direct PHY access is enabledHarald Welte1-2/+2
In the existing code, GSMTAP messages were only generated in case no direct PHY access was being used (i.e. in the case all user traffic goes over the PCU socket). I'm not quite sure what the reason is for that would be and conclud this is not intentional. Let's first send the message to GSMTAP and then decide whether to send it via the direct PHY access or via the PCU socket into the BTS/BSC. Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade
2016-11-17pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for array iterationHarald Welte1-6/+6
Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75
2016-08-27Change interface in osmo-pcu for 11 bit RACHbhargava1-1/+2
Interface structure between osmo-bts and osmo-pcu is updated with the parameters to differentiate the type of RACH and further support 11 bit RACH. The function prototype and definitions are changed accordingly. Interface version number is increased. Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4
2016-08-04Extend BTS <-> PCU protocol with measurementMax1-1/+9
Note: this increases the version of BTS <-> PCU protocol and thus requires corresponding change in BTS. Change-Id: Ide0e29b668ee38516605c1763fda85e87e867813 Related: OS#1616
2016-07-26Remove useless ARFCN parameterMax1-3/+3
ARFCN is already part of TRX struct so there's no need to supply it explicitly in a separate parameter. I've tested and those are the same anyway. Change-Id: I8e975c52cbc819427880093b1e5371fe1f8ce460
2016-05-19Change internal API for consistencyMax1-4/+5
Make TRX API (void *) consistent with the way it's used (integer). Use uint8_t for TRX numbering everywhere (we don't expect hardware with more than 256 transceivers in the near future). This change helps to avoid unnecessary casts and make API much clearer. Change-Id: Ic584611184b0c8b5417ecff0ddae3d526b55a079 Related: SYS#2443 Reviewed-on: https://gerrit.osmocom.org/59 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-22Rename define for direct hw accessMax1-4/+4
2016-02-22Add gsmtap support to generic btsMax1-11/+27
Instrument TX and RX functions dealing with regular BTS (without direct DSP access) to use GSMTAP. Previously only DSP-related functions were instrumented.
2016-02-22Introduce --gsmtap-ip/-i optionMax1-2/+3
This option allows user to use custom IP address instead of default "localhost". Correspondingly gsmtap init moved from sysmoBTS-specific code up to "bts" struct level. This way it can be easier reused by other implementations. The lack of regressions was verified by checking following command on sysmoBTS: "./osmo-pcu -c osmo-pcu.cfg -r 1 -i 192.168.10.1" where 192.168.10.1 is the host which was running wireshark and netcat: "nc -u -l 192.168.10.1 -p 4729" to accept gsmtap flow.
2015-08-28l1: Use the FN of all data_ind/ra_ind DSP messagesJacob Erlbeck1-0/+11
Currently all of these messages are discarded if they are assumend to be caused by noise. But even in these cases, the FN and TN values which are added by the DSP are valid. So these can be used to update the current_frame value. The osmo-bts sets the fBFILevel of a physical channel to -200dB if it is used for PDTCH or PACCH which is the case for all PDCH. This way a data_ind or ra_ind message is already send at least once per block period (4 frames) per PDCH. These messages are passed to either handle_ph_data_ind or handle_ph_ra_ind even if they contain garbage data. The ra_ind messages are sometimes sent a few frames earlier than data_ind messages using the same frame. This commit adds calls to update the current_frame value based on all of these messages before they are discarded. The FN taken from ra_ind are passed with an increased max_delay (5) to compensate for early ra_ind messages. Sponsored-by: On-Waves ehf
2015-06-22l1: Pass all L1 measurements upwardsJacob Erlbeck1-3/+5
Currently only the RSSI value is passed to the upper layers. Other values like TA and BER which are needed for TA update respectively CS selection are not propagated. This commit introduces and passes a struct that contains a set of measurement values. Sponsored-by: On-Waves ehf
2014-06-15Always exit and don't try to recoverDaniel Willmann1-2/+2
The current code tries to recover from dropped connections and resets the pcu state so it can keep running. However, this never worked correctly which is why the -e option is used. This option exits the pcu as soon as the internal state needs to be reset. This patch removes this option and makes this behaviour default. Ticket: SYS#390 Sponsored-by: On-Waves ehf
2013-10-30bts: Move gprs_rlcmac_rcv_rach into the BTS classHolger Hans Peter Freyther1-1/+1
2013-10-30bts: Move rcv_imm_ass_cnf into the bts codeHolger Hans Peter Freyther1-2/+1
2013-10-30pdch: Instead of passing bts, trx, ts use the pdchHolger Hans Peter Freyther1-3/+5
All dispatching will go through the PDCH. This will clean a lot of the look-ups inside the gprs_rlcmac_data.c and continue with adding structure to the pcu code.
2013-10-30pdch: Simplify the reset code, rename variables to XYZ_noHolger Hans Peter Freyther1-2/+2
Simplify the reset code now that the PDCH can know where it is located. Rename the variables in the sba to trx_no and ts_no as it stores the number and not the actual thing.
2013-10-30bts/tbf: Move the lists into the BTS and do the look-up from the BTSHolger Hans Peter Freyther1-2/+2
The list belongs to the BTS. This makes cleaning this up more easy and establishes a hierachy of resources that start from the BTS. The debug_diagram code is now broken.
2013-10-30sba: Create a SBAController that will manage the sbas for a BTSHolger Hans Peter Freyther1-2/+2
The PollController is a friend of the SBAController and is allowed to access the internal list. The list is hidden from everyone else. This is done because the calculation of timeout should belong into the PollController and not into the SBAController.
2013-10-30bts/pdch: Move the adding of paging to the BTS/PDCH objectsHolger Hans Peter Freyther1-1/+1
Only the gprs_rlcmac_pdch will manipulate the paging list now. There can be various more refactorings of the code but they can be done later. E.g. on memory allocation failure we can continue instead of leaving the code, we should also set any_tbf only after things have been paged.
2013-10-30pdch: Move enable/disable into the PDCH codeHolger Hans Peter Freyther1-33/+7
When a PDCH is disabled all resources should be freed. This is currently not possible as the PDCH does not know where it belongs to. On top of that the list (and other resources) should be properly initialized on construction so that disable() is idempotent and does not check if it was disabled. During the re-factoring I noticed that during a sysmobts re-start some resources are not freed. I left a warning in the code to resolve this issue later.
2013-10-30bts: Introduce a PollController that has the responsibility to pollHolger Hans Peter Freyther1-31/+0
For each frame indication received by the BTS the poll controller is asked to expire timedout entries.
2013-10-30bts: Move the frame_number into the BTS sructureHolger Hans Peter Freyther1-14/+2
The current_frame is an attribute of the BTS. Move it from the pcu_l1_if.cpp into the BTS. As the next step we can trigger actions depending on the change of the frame.
2013-10-30bts: Introduce a singleton for the BTS and use it in the codeHolger Hans Peter Freyther1-9/+12
Compared to the previous code there will be a branch to get the global pointer so the code will be slightly slower than the previous version but it allows us to start creating objects but still use the code from C. It is best approach I have found so far. One downside of C++ is that by default talloc will not be used (unless we override the new operator to use talloc. Right now we need to memset the C data structure by hand. The benefit of enforcing a better structure should is more important though.
2013-10-30bts: Move struct gprs_rlcmac_bts and other structs into a bts.hHolger Hans Peter Freyther1-0/+1
Begin to make the BTS a real C++ object with real responsibilities. The biggest issue will be the pcu_vty.c that might not like C++ at all.
2013-10-30bts: Remove global state from gprs_rlcmac_rcv_rts_blockHolger Hans Peter Freyther1-1/+1
2013-10-30bts: Remove global state from gprs_rlcmac_add_pagingHolger Hans Peter Freyther1-1/+1
2013-10-30bts: Remove global state from gprs_rlcmac_rcv_rachHolger Hans Peter Freyther1-1/+2
2013-10-30bts: Remove global state from gprs_rlcmac_rcv_data_block_acknowledgedHolger Hans Peter Freyther1-1/+1
2013-10-30bts: Remove the global state gprs_rlcmac_trigger_downlink_assignmentHolger Hans Peter Freyther1-2/+2
Remove the global state from gprs_rlcmac_trigger_downlink_assignment and walk up to the pcu_l1_if.cpp where I find the timeout handling that should be part of the SBA and TBF functionality. In terms of hierachies things start to be more clear. There should be the BTS object. That holds the SBA and TBF Controllers that can allocate TBFs and SBAs and will handle the timeout polling for a BTS.
2013-10-28tbf: Add another variant of the free_all now by pdchHolger Hans Peter Freyther1-10/+2
2013-10-28tbf: Move the struct to the tbf.h header fileHolger Hans Peter Freyther1-0/+1
This is the begin of a long march of turning tbf into a C++ class and properly hiding the secrets inside this implementation instead of having it spread across various different files.
2013-10-02tbf: constify the IMSI argument for the downlink assignmentHolger Hans Peter Freyther1-1/+1
2013-09-04bssgp: Return the gprs_bssgp_pcu instance from create/connectHolger Hans Peter Freyther1-2/+3
This can be used to install handlers/testcases to register callbacks and other data.
2013-09-04rlcmac: Reduce the depedency on the global gprs_rlcmac_bts variableHolger Hans Peter Freyther1-1/+1
For mocking/unit-testing/emulation (and a dual trx-systems) having global state is quite bad. Cut back on the usage of the global struct gprs_rlcmac_bts. It also makes the complexity of certain routines more clear.
2013-08-02bssgp: The method creates and the connects.. reflect that in the nameHolger Hans Peter Freyther1-1/+1
Call things by what they do. This method is creating and then connecting a BSSGP..
2013-08-02pcu_l1_if.cpp: Remove unused method and commentHolger Hans Peter Freyther1-6/+0
pcu_l1_if.cpp:195:13: warning: 'void pcu_l1if_tx_bcch(uint8_t*, int)' defined but not used [-Wunused-function]
2013-07-27misc: Add an option exit/quit when the BSSGP is supposed to be destroyedHolger Hans Peter Freyther1-1/+1
The PCU does not properly re-set the state when the connection to the BTS is lost (and the SGSN potentially is re-started during that). This results in the BSSGP BVCI > 1 remaining blocked and no data will be accepted by the SGSN. Add the '-e' option and exit the PCU when the BSSGP/NS are getting destroyed.
2013-05-13Added timing advance support for up and downlink TBFsAndreas Eversberg1-4/+14
The timing advance of any TBF is stored when it ends. Whenever a new TBF with the same TLLI is created (downlink TBF), the stored TA is recalled. This algorithm assumes that the mobile does not move too fast during transfer. Also the mobile must start a connection in order to get correct initial timing advance. This algorithm does not implement the timing advance procedure as defined in TS 04.60. To implement the standard timing advance procedure, the BTS must decode RACH on certain bursts, the mobile is expected to send them. This requires much more complexity to a transceiver like USRP/UmTRX or Calypso BTS. The algorithm was tested at TA >= 8 and works quite well.
2013-03-17Fix: Correctly display SGSN remote IP at debuggingAndreas Eversberg1-1/+4
2013-03-17Add RSSI of data blocks to PCU interface0.2.00.2Andreas Eversberg1-3/+4
This bumps the PCU API version to 5 and requires osmo-bts >= 0.2.0.
2013-03-10PCU: respect the PCU-side "local port" as configured via L1 IFHarald Welte1-1/+2
This makes sure that the UDP local port of the Gb link is actually set to what is configured via OML from OpenBSC.