summaryrefslogtreecommitdiffstats
path: root/src/host/virt_phy/src
AgeCommit message (Collapse)AuthorFilesLines
2019-07-21virtphy: Fix array out of bounds access in getL1ctlPrimName()Harald Welte1-1/+1
Closes: CID#198573 Change-Id: I6504a7ffcf961d3162e6ab2ec8f5f2016ef12cde
2019-05-28virt_phy: Fix typo in log messageHarald Welte1-1/+1
Change-Id: I9291957ef5d7033d46060d07f2aa0a3880612e1a
2018-11-05l1ctl_proto.h: use flexible array member for traffic messagesVadim Yanitskiy1-1/+5
Unlike the DATA messages, traffic frames may have different length. Instead of having fixed payload (i.e. TCH frame) length, let's introduce a flexible array member. This would allow one to calculate the frame length using the MSGB API. Change-Id: I119fa36c84e95c3003d57c19e25f8146ed45c3c6
2018-09-16Install to /bin as it doesn't require special privileges..Holger Hans Peter Freyther1-1/+1
This makes packaging the binary for the gsm tester more easy. Change-Id: Ibe572a4c17871785b623e70acc7f5da056f945e5
2018-08-27cosmetic: add commandline helpPhilipp Maier1-1/+24
There is no helptext for the commandline options, which makes it difficult for new users to use the program. - Add commandline help Change-Id: I8d04644342acd64432742f96e32dc9f2e0e91c20
2018-08-27cosmetic: fix typoPhilipp Maier1-1/+1
Change-Id: Ib9c5cb1aa0aaf12b68f9d93f9ce9a27037b84a56
2018-08-24osmo_mcast_sock: make sure SO_REUSEADDR is appliedPhilipp Maier1-2/+3
virtphy uses UDP multicast to communicate with its osmo-bts-virtual counterpart. At the momemnt SO_REUSEADDR is not applied for those multicast connections because OSMO_SOCK_F_UDP_REUSEADDR is not set. This makes prevents the proper function of UDP multicast. - Make sure OSMO_SOCK_F_UDP_REUSEADDR is set Change-Id: Ia1014ac5e0522e77178249cdc6398dec2168bffe Depends: libosmocore I1399a428467ca12f1564a14eb8ffb294d4f59874 Related: OS#3497
2018-04-15VIRT_PHY: add missing L1CTL_BURST_IND to l1ctlPrimNamesVadim Yanitskiy1-0/+1
Change-Id: I442305c034bbba5eaed080fb262a61895623eb4f
2018-03-21virt_phy: Add missing gprs related entries to l1ctlPrimNamesPau Espin Pedrol1-1/+6
Change-Id: Ia59e22cda9cf5e25b5e2b1fe38f8ec3937b16f80
2017-08-20VIRT-PHY: Add support for GPRS / TBF modeHarald Welte2-5/+239
we add a new STATE_TBF to vthe MS model and add some L1CTL primitives to configure that TBF mode as well as to enqueue transmissions for blocks at a given USF+TS. Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a
2017-08-20VIRT-PHY: virt_l1_sched: Pass timeslot number into call-backHarald Welte5-8/+8
When we schedule a given frame for transmission, we save its timeslot number. However, the callback doesn't get informed about this so far. Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6
2017-08-20VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCHHarald Welte1-2/+2
Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a
2017-08-20virtphy: Add SIGINT+SIGTERM handlersHarald Welte1-0/+6
Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8
2017-07-19VIRT-PHY: enable proper memory leak debuggingHarald Welte2-3/+26
We make sure that all allocations are tracked back to one talloc root context, and install the usual SIGUSR1 handler to dump the talloc report. This enables us to do interactive debugging for memory leaks while virtphy is running. Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a
2017-07-19VIRT-PHY: We don't do line-breaks inside log statementsHarald Welte1-3/+1
Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd
2017-07-19VIRT-PHY: Properly destroy l1_model_ms after disconnectHarald Welte5-1/+28
If a MS disconnects, we need to clean up all related state Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d
2017-07-19VIRT-PHY: Change default log levelsHarald Welte1-1/+1
This will basically only print L1C message for all L1CTL happening between MS and the BTS, while suppressing the GSMTAP/virtUM and L1P related messages. Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24
2017-07-19VIRT-PHY: Clean up logging statementsHarald Welte7-59/+66
The generated log lines have been *super* long, let's make them significantly shorter. Also, differentiate between DEBUG and INFO level, so normal operation with LOGL_INFO will not spam the user while still printing useful information. Change-Id: If06a8b5f99349796d66a71201524361a6547945a
2017-07-19VIRT-PHY: Separate logging of L1 Control and L1 DataHarald Welte5-7/+36
L1 Data is quite verbose, while control is typically limited, so let's make sure we log them as separate sub-systems Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1
2017-07-19VIRT-PHY: Log MS context number whenever possibleHarald Welte11-43/+61
Now that we can have multiple MS connected to one virtphy instance, it is important to log some context whenever possible. To do so, we introduce a monotonically increasing MS number which gets assigned whenever we allocate a l1_model_ms and printed when the LOGPMS() or DEBUGPMS() macros are used. Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65
2017-07-19VIRT-PHY: Major rewrite to deal with muliple L1CTL clientsHarald Welte11-365/+316
Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6
2017-07-19VIRT-PHY: Don't redefine GSMTAP port number, use libosmocoreHarald Welte1-2/+2
Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec
2017-07-18VIRT-PHY Use libosmocore unix domain socket helperHarald Welte1-28/+11
Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3
2017-07-18VIRT-PHY: reorganize data structuresHarald Welte10-69/+73
* l1_model_ms can become a static member of l1_model_ms * crypto_info_ms can become a static member of l1_state_ms Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12
2017-07-13VIRT-PHY: Use osmo_fd_close() introduced in libosmocoreHarald Welte1-15/+4
libosmocore has recently received a new function osmo_fd_close() which can be used to replace the private fd_close() function in this code. This requires Change-Id Icd0933eed6a24edde7cdcb378e138897ecc5332c in libosmocore. Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d
2017-07-13VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP,ALL} flagsHarald Welte1-36/+8
libosmocore has recently gained support for flags like OSMO_SOCK_F_NO_MCAST_LOOP and OSMO_SOCK_F_NO_MCAST_ALL that can be passed to the socket initializer functions, further reducing complexity of the code in osmo_mcast_sock.c here. The related change-IDs are I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 and I24a5b1ebc3f84d2d5d4734e54df50efaea26490b in libosmocore.git. Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b
2017-07-13VIRT-PHY mcast_sock: Use uint16_t for ports, bool and constHarald Welte1-8/+8
Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7
2017-07-13VIRT-PHY: mcast_sock: properly clean up in error paths (close/unreg socket)Harald Welte1-0/+4
Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44
2017-07-13VIRT-PHY: Further simplify mcast_sock codeHarald Welte1-66/+55
By avoiding dynamic allocations and relying on osmo_fd, we can significantly simplify the code. Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271
2017-07-13VIRT-PHY: mcast_sock: We must close the fd before setting it to -1Harald Welte1-1/+1
Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063
2017-07-13VIRT-PHY: mcast_sock: Don't keep subscribed multicast group aroundHarald Welte1-10/+7
We can avoid having to keep around the multicast group in a chunk of dynamically allocated memory and simplify related code. Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50
2017-07-13VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd memberHarald Welte1-22/+17
Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909
2017-07-13VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_confHarald Welte1-9/+1
We don't need to store this data, we cans simply connect the socket to the destination mcast address instead. Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05
2017-07-13VIRT-PHY: osmo_mcast_sock.c coding style cleanupHarald Welte1-24/+20
Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab
2017-07-13Port osmo_mcast_sock to libosmocore socket routinesHarald Welte1-65/+44
Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43
2017-07-13VIRT-PHY: Use gsmtap value_strings in recent libosmocoreHarald Welte1-42/+2
In Change-ID Iaf8a99912f42a56ef785a1642e18238c0b67cf68 libosmocore introduced value_strings fro the GSMTAP_CHANNEL_* and GSMTAP_TYPE_* constants, so we can remove the private tables. Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851
2017-07-13VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocoreHarald Welte2-45/+1
As of Change-Id Ie1bc00670887064da0fea61c3dab036c23ceea25, this function is offered by libosmocore. Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc
2017-07-12VIRT-PHY: Fix all compiler warnings on gcc-6.3.0Harald Welte5-3/+6
Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db
2017-07-12VIRT-PHY: coding style / API usage cleanupHarald Welte12-485/+563
This is the result of my manual clean-up of the many coding style issues found in the stumpf/virt-phy branch of OsmocomBB. Some may remain, but it's much closer to what we're used to in the Osmocom world now. Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b
2017-07-12VIRT-PHY: Remove non-overridable CFLAGS "-g -O0"Harald Welte1-2/+0
If the user wants debugging / no optimziation, they can always pass the related CFLAGS at ./configure time, there's no nee to have them hard-coded in the actual Makefiles. Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56
2017-07-12VIRT-PHY: Configurable signal power reductions for multiple arfcns.Sebastian Stumpf6-25/+106
Model was expanded and holds now power management information consisting of an array of received power levels for all arfcns and one for the reduction of this signal in dbm. The reduction is configurable by commandline by --arfcn-sig-lev-red 666,12:888,13. The signal level is assumed to be max level (-63) if a packet from that arfcn is received within a timeframe (also configurable via cmd -- timeout-pm 5:800 == <seconds>:<microseconds>). After that timeout it will be reduced to min level (-110). Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9
2017-07-12VIRT-PHY: Extracted common virtphy utils.Sebastian Stumpf3-78/+45
Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955
2017-07-12VIRT-PHY: Added option parsing.Sebastian Stumpf3-20/+70
Available options: dl-rx-grp: mcast group messages on downlink are received from ul-tx-grp: mcast group messages on uplink are sent to port: port used for mcast sockets log-mask: logging mask l1ctl-sock: l1ctl socket path to connect to l23 Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6
2017-07-12VIRT-PHY: Add downlink filter for msg on dedicated channels.Sebastian Stumpf3-16/+17
Messages incoming on dedicated channel (SDCCH/8, SDCCH/4) are no longer forwarded to l23 if their timeslot/subchannel is not fitting the ones configured by l23 via L1CTL_DM_EST_REQ. Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3
2017-07-12VIRT-PHY: Fixed power management and PCS sync.Sebastian Stumpf5-82/+126
PCS flag was ignored in fbsb. Power management returned a perfect link for all possible arfcns causing the mobile trying to sync to all these afterwards. This took too long and PM now only returnes a good link quality for arfcns configured as available. Power management was also extracted to an own file. Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0
2017-07-12VIRT-PHY: Fixed FACCH processing on TCH.Sebastian Stumpf5-92/+149
As TCH is not supported in GSMTAP yet, all incoming frames on the virt-phy are forwarded as FACCH to the l23 for now. Cleanup code in virt_prim_data and virt_prim_traffic. Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5
2017-07-12VIRT-PHY: Scheduler - correct handling over hyperframe repeat.Sebastian Stumpf1-4/+14
Scheduler will no longer skip tasks that are scheduler for a framenumber greater than the current fn because of a hyperframe repetition. Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda
2017-07-12VIRT-PHY: Calculate correct scheduler fn for data- and tch-msgs on ul.Sebastian Stumpf6-32/+376
Proper calculation of the scheduled frame number and appending the jobs with that fn to the scheduler. Thus uplink msgs are scheduled at the (approx.) correct fn and with this fn set in the gsmtap hdr. Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54
2017-07-12VIRT-PHY: Fixed error causing send msgs to be received on same sock.Sebastian Stumpf1-1/+9
This could be disabled setting socket option IP_MULTICAST_ALL = 0. Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875
2017-07-12VIRT-PHY: Data and traffic req from l23 now use scheduler.Sebastian Stumpf7-67/+200
Msgs are not put on virt um directly in the handler like before, but are scheduled. FN they are scheduled with not yet properly calculated. Also, code was extracted from lactl_sap.c into own files. Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e