Commit graph

547 commits

Author SHA1 Message Date
Jon Szymaniak
8bbf917446 libbladeRF: Addressed warning from GCC -Os in device_identifier.c
Only seeing this warning with GCC - haven't observed this with
Clang or Coverity scans.

host/libraries/libbladeRF/src/device_identifier.c:121:22: error: ‘val’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             value[i] = tolower((unsigned char) c);
                      ^
host/libraries/libbladeRF/src/device_identifier.c:175:34: note: ‘val’ was declared here
     char *dev_id, *token, *arg, *val, *saveptr;
                                  ^
Addressing this by initializing ptrs to NULL and status variables to
BLADERF_ERR_UNEXPECTED. Added NULL pointer checks.
2016-01-04 09:28:37 -05:00
Ryan Tucker
e0f9254a40 Specify unsigned integer on big constant (Fixes #444) 2016-01-01 22:44:10 -05:00
Jon Szymaniak
681137c137 libbladeRF: Updated to v1.5.0 2015-12-30 23:04:09 -05:00
Jon Szymaniak
3e5faa42fb libbladeRF: Changed default frequencies
Per the libbladeRF API documentation, it is recommended to keep the RX
and TX frequencies >= 1 MHz apart. For consistency, the default
frequencies have been changed to follow this recommendation.

Additionally, the default frequencies have been moved within the 2.4 GHz
ISM band.
2015-12-29 18:46:38 -05:00
Jon Szymaniak
ccce423cff libbladeRF: Added BLADERF_MODULE_INVALID enumeration value 2015-12-28 22:20:20 -05:00
Jon Szymaniak
2161248943 libbladeRF: Added API call to read firmware log data
bladerf_get_fw_log() allows API users to retrieve firmware log
data and write it to a file.
2015-12-28 16:10:39 -05:00
Jon Szymaniak
a3caa70dff libbladeRF: Added FPGA v0.5.0 to version compat table 2015-12-14 15:29:59 -05:00
Jon Szymaniak
ec56c713e0 libbladeRF: Set VCTCXO taming capability for FPGA >= 0.5.0 2015-12-14 15:29:59 -05:00
Jon Szymaniak
9cdfbedd5d libbladeRF: Adding VCTCXO tamer mode selection support 2015-12-14 15:29:59 -05:00
Jon Szymaniak
33578a26e4 libbladeRF: Fixed check for invalid enum value in sync_init() (CID1343277) 2015-12-14 14:27:31 -05:00
Nick "Darkfiber" Wolff
327dce57b1 host: Minimal build fixes for FreeBSD
Work still needs to be done to troubleshoot libusb issues.
2015-12-14 11:36:15 -05:00
Mathieu Rene
0d55229719 libbladeRF: Added helper function for setting the FPGA's rx_mux
This function provides simpler access to the FPGA's RX mux,
whose settings are controlled by FX3 <-> FPGA GPIOs.
2015-12-09 23:31:16 -05:00
Jon Szymaniak
f0f3783f13 libbladeRF: Added bladerf_submit_stream_buffer_nb()
This provides a non-blocking variant of bladerf_submit_stream_buffer(),
which provides API users with more control over how they might want
to handle asynchronous buffer submission.

This API functionality has been exposed to allow users to implement
schemes similar to that used to address Issue #438.
2015-11-20 15:38:06 -05:00
Jon Szymaniak
bede8a99eb libbladeRF: Build fixes for dummy backend 2015-11-20 15:38:05 -05:00
Jon Szymaniak
e029251eb8 libbladeRF: Comment typo and copyright date touch-ups 2015-11-20 15:38:04 -05:00
Jon Szymaniak
6b197881f5 libbladeRF: Utilize all available TX buffers
This fixes issue #438, in which the bladerf_sync_tx() implementation
was limited by the number of transfers, and not taking advantage
of the available TX buffers (beyond N=<num_transfers>).

This is addressed by allowing the bladerf_sync_tx() context to defer
buffer submission to the sync TX callback handler when it is unable to
submit filled buffers.

Once assigned the responsibility of submitting deferred (filled)
buffers, the sync TX callback will continue to do so until
no filled buffers are available. At this point, the callback
relinquishes its submission duty back to the bladerf_sync_tx() context.
2015-11-20 15:38:03 -05:00
Jon Szymaniak
3dafac7add libbladeRF: Added "non-block" option to internal async buffer submission
This is one step towards addressing issue #438; we must first
know that we are unable to submit a buffer so that we can defer
its submission to a later callback.
2015-11-20 15:38:02 -05:00
Jon Szymaniak
f84df2601d libbladeRF: Added BLADERF_ERR_WOULD_BLOCK
This will be returned by API functions when an operation would need
to block to complete, but the caller has requested non-blocking
operation.  In this situation, the caller may need to wait and
resubmit the request at a later time.
2015-11-20 15:38:00 -05:00
Jon Szymaniak
0a2a3ace6b libbladeRF: Warn when device cannot be probed/opened due to permissions 2015-10-08 15:37:50 -04:00
Brian Padalino
01940e6ebd libbladeRF: Adding ability to set SMB frequency.
Adding the ability to set the SMB frequency when in MIMO master mode.
Also fix a bug where attaching the xb200 and setting MIMO master
would turn off the other clock not allowing an xb200 enabled device
to ever be a master clock supplier.

Being able to set the master frequency is useful when you want to
lock test equipment to the bladeRF oscillator.
2015-09-09 18:34:51 -04:00
Adam Greig
f7f26d5bb7 Add support for setting SMB clock output to arbitrary frequency 2015-09-09 17:58:41 -04:00
Jon Szymaniak
3ef92a7464 libbladeRF: Updated version compat table for FX3 FW v1.8.1 2015-09-08 12:50:17 -04:00
Jon Szymaniak
94fed3d0cd libbladeRF: Fixed an invalid mask value 2015-09-01 15:59:08 -04:00
Jon Szymaniak
1d0a6cc0c7 libbladeRF: Added support for attaching XB100
It appears that the voltage across the LEDs is always large
enough to keep them ON despite the output voltage.

A potential workaround for this rev of the XB100 is to use the
directionality of the LED IO pins to turn the LED on/off.
2015-09-01 13:24:33 -04:00
Jon Szymaniak
82191d8dee libbladeRF: Added masked XB GPIO write routines and XB GPIO macro definitions 2015-09-01 13:11:35 -04:00
Jon Szymaniak
a7c9d64d4f libbladeRF: Updated FPGA version compat table for v0.4.1 2015-09-01 11:37:03 -04:00
Jon Szymaniak
859377326b nios, lms, libbladeRF: Utilize FPGA support for atomic NINT/NFRAC write
Both the host and NIOS II FPGA retuning modes now make use of
FPGA v0.4.0's atomic write of the LMS6002D NINT and NFRAC PLL registers.

This helps avoid changing the PLL multiple times when attempting to
configure it.
2015-08-27 15:54:25 -04:00
Jon Szymaniak
20b7196e2d libbladeRF: Return BLADERF_ERR_PERMISSION in file operations 2015-08-25 14:40:51 -04:00
Jon Szymaniak
a8f5f71a97 libbladeRF: Added INFO message regarding insufficient permissions
This is intended to help folks recognize that they've forgotten
to update their udev rules.
2015-08-25 14:19:39 -04:00
Jon Szymaniak
2afcc6a895 libbladeRF: Added error code to denote insufficient permissions 2015-08-25 14:13:40 -04:00
Jon Szymaniak
2636bb377f libbladeRF: Restored default of FPGA tuning mode per v0.3.5 fix 2015-08-25 13:28:05 -04:00
Jon Szymaniak
0d67e4e689 libbladeRF: Updated compatibility table for FPGA v0.3.5 2015-08-25 13:28:05 -04:00
Jon Szymaniak
9fea12caaf libbladeRF: Added frequency tuning debug message 2015-08-25 13:28:05 -04:00
Martin Murray
7274d263ad libbladeRF: Always set a default rx/tx filter for an XB-200
While we could read back the mux state via gpio to infer what filters were
previously set, we don't know if the user had selected them explicitly or
had been using the auto_1db or auto_3db filters. Since it's ambiguous, we
should instead apply a default so that users can expect consistent results.
2015-08-23 02:41:34 -04:00
Martin Murray
1dd24e1de0 libbladeRF: Fixed segfault in nios_legacy_expansion_gpio_write
An error log message was missing a printf format argument causing a
segfault on old FPGA images.
2015-08-23 02:41:34 -04:00
Martin Murray
0ce3aaa280 libbladeRF: Simplified xb200 filter configuration routines.
Handling of the XB-200 hard and auto filters is separated into two
paths to avoid the confusion introduced in the fix for #404.

xb200_set_filterbank is the internal API entry point for the external
bladerf_xb200_set_filterbank. If the configured filter is a hard
filter, then internal state is updated and set_filterbank_mux is
invoked to realize the hardware changes.

If the configured filter is an automatic filter, then internal state
is updated and xb200_auto_filter_selection() is called with the
currently tuned frequency for specificed module.

xb200_auto_filter_selection() then invokes set_filterbank_mux to
realize the hardware changes.
2015-08-23 02:41:34 -04:00
Martin Murray
aeacd6df8c libbladeRF: Added a debug message when changing xb-200 filter mux. 2015-08-23 02:41:34 -04:00
Jon Szymaniak
6919e9ef4c libbladeRF: Temporarily default to host tuning until #417 is resolved
Failures have been observed when using FPGA tuning to retune
between vastly different frequencies.  It appears that in cases
where significant VCOCAP changes take place, much longer delay between
VCOCAP updates and VTUNE reads are needed than currently utilized in the
NIOS II implementation.

Until this is resolved, host tuning is being set as the default mode,
which does not exhibit this failure because register access overhead
incurs more than ample delay.
2015-08-13 14:47:46 -04:00
Jon Szymaniak
022a966987 libbladeRF: Hold lock when resetting sync state items
Per CID 1288660 and CID 1288661, these cases were the only times
these were accessed without holding the buffer management lock.

Although there shouldn't be a race here, this change is introduced to
maintain consistency with other accesses of the sync i/f state info.
2015-08-12 16:22:16 -04:00
Jon Szymaniak
75e7793636 libbladeRF: Added bug catcher for CID 1308077
This addresses an item picked up by Coverity. Defects in bands[] or
frequency checks could potentially cause an out-of-bounds memory access.

A bounds check has been added to avoid an invalid access, should one of
the aforementioned defect ever creep in.
2015-08-12 15:50:00 -04:00
Jon Szymaniak
f11427e661 libbladeRF: Fixed format specifier typos (Fixes #416) 2015-08-05 10:11:09 -04:00
Jon Szymaniak
c259e3d233 libbladeRF: Fixed order of add/data params to log_verbose(). Fixes #415. 2015-08-04 09:30:32 -04:00
Jon Szymaniak
6ecca0b3a9 libbladeRF: End bursts with 3 zero-samples, not 2.
See "Figure 9: TX data interface" in the LMS6002D data sheet for the
register stages that drive this requirement.

Due to a extra clock cycle delay in bladeRF FPGA <= v0.3.3, we were
"getting away" with a 2-sample 0-pad. However, FPGA v0.3.4 removes the
extraneous delay, which requires us to end the burst properly, with 3
zero samples.
2015-07-25 15:30:19 -04:00
Jon Szymaniak
bf4ec73ab4 libbladeRF: Updated FPGA version compatibility table 2015-07-25 15:28:57 -04:00
Jon Szymaniak
60fe9c65e3 libbladeRF: Prepend installation prefix to file search paths
When searching for FPGA bitstreams or other files, we should be
searching locations relative to the installation prefix.

In an effort to avoid breaking existing packaging scripts, the
previously used paths "/usr/share/Nuand/bladeRF" and
"/etc/Nuand/bladeRF" have been kept in the search list, but at a lower
priority than the items with the installation prefix.
2015-07-22 12:06:05 -04:00
Jon Szymaniak
774e60b5d5 libbladeRF: Made some verbose log output clearer 2015-07-14 11:04:36 -04:00
Jon Szymaniak
9dad01f9fa libbladeRF: Fix #404, XB-200 filter bank selection regression in 41476cb
The fix for issue #394 introduced another defect via:

    /* Update state information regarding automatically selected filter.
     * Invalidate the entry if we're not performing automatic selection. */
    if (filter == BLADERF_XB200_AUTO_1DB || filter == BLADERF_XB200_AUTO_3DB) {
        dev->auto_filter[module] = filter;
    } else {
        dev->auto_filter[module] = -1;
    }

The problem is that xb200_auto_filter_selection() ends up calling this with
filter set to the desired filterbank. We should only apply this state update
when getting called from bladerf_xb200_set_filterbank(), and not when we're
updating the filter selection from xb200_auto_filter_selection().
2015-07-13 14:58:59 -04:00
Jon Szymaniak
962d7b2be9 libbladeRF: Support matching a subset of a serial number
Users no longer have to enter the entire serial number when using
bladerf_open() or bladerf_open_with_devinfo(). Instead, the
shortest unambiguous subset (starting at the first character) can
be used.

For example, for a bladeRF with serial f12ce1037830a1b27f3ceeba1f521413,
one could open it via the device string:
    "*:serial=f12c"

If the requested serial number subset is ambiguous, then libbladeRF
will open whichever matching device it encounters first.
2015-07-05 13:48:04 -04:00
Jon Szymaniak
5517732a24 libbladeRF: Updated version compat table for FPGA v0.3.3 2015-06-30 18:58:12 -04:00
Jon Szymaniak
93b91fd40a libbladeRF: Added verbose output for nios access operations 2015-06-24 10:51:54 -04:00