laforge
/
openbts-osmo
Archived
1
0
Fork 0
Commit Graph

226 Commits

Author SHA1 Message Date
Thomas Tsou 7fc5b4e6cd usrp: fix receive gain setting bug on non-uhd
When setting rx gain from the console, the returned set
value would never change due to a braces error around
logging macros.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-06-01 15:02:48 -07:00
Florian Wolff 6a8641438a gsm: fix for "L3 RR GPRS Suspension Request" error
Certain phones with GPRS capabilities will fail to
initiate calls with the following error. No call output
will be present in the Asterisk log.

1265648543.0255 INFO 3073350512 GSML3Message.cpp:162:parseL3: L3 recv RR GPRS Suspension Request
1265648543.0257 NOTICE 3073350512 DCCHDispatch.cpp:144:DCCHDispatcher: UnexpectedMessage

The issue and patch were discussed on the openbts-discuss
mailing list.

"David is right that openBTS does not emit any GPRS beacon,
so the behaviour is triggered from mobile station which
believe that there has been some GPRS before (i.e. in it's
old location area).

Unfortunately openBTS does not simply ignore this L3 RR
GPRS Suspension Request, instead a expected message flow
sequence (i.e. during call setup) is terminated with an
exception.

However we created a small patch against openbts-2.5.3
Lacassine to really ignore the L3 message. Feel free to
distribute it upstream to the community."

The author of the patch is >> Florian.Wolff@Siemens.com <<

According to his statement, O2 XDA Orbit and Motorola
Milestone are working fine with those changes. They had
the same problems before as with the iPhone.

Reported-by: Michael Folz <michael.folz@fh-kl.de>
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-31 16:01:00 -07:00
Thomas Tsou 3896e7499f transceiver: fix energy threshold bug
If no bursts were received over a long enough duration
then the threshold would roll into negative territory.
The energy detection is based on a comparison with the
squared threshold, so all handsets would become
effectively barred after a certain period of
inactivity.

In theory, this bug also exists in the mainline tree,
but there the daughterboard receive gain is fixed at
max, which always allows the ADC to generate sufficient
noise to trigger the energy dectector and keep the
system in a valid steady state.

To fix, simply add a negative value check like those
already in place for other locations.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-26 15:40:38 -07:00
Thomas Tsou f398757fe6 Merge branch 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts
* 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts:
  configure.ac: use AM_SILENT_RULES if available
2011-05-26 15:40:21 -07:00
Thomas Tsou e456a41edf transceiver: fix bug on non-UHD builds
Add a missing variable that was supposed to go with,

b7c09bba14

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-26 15:40:03 -07:00
Thomas Tsou e161523c8b transceiver: simplify transmit power control
UHD will internally accept floats with a range of +/-1.0,
which corresponds to a 16-bit signed integer range of
apporximately +/- 32000. Set the default amplitude to .3,
which is a safe value agaist saturation elsewhere in the
transmit chain.

The non-UHD maximum amplitude is unchanged at 13500.

Remove digital gain control because it's unnecessary and
causes extra load on enbedded systems.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-26 15:39:54 -07:00
Thomas Tsou acdb4969d5 config: modify example defaults
Lower the default setting to ERROR for main and TRX
logs. This makes the log friendlier for embedded
installations.

With default setting of midpoint and WBX board on
N200, the overall receive gain comes out to 19 dB.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-26 15:39:32 -07:00
Thomas Tsou a3bd572e45 uhd: reorganize error handling, exit when non-recoverable
This is primarily a minor refactor with the exception
of non-recoverable errors - notably if the receive times
out - which almost always requires a reload of the FPGA.
In these cases, quit without trying as resistance is
futile.

ERROR_TIMING:          Soft restart of streaming
ERROR_UNHANDLED:       Benign errors
ERROR_UNRECOVERABLE:   Abandon ship

Non-recoverable behaviour has not been observed in recent
builds, but may exist in older (or future) configurations.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-25 17:02:10 -07:00
Thomas Tsou 99a1466155 uhd: enable automatic alignment updates
Overnight testing shows that this shouldn't be required
in the majority of cases, but shit happens. Enabling
this forces transmit timing realignment at one minute
intervals. As a fallback method, timing slips not
caught by normal checks will be reset at the update.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 19:01:32 -07:00
Thomas Tsou 6ddbc257c8 uhd: cleanup startup timestamp alignment
At startup, instead of flushing initial packets blindly,
send a stop streaming command, flush, and start. The same
procedure is used in the event of a runtime timestamp
validity error.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 19:01:21 -07:00
Thomas Tsou 055af67a4e transceiver: rework digital gain settings
The output of the modulator or resampler is scaled and
converted from floating point to fixed point. The scaling
factor is the leftover dB in RF attention (relative to max
transmit power), which is handled prior to the integer
conversion. This should work across all daughterboards and
non-UHD installations.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 19:01:12 -07:00
Thomas Tsou b7c09bba14 transceiver: populate gain setting operations
These were carried over from the 52M transceiver to
allow recently added control commands to actually
work.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 19:00:56 -07:00
Thomas Tsou 2ba373fea9 Merge branch 'dboard'
* dboard:
  Transceiver52M: add WBX, DBSRX, and single board support
  Transceiver: add WBX, DBSRX, and single board support

Conflicts:
	public-trunk/Transceiver/radioInterface.cpp
2011-05-23 19:00:44 -07:00
Thomas Tsou dd0ee20c1a transceiver: enable adjustable gain settings on non-52MHz
Add gain and attenuation settings that were present
only in the 52MHz transceiver. This patch also
fixes SETRXGAIN failed warnings at startup.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 18:59:58 -07:00
Thomas Tsou db419b17c7 uhd: set attenuation relative to max RF gain
Previously this was referenced off the the ad9862
PGA with a range from 0 to -20 dB. Instead base
the attenuation factor on the maximum total RF
gain returned by the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 12:08:09 -07:00
Thomas Tsou e94b1f4827 uhd: disable adaptive buffering in 52 MHz transceiver
Similar to the non-52 Mhz case,

589dd9091e

This drastically reduces underruns on the E100.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 12:02:56 -07:00
Thomas Tsou 4f08ddf45a uhd: rework handling of timestamp errors
On a lapses of time monotonicity (and possibly other errors),
stop and restart the receive streaming with a buffer flush
in between. This is a cleaner replacement to the previous
clock reset with that didn't attempt to stop steaming.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 11:52:46 -07:00
Thomas Tsou de018f7fef uhd: fix timestamp conversion bug on 32-bit architectures
Type size_t was used in the UHD time_spec_t to integer
conversion, which would overflow at roughly 4 and a half
hours causing the sample buffer to error on timestamp
validity. Builds where size_t takes on 64-bits were not
affected by this bug.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 11:32:37 -07:00
Alexander Huemer a2d4ed5c71 configure.ac: use AM_SILENT_RULES if available
M_SILENT_RULES improves readability of the messages emitted by make,
compiler warnings are easier to spot.

Available since automake-1.11, ignored on earlier versions.

Traditional verbose output can be forced by
"./configure --disable-silent-rules" or "make V=1"

Written-by: Alexander Huemer <alexander.huemer@xx.vu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-05-23 19:04:50 +02:00
Thomas Tsou 551dbd3326 uhd: reset sample clock when time goes non-monotonic
With UHD b4fc0d61bb6cbd1a5614745bab9aeb0abc22cb6f

Sample clock will reset to zero after an overrun. Earlier
versions may hang the FPGA, which is non-recoverable,
requiring a manual image reload or reboot.

If reset to zero, attempt to kick the sample clock to the
last properly received timestamp value. At this point,
there will be a timing continuity jump, which will drop
connections, but transmit and receive chains should be
aligned allowing for re-establishment.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-08 13:46:29 -04:00
Thomas Tsou 67714e4292 uhd: inline thread priority setting
Push the ability to set thread priority out to the 52M
Transceiver interface, because that's where the thread
control exists.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 21:01:42 -04:00
Thomas Tsou 17750fd756 uhd: move static functions into the uhd_device class
Simplifies things slightly, and this is supposed to be
C++ after all.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 20:35:47 -04:00
Thomas Tsou 88223de898 uhd: allow the non-uhd to still compile unchanged
The missing methods are not implemented and simply return. They
didn't exist in the first place.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 17:42:29 -04:00
Thomas Tsou 8c86da79c0 uhd: move non-52MHz transceiver to common radio device interface
Use the same header files for the device and start moving
toward a commmon transceiver without so much redundant code.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 17:42:18 -04:00
Thomas Tsou 258ad91549 uhd: set and shadow settings through interface
Shadow all gains and frequencies, which minimizes device access.
This allows the transceiver to variably control the device
settings.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 17:42:09 -04:00
Thomas Tsou 79a1cf3d34 uhd: set receive gain during initialization
This shouldn't matter much, but the gain settings through the
interface are short circuited right now, which makes this a
problem.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 13:34:30 -04:00
Thomas Tsou 0ff69c95ff uhd: set hardware side delay offset for e100
The value is used to align transmit and receive time slots within
a sample. This oscilloscope measured value is close, but may
need minor tweaking.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 13:19:47 -04:00
Thomas Tsou 39f0bcfd18 uhd: log useful information on monotonic errors
Track the current errant and previous timestamp values.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 12:58:41 -04:00
Thomas Tsou 6c51f54909 uhd: only the E100 supports FPGA timestamps and adjustable clock rate
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:21:17 -04:00
Thomas Tsou b4fa0c4074 uhd: flush initial receive samples
Occasionally, the E100 will have errant timestamps at start
related to previous sessions. Early packets will be thrown
out anyways, so do this explicitly so the timestamps don't
royally fuck up the sample timing.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:21:08 -04:00
Thomas Tsou 90d7633583 uhd: add 52 MHz transceiver support
These are mostly identical changes as added to the non-52MHz
implementation with the exception of sample rate.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:20:08 -04:00
Thomas Tsou 2e096d9e9c uhd: remove extra type conversion
Type conversion, if necessary, should happen inside the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:18:42 -04:00
Thomas Tsou 47faafb525 uhd: one-off code cleanup and evisceration of camel casing
Because I can't take it anymore...

Actually, I've been manually converting names to camel
case before checking in, which was an error prone process
in and of itself.

The interface is unchanged, so nobody should complain.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:15:02 -04:00
Thomas Tsou 1c21ffd51b uhd: clean up sample alignment procedure
Utilize start and stop burst flags more effectively to
manage interaction with the FPGA. This makes communication
slightly more explicit, though it is not expected to
have a major effect. Also, lower the alignment messages
to DEBUG, and raise the asynchronous messages to INFO.
In other words, report the underrun, but not the handling
of it.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-04 23:08:43 -04:00
Thomas Tsou baffdf3e65 uhd: fix seg fault at startup
On the E100, and possibly other systems, OpenBTS seg faults
at startup. The cause is a null reference to the global
logging file descriptor occuring due to an initializer order
dependency, which is not guaranteed across compilation
units.

When this occurs, check for for null and set the output to
stdout.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-04 23:08:25 -04:00
Thomas Tsou 9de5527574 uhd: enable priority scheduling on receive loop
Though the receive loop ultimately drives the GSM clock,
it does not have any priority because it runs as a
separate thread from the trasmit loop. The transmit
has priority because it starts the UHD device, where
priority scheduling is enabled. The result is frequent
underruns, which occur regardless of buffer size tuning.

To address this, break out and expose the priority
setting so that it can be called from the radioInterface
at the start of a new thread.

Tested on a modest Intel Core 2 Duo tablet running
Linux 2.6.33.7.2-rt30, this reduced underruns down to
near zero.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-03-23 11:35:35 -04:00
Thomas Tsou 391b377668 uhd: log timestamp on receive error
Currently, upon receiving an unexpected timestamp, the sample
buffer will error and log its internal state. The errant
timestamp is not logged though. This patch fixes that.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-03-21 15:05:08 -04:00
Thomas Tsou d64ddbc0d1 Merge branch 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts
* 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts:
  Indicate no support for emergency calls in OpenBTS.config.example.
2011-03-09 01:15:34 -05:00
Thomas Tsou a8dd7a370b Revert "uhd: temporary fix for lingering packet bug"
This reverts commit f5e4628f1f.

Fix was moved upstream.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-03-09 01:09:59 -05:00
Thomas Tsou dff752739d Transceiver52M: add WBX, DBSRX, and single board support
Remove all RFX specific parts and control daughterboard
functionality using the base API. The tuning is now set
to a non-inverted image so remove the I/Q swap as well.

Daughterboard configuration is set through an enum
variable. Currently, there is no auto-configuration and
the default is Tx/RX on sides A/B respectively. For
transceiver boards the receive antenna is set to RX2.

enum dboardConfigType {
  TXA_RXB,
  TXB_RXA,
  TXA_RXA,
  TXB_RXB
};

const dboardConfigType dboardConfig = TXA_RXB;

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-03-08 22:19:41 -05:00
Thomas Tsou bf383dd3ff Transceiver: add WBX, DBSRX, and single board support
Remove all RFX specific parts and control daughterboard
functionality using the base API. The tuning is now set
to a non-inverted image so remove the I/Q swap as well.

Daughterboard configuration is set through an enum
variable. Currently, there is no auto-configuration and
the default is Tx/Rx on sides A/B respectively. For
transceiver boards the receive antenna is set to RX2.

enum dboardConfigType {
  TXA_RXB,
  TXB_RXA,
  TXA_RXA,
  TXB_RXB
};

const dboardConfigType dboardConfig = TXA_RXB;

The gains are currently not configurable through the
device API and default to midpoint for the installed
daughterboard(s).

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-03-08 22:19:41 -05:00
Alexander Chemeris d15a9730fe Indicate no support for emergency calls in OpenBTS.config.example. 2011-02-08 14:39:21 +03:00
Thomas Tsou f5e4628f1f uhd: temporary fix for lingering packet bug
Certain chipsets (e.g. RTL8168) have issues with the
initial packet of samples at that start of a UHD
receive stream resulting in timestamp errors shortly
after start. This temporary patch forces a receive
during init to clear any lingering errant packets.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-02-04 17:07:48 -05:00
Thomas Tsou 5ed92311dc uhd: remove device time read during alignment
Recent UHD firmware for the USRP2/N210 replaces the MicroBlaze
with a slower ZPU in addition to changes to the control
transactions. The effect is less predictable reading of the
current time and Tx/Rx sample mis-alignment following
underruns.

After an underrun, this patch drops potentially stale packets
with a fixed interval instead of relying on reading the
current time from the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-01-28 13:27:12 -05:00
Thomas Tsou 753118031e Transceiver: move I/Q swap and byteorder to behind device interface
The non-UHD implementation tunes the DDC to output an inverted
spectrum that requires swapping on the host. Push I/Q and byte
swapping into the device implementation and strip the related
bits out of the remaining transceiver code.

This also moves the Transceiver closer to the Transcever52M
version.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-01-28 13:26:39 -05:00
Thomas Tsou f1ec79c540 Merge branch 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts
* 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts: (21 commits)
  Transceiver52M: Do not delete 'trx' on exit.
  common libs: Implemented ISLOGGING() macro to test whether given loglevel is going to be logged.
  common libs: Implemented BitVector::unhex() which reads a hex string into a BitVector.
  common libs: Lower log level for "setting log path to " message.
  common libs: Use gethostbyname2_r() instead of gethostbyname() if available.
  control: Save IMEI in TMSI table for informational purposes.
  sip: Set display name for To field in a SIP MESSAGE.
  control: Use std::string in TransactionEntry to ctore messaging payload.
  smqueue: Documentation fixes for sm_state enumeration in smqueue.
  gsm: Add 8-bit alphabet to enumeration of GSM alphabets.
  sip: More comments and minor code ordering in SIP::sip_message().
  smqueue: Fix compiler warning about char* and constant strings.
  Transceiver: correctly exit if USRP is not found.
  Transceiver52M: Fix wrong memcpy().
  Better safety checks in TMSIRecord::load().
  Zero file descriptors set before use.
  Remove unused variable in BitVector::hex().
  Move more code out of asserts.
  Don't put real code into assert().
  Fix a bug with Timeval difference calculation on 64-bit Linux.
  ...
2010-12-22 01:10:22 -05:00
Alexander Chemeris 3fa2aa19cb Transceiver52M: Do not delete 'trx' on exit.
This should make it slightly less frequent to segfault on exit.
Actually we should shutdown all our threads correctly, but that's a lot of work.

(cherry picked from commit 7cd65d3e5a717e0c224477cacfe932cfd7a45b8f)
2010-12-21 18:29:57 +03:00
Alexander Chemeris 6423e707df common libs: Implemented ISLOGGING() macro to test whether given loglevel is going to be logged.
(cherry picked from commit d5e1c75147ef6d4bd6699c57250cc7b4def2e92b)
2010-12-21 18:29:23 +03:00
Alexander Chemeris a2ce7ae628 common libs: Implemented BitVector::unhex() which reads a hex string into a BitVector.
(cherry picked from commit d017dd20de029dbaa275335450728885f19ed01d)
2010-12-21 18:28:45 +03:00
Alexander Chemeris e2e267dcca common libs: Lower log level for "setting log path to " message.
I don't see real value of this message, while it's been printed to the screen like something very important.

(cherry picked from commit 3f3c9b2d2599a672f08624b3081c2c687cbba4d4)
2010-12-21 18:13:05 +03:00
Alexander Chemeris 80963d1ed9 common libs: Use gethostbyname2_r() instead of gethostbyname() if available.
gethostbyname() is not thread-safe. It's recommended to use gethostbyname_r() or gethostbyname2_r() instead.

(cherry picked from commit f27e9581cdb6837f83d0aab467f0e5f83e814e7b)
2010-12-21 18:11:14 +03:00
Alexander Chemeris 422848f5c1 control: Save IMEI in TMSI table for informational purposes.
So yes, now you should be able to identify all those annoying iPhones.

(cherry picked from commit e09c0b87d2ecbb5df713c020b814e3a8f371a9d4)
2010-12-21 18:09:31 +03:00
Alexander Chemeris c5e8a2337d sip: Set display name for To field in a SIP MESSAGE.
(cherry picked from commit 82d2d87f3f726976d9003829517a6cce395543ee)
2010-12-21 18:07:36 +03:00
Alexander Chemeris 25cef9ef96 control: Use std::string in TransactionEntry to ctore messaging payload.
Originally there was a fixed-size char array, which didn't allow to work with long hex strings.

(cherry picked from commit fdc6fc85f9f431438ef7279975c2f7c230cb4aa5)
2010-12-21 18:06:31 +03:00
Alexander Chemeris c39af79c75 smqueue: Documentation fixes for sm_state enumeration in smqueue.
(cherry picked from commit 70dffa1fcfb497cb6f90c1f83bf5d34942d27c59)
2010-12-21 18:05:51 +03:00
Alexander Chemeris b854303428 gsm: Add 8-bit alphabet to enumeration of GSM alphabets.
(cherry picked from commit 6c2e5134808e66f525e7df3e250a3f7be5cfd31c)
2010-12-21 18:05:09 +03:00
Alexander Chemeris 9de3435b20 sip: More comments and minor code ordering in SIP::sip_message().
(cherry picked from commit e7d2a39129e86c9a844bdb0c282fdf489f2f4ee7)
2010-12-21 18:03:56 +03:00
Alexander Chemeris f92807c2bd smqueue: Fix compiler warning about char* and constant strings.
(cherry picked from commit d712b09cdd)
2010-12-21 18:01:56 +03:00
Alexander Chemeris 2c0be6d746 Transceiver: correctly exit if USRP is not found.
(cherry picked from commit 8880f019e8071eb7f43f3727ab5414f744aedc4b)
2010-12-21 17:52:18 +03:00
Alexander Chemeris 91d16c65b7 Transceiver52M: Fix wrong memcpy().
1) It should be memmove(), because source and destination regions may overlap.
2) Amount of moved memory was calculated incorrectly and was about 2x times more then really needed. We thus touched memory outside of the allocated array and may crash the program.

(cherry picked from commit fbed302055ebe77ca19b899c8bc307ca05b4a604)
2010-12-21 17:50:35 +03:00
Alexander Chemeris 889d45eb22 Better safety checks in TMSIRecord::load().
This also avoids "corrupt TMSI file" message on empty file.

(cherry picked from commit 8ce5b5ec29deb53a72c81139a1fd768db52f60aa)
2010-12-21 17:49:24 +03:00
Alexander Chemeris 0517600882 Zero file descriptors set before use.
(cherry picked from commit cc1e6635f58512ec1bc07f4a933d6535e2c75d7f)
2010-12-21 17:48:25 +03:00
Alexander Chemeris e8b244c306 Remove unused variable in BitVector::hex().
(cherry picked from commit 4ff6edb50ce90db31e66dba3f77e08259929f1ac)
2010-12-21 17:47:29 +03:00
Alexander Chemeris 955f6ca200 Move more code out of asserts.
This time I checked all occurrences of assert() and all others are ok, if I didn't miss anything

(cherry picked from commit 2afd3fd962eb89e08a73420542267191f459815f)
2010-12-21 17:45:55 +03:00
Alexander Chemeris 410d42eda0 Don't put real code into assert().
If you compile with optimization and NDEBUG is defined, then the whole assert() is replaced with ((void) 0) and your code is not executed at all.

Don't assert() on pthread_join() return value. If thread was not started yet, then pthread_join() will fail, but it's ok for us.

(cherry picked from commit d0b797e62c, 21a84dcec9cdf25657bba5c221aac9d4bb81d8b3, 8ed37a1f36e1b1266728647e715f95a28df3f900)
2010-12-21 17:42:09 +03:00
Alexander Chemeris f24e148432 Fix a bug with Timeval difference calculation on 64-bit Linux.
Subtracting uint32_t from uin32_t gives you uint32_t. And assigning result to a long doesn't make it a signed value, because on 64-bit Linux long is 64 bits.

(cherry picked from commit 82dd78d698)
2010-12-21 17:38:21 +03:00
Alexander Chemeris fc81223045 Fix a bunch of typos.
(cherry picked from commits 2da5a28a07, 6cddd36139. 7852c1e572abbc9fee2548a58e377cfbb3eff46d, f85d5b3f528ba19c598cbe77bad2566920bf9dd4, 0f8766a506f25118f732cca10fe44a1c9a0ace6a, 26adfe2d158e6a80d50b4e247c1539b5a07add9f)
2010-12-21 16:58:05 +03:00
Thomas Tsou b7bf610484 Merge branch 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts
* 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts:
  gsm: Remove obsolete PCAP stuff from gsmtap.h
  gsm: Update and enhance the GSM Tap functionality
  gsm: Add same ARFCN()/typeAndOffset() accessors to L1Decoder than L1Encoder
  gsm: Save time of received frame for later use in XCCHL1Decoder
  gsm: Create more precise TypeAndOffset cste for BCCH/CCCH
  transceiver: Fix misusage of ~ in bitfields
  misc: Add a proper .gitignore file
  build: Fix Transceiver/Makefile.am to use AM_CXXFLAGS instead of CXX_FLAGS
  build: Remove all files autogenerated by autoreconf

Fix trivial conflict:
	public-trunk/Transceiver/Makefile.am
2010-12-08 12:18:39 -05:00
Sylvain Munaut 647a207bde gsm: Remove obsolete PCAP stuff from gsmtap.h
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:46:02 +01:00
Sylvain Munaut e6d5057d5d gsm: Update and enhance the GSM Tap functionality
* switch to the new format
* add uplink frame dump as well
* fill more fields than before (not fully complete yet tough)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:46:02 +01:00
Sylvain Munaut b6b3f6ace1 gsm: Add same ARFCN()/typeAndOffset() accessors to L1Decoder than L1Encoder
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:00:18 +01:00
Sylvain Munaut 3c7ad29fa8 gsm: Save time of received frame for later use in XCCHL1Decoder
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:00:18 +01:00
Sylvain Munaut 908bc39f5f gsm: Create more precise TypeAndOffset cste for BCCH/CCCH
Very useful to know in L1 what burst/encoder/fec are related to.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:00:18 +01:00
Sylvain Munaut a8834fde88 transceiver: Fix misusage of ~ in bitfields
Somehow it seems the author tought using ~ would set that bit to 0. But
it invert all bits and as such set all others to '1'.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:00:18 +01:00
Sylvain Munaut d82d8b9496 misc: Add a proper .gitignore file
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:00:18 +01:00
Sylvain Munaut 1a861cad9b build: Fix Transceiver/Makefile.am to use AM_CXXFLAGS instead of CXX_FLAGS
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 00:00:18 +01:00
Sylvain Munaut 50006e364d build: Remove all files autogenerated by autoreconf
Best practice is to not include those in repositories but only
in tar.gz dist tarball.

autoreconf -i will regenerate them

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-30 23:58:50 +01:00
Thomas Tsou 2ce9041742 uhd: update to change in uhd metadata interface
Fixes the following build error.

UHDDevice.cpp:462: error: ‘EVENT_CODE_SUCCESS’ is not a member of ‘uhd::async_metadata_t’
UHDDevice.cpp:507: error: ‘EVENT_CODE_SUCCESS’ is not a member of ‘uhd::async_metadata_t’

Reported-by: Dirk Kirsten <Dirk.Kirsten@uni-konstanz.de>
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-27 18:43:18 -05:00
Thomas Tsou 6e55e19418 uhd: add missing return in device open
Fixes a compile warning; returns true if all is goes well.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-27 17:58:00 -05:00
Thomas Tsou e9010cb9a0 uhd: fix potential buffer overrun
Fix a bug that might allow a sample buffer write to go a sample too far.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-27 17:57:06 -05:00
Thomas Tsou aaf378a111 uhd: update to new uhd range api
Fixes the following that occurs with recent uhd changes.

UHDDevice.cpp:260: error: ‘struct uhd::gain_range_t’ has no member named ‘max’
UHDDevice.cpp:260: error: ‘struct uhd::gain_range_t’ has no member named ‘min’

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-17 01:45:01 -05:00
Thomas Tsou 589dd9091e uhd: increase initial transmit latency and disable adaptive control
The underrun behaviour of the USRP2 is different from the USRP1, and
the adaptive latency mechanism is not directly transferable. Instead,
fix the latency with a higher starting value, which effectively
buffers more samples on the host in front of the Ethernet interface.

An alternative may be to use the adaptive approach with USRP2
specific upper and lower bounds. For now, just use preprocessor
directives until a better solution comes around.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-17 01:44:51 -05:00
Thomas Tsou af2ded3b01 uhd: remove I/Q swap from radio interface
There should be a better way to do this. Only the USRP1 option
in non-loopback mode needs the swap.

UHD   & !SWLOOPBACK: FLIP_IQ = 0
UHD   &  SWLOOPBACK: FLIP_IQ = 0
USRP1 & !SWLOOPBACK: FLIP_IQ = 1
USRP1 &  SWLOOPBACK: FLIP_IQ = 0

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-17 01:44:44 -05:00
Thomas Tsou fb852969db uhd: add conditional build support
Transceiver can be built with UHD by specifiying the --with-uhd
option. Fractional sample rates are not supported by the USRP2
so Transceiver52M is not built.

Otherwise, the default GNU Radio USRP1 implementation is used.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-17 01:44:38 -05:00
Thomas Tsou 2735b806dd uhd: add uhd device implementation
This patch adds USRP2 device support and future support for
other UHD based devices. On receive, a sample buffer class,
which is indexable by timestamps, is used to temporarily
hold data until the requested samples are available.

On transmit, samples are sent immediately unless sample
alignment is known to be off - during startup or after the
occurrence of underruns or other errors. To regain
synchronization at these moments, timestamps are compared
against the current device time and dropped unless there
exists significant delay margin to physically arrive at the
device before deadline.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-17 01:44:16 -05:00
Thomas Tsou ce33adf422 uhd: exit on device open failure
If the device doesn't open, there's no reason to continue. Shut down
so the process doesn't linger.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-16 22:11:50 -05:00
Thomas Tsou 9c091dc7a9 uhd: separate USRPDevice and create virtual device interface
Move essential interface components into an abstract Device class
and create a factory method for instantiating compile-time
specified derived types (USRP1 or UHD).

The radioInterface has a device specific type conversion call to
the USRP1 driver, so push that behind the Device interface too.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2010-11-16 22:11:50 -05:00
Alexander Chemeris 62a2d77ccc Better code for MOUSSDController(). 2010-11-01 14:57:22 +03:00
Alexander Chemeris ce66ecb51d Some more changes. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 94523e388a USSD SIP handler initial implementation.
It works for basic requests, but needs more tsting for timeouts and other exceptional cases.
2010-11-01 14:57:22 +03:00
Alexander Chemeris bf4c962d41 Implement another flavor of TransactionTable::find() with mobile ID and service type. 2010-11-01 14:57:22 +03:00
Alexander Chemeris aeedcc50b6 Print USSDData pointer when printing TransactionEntry. 2010-11-01 14:57:22 +03:00
Alexander Chemeris a2298288fe Other USSD code beautification and fixes. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 9f707665ba Better result reporting for waitUSSDData() and postUSSDData(). 2010-11-01 14:57:22 +03:00
Alexander Chemeris 9c542926ac Always initialize mUSSDData in a transaction. 2010-11-01 14:57:22 +03:00
Alexander Chemeris c288b250b6 Remove second USSDHandler constructor. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 00b1810997 Store mobile IMSI instead of TMSI in MOUSSD transaction. 2010-11-01 14:57:22 +03:00
Alexander Chemeris e8ffcdb72f Update SIP interface to support SIP MESSAGEs for USSD. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 77d380565b Send correct text string with USSD release message. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 86b066da63 Fix comments typos and code formating. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 7ae0243308 Implement USSD short code in smqueue for testing purposes. 2010-11-01 14:57:22 +03:00
Alexander Chemeris 7d9b0497bc Added MO-USSD handlers map to config.
Now you can configure which request will go to which handler.
2010-11-01 14:57:22 +03:00
Alexander Chemeris 58821a8f74 Add comments anf better formating to USSDHandler::postUSSDData(). 2010-11-01 14:57:21 +03:00
Alexander Chemeris dd366df4f4 BUGFIX: Forgotten parentheses in USSDHandler::postUSSDData(). 2010-11-01 14:57:21 +03:00
Alexander Chemeris 7f5fbdb906 Create a constant for max USSD message length and make continuation string configurable. 2010-11-01 14:57:21 +03:00
Alexander Chemeris b39dc1bc78 Fix license header in USSD-specific files to AGPLv3. 2010-11-01 14:57:21 +03:00
Alexander Chemeris 216ade372c Merge 'achemeris/pending' into 'USSD' 2010-11-01 14:29:14 +03:00
Alexander Chemeris bac46e3b7d Better documentation and error reporting for ThreadSemaphore. 2010-09-29 10:48:25 +04:00
Alexander Chemeris 6cddd36139 Typos in comments fixed. 2010-09-29 10:47:29 +04:00
Alexander Chemeris d712b09cdd Fix compiler warning about char* and constant strings. 2010-09-29 10:29:55 +04:00
Alexander Chemeris d0b797e62c Don't put real code into assert().
If you compile with optimization and NDEBUG is defined, then the whole assert() is replaced with ((void) 0) and your code is not executed at all.
2010-09-29 10:29:26 +04:00
Alexander Chemeris 82dd78d698 Fix a bug with Timeval difference calculation on 64-bit Linux.
Subtracting uint32_t from uin32_t gives you uint32_t. And assigning result to a long doesn't make it a signed value, because on 64-bit Linux long is 64 bits.
2010-08-24 21:03:13 +04:00
Alexander Chemeris e139404884 Implementation of Semaphore. 2010-08-18 22:52:33 +04:00
Alexander Chemeris 2da5a28a07 Typos in comments and debug logs fixed. 2010-08-18 21:59:08 +04:00
Alexander Chemeris ae0def5cc7 Implemented "trans" CLI command to list all active transacions. 2010-08-18 21:59:07 +04:00
Alexander Chemeris 3d6e95356c Remove Makefile which is generated by ./configure. 2010-08-18 21:59:07 +04:00
Ivan Kluchnikov d4da240011 This shoud not be committed.
When this code is  enabled transaction will be closed after about 15 seconds of inactivity. It is  too short for USSD and should be fixed later.
2010-08-10 17:25:37 +04:00
Ivan Kluchnikov 3889999846 Initial USSD support commit. 2010-08-10 17:04:04 +04:00
Sylvain Munaut 5a969569c5 Tranceiver52M: Remove the Nieue hack
This hack accidentally leaked in the release code ... but it prevents
tuning for certain ARFCN and reduces TX power.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-08-09 09:55:25 +02:00
David A. Burgess 3a8fd4fac1 Another fix to the copyright notice header. 2010-07-16 17:09:09 -07:00
David A. Burgess fa179f74b7 Change license to AGPLv3. 2010-07-04 15:28:06 -07:00
David A. Burgess 9f1e320914 Fixed spelling errors in LEGAL. 2010-07-02 18:26:24 -07:00
David A. Burgess 5294b893b1 Added comment referencing the SMS spec. 2010-07-02 18:18:49 -07:00
David A. Burgess 35750c3d11 Fix parsing error for malformed mobile identity types. 2010-07-02 18:18:00 -07:00
David A. Burgess 98e0876b50 Added language for US gov't contractors and users
to clarify that the GPLv3 license applies to them
as well as anyone else.
2010-07-02 18:17:11 -07:00
David A. Burgess ecbaf97509 Initial import of OpenBTS 2.6 for a new public trunk. 2010-05-23 19:42:16 -07:00