Fork 0
Commit Graph

211 Commits

Author SHA1 Message Date
Harald Welte 1c41c4e0ae TrueBTS: add a new skeleton OsmoSAPMux
We will use this SAPMux replacement to tie the OpenBTS L1 to osmo-bts L2.
2011-11-12 17:57:43 +01:00
Harald Welte 98cdb03713 GSM: Move BCCHL1Encoder::generate() into separate file
BCCHL1Encoder actually belongs to layer3, but is implemented as part of
Layer1.  If we keep it linked into GSML1FEC.o, it will cause
dependencies to higher layers (through gBTS)
2011-11-12 17:54:47 +01:00
Harald Welte 7a2026ab44 GSM: Slit and
The purpose of this exercise is to make sure the L1 can be used
independent of the higher layers.
2011-11-12 17:52:23 +01:00
Harald Welte efd2e6e25f Introduce gBTSL1 global and use it from the GSM L1
The purpose of this is to find a way how we can just configure the L1
without depending on the higher layers of the protocol stack.
2011-11-12 17:43:31 +01:00
Harald Welte bc570dd885 Introduce GSMConfigL1 as base class for GSMConfig
GSMConfigL1 only contains those fields applicable for the Layer1,
while GSMConfig contains all fields for higher layers.
2011-11-12 17:43:25 +01:00
Thomas Tsou fa05e2e7c4 transceiver, resamp: enlarge transmit resampler output buffer
It was possible to reach a state where a resampled burst would
overrun the transmit output buffer and corrupt the global
allocated signal vectors. The result was a segmentation fault
when attempting to access heap allocated signal vectors since
the pointers were garbage.

Whether the segfault occured or not appears to depend on the
memory location of the signal vector pointers, since it does
not occur on all systems.

Double buffer size to accomodate an incoming burst plus up to
a full chunk that may be remaining from the previous resampling

Signed-off-by: Thomas Tsou <>
2011-11-10 19:32:55 -05:00
Thomas Tsou 6445a3bf86 transceiver, resamp: insert missing filter values
With transceiver integration, the resampling filter files were
dropped. This created a working resampling implementation for
the USRP2 / N200, but with spectrum irregulaties that likely
caused issues at longer range operation. Simply reinsert the
filter files and modify the filter initialization to use them.

Signed-off-by: Thomas Tsou <>
2011-11-04 12:58:03 -04:00
Thomas Tsou 3800745c6a config: remove non-52MHz transceiver from configuration file
It no longer exists; 64MHz USRP1 support is out. Enable the
resampler in the 52MHz transceiver at build time for
external reference capable USRP2 and N2xx devices.

Signed-off-by: Thomas Tsou <>
2011-10-21 12:27:20 -04:00
Thomas Tsou d93729a806 transceiver: usrp1: select single dboard use at compile time
The following option selects single daughterboard use on
side A only. Otherwise, the default setting is TX on A and
Rx on B.

  ./configure --with-singledb

Other options are possible, as per the following enum, but
for simplicity with configure options, there are only two

  enum dboardConfigType {

Signed-off-by: Thomas Tsou <>
2011-10-21 12:06:01 -04:00
Thomas Tsou 515c859556 transceiver: uhd: make external reference a compile time option
External reference selection was already compile-time
determined by a hard coded value. Make it selectable
as a configure option.

Signed-off-by: Thomas Tsou <>
2011-10-21 12:05:51 -04:00
Thomas Tsou 03fd84469e transceiver: update main to accommodate resampling
With the unified transceiver, we need to select between
two device sample rates, GSM symbol rate and 400ksps for
resampler use. Make this selection available for configure
time options.

Signed-off-by: Thomas Tsou <>
2011-10-21 12:03:54 -04:00
Thomas Tsou 44fe0df73f build: insert autofoo for usrp transceiver and options

  ./configure --with-usrp1

  Enable non-UHD USRP1 support through the gnuradio-based
  driver. Requires gnuradio (libusrp) to be installed.

 ./configure --with-resample

  Enable host-based 400ksps to 270.833ksps resampling.
  Only supported for UHD devices. If not enabled, the GSM
  sample rate is requested directly from the device.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:10:41 -04:00
Thomas Tsou ba7a18d80d transceiver: add a newline for uhd information outputs
Minor change to clarify the logging output.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:10:41 -04:00
Thomas Tsou 1928417a66 transceiver: reject usrp1 if detected using uhd 2011-10-20 21:10:41 -04:00
Thomas Tsou eb10d9b31d transceiver: make the transmit drive loop bus dependent
With the introduction of the B100, there is USB support
using UHD devices. The characteristics of the trasmit
side burst submissions are more reflective of the bus
type than the device or driver.

Use a fixed latency interval for network devices and the
adaptive underrun approach for USB devices - regardless
of driver or device type.

The GPMC based transport on the E100 appears unaffected
by either latency scheme, which defaults to network.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:10:41 -04:00
Thomas Tsou cdbfa6910f transceiver: clean variable init of radio interface constructor
Signed-off-by: Thomas Tsou <>
2011-10-20 21:10:00 -04:00
Thomas Tsou 84ba2673e4 transceiver: move various radio interface definitions
Move them out of the interface file - primarily for

Signed-off-by: Thomas Tsou <>
2011-10-20 21:03:41 -04:00
Thomas Tsou 9d0beae1a5 transceiver: rename getting radio vector time to getTime()
Small name change to match setTime for a get/set pair.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:03:41 -04:00
Thomas Tsou bb1c2f2ad2 transceiver: add option for host based resampling
The resampling transceiver is unified with the 52MHz
version. The option to resample 400ksps from the device
to a GSM appropriate 270.833ksps is enabled at compile
time with the following option.

   ./configure --with-resamp

Signed-off-by: Thomas Tsou <>
2011-10-20 21:02:37 -04:00
Thomas Tsou b667ea6267 uhd: keep reading on overrun or other non-fatal errors
The readSamples call does not return less than the
number of samples requested. Doing otherwise is a
fatal error. So on overruns, which are not fatal,
continue reading until the requested number of
samples is received.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:02:12 -04:00
Thomas Tsou 7e3692c087 transceiver: separate I/O portion of radio interface implementation
Move push and pull of buffers into a dedicated file. This will
allow us to swap out resampling, non-resampling, and possibly
floating point device interfaces while presenting a single
floating point abstration in the interface itself.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:01:39 -04:00
Thomas Tsou f5575b9240 transceiver: separate radio clock and vector interfaces
Remove radio clock and vector interfaces into their own
files. This clears up and simplifies the radio interface
and, additionaly, prepares for a further split of the I/O
portion for optional resampler use.

Signed-off-by: Thomas Tsou <>
2011-10-20 21:00:22 -04:00
Thomas Tsou 285b0a481c transceiver: uhd: update copyright header
Signed-off-by: Thomas Tsou <>
2011-10-20 20:49:34 -04:00
Thomas Tsou 0b974109a8 transceiver: minor cleanup of sample type sizing in uhd
A small simplification of buffer indexing and sizing.

Signed-off-by: Thomas Tsou <>
2011-10-20 20:49:34 -04:00
Thomas Tsou 331755f458 transceiver: remove extraneous comments
These lines are virtually never enabled.

Signed-off-by: Thomas Tsou <>
2011-10-20 20:49:34 -04:00
Thomas Tsou 86545d1ab9 transceiver: remove extra typedefs to remove warnings
These typedefs serve no purpose and the compiler complains.

Signed-off-by: Thomas Tsou <>
2011-10-20 20:48:56 -04:00
Thomas Tsou 4fcc2bd352 transceiver: remove old resampling transceiver 2011-10-20 20:45:20 -04:00
Thomas Tsou 1898c37e43 transceiver: reroute UHD messages to logging facility
Pipe the following uhd message types to standard warning
levels (INFO, WARN, ERROR) respectively. Ignore fastpath
logging messages and, instead, catch them from the
asynchronous device interface.

    enum type_t{
        status  = 's',
        warning = 'w',
        error   = 'e',
        fastpath= 'f'

Signed-off-by: Thomas Tsou <>
2011-10-07 13:45:06 -04:00
Ivan Kluchnikov 20ea06422d Merge commit 'USSD' 2011-08-22 16:52:29 +04:00
Thomas Tsou 980d31a404 uhd: remove external clock polarity setting
Unused and causes the follwing errors on certain UHD versions.

"ValueError: unhandled clock configuration reference source: _external_"

Signed-off-by: Thomas Tsou <>
2011-08-10 16:52:09 -07:00
Thomas Tsou d71ce7c294 uhd: output more informative error message on make failure
The device make generally only fails on failure to find an
appropriate device.

Signed-off-by: Thomas Tsou <>
2011-08-05 12:30:19 -07:00
Thomas Tsou fda11abe6c uhd: verify setting of master clock rate
If the master clock rate fails to set - this basically only happens
when the wrong transceiver is choosen for the particular device -
the error is fatal and the transceiver should exit. The clock rate
setting was previously never verified.

Signed-off-by: Thomas Tsou <>
2011-08-05 12:29:31 -07:00
Thomas Tsou f8838172ad transceiver: fix bug in setting low-level attenuation
This patch fixes some confusion in gain vs. attenuation
setting. The UHD device is controlled through gain
settings but OpenBTS represents gain in terms of
attenuation relative to maximum - 0 dB attenuation.

Signed-off-by: Thomas Tsou <>
2011-08-01 19:56:16 -07:00
Alexander Chemeris e64e4119ae CLI: Fix sendsms CLI command to actually accept text strings.
Now we have two commands - "sendsms" which behaves as intended and "sendsmsrpdu" which accepts a hex string of RPDU.
2011-07-25 14:37:34 -04:00
Alexander Chemeris 3d2c5ecfbc Update .gitignore to include new executables and config files. 2011-07-25 14:36:20 -04:00
Thomas Tsou 44aff7de0b uhd: remove uhd type argument
UHD recently modified the E100 type name from 'usrp-e' to
'e100' causing the device make to fail. Remove device type
checking to keep things working with the older and newer

Signed-off-by: Thomas Tsou <>
2011-07-08 17:37:11 -07:00
Thomas Tsou 6d34bace87 transceiver: reinsert digital gain scaling
Commit e161523c (transceiver: simplify transmit power control)
changed transmit gain control to RF setting only. This was
appropriate for a WBX board with 25 dB of gain control, but
inappropriate for an RFX with fixed transmit gain.

RFX boards will regain the ability to set transmit
attenuation. Since gain is set on the RF side first,
reintroducing digital gain settings should have limited
overall effect on non-RFX daughterboards.

Signed-off-by: Thomas Tsou <>
2011-06-22 13:39:13 -07:00
Thomas Tsou 8301298f88 Merge branch 'remote-cli'
* remote-cli: (22 commits)
  Throw exception if usrp is not found. Don't crash transceiver.
  Update OpenBTS init script
  Correctly exit OpenBTS even if console is not started yet.
  Add option to run OpenBTS in a failsafe loop.
  Shutdown without core dump on a usual SocketError.
  Remove Transceiver PID file on OpenBTS exit.
  Save transceiver PID to a file and use it to kill old transceivers.
  Correct comment for Server.WritePID.
  Set FD_CLOEXEC flag on all sockets.
  Stupid bug fixed - can't move stack variables initialization to a separate function.
  Gracefully shutdown OpenBTS on transceiver timeout/error.
  Make functions and variables in OpenBTS.cpp static to avoid their use outside of the file.
  Remove PID file on program exit.
  Implemented daemon mode, configured from config.
  Better default name for OpenBTS control UNIX socket.
  Initialize logger right after loading config file.
  Use normal cout and cerr while we have only one thread.
  Better comments for previous commit.
  Catch SIGINT, SIGTERM and SIGHUP and shutdown the server gracefully.
  Uncomment real BTS start/stop.
2011-06-21 19:02:19 -07:00
Thomas Tsou 3ea07de75c Merge branch 'sms-split'
* sms-split:
  smqueue: Add SMSC short code to smqueue.config.example
  Checking in forgotten smsc.cpp and smsc.h files.
  Ignore User-Data-Header in SMS TPDU when decoding text in TLUserData::encode7bit().
  Transparently pass TP-UHDI (User-Data-Header-Indicator) from SMS-SUBMIT to SMS-DELIVER.
  Slightly cleaner output in TLUserData::write().
  Log contents of a message instead of its memory addresss in SMS::parseTPDU().
  Use decoded text from original message in bounce and e-mail messages.
  More readable bounce message.
  Maximum SMS length is 160 symbols in default alphabet.
  Avoid duplication of "IMSI" in SC.Register.Msg.
  Set Log.Alarms.* values in smqueue config.
  Make "from" address for bounce messages configurable.
  Move most of the SMS processing to smqueue (initial check-in).
  Better documentation and error reporting for ThreadSemaphore.
  Implementation of Semaphore.
  Implemented "trans" CLI command to list all active transacions.
2011-06-21 19:02:10 -07:00
Thomas Tsou f6ed307167 control: use braces with conditions and logging macros
Removes warnings and may prevent future clumsy mistakes.

Signed-off-by: Thomas Tsou <>
2011-06-21 17:49:29 -07:00
Alexander Chemeris 23d826d3ba Throw exception if usrp is not found. Don't crash transceiver. 2011-06-21 16:46:55 -07:00
Alexander Chemeris f3fbf2a39e Update OpenBTS init script 2011-06-21 16:46:55 -07:00
Alexander Chemeris fc61ebaf53 Correctly exit OpenBTS even if console is not started yet. 2011-06-21 16:46:55 -07:00
Alexander Chemeris 7d9fa86569 Add option to run OpenBTS in a failsafe loop. 2011-06-21 16:46:55 -07:00
Alexander Chemeris d0c9057711 Shutdown without core dump on a usual SocketError. 2011-06-21 16:46:55 -07:00
Alexander Chemeris a0f3b96688 Remove Transceiver PID file on OpenBTS exit. 2011-06-21 16:46:55 -07:00
Alexander Chemeris 7b3c0d3090 Save transceiver PID to a file and use it to kill old transceivers. 2011-06-21 16:46:55 -07:00
Alexander Chemeris 1cd7f00470 Correct comment for Server.WritePID. 2011-06-21 16:46:55 -07:00
Alexander Chemeris f7d78ff578 Set FD_CLOEXEC flag on all sockets.
We don't want them to be inherited on exec(). We use exec() to run Transceiver and it OpenBTS process crashes, transceiver becomes owner of all LISTEN sockets.
2011-06-21 16:46:55 -07:00
Alexander Chemeris 08bdbb921c Stupid bug fixed - can't move stack variables initialization to a separate function. 2011-06-21 16:46:55 -07:00