zephyr/subsys/net
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
..
conn_mgr iterable_sections: move to specific header 2023-05-22 10:42:30 +02:00
ip net: l2: ieee802154: standardize RSSI value 2023-06-17 07:16:32 -04:00
l2 net: wifi_mgmt: Pass address instead of value as pointer 2023-06-13 08:28:43 -04:00
lib net: coap: CoAP reply handler fix 2023-06-13 07:06:08 -04:00
pkt_filter
buf_simple.c net: buf: Factor out net_buf_simple to separate source file 2023-03-15 10:50:16 +01:00
buf.c net: buf: fix data ref_count offset in generic_data_ref() 2023-05-31 10:01:40 -04:00
CMakeLists.txt net: conn_mgr: Reorganize files 2023-05-11 12:15:44 +02:00
hostname.c
Kconfig net: conn_mgr: Reorganize files 2023-05-11 12:15:44 +02:00
Kconfig.hostname
Kconfig.template.log_config.default.net
Kconfig.template.log_config.net