zephyr/tests/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
..
6lo samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
all samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
arp samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
bridge samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
buf samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
buf_simple samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
checksum_offload samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
conn_mgr net: conn_mgr: Add test suite 2023-05-11 12:15:44 +02:00
conn_mgr_conn net: conn_mgr: connect/disconnect adjustments 2023-05-11 12:15:44 +02:00
context samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
dhcpv4 test: DHCPv4: Add test for option callbacks 2023-05-22 15:25:40 +02:00
ethernet_mgmt samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
hostname samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
icmpv4 samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
icmpv6 samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ieee802154 net: l2: ieee802154: standardize RSSI value 2023-06-17 07:16:32 -04:00
iface samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
igmp samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ip-addr samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ipv4_fragment samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ipv6 net: iface: Improve thread safety of net_if_ipv*_maddr_* functions 2023-05-10 11:06:15 +02:00
ipv6_fragment samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
lib tests: coap_client: Type case to uint8_t after shift 2023-05-30 13:04:13 -04:00
mgmt samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
mld samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
mocks test: net: buf_simple: Add unit tests for simple buffers 2023-03-15 10:50:16 +01:00
neighbor samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
net_pkt net: pkt: Allow zero payload for non-IPv4/v6 frames 2023-02-06 10:04:03 +01:00
npf samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
offloaded_netdev samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
pm samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ppp/driver samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
promiscuous samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ptp/clock samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
route samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
route_mcast samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
shell samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
socket tests: net: socket: tls: Verify accept is interrupted correctly on close 2023-05-29 14:34:03 -04:00
tcp net: tcp: test: Implement correct sequence number feeding around FIN 2023-05-15 15:25:51 +02:00
traffic_class samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
trickle samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
tx_timestamp samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
udp includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
utils samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
virtual samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
vlan samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00