raulcxw opened a new pull request, #19353:
URL: https://github.com/apache/nuttx/pull/19353
## Summary
* Migrate the Ameba WHC WiFi driver (RTL8721Dx / RTL8720F) from the
legacy
flat `net_driver_s` model to the netdev **lower-half** framework
(`netdev_lowerhalf_s` + `netdev_ops_s`, IOB/netpkt quota backpressure
and a
dedicated RX thread). This gives real TX backpressure and moves RX off
the
IPC callback onto a bounded queue. See
`Documentation/components/net/netdriver.rst`.
* Raise the host TX skb pool (`skb_num_ap`) to a minimum of 16: the SDK
default of 4 starves sustained TCP TX (host send `-2`, retransmit
exhaustion, connection abort with ENOTCONN).
* Enable `CONFIG_NET_TCP_SELECTIVE_ACK` (which selects OUT_OF_ORDER) in
both
board defconfigs. WiFi's occasional loss otherwise stalls TCP RX on RTO
timeouts (~1-2 Mbit/s); with SACK it recovers to double-digit Mbit/s.
* Register `wlan0` synchronously on the board bring-up path (it was
created on
a kthread, so the netdev appeared only after netinit's one-shot
associate had
run -> no boot auto-connect). Enable the standard netinit machinery in
both
defconfigs: `NETINIT_THREAD`, `NETINIT_DHCPC`, and placeholder
`NETINIT_WAPI_SSID/PASSPHRASE` the user replaces (or overrides at
runtime
with `wapi`). `WIRELESS_WAPI` + the wapi cmdtool are already enabled.
## Impact
* Is new feature added / existing changed? YES — WiFi netdev now uses the
lower-half framework; boards auto-connect on boot when credentials are
set.
* Impact on user? YES (minor) — set `NETINIT_WAPI_SSID/PASSPHRASE`
(placeholders
shipped) or use `wapi` at runtime. No API change.
* Impact on build? NO (driver + config only).
* Impact on hardware? YES — arch/arm RTL8721Dx + RTL8720F WHC WiFi
driver and
both board defconfigs.
* Impact on documentation? NO (follows existing netdriver.rst).
* Impact on security? NO — only placeholder credentials are committed.
* Impact on compatibility? NO (self-contained to the Ameba arch/boards).
## Testing
Build Host: Ubuntu (WSL2), x86_64; Realtek asdk arm-none-eabi-gcc
auto-fetched.
Targets: `rtl8720f_evb:nsh` (RTL8720F), `pke8721daf:nsh` (RTL8721Dx).
Environment: open-space RF — throughput fluctuates mid-run due to
interference
and retransmission; the low samples are environmental, not a regression.
Boot + auto-connect (RTL8720F, credentials set in local .config):
```
[ameba-wifi] ameba_wifi_start -> 0
[ameba-wifi] ameba_wlan_initialize -> 0
NuttShell (NSH) NuttX-13.0.0-RC0
nsh> [ameba-wifi] connecting to "<ssid>" ...
[WLAN-A] assoc success(2)
[$]wifi connected
```
Placeholder behaviour + runtime override (RTL8721Dx, shipped defconfig):
```
nsh> [ameba-wifi] connecting to "YOUR_WIFI_SSID" ...
[ameba-wifi] connect failed: -4108
nsh> wapi psk wlan0 <pass> 3
nsh> wapi essid wlan0 <ssid> 1
[$]wifi connected
nsh> ifconfig
wlan0 ... inet addr:192.168.x.x
```
iperf after change (before SACK, RTL8721Dx TCP RX stalled at ~1-2
Mbit/s):
```
RTL8720F:
TCP RX (iperf -s): ~13 Mbit/s (peak 16.3), interference dips
TCP TX (iperf -c): 15.05 Mbit/s (0-30s avg)
UDP RX (iperf -s -u): ~26 Mbit/s
UDP TX (iperf -c -u): 54.91 Mbit/s (0-30s avg)
RTL8721Dx (weaker open-space signal):
TCP RX (iperf -s): ~5 Mbit/s (4-9 range)
TCP TX (iperf -c): 10.76 Mbit/s (0-30s avg)
UDP RX (iperf -s -u): ~12-17 Mbit/s
UDP TX (iperf -c -u): 18.64 Mbit/s (0-30s avg)
```
## PR verification Self-Check
* [x] This PR introduces one functional change (Ameba WHC WiFi
networking).
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines (checkpatch passes, no
long lines).
* [ ] My PR is still work in progress (not ready for review).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]