Commit graph

186 commits

Author SHA1 Message Date
Jędrzej Ciupis 774dd16555 drivers: ieee802154: gracefully handle invalid Ack timestamp
The nRF IEEE 802.15.4 driver might report a received Ack frame with
invalid timestamp, if the timestamp could not have been taken. The upper
layers are not prepared to handle such a case as they expect that for a
received frame, the timestamp is always present and valid.

This commit detects this situation and handles it gracefully by
reporting the transmission as failed as if no Ack was received.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-09 07:37:10 -04:00
Georgios Vasilakis 7a8d454e22 soc: nordic: Refactor soc_secure.h
The soc_secure_* function are used by the non-secure application
to access hardware resources which are mapped as secure.
Using these functions for hardware resources mapped as non-secure
is missleading.

We have some soc_secure_* functions which read FICR values.
In nRF91 and nRF53 platforms this made sense since FICR
has hardware fixed mapping as secure.
For nRF54 though the FICR has hardware fixed mapping as non-secure.

This change refactors the soc_secure.h to exclude the functions
which read FICR values from being included when FICR is mapped as
non-secure.

Also updates the hwinfo and ieee802154 drivers to adjust to this change.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2024-04-04 13:17:13 -05:00
Andrzej Kuros 8e8d4af6c1 drivers: ieee802154_nrf5: Use Radio IRQ number from DT
Used RADIO_IRQ number is based on information provided by DT rather
than direct use of RADIO_IRQn.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-03-05 12:22:08 +01:00
Maciej Baczmanski dbe74b3299 Revert "drivers: ieee802154: nrf: cache radio channel"
This reverts commit 780b12854c.
"drivers: ieee802154: nrf: cache radio channel"

Implementation affected RCP devices in openthread as MAC layer
does not call `Receive()` functions after transmit is done.

Additionally, after sending a frame to a new channel (for example
while discovery operation), radio switches to RX state immediately
after TX, but continues to listen on old channel for about 5ms,
until MAC layer calls `Receive` operation, forcing to change the
channel.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-02-07 15:35:29 +00:00
Maciej Baczmanski 0f1747e4e7 net: openthread: upmerge to 7761b81
additionaly, implement `otPlatRadioResetCsl` functionality

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Maciej Baczmanski d76bcd346c drivers: ieee802154: fix ACK header IE implementation
- In `set_vendor_ie_header_lm`, case when
`link_metrics_data_len == 0` has been ignored.
This commit fixes that by setting `header_ie->length = 0`
before returning.
- current implementation of enh ACK header IE returns
`-ENOTSUP` when `ack_ie.header_ie == NULL` or
`ack_ie.header_ie->length == 0`. This commit fixes that by
refactoring checks in `nrf5_configure`.

Co-authored-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Jędrzej Ciupis 8f9a86cf5e drivers: ieee802154: fix nRF5 Rx error handling
The current implementation implicitly assumes that if the device is
configured to have the capability of acting as a CSL endpoint then in
case a delayed reception with matching ID finishes with a timeout no
action is needed. This assumption is correct when RxOnWhenIdle mode is
disabled because the transition to sleep is done automatically by the
driver below. However, it's wrong when RxOnWhenIdle is enabled. This
commit fixes that case by adding a call to event handler that notifies
the higher layer about the event and allows it to transition to RxOff if
needed.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-19 07:25:43 -06:00
Pisit Sawangvonganan 80e1482ddd drivers: ieee802154: set 'ieee802154_radio_api' as 'static const'
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-05 09:04:28 +01:00
Eduardo Montoya 586eca8ad2 drivers: ieee802154: nrf5: add IEEE802154_RX_ON_WHEN_IDLE capability
Add `IEEE802154_RX_ON_WHEN_IDLE` capability.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2024-01-05 09:04:17 +01:00
Eduardo Montoya 780b12854c drivers: ieee802154: nrf: cache radio channel
Cache configured radio channel and apply them only when a relevant
radio task is requested.

This allows to configure the channel in the transmit metadata, thus
avoiding unneeded `nrf_802154` API calls in some scenarios.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-05 09:04:17 +01:00
Eduardo Montoya 5767998d4f drivers: ieee802154: nrf: make selective tx power the default
Remove `IEEE802154_SELECTIVE_TXPOWER` option.

Cache the tx power value in nRF5 driver and make use of it on each
operation.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-05 09:04:17 +01:00
Jędrzej Ciupis 7afeb62e20 drivers: ieee802154: support Key Identifier Mode > 1
IEEE 802.15.4-2020 defines four possible values for Key Identifier Mode
field of the Auxiliary Security Header. The current ieee802154 driver
API only supports two of them: b00 and b01. This commit adds support for
the two remaining Key Identifier Mode values. It's done by replacing a
field that can only hold Key Index into a field that can holds a pointer
to the entire Key Identifier field.

See IEEE 802.15.4-2020, sections 9.4.2.3 and 9.4.4 for further reference.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-12-13 13:57:24 +01:00
Jędrzej Ciupis 0bad09c7fa drivers: ieee802154: nrf5: support raw mode
When CONFIG_IEEE802154_RAW_MODE is set there is no network interface
that could provide pointer to the device the interface is running on top
of. The current implementation of nRF5 ieee802154 driver implicitly
assumes that such an interface is always present, which leads to crashes
when raw mode is enabled.

This commit adds support for IEEE802154_RAW_MODE in nRF5 ieee802154
driver by latching pointer to the ieee802154 device on initialization if
needed so that it doesn't have to be retrieved using the network
interface in run-time.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-11-24 09:25:11 +01:00
Jamie McCrae 90dfbf99d8 drivers: ieee802154: nrf5: Fix missed variable rename
Fixes and issue with a variable that has been renamed but whose
reference in the source file has not

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 09:54:23 +01:00
Alberto Escolar Piedras 4df07224f8 drivers ieee802154_nrf5: Fix infinite loop for simulation on stop
With CSL enabled, when nrf5_stop is called,
nrf_802154_sleep_if_idle() will be called, and if the radio is
busy with another task, another IEEE802154_EVENT_RX_OFF event
will be pended right away, resulting in another call
to nrf5_stop(), effectively busy waiting until the
radio has reached idle.

In simulation, this whole operation (busy wait loop) is
done without letting the CPU sleep, in an infinite loop,
and therefore without letting any time pass
(note that in the POSIX architecture,
no time passes if the CPU does not go to sleep).
And therefore the radio will never be done with whatever
it is doing, resulting in the simulation being stuck
in this loop.

Let's add a very minor delay to this loop, which is
conditionally compiled only for the POSIX architecture.
Which effectively mimics the time it takes for the CPU
to loop thru, let's time pass, and allows the radio
to eventually be done.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-08 11:07:30 +01:00
Eduardo Montoya 3676e7c360 drivers: ieee802154: nrf5: set security enabled bit value
Assign `ack_seb` in `net_pkt_cb_ieee802154`.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-11-03 09:57:53 +01:00
Eduardo Montoya 09758f21e3 drivers: ieee802154: nrf: limit number of serialized calls
For serialized nRF IEEE 802.15.4 Driver host, avoid using
`nrf_802154_csl_writer_anchor_time_set` too often by caching the CSL
RX time and period and using them to detect any shift on the periodic
pattern.

This improves power consumption by limiting the number of serialized calls.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-11-01 11:02:25 +00:00
Florian Grandel e9d5a98e9d drivers: ieee802154: improve CSL standard conformance
This change slightly simplifies the configuration of a CSL receiver and
generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive
across several timing-sensitive IEEE 802.15.4 standard sub-protocols
(namely BE-PANs/DSME/CSL/RIT/TSCH).

This API change is based on the rules outlined in RFC #61227.

Fixes: #62918

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-10-20 14:58:32 +02:00
Florian Grandel 80da9ddfef drivers: ieee802154: improve ACK header IE config
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE
option and introduces certain "soft MAC" capabilities around header IEs:
 * Introduces types and helpers that allow driver maintainers to
   represent, parse, write and validate header IEs.
 * Introduces helper functions to access non-aligned fields in header
   IEs, namely element IDs.

Updates the only existing L2 and driver pair that uses
IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5
and improves header IE validation in the nRF5 driver.

This change should help further driver maintainers to support
OpenThread's CSL and vendor IE extensions. It is based on the rules
specified in RFC #61227.

It is also a precondition to generically support both, "soft MAC" and
"hard MAC", approaches to header IEs in the TSCH protocol, namely the
time synchronization IE.

Fixes: #62940

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-10-20 14:58:23 +02:00
Florian Grandel 62396443fc drivers: ieee802154: deprecate OT "sleep" nomenclature
"Sleeping" has a well defined meaning in Zephyr related to threading and
power management. This differs from OpenThread's definition:

- Deprecates the "SLEEP_TO_TX" capability as it is redundant and
  conflicts with all of Zephyr's nomenclature, #61227, RFC 2863, Thread
  standard and IEEE 802.15.4. This binds the API to an implementation
  detail of OpenThread, instead. See #63670 for the agreed migration path.

- Renames the "SLEEP" event to "RX_OFF" which conforms to the
  nomenclature in Zephyr, this API and IEEE 802.15.4.

Fixes: #62995

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-10-20 14:58:16 +02:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Florian Grandel 36402b6d2a net: pkt: time: introduce ns timestamp helper
A little refactoring that simplifies dealing with nanosecond timestamp
values in packets and further decouples calling code from PTP:

Benefits:
- simplifies calling code by removing redundant conversions.
- prepares for removing PTP dependencies from net_pkt.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-29 16:27:15 +02:00
Florian Grandel a12a6ab5b9 drivers: ieee802154: introduce channel pages
Replaces the previous approach to define bands via hardware capabilities
by the standard conforming concept of channel pages.

In the short term this allows us to correctly calculate the PHY specific
symbol rate and several parameters that directly depend from the symbol
rate and were previously not being correctly calculated for some of the
drivers whose channel pages could not be represented previously:
* We now support sub-nanosecond precision symbol rates for UWB. Rounding
  errors are being minimized by switching from a divide-then-multiply
  approach to a multiply-then-divide approach.
* UWB HRP: symbol rate depends on channel page specific preamble symbol
  rate which again requires the pulse repetition value to be known
* Several MAC timings are being corrected based on the now correctly
  calculated symbol rates, namely aTurnaroundTime, aUnitBackoffPeriod,
  aBaseSuperframeDuration.

In the long term, this change unlocks such highly promising functional
areas as UWB ranging and SUN-PHY channel hopping in the SubG area (plus
of course any other PHY specific feature).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-27 12:44:15 -04:00
Andrzej Kuros 04d3dcb116 drivers: ieee802154_nrf5: energy_detected api change adjust
The prototype of `nrf_802154_energy_detected` callout has changed.
This commit adjusts to this change.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-08-20 19:31:21 +02:00
Florian Grandel 137a7edd6e drivers: ieee802154: nRF5: TX timestamp now refers to start of PHR
Based on the standard based definitions given in previous commits, the
TX timestamp used for timed TX now refers to the start of PHR. As OT
continues to calculate timestamps based on a "start of SHR" definition,
the duration of the PHY specific SHR is added in the OT adaptation layer
to make up for this OT quirk.

Fixes: #59245

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-08-16 17:06:16 +02:00
Florian Grandel 7db0184e1b drivers: ieee802154: nRF5: remove RX PHR offset workaround
Builds upon the newly introduced nrf_802154_phr_timestamp_get() function
to calculate RX timestamps according to the timestamp definitions
introduced in earlier commits and removes the prior workaround to
calculate the start-of-frame message timestamp point.

Fixes: #59245

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-08-16 17:06:16 +02:00
Florian Grandel eacec3dad2 modules: openthread: radio: encapsulate OT 32-bit timestamp
OT does not have 64 bit timestamp support. This is a limitation of OT
and not of the IEEE 802.15.4 driver API. Therefore any workaround
related to such OT idiosyncracies should be encapsulated inside the OT
adapatation layer.

This change moves the OT-specific conversion of OT 32 bit timestamps to
Zephyr 64 bit timestamps into the OT adaptation layer.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-08-16 17:06:16 +02:00
Eduardo Montoya f4d54fa4b9 drivers: ieee802154: nrf5: fix handling multiple CCA
Fix a couple of bugs introduced with last commits related to multiple
CCA support.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-08-09 08:32:26 +00:00
Florian Grandel a4cd5cee40 drivers: ieee802154: consistent high res timestamps
The IEEE 802.15.4 API and networking subsystem were using several
inconsistent timestamp resolutions and types. This change defines all
timestamps with nanosecond resolution and reduces the number of
available types to represent timestamps to two:
* `struct net_ptp_time` for PTP timestamps
* `net_time_t` for all other high resolution timestamps

All timestamps (including PTP timestamps) are now referred to a
"virtual" local network subsystem clock source based on the well-defined
types above. It is the responsibility of network subsystem L2/driver
implementations (notably Ethernet and IEEE 802.15.4 L2 stacks) to ensure
consistency of all timestamps and radio timer values exposed by the
driver API to such a network subsystem uptime reference clock
independent of internal implementation details.

The "virtual" network clock source may be implemented based on arbitrary
hardware peripherals (e.g. a coarse low power RTC counter during sleep
time plus a high resolution/high precision radio timer while receiving
or sending). Such implementation details must be hidden from API
clients, as if the driver used a single high resolution clock source
instead.

For IEEE 802.15.4, whenever timestamps refer to packet send or receive
times, they are measured when the end of the IEEE 802.15.4 SFD (message
timestamp point) is present at the local antenna (reference plane).

Due to its limited range of ~290 years, net_time_t timestamps (and
therefore net_pkt timestamps and times) must not be used to represent
absolute points in time referred to an external epoch independent of
system uptime (e.g.  UTC, TAI, PTP, NTP, ...).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 29988b5c04 drivers: ieee802154: nRF5: fix return type
Adapts a return type to the API specification. The changed return type
is not referenced anywhere so it can be changed without breaking
backwards compatibility.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Andrzej Kuros 9babac94a7 drivers: ieee802154: nrf5: multiple CCA support
The support for capability IEEE802154_OPENTHREAD_HW_MULTIPLE_CCA is added
to the ieee802154_nrf5 driver.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Andrzej Kuros 3f4da29a3c drivers: ieee802154: nrf5: Revert Add transmission with multiple CCA
This reverts commit 5443d4127b.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Robert Lubos 5c5be08ba9 drivers: ieee802154_nrf5: Use generic symbols for packet size
Use generic symbols defined in ieee802154.h for packet/FCS size instead
of redefining them in the driver header.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-20 16:24:26 +02:00
Robert Lubos cf58d11f8f drivers: ieee802154_nrf5: Add payload length check on TX
In case upper layer does not follow the convention, and the net_pkt
provided to the nRF 15.4 driver had a payload larger than the maximum
payload size of an individual 15.4 frame, the driver would end up with
buffer overflow.

Fix this by adding an extra payload_len check before attempting to copy
the payload to the internal buffer.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-20 16:24:26 +02:00
Andrzej Kuros 5443d4127b drivers: ieee802154: nrf5: Add transmission with multiple CCA
The Kconfig IEEE802154_NRF5_MULTIPLE_CCA option is added.
The new functions `z_ieee802154_nrf5_extra_cca_attempts_set` and
`z_ieee802154_nrf5_extra_cca_attempts_get` are added.
The ieee802154_nrf5.c is updated allowing to pass extra cca attempts
to nRF 802.15.4 Radio Driver.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-14 09:46:36 -04:00
Damian Krolik a6e9782b01 drivers: ieee802154: fix declaration in case blocks
The code declares variables in switch-case blocks. This
seems to compile without an error on GCC 11 and newer,
but older compilers don't accept this code.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2023-07-07 11:29:33 +02:00
Florian Grandel 7571be3261 net: l2: ieee802154: deprecate NET_L2_IEEE802154_ACK_REPLY
Acknowledgment is mandatory if legitimately requested by the package's
"ACK requested" flag. The L2 layer will have to ensure that compliant
ACK packages will always be sent out automatically as required by the
standard.

For IEEE 802.15.4 compliance, the NET_L2_IEEE802154_ACK_REPLY option is
therefore being deprecated.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-17 16:20:21 -04:00
Florian Grandel 1ee4d3ed77 net: l2: ieee802154: document L1/L2 sep. of concerns
The method ieee802154_radio_handle_ack() does not belong to the
PHY/radio layer but to the L2 layer. It is a callback called from the
radio layer into the L2 layer and to be implemented by all L2 stacks.
This is the same pattern as is used for ieee802154_init(). The
'_radio_' infix in this function is therefore confusing and
conceptually wrong.

This change fixes the naming inconsistency and extensively documents
its rationale.

It is assumed that the change can be made without prior deprecation of the
existing method as in the rare cases where users have implemented custom
radio drivers these will break in obvious ways and can easily be fixed.

Nevertheless such a rename would not be justified on its own if it were
not for an important conceptual reason:

The renamed function represents a generic "inversion-of-control" pattern
which will become important in the TSCH context: It allows for clean
separation of concerns between the PHY/radio driver layer and the
MAC/L2 layer even in situations where the radio driver needs to be
involved for performance or deterministic timing reasons. This
"inversion-of-control" pattern can be applied to negotiate timing
sensitive reception and transmission windows, it let's the L2 layer
deterministically timestamp information elements just-in-time with
internal radio timer counter values, etc.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-17 16:20:21 -04:00
Eduardo Montoya 574a533cb6 net: openthread: allow to configure CSL debugging
Add new `IEEE802154_CSL_DEBUG` Kconfig option that, when enabled,
prevents the radio to sleep after a delayed reception is finished.

This allows to debug CSL timing issues due to accuracy drifts in
communications between receiver and transmitter.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-06-17 07:48:25 -04:00
Florian Grandel b224a099fd net: l2: ieee802154: standardize RSSI value
The RSSI value in net_pkt (net_pkt_cb_ieee802154.rssi) was used
inconsistently across drivers. Some drivers did cast a signed dBm value
directly to net_pkt's unsigned byte value. Others were assigning the
negative value of the signed dBm value and again others were offsetting
and stretching the signed dBm value linearly onto the full unsigned byte
range.

This change standardizes net_pkt's rssi attribute to represent RSSI on
the RX path as an unsigned integer ranging from 0 (–174 dBm) to 254 (80
dBm) and lets 255 represent an "unknown RSSI" (IEEE 802.15.4-2020,
section 6.16.2.8). On the TX path the rssi attribute will always be
zero. Out-of-range values will be truncated to max/min values.

The change also introduces conversion functions to and from signed dBm
values and introduces these consistently to all existing call sites. The
"unknown RSSI" value is represented as INT16_MIN in this case.

In some cases drivers had to be changed to calculate dBm values from
internal hardware specific representations.

The conversion functions are fully covered by unit tests.

Fixes: #58494

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-17 07:16:32 -04:00
Robert Lubos f3bdac91b2 net: ieee802154: Remove IEEE802154_2015 option usage
The IEEE802154_2015 option is misleading, as it does not introduce full
802.15.4-2015 standard compliance but only random bits, plus it's
defined at the radio driver level, which brings yet another confusion.
Because of that, the option will be deprecated, and respective parts of
code that made use of it converted to use more specific configurations:

* nRF driver will now use CONFIG_NRF_802154_ENCRYPTION to specify
  whether to compile in TX security
* net_pkt will only add extra 802.15.4 control block fields if
  OpenThread is used, as they were solely used by this L2
* OpenThread radio layer will now use the OpenThread version to
  determine whether to compile in TX security.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-06-01 04:53:02 -04:00
Andrzej Kuros 174b7f4775 nrf_802154: nrf_802154_serialization_error never returns
Functions nrf_802154_serialization_error and
nrf_802154_sl_fault_handler shall never return.
However `__ASSERT()` might expand to an empty instruction
CONFIG_ASSERT=n and is not enough to stop execution.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-05-24 16:41:39 +02:00
Eduardo Montoya 570110e672 drivers: ieee802154: remove not useful log
Remove a warning log which shows on every delayed transmission and
it is not helpful.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-03-28 15:07:33 +02:00
Maciej Baczmanski bcf1e8150b drivers: ieee802154: Fix csl_rx_time overflow issue for NRF5 and
clean up redundant static functions

convert `csl_rx_time` to uint32_t and remove redundant `nrf5_schedule_rx`
`nrf5_config_csl_period` and `nrf5_receive_at` static functions.

`csl_rx_time` has been passed as uint32. It is compared to uint64 value
returned by `nrf_802154_sl_timer_current_time_get` in
`nrf_802154_ie_writer.c` which leads to wrong calculation of phase in CSL.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2023-03-20 10:47:33 +01:00
Przemyslaw Bida dc5155e5a5 openthread: ieee802154_nrf5: Add implementation of new api.
Adding an Openthread radio API `otPlatRadioSetMacFrameCounterIfLarger`
implementation and the corresponding call to the IEEEE802154 driver.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2023-03-08 11:07:22 +01:00
Maciej Baczmanski 01884c857a drivers: ieee802154: nrf5: added continuous_carrier API call
implemented `nrf5_continuous_carrier()` which starts continuous
carrier wave transmission

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2023-02-24 09:26:01 +01:00
Krishna T 186fbc33a2 drivers: ieee802154: Fix build error for variable net buffers
The assert is only applicable for fixed network buffers, so, add a
protection.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-02-22 12:18:24 +01:00
Alberto Escolar Piedras 0de83109de drivers: ieee802154_nrf5: Fix warning in ISR prototype
The ISR prototype was changed some time ago
(6df8b3995e)
to (const void*) => fix the prototype used when
CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT is not set
to avoid a compile warning.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-01-27 12:35:33 +01:00
Erwan Gouriou 66d4c64966 all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-21 10:09:23 +01:00
Artur Hadasz f610743ef8 drivers: ieee802154_nrf5: Removed CSL placeholder window
Since nRF IEEE 802.15.4 radio driver is now capable of calculating CSL
phase based on provided anchor time and CSL period, the CSL placeholder
window is no longer necessary. This commit removes it and switches to
the new calculation method.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-11-16 11:19:33 +01:00