According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:
sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Currently if an attempt to disable CSMA-CA in by setting an
appropriate flag in another (for example application)
CmakeLists.txt it caused lots of warnings. This fix allows
higher level CMakeLists.txt to disable CSMA-CA without
warnings.
Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
The API to set a callback has the namespace cipher but the driver
function pointer was using the namespace crypto. As this API belongs
to the cipher subgroup, just rename the function pointer in the driver
to be consistent.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Just give a better name to this file since now we have changed the
file where crypto driver API is defined.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This file defines the crypto driver API, cipher is supposed to be just
one type of capability (other can be hash) of these drivers, just
change the file name to be consistent with it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add 'cipher' namespace in some in the driver API since these
operations are for cipher.
Set a namespace to make it clear that these are cipher operations,
this allow further functionalities, like hash, to be added in this
driver API.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The updated nrf_802154 API accepts 64-bit time in microseconds.
The shim layer is updated to use 64-bit time.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Simplify driver implementation by using spi_dt_spec. Most internal
functions now take a device reference to simplify the operation, since
config did not exist before.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The device already has a DT compatible (and uses DT properties).
Instantiate the device using the DT-based macros and remove hardcoded
name.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Simplify driver implementation by using spi_dt_spec. Note that driver
has 2 SPI configurations, identical except the speed. For this reason,
the slow config is still kept in RAM and copied from the one obtained
via the SPI dt_spec macros. A better solution would be to have macros
that allow to override the SPI frequency, but this can be improved
later. Most internal helpers have been adjusted to accept a device
reference to make SPI (and future GPIO) transition easier.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Due to serialization restrictions radio api calls cannot be nested, any
violation of this rule leads to a deadlock. This commit fixes the bug
by transferring the nested radio api call to ot_radio_workq.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
For multicore devices like nRF53, shim layer part of setting mac keys
and frame counters is called on application core where
CONFIG_NRF_802154_ENCRYPTION is disabled (the define concerns radio
driver for net core). This commit replaces
CONFIG_NRF_802154_ENCRYPTION with CONFIG_IEEE802154_2015.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
Replace all get_dev_data()/get_dev_config() accessor utilities with
dev->data and dev->config.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
When the csl is active the nrf_802154_sleep() is called unnecessary.
This commit fixes it.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
This commit fixes compilation warning (unused variable)
generated in nrf5_config_mac_keys function, when the ASSERT
macros were disabled.
Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
This commit updates the ieee802154 driver to match the current feature
set of the nRF 802.15.4 radio driver for nRF53 SoCs.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
- B91 SoC requires to set RX mode again if channel is changed
- Fixed wrong ACK packet detection, mask should be used
Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
Driver has dedicated workqueue for IRQ processing.
Submit work to dedicated workqueue intead of system workqueue.
It also fixes driver functionality when NET_TC_TX_COUNT is set to 0.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Define a custom IEEE802154 based L2. The user can then use those symbols
to implement their own 802.15.4 based L2, based on those symbols, w/o a
need to modify the Zephyr tree.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Some 802.15.4 L2 implementations expect that FCS length is included in
the overall packet length while others not. Allow to configure this
behavior, based on the selected upper layer.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce a common config for all 802.15.4 based L2 implementations.
This way, any custom 15.4 L2 implementation will be able to
automatically enable use 15.4 driver, w/o a need to modify the actual
Kconfig.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The print specifier for `atomic_t` should be updated
to `%ld`, `%lu`, or `%lx` to account for the type
change of `atomic_t` to `long`.
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
When a frame is sent with a cleared ACK request bit, the transmit
metadata contains a NULL pointer to the ACK frame.
The pointer must not be dereferenced in such case.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
This commit makes nrf5_config_mac_keys function more generic.
Is uses lookup table for storing keys to override. It removes old keys
before storing new ones.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
Convert cc2529 driver to `spi_dt_spec` and `gpio_dt_spec`. Required a
whole driver conversion from passing around the driver data struct to
passing around the driver itself.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Convert cc1200 driver to `spi_dt_spec` and `gpio_dt_spec`. Required a
whole driver conversion from passing around the driver data struct to
passing around the driver itself.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
When ack data for extended address is set with the
nrf_802154_ack_data_set function, the extended address
must be reversed to the IEEE 802.15.4 address transmit
order in order to be properly matched.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Instead of putting object files inside libzephyr.a,
simply build a separate static library as most other
driver types are doing this already.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit aligns the nRF5 ieee802154 driver with the latest
API changes necessary to handle security-related flags properly.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
When stopping the interface, also abort the RX routine and enable RF
power saving. Will re-start RX on iface start.
Also fixed a bug with `cmd_fs` crashing at RF wakeup because `rf_mode`
was allocated on stack.
Signed-off-by: Stancu Florin <niflostancu@gmail.com>
When frame counter is managed by the radio driver the upper layer
needs to be informed about the frame counter changed. The upper layer
looks for the most recent frame counter in the transmitted frame,
this is why the tx_payload need to be updated after processed by
the radio driver.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
This commit extends the capabilities of the nRF IEEE 802.15.4 radio
driver with IEEE802154_HW_TX_SEC capability.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Copy back the TX buffer content back into the upper layer
in case of a TX failure.
This is necessary in when frame encryption by the radio driver
is used. The shim layer for the nRF5 driver has a buffer, that
is used by the driver to authenticate and encrypt the frame
in-place. In case of a TX failure, the buffer contents
are propagated back to the upper layer. The upper layer
must use the same secured frame for retransmission.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Use the nrf_802154_retransmit_csma_ca_raw and
nrf_802154_retransmit_at_raw API to retry the frame transmission
after a failed attempt.
The retry must be performed only in response to
a nrf_802154_transmit_failed event.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Function 'nrf_802154_transmitted_timestamp_raw' is not serialized and
connot be used for multi-core devices yet.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
Fill the ACK timestamp field in nRF5 driver. This is required by
OpenThread for the proper CSL transmitter functioning.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
OpenThread expects the FCS field at the end of the ACK frame to be
passed with `otPlatRadioTxDone`.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
This commit updates the revision of hal_nordic component
and introduces necessary changes to the IEEE 802.15.4 driver
to match latest nRF IEEE 802.15.4 radio driver API.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
The current rf2xx driver not implement any configuration. Add
the minimal structre to implement rf2xx driver configuration and
implement IEEE802154_CONFIG_PROMISCUOUS mode.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Configure transceiver to create a 0 period backoff and perform only one
time the CCA without transmission retires for failures.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The current RF2XX driver only support IEEE802154_TX_MODE_CSMA_CA. Add
IEEE802154_TX_MODE_DIRECT to allow transmit packets immediately without
performing random backoff, CCA and retransmission process.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit implements the OpenThread APIs to pass MAC keys and
frame counter to the radio layer in order to process the
transmission security. This is needed for the correct functioning
of a CSL transmitter.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Add support for delayed transmission of frames for the CSL
Transmitter OpenThread function.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
After changes in commit a42d6c98d3, the
pkt can no longer be a NULL pointer. Remove the unnecessary NULL pointer
check to silence the Coverity.
Coverity ID: 219536
Fixes#32912
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Replace all existing deprecated API with the recommended alternative.
Be aware that this does not address architectural errors in the use
of the work API.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Currently there is no way to distinguish between a caller
explicitly asking for a semaphore with a limit that
happens to be `UINT_MAX` and a semaphore that just
has a limit "as large as possible".
Add `K_SEM_MAX_LIMIT`, currently defined to `UINT_MAX`, and akin
to `K_FOREVER` versus just passing some very large wait time.
In addition, the `k_sem_*` APIs were type-confused, where
the internal data structure was `uint32_t`, but the APIs took
and returned `unsigned int`. This changes the underlying data
structure to also use `unsigned int`, as changing the APIs
would be a (potentially) breaking change.
These changes are backwards-compatible, but it is strongly suggested
to take a quick scan for `k_sem_init` and `K_SEM_DEFINE` calls with
`UINT_MAX` (or `UINT32_MAX`) and replace them with `K_SEM_MAX_LIMIT`
where appropriate.
Signed-off-by: James Harris <james.harris@intel.com>
The shim layer could in some circumstances not be properly
configured which would result in an unbound radio interrupt
handler.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
The driver was reworked recently so that driver capabilites are
obtained at runtime. The function to obtain the capabilities was
called after L2 initialization though, which is invalid as L2
initialization code already depends on certain driver capabilites.
Move the capability initializer to an earliest possible stage
(i. e. just after the core driver is initialized) to fix the issue.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This is a follow-up to commit 9f56cc5531.
Add net/ in the inclusion of ieee802154_radio.h so that the file can
be successfully included.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit introduces runtime query of the HW Capabilities of
the nRF IEEE 802.15.4 Radio Driver.
Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
Currently, if no net_pkt's are available, the radio driver RX thread
drops the 802.15.4 frame silently. This causes undesired behaviour,
where we can drop the packet which has already been acknowledged at
the 802.15.4 level.
Fix this, by blocking the RX thread if no net_pkt is avaliable. The
packets received while the RX thread is blocked will be accumulated in
the underlying nRF 802.15.4 driver, and eventually when it runs out of
internal buffers before the thread is unblocked, it'll stop
acknowledging the incoming frames.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The driver allocated packet from the TX pool on its RX path. Fix this
by using a correct allocator function.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Convert drivers to DEVICE_DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add support for transmission modes that send a packet
at a specific time in the future.
Remove TXTIME, TXTIME_CCA, CSMA_CA capabilities and their calls when
they are not supported by selected drivers. Add TXTIME flag in
get_capabilites function.
Signed-off-by: Maciej Fabia <maciej.fabia@nordicsemi.no>
Signed-off-by: Pawel Kwiek <pawel.kwiek@nordicsemi.no>
This change adds IEEE802154_RAW_MODE support for the
cc1352r.
This allows using the cc1352r 2.4 GHz radio and Sub Ghz
radio as a transceiver (PHY) instead of using L2 networking.
Signed-off-by: Erik Larson <erik@statropy.com>
This commit introduces the catch that prevents building of
IEEE 802.15.4 nRF driver in case the non-secure domain of the core
is used.
Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
This change enables the multi-protocol rf patch to be used for
the cc13xx_cc26xx IEEE 802.15.4 2.4 GHz PHY, which allows both
the 2.4 GHz and Sub GHz PHY to be used simultaneously.
Eventually, BLE will also work simultaneously on 2.4 GHz (with
arbitration).
Fixes#29883
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change adds IEEE 802.15.4g (Sub GHz) support for the
cc1352r.
The 2.4 GHz radio and the Sub GHz radio are capable of
operating simultaneously.
Fixes#26315
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This is a temporary workaround for an issue in TI's RF Driver
API. A subsequent release of the SimpleLink SDK will mitigate
the need for it and it can be reverted when hal/ti receives
that update.
Fixes#29418
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change reworks the cc13xx_cc26xx IEEE 802.15.4 driver to use
the TI RF driver API that is available in modules/hal/ti.
There are a number of benefits to using TI's API including
- a stable multi-OS vendor library and API
- API compatibility with the rest of the SimpleLink SDK and SoC family
- potential multi-protocol & multi-client radio operation
(e.g. both 15.4 and BLE)
- coexistence support with other chipsets via gpio
- vetted TI RF driver resources, such as
- the radio command queue
- highly tuned / coupled RTC & RAT (RAdio Timer) API
Fixes#26312
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Thread implements couple of counters that require notification of failed
frame reception.
Implemented RX failed notification.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.
Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
In all of these drivers, passing the device's data was sufficient as
only the data is being used by thread.
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Support for defining vendor specific OUI (Organizationally
Unique Identifier) was added.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
OT_RADIO_CAPS_SLEEP_TO_TX was added as a radio capability
for ieee802154 radio. Waiting on RX state before transmission
is alternative condition to OT_RADIO_CAPS_SLEEP_TO_TX support
as it was a result of OpenThread architecture and is actually
not needed in the Zephyr. Such change lets to start transmission
faster and lower SED device power consumption in active state
about 30%.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level. This pass DT information to driver instance to
ensure proper behavior.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Since commit 5963ebaf33
("drivers: spi: CS configuration through devicetree")
the SPI GPIO CS flags are obtained from DT,
but the patch series has missed the necessary changes
for the ieee802154_dw1000 driver and decawave_dwm1001_dev board.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Implemented rf2xx_set_txpower() in ieee802154_rf2xx.c by mapping dBm
values to RF2XX register values.
Signed-off-by: Kari Severinkangas <kari.severinkangas@tridonic.com>
Signed-off-by: Markus Becker <markus.becker@tridonic.com>