nuttx/drivers/wireless
Chip L. 7bfd6ee33e wireless/cc1101: Add MSK/4-FSK, dynamic PATABLE ramping, and fix IOCTL safety
This commit overhauls the CC1101 RF driver to address physical hardware
constraints, prevent register wrap-around overflows, and support accurate
dBm power scaling via the standard IOCTL interface.

What this change does:
1. Adds WLIOC_MSK and WLIOC_4FSK modulation support in `ioctl.h` and driver.
2. Replaces static PATABLE initialization with a dynamic Ramp-up curve
   generator `cc1101_ioctl_apply_power()` based on lab calibration data.
3. Modifies WLIOC_SETTXPOWER and WLIOC_GETTXPOWER to process actual dBm
   values with a nearest-match algorithm instead of raw array indices.
4. Removes DEBUGASSERT on user-space IOCTL pointers and replaces them
   with strict -EFAULT checks.
5. Implements saturation clamping (e.g., mantissa to 256-511) to prevent
   bitrate and frequency deviation calculation overflows.
6. Rebuilds volatile PATABLE memory upon SLEEP mode wake-up.

Why it is necessary & what it fixes:
- Fixes severe OOK modulation distortion and FSK spectral splatter caused
  by statically assigned PATABLE indices.
- Fixes potential kernel panic in flat builds when IOCTL receives a NULL
  pointer from user space.
- Fixes register wrap-around (silent failures) when users pass
  out-of-bounds baud rate or FDEV values.
- Prevents RF silence after SLEEP mode due to PATABLE volatility.
- Resolves inaccurate power output when changing frequencies dynamically.

Impact:
Changes the behavior of CC1101 TX power and modulation IOCTLs to strictly
comply with standard `wlioc` definitions. Improves overall driver stability
and hardware safety.

Signed-off-by: Chip L. <chplee@gmail.com>
2026-03-11 16:05:19 +01:00
..
bluetooth sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
ieee80211 driver/net: replace net_lock with netdev_lock 2026-01-06 16:08:30 +08:00
ieee802154 drivers/xbee: remove nxsig_notification when signal support is disabled 2026-02-26 20:03:05 +08:00
lpwan wireless/lpwan/sx127x: Update default TX power and enable CRC 2026-03-08 16:08:39 -03:00
spirit netdev_driver: add carrier_on to xxx_ifup where carrier_on is absent 2026-02-02 13:23:05 +08:00
cc1101.c wireless/cc1101: Add MSK/4-FSK, dynamic PATABLE ramping, and fix IOCTL safety 2026-03-11 16:05:19 +01:00
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
gs2200m.c sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
ISM1_868MHzGFSK100kbps.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
ISM2_433MHzMSK500kbps.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
ISM2_905MHzGFSK250kbps.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
Kconfig wireless/cc1101: Add Kconfig option to bypass strict version check 2026-02-27 08:10:04 -03:00
Make.defs drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
nrf24l01.c wireless/nrf24l01: Implement common RF IOCTLs and fix missing register reads. 2026-03-02 08:07:39 -03:00
nrf24l01.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00