Instead of retrieving a pointer with NETOPT_STATS, retrieve the current
data. This avoids data corruptions when reading from one thread (e.g.
the thread running the shell (ifconfig command)) while another thread
is updating it (e.g. the netif thread).
The issue affects all boards, as users typically expect the count of
TX packets and the number of TX bytes to refer to the same state. For
16 bit and 8 bit platforms even a single netstat entry can read back
corrupted.
This fixes the issue by just copying the whole netstat_t struct over
without requiring explicit locking on the user side. A multi-threaded
network stack still needs to synchronize the thread responding to
netopt_get with the thread writing to the netstat_t structure, but that
is an implementation detail no relevant to the user of the API.
The RSSI values reported by LoRa transceiver can be less than -127.
Therefore, `int8_t` is not enough. This commit defines the RSSI of
`netdev_lora_rx_info` as `int16_t` and adapt the drivers accordingly
(sx126x, sx127x).
Reasoning:
- Many drivers already just generate these events regardless of configuration.
This will make behavior more consistent
- Run time configuration increases ROM, complexity and maintaining
effort
- At least NETOPT_TX_END_IRQ is now de facto mandatory, as the new
netdev driver API requires NETDEV_EVENT_TX_COMPLETE to always be
generated.
The driver uses the netdev interface. Due to the limited
capabilities of the transceiver (32 byte FIFO and no source address in the layer2 frame),
it relies on 6LowPAN compression and adds the source address to the frame for that.
This is not used anymore within the RIOT code-base so it is time to plan
the removal of the driver support. The deprecation was already put up
for the 2019.01 release, so I think removing it for the 2019.07 release
seems reasonable.
Renamed NETOPT_MAX_PACKET_SIZE into NETOPT_MAX_PDU_SIZE and updated the
documentation. NETOPT_MAX_PACKET_SIZE is introduced as preprocessor alias
for NETOPT_MAX_PDU_SIZE to remain backward compatible and is marked as
deprecated.
Documentation of the option types was clarified in #8655. I only noticed
after merging #8884, that `NETOPT_BLE_CTX` was not documented using
that new style. So I deliver the change myself to make it quicker.