Increase default TX power from 14 to 17 dBm and enable CRC
by default to improve link reliability and data integrity.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Implement `cc1101_file_ioctl` to map common NuttX wireless IOCTL commands
to CC1101 hardware registers. This allows dynamic configuration of radio
parameters from user-space applications.
* Map `WLIOC_SETRADIOFREQ` and `GETRADIOFREQ` to `FREQ[2:0]`.
* Map `WLIOC_SETADDR` and `GETADDR` to `ADDR`.
* Map `WLIOC_SETTXPOWER` and `GETTXPOWER` to internal PATABLE indexing.
* Map `WLIOC_SETMODU` and `GETMODU` to `MDMCFG2`.
* Map `WLIOC_FSK_SETBITRATE` and `GETBITRATE` to `MDMCFG4` and `MDMCFG3`.
* Map `WLIOC_FSK_SETFDEV` and `GETFDEV` to `DEVIATN`.
* Normalize positive SPI status byte returns from `cc1101_access` to `OK` (0)
to ensure POSIX compliance and prevent silently skipped register writes.
Signed-off-by: Chip L. <chplee@gmail.com>
Update the nrf24l01_ioctl function to fully comply with the common wireless
character driver interface defined in nuttx/wireless/ioctl.h, and complete
previously unimplemented device-specific commands.
* Add support for WLIOC_SETRADIOFREQ and WLIOC_GETRADIOFREQ with
quantitative conversion between Hz (API) and MHz (Hardware).
* Add support for WLIOC_SETTXPOWER, WLIOC_GETTXPOWER, WLIOC_SETFINEPOWER,
and WLIOC_GETFINEPOWER.
* Add WLIOC_SETMODU and WLIOC_GETMODU, strictly enforcing WLIOC_GFSK
modulation as required by the nRF24L01 physical layer.
* Map WLIOC_SETADDR and WLIOC_GETADDR to the existing TX address routines.
* Resolve -ENOSYS in NRF24L01IOC_GETRETRCFG by reading the
NRF24L01_SETUP_RETR register and decoding ARD/ARC shift bits.
* Resolve -ENOSYS in NRF24L01IOC_GETDATARATE by parsing RF_DR_LOW and
RF_DR_HIGH bits from the NRF24L01_RF_SETUP register.
Signed-off-by: Chip L. <chplee@gmail.com>
Many third-party CC1101 modules (such as those populated on the Evil Crow
RF V2) feature clone silicon that hardcodes the VERSION register to 0x00
instead of the official 0x14.
Previously, the cc1101_checkpart() function strictly enforced
VERSION == 0x14, which caused cc1101_register() to return -ENODEV (-19)
and abort initialization on these compatible modules.
This commit introduces the CONFIG_WL_CC1101_IGNORE_VERSION Kconfig option.
- When disabled (default), the driver maintains strict official silicon
validation. This preserves the diagnostic ability to catch hardware
faults, such as a MISO line shorted to GND (which also reads as 0x00).
- When enabled, the driver explicitly permits VERSION == 0x00, allowing
successful initialization and interoperability with clone chips while
printing a warning to the syslog.
Signed-off-by: Chip L. <chplee@gmail.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
since the judgment for network card selection was changed from IS_UP to
IS_RUNNING, drivers that lack carrier_on need to add the carrier_on
operation; otherwise, network access issues will occur.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
modify the code of the adapted protocol stack to avoid deadlocks and the
logic that cannot be protected by locks after modification.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit adds support to fix RX timeout for SX127x, it is done
leaving the RX mode, entering in stanby mode and returning to RX
mode. It is enough to fix the AFC and get communication working
again.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit moves sx127x Kconfig to lpwan/sx127x/ to follow the
same logic used by sx126x and adds the configuration to support
different bitrate (the default 4800 is fine tuned for LORA).
Signed-off-by: Alan C. Assis <acassis@gmail.com>
Nuttx currently has 2 types of sleep interfaces:
1. Signal-scheduled sleep: nxsig_sleep() / nxsig_usleep() / nxsig_nanosleep()
Weaknesses:
a. Signal-dependent: The signal-scheduled sleep method is bound to the signal framework, while some driver sleep operations do not depend on signals.
b. Timespec conversion: Signal-scheduled sleep involves timespec conversion, which has a significant impact on performance.
2. Busy sleep: up_mdelay() / up_udelay()
Weaknesses:
a. Does not actively trigger scheduling, occupy the CPU loading.
3. New interfaces: Scheduled sleep: nxsched_sleep() / nxsched_usleep() / nxsched_msleep() / nxsched_ticksleep()
Strengths:
a. Does not depend on the signal framework.
b. Tick-based, without additional computational overhead.
Currently, the Nuttx driver framework extensively uses nxsig_* interfaces. However, the driver does not need to rely on signals or timespec conversion.
Therefore, a new set of APIs is added to reduce dependencies on other modules.
(This PR also aims to make signals optional, further reducing the code size of Nuttx.)
Signed-off-by: chao an <anchao.archer@bytedance.com>
In file_read(), asynchronous reading is supported, so partial reads and the minread parameter are no longer needed.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
In btuart_rxwork, There is no case for parsel HCI data of ISO type, but there are corresponding processes in the SIM and vendor driver code.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
When the nread return value < 0, if the total length ntotal that has been read is > 0, the function returns ntotal; otherwise, it returns the nread error code.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
Read as much data as possible initially, then process each packet individually. Defined the read buffer within the structure and added a rx_len variable to indicate the current read offset. After processing each complete packet, leftover data is moved to rxbuf[0] and rx_len is reduced by the length of the processed packet. The next packet process will start from rxbuf[0] after the read ends at new rxbuf[rx_len].
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
This commit resolves issue #16009, where a sync word of less than 64
bytes was printed as 0-padded hex. 0-padding is invalid for the RN2xx3
modules, so now it has been removed.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Driver now validates ACL provided buffer length agaist the size of
the data buffer which is defined by CONFIG_BLUETOOTH_UART_RXBUFSIZE.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
examples:
There are two threads involved: thread A with a priority of 100 and
thread B with a priority of 101. Here's how they interact:
When thread A releases a semaphore, thread B is scheduled to execute
some code and may reacquire the semaphore. If no other tasks are ready,
thread A will be scheduled to run.
This continuous process can lead to a busy loop.
Thread A: Thread B:
while (nxsem_get_value(&priv->wait, &semcount) >= 0 && <---
semcount <= 0) | 2)context switch
{ 1)contex switch |
nxsem_post(&priv->wait); -------------> run some code and nxsem_wait again
}
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
radio transceivers. This initial support includes transmit and receive
functionality and configuration and reading of radio parameters like
frequency and bandwidth.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
[Experimental]
This adds a driver for the SX126x (SX1261 and SX1262) LoRa chips.
All functions and definitions are coming directly from the DS SX1261-2 V2.1 datasheet.
Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
This commit cleans up redundant header file includes throughout the codebase.
The changes include:
- Removing duplicate #include directives that were present in the same file
- Consolidating includes that were split across multiple lines unnecessarily
- Removing unused includes that were no longer needed
- Fixing some formatting issues with includes
The changes improve code organization and maintainability by:
- Reducing unnecessary dependencies
- Making include dependencies more explicit
- Following consistent include patterns
- Removing dead code
No functional changes are made - this is purely a code cleanup commit.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Modify the kernel to use only atomic_xx and atomic64_xx interfaces,
avoiding the use of sizeof or typeof to determine the type of
atomic operations, thereby simplifying the kernel's atomic
interface operations.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
that pr requires chip turn on CONFIG_DRIVERS_BLUETOOTH to use bluetooth,
but not all defconig enable this option, so let's map bt_driver_register
to bt_netdev_register in header file in this case, and revert the unnessary
change in the related chip and board folders.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
rootcause: in btuart_rxwork, read data in blocking mode and btuart_read do three times, maybe remote send some packets one time,so it wont read the sencond packets.
Signed-off-by: wangzhi7 <wangzhi7@xiaomi.com>
add bt_driver_register interface, which could handle
these cases:bth4 bth5 btbridge btslip and btuart_lowerhalf_s etc.
Signed-off-by: chengkai <chengkai@xiaomi.com>
add btuart_create interface, which would be more
flexible in complex cases. And extract btuart_register interface.
Signed-off-by: chengkai <chengkai@xiaomi.com>
BLUETOOTH_MAX_FRAMELEN buffer size is only for LE only mode.
then we need to increase HCI buffer size in BR/EDR and LE mode.
Signed-off-by: chengkai <chengkai@xiaomi.com>