wlan-prima (wireless module) and wcnss-service
Continuation of https://github.com/postmarketOS/pmbootstrap/issues/143 and https://github.com/postmarketOS/pmbootstrap/issues/358
@yuvadm and I are working (see my titan-wifi branch and yuvadm's device-mozilla-flame) on the dynamic firmware loading feature (https://github.com/postmarketOS/pmbootstrap/issues/147) which is required by the wlan-prima module to load blobs (are these considered blobs?) in order to initialize the wireless interface later. This is the case for mozilla-flame and motorola-titan so far.
This is how it works:
- The wlan-prima kernel module is loaded
- wlan-prima tries to load the firmware (multiple files) (will be solved in issue https://github.com/postmarketOS/pmbootstrap/issues/147)
- wcnss-service initializes the wireless interface
I made the wcnss-service (initially written for Android) some modifications (removed Android stuff, mocked Android functions) and added a Makefile and now it compiles and works in real linuxes.
This so-called service reads the following system variables:
ro.serialno
-
ro.baseband
(the MODEM_BASEBAND_PROPERTY constant)
and writes wlan.driver.config
and wlan.driver.ath
.
Maybe writing the variables is not needed for postmarketOS. However ro.serialno
is used to generate a serial number, used to initialize the interface. I have hardcoded this value for testing but it can be read from /proc/cmdline.
However my device gets frozen right after running wcnss-service. There must be something I've left back.
Things we should take the chance to discuss:
- Firmware path(s). Is it
/lib/firmware
or/lib/firmware/postmarketos
?
yuvadm commented on Matrix:
also keep in mind that at least for the flame I have firmware that is flashed on some special partitions and ideally i would want to mount them to /lib/firmware/$foo
This is a draft TODO:
-
udev dynamic firmware loading https://github.com/postmarketOS/pmbootstrap/issues/143 (pick firmware.sh and the udev rule from some of the branches and include them in postmarketos-base -
Fix wcnss-service so that it doesn't hang the device :) -
Investigate also other versions of wcnss-service (will paste the link later, I found some newer version, that might fix the hang) and compiling options (is -DWCNSS_QMI needed?) -
Research what does the serial number (derived from ro.serialno
). Is this the MAC address?