nuttx/include/nuttx/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 style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
cellular style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
ieee80211 include: fix Private Types banners 2025-05-28 10:17:15 +08:00
ieee802154 net/wireless: fix compile warning 2025-12-25 18:05:33 +08:00
lpwan style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
lte style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
cc1101.h wireless/cc1101: migrate to wlioc_rx_hdr_s and add operation modes 2026-03-11 02:25:50 +08:00
gs2200m.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
ioctl.h wireless/cc1101: Add MSK/4-FSK, dynamic PATABLE ramping, and fix IOCTL safety 2026-03-11 16:05:19 +01:00
nrf24l01.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
pktradio.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
spirit.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
wireless.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00