Project

General

Profile

WiFiResearch » History » Version 92

Denis 'GNUtoo' Carikli, 01/22/2019 11:50 PM

1 75 Wolfgang Wiedmeyer
h1. WiFi Research
2 1 Denis 'GNUtoo' Carikli
3
h2. Issue
4 75 Wolfgang Wiedmeyer
5 77 Wolfgang Wiedmeyer
Currently, the internal WiFi chip cannot be used on any of the Replicant-supported devices without having to load non-free firmware. See [[ReplicantStatus|Replicant status]] and the [[Index#Supported-devices|device pages]] for more information. 
6 28 Denis 'GNUtoo' Carikli
7
On desktops and laptops, several WiFi chips don't require non-free firmwares to be loaded.
8 27 Denis 'GNUtoo' Carikli
9
Several cases exist:
10
* The WiFi chip doesn't need a firmware, and the driver talks directly to the hardware (ath5k and ath9k compatible chips)
11
* The WiFi chip has a free software firmware (ath9k_htc, carl1970, and some b43 compatible chips)
12
* The WiFi chip has a non-free firmware in a flash chip and don't need loadable firmware.
13
14 80 Joonas Kylmälä
On phones, the only WiFi chip that doesn't require a non-free firmware that we know of is the OpenMoko FreeRunner WiFi chip. The firmware is in a flash chip.
15 29 Denis 'GNUtoo' Carikli
16 31 Denis 'GNUtoo' Carikli
The idea here is to find ways to still get WiFi on Replicant Supported devices, without needing to load any non-free firmware.
17
18
h2. WiFi Drivers and Firmwares types
19
20
Either the firmware implements the WiFi operations (scanning, association, and so on), either the driver implements it.
21
22
h3. Firmware implementing the WiFi operations
23
24 32 Denis 'GNUtoo' Carikli
This is also known as Hard-MAC. 
25
An easy way to find out is to look into the WiFi driver Kconfig for "select CFG80211" or "depends CFG80211"
26
27
Example:
28 33 Denis 'GNUtoo' Carikli
<pre>
29
config LIBERTAS
30
        tristate "Marvell 8xxx Libertas WLAN driver support"
31
        depends on CFG80211
32
[...]
33
</pre>
34 31 Denis 'GNUtoo' Carikli
35
If it is implemented by the firmware, it often contains bugs which cannot be fixed by the community. That also severally limit the use case of such WiFi chip beyond its most common uses cases.
36
37
This can result in more help in getting a free software firmware to run on such chip. However the amount of work to re-implement such firmware may be bigger.
38
39 81 Kurtis Hanna
The best way to reimplement it would be to write a new driver taking care of such WiFi operations and to make the firmware do the smallest amount of work possible.
40 31 Denis 'GNUtoo' Carikli
41
h3. Driver implementing the WiFi operations
42
43 34 Denis 'GNUtoo' Carikli
This is also known as Soft-MAC. 
44
An easy way to find out is to look into the WiFi driver Kconfig for "select MAC80211" or "depends MAC80211"
45 31 Denis 'GNUtoo' Carikli
46 34 Denis 'GNUtoo' Carikli
Example:
47
<pre>
48 35 Denis 'GNUtoo' Carikli
config WL1251
49
        tristate "TI wl1251 driver support"
50
        depends on MAC80211
51 34 Denis 'GNUtoo' Carikli
[...]
52
</pre>
53 31 Denis 'GNUtoo' Carikli
54 1 Denis 'GNUtoo' Carikli
h2. Internal WiFi chips on devices currently targeted by Replicant
55 2 Denis 'GNUtoo' Carikli
56 91 Denis 'GNUtoo' Carikli
|_. Device |_. WiFi chip |_. driver(s) |_. Research |
57 56 Denis 'GNUtoo' Carikli
| Galaxy S |/3. Broadcom BCM4329 |/3. BCMDHD (cfg80211) |
58 54 Denis 'GNUtoo' Carikli
| LG Optimus Black |
59 1 Denis 'GNUtoo' Carikli
| Nexus S |
60 92 Denis 'GNUtoo' Carikli
| Galaxy Nexus |/5. Broadcom BCM4330 |/5. |/5. *See the "nextmon project":https://github.com/seemoo-lab/nexmon
61
* The BCM4330 has a rom. Can the driver use it? |
62 1 Denis 'GNUtoo' Carikli
| Galaxy Note |
63 78 Wolfgang Wiedmeyer
| Galaxy S 2 |
64
| Galaxy Tab 2 7.0 |
65
| Galaxy Tab 2 10.1 |
66
| Galaxy S 3 |/3. Broadcom BCM4334 |/3. |
67
| Galaxy S 3 4G |
68
| Galaxy Note 2 |
69 54 Denis 'GNUtoo' Carikli
|/2. GTA04 |/2. Marvell 8686 (W2CBW003) | libertas_sdio(mainline, cfg80211) |
70
| libertas_tf_sdio(patches, mac80211) |
71 40 Denis 'GNUtoo' Carikli
72 1 Denis 'GNUtoo' Carikli
h2. Available Internal WiFi chips for smartphones and tablets
73
74 59 Denis 'GNUtoo' Carikli
|_. Driver |_. Busses |_. Firmware |_. Issues |
75 68 Denis 'GNUtoo' Carikli
| ath5k | PCI, PCIe, PCMCIA, AHB  | None(Driver<->Hardware) | Busses? chip size? power consumption? |
76
| ath9k | PCI, PCIe, PCMCIA, AHB  | None(Driver<->Hardware) | Busses? chip size? power consumption? |
77 61 Denis 'GNUtoo' Carikli
| ath9k_htc | USB | Free firmware | Bus? chip size? power consumption? |
78 62 Denis 'GNUtoo' Carikli
| carl9170 | USB | Free firmware | Bus? chip size? power consumption? |
79 63 Denis 'GNUtoo' Carikli
| airo | PCI, PCMCIA | Non-free firmware on flash | ? |
80 64 Denis 'GNUtoo' Carikli
| at76c50x-usb | USB | Non-free firmware needed for some cards only | ? |
81 65 Denis 'GNUtoo' Carikli
| b43/b43-legacy | SSB, PCI, PCI-E, PCMCIA | OpenFWWF with 4306, 4311(rev1), 4318, 4320 | ? |
82 66 Denis 'GNUtoo' Carikli
| rt2400 | PCI | No non-free firmware needed | ? |
83 1 Denis 'GNUtoo' Carikli
| rt2500 | PCI | No non-free firmware needed | ? |
84 66 Denis 'GNUtoo' Carikli
| rt2500usb | PCI | No non-free firmware needed | ? |
85 68 Denis 'GNUtoo' Carikli
| rtl818x | PCI, USB | No non-free firmware needed | ? |
86 87 Denis 'GNUtoo' Carikli
| esp8266 |  UART, SPI, SDIO  | "Out of tree Linux driver available":https://github.com/george-hopkins/esp8089-spi which depend on nonfree firmware | "nonfree binaries required to make WiFi work":https://github.com/espressif/ESP8266_NONOS_SDK/tree/master/lib |
87 88 Denis 'GNUtoo' Carikli
| esp32 | | | "nonfree binaries required to make WiFi work":https://github.com/espressif/esp32-wifi-lib | 
88 84 Denis 'GNUtoo' Carikli
| rsi91x | SDIO, USB, other? | * nonfree firmware required
89 82 Denis 'GNUtoo' Carikli
* "may be possible to add it on a dedicated flash chip":https://puri.sm/posts/librem5-2018-09-hardware-report/ |  |
90 59 Denis 'GNUtoo' Carikli
91 72 Denis 'GNUtoo' Carikli
Notes:
92
* PCI, PCIe and PCMCIA are available on very few SOCs (Like I.MX)
93 80 Joonas Kylmälä
* We are not aware of phone designs using USB WiFi chips.
94
* AHB and SSB are usually used as internal memory bus for SOCS. Maybe it can be used to connect a WiFi chip to the SOC memory, like with the I.MX WEIM bus?
95
* Chip size is important to fit inside a phone. Might be less an issue for tablets.
96 72 Denis 'GNUtoo' Carikli
97 69 Denis 'GNUtoo' Carikli
References:
98
* https://en.wikipedia.org/wiki/Comparison_of_open-source_wireless_drivers#Status
99
* https://wireless.wiki.kernel.org/en/users/drivers
100
* http://netweb.ing.unibs.it/~openfwwf/index.php
101 70 Denis 'GNUtoo' Carikli
* https://nurdspace.nl/ESP8266
102 69 Denis 'GNUtoo' Carikli
103 85 Denis 'GNUtoo' Carikli
h3. TODO
104 1 Denis 'GNUtoo' Carikli
105 85 Denis 'GNUtoo' Carikli
* Coordinate the work with the "Libreplanet wiki":https://libreplanet.org/wiki/Group:Hardware/ReverseEngineering#WiFi.2FBluetooth_chips_for_Smartphones_and_Tablets
106 90 Denis 'GNUtoo' Carikli
* Look into broadcom chipset reverse engineering tools like "nextmon":https://github.com/nextmon and internalblue:"https://github.com/seemoo-lab/internalblue" for bluetooth
107 1 Denis 'GNUtoo' Carikli
108 85 Denis 'GNUtoo' Carikli
h2. Internal WiFi chips on devices currently targeted by Replicant
109 57 Denis 'GNUtoo' Carikli
110 27 Denis 'GNUtoo' Carikli
h2. External Wifi solution
111 36 Denis 'GNUtoo' Carikli
112
Most/All Replicant supported devices support USB OTG. With the proper (standard) cable, the USB port of the device can do USB host.
113
114 80 Joonas Kylmälä
However devices differ a lot in the number of Milli-ampers they can deliver through that USB port. Some phones also have USB host enabled by default in their kernel configuration, and some other require patching the kernel.
115 37 Denis 'GNUtoo' Carikli
116
On Replicant kernels, USB WiFi drivers are probably not compiled in by default. So you will also need to recompile.
117
118
|_. Device |_. Replicant Kernel |_. Max mA |
119 55 Denis 'GNUtoo' Carikli
| Galaxy Nexus | | |
120
| Galaxy Note | | |
121
| Galaxy Note 2 | | |
122
| Galaxy S | | |
123
| Galaxy S 2 | | |
124
| Galaxy S 3 | | |
125
| Galaxy Tab 2 7.0 | | |
126
| Galaxy Tab 2 10.1 | | |
127
| GTA04 | | |
128 37 Denis 'GNUtoo' Carikli
| Nexus S | | |
129 55 Denis 'GNUtoo' Carikli
| Optimus Black | |