Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

docs/cellular.md: the DPM Open Port step and the full DPM/WDA/bind/IP-family/start order, and a section on porting the SoC addresses to another phone with soc-args.py

shimoku74034c3052c9eb
diff --git a/docs/cellular.md b/docs/cellular.md
index 37c4811..bccb92d 100644
--- a/docs/cellular.md
+++ b/docs/cellular.md
@@ -42,12 +42,36 @@ for IPA 4.11; everything is in `xnu/files/bsd/dev/hakios.ipa.c` and `hakios.cell
The kernel answers ARP for every address and DHCP with the session's address, a /24 around it,
the router and the DNS servers, so iOS's configd configures `en1` as it would a USB Ethernet
adapter and routes through it. IPv6 is not carried.
-- `modem_ipa_data_off=1` leaves all of this out; `modem_ipa_data_trace=1` logs every packet.
+- The modem is told about this side the way ModemManager does for a phone behind the IPA
+ (`net_driver == "ipa"`): **DPM Open Port** (Data Port Mapper) names the embedded port's IPA
+ endpoints (the modem receives on our TX endpoint 2 and sends on our RX endpoint 16), then **WDA
+ Set Data Format** sets raw IP in QMAP on it. Only then do the WDS steps run: **Bind Mux Data
+ Port** (mux 1), **Set IP Family** (IPv4), **Start Network Interface** (with the APN) once NAS is
+ registered, retried while the packet domain is still attaching. Skipping the DPM step was why
+ WDA and the session answered InvalidOperation and the bind Internal (cycles 38-41): the modem
+ had no embedded port to bind to.
+- The rings are polled by the interface's thread; no interrupt is taken from the GSI.
+- The modem's packets are an Ethernet-looking interface, `en1`, with a made-up router behind it.
+ The kernel answers ARP for every address and DHCP with the session's address, a /24 around it,
+ the router and the DNS servers, so iOS's configd configures `en1` as it would a USB Ethernet
+ adapter and routes through it. IPv6 is not carried.
+- `modem_ipa_data_off=1` leaves all of this out; `modem_dpm_off=1` / `modem_wda_off=1` skip those
+ steps; `modem_ipa_data_trace=1` logs every packet.
+
+## Another phone: the SoC addresses
+
+The modem and IPA drivers carry the POCO X5 Pro's register and memory addresses as defaults and
+take any that differ from boot-args `soc_*` (`hakios.mpss.c` `soc_override()`, `hakios.ipa.c`).
+`tools/soc-args.py` reads a phone's own device tree (`devices/<name>/pull-soc.sh` pulls
+`/sys/firmware/fdt` over adb) and prints the `soc_*` it needs; the run scripts append
+`devices/<name>/soc.args`. For the first phone every generated value equals the default, so it
+needs no arguments.
## Not yet
-- Network registration itself: the modem sees the network but has not registered; the last
- change (binding the provisioning session) is being tested, and the data path above waits on it.
+- Registration reaches full LTE service, but the data session is still refused until the packet
+ domain attaches; the DPM/WDA/bind order above is the current attempt, untested on hardware since
+ the phone went off USB.
- Calls, SMS, IPv6.
## How to run it
@@ -73,7 +97,8 @@ XL_SB_DELAY=8 tools/modem-cycle.sh "modem=1 modem_again=1 modem_buffer=0xa800000
| `modem_ipa=3` (default) | the SMP2P entry `ipa`: valid, clock on |
| `modem_sim_switch_off=1` | do not point logical slot 1 at the slot with the ready card |
| `modem_sim_probe_off=1` | no SIM and network-selection queries |
-| `modem_data_off=1` | no data session (no WDS/WDA) |
+| `modem_data_off=1` | no data session at all |
+| `modem_dpm_off=1` / `modem_wda_off=1` | skip the DPM / WDA step |
| `modem_data_nobind=1` | the session without binding the client to the mux |
| `modem_apn=NAME` | the session to that APN instead of the SIM's default profile |
| `modem_ipa_data_off=1` | no IPA data path for this processor, no `en1` |