Skip to content

Commit 02ca310

Browse files
authored
Merge pull request #1337 from kernelkit/wifi-ap2
Add WiFi Access point support
2 parents 7114b01 + ac39a80 commit 02ca310

56 files changed

Lines changed: 4067 additions & 537 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,25 @@
1717
"state": {
1818
"admin-state": "unlocked"
1919
}
20+
},
21+
{
22+
"name": "radio0",
23+
"class": "infix-hardware:wifi",
24+
"infix-hardware:wifi-radio": {
25+
"country-code": "DE",
26+
"band": "2.4GHz",
27+
"channel": "auto"
28+
}
29+
},
30+
{
31+
"name": "radio1",
32+
"class": "infix-hardware:wifi",
33+
"infix-hardware:wifi-radio": {
34+
"country-code": "DE",
35+
"band": "5GHz",
36+
"channel": "auto"
2037
}
38+
}
2139
]
2240
},
2341
"ietf-interfaces:interfaces": {
@@ -150,12 +168,36 @@
150168
}
151169
},
152170
{
153-
"name": "wifi0",
154-
"type": "infix-if-type:wifi"
171+
"name": "wifi0-ap",
172+
"type": "infix-if-type:wifi",
173+
"infix-interfaces:wifi": {
174+
"radio": "radio0",
175+
"access-point": {
176+
"ssid": "Infix",
177+
"security": {
178+
"secret": "wifi"
179+
}
180+
}
181+
},
182+
"infix-interfaces:bridge-port": {
183+
"bridge": "br0"
184+
}
155185
},
156186
{
157-
"name": "wifi1",
158-
"type": "infix-if-type:wifi"
187+
"name": "wifi1-ap",
188+
"type": "infix-if-type:wifi",
189+
"infix-interfaces:wifi": {
190+
"radio": "radio1",
191+
"access-point": {
192+
"ssid": "Infix5Ghz",
193+
"security": {
194+
"secret": "wifi"
195+
}
196+
}
197+
},
198+
"infix-interfaces:bridge-port": {
199+
"bridge": "br0"
200+
}
159201
}
160202
]
161203
},
@@ -171,6 +213,15 @@
171213
"certificates": {}
172214
}
173215
]
216+
},
217+
"symmetric-keys": {
218+
"symmetric-key": [
219+
{
220+
"name": "wifi",
221+
"infix-keystore:symmetric-key": "infixinfix",
222+
"infix-keystore:key-format": "infix-crypto-types:wifi-preshared-key-format"
223+
}
224+
]
174225
}
175226
},
176227
"ietf-netconf-acm:nacm": {

board/aarch64/raspberrypi-rpi64/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ To configure WiFi as a client, first store your WiFi password in the keystore:
108108
admin@infix:/> configure
109109
admin@infix:/config/> edit keystore symmetric-key mywifi
110110
admin@infix:/config/keystore/…/mywifi/> set key-format wifi-preshared-key-format
111-
admin@infix:/config/keystore/…/mywifi/> set cleartext-symmetric-key YourWiFiPassword
111+
admin@infix:/config/keystore/…/mywifi/> set symmetric-key YourWiFiPassword
112112
admin@infix:/config/keystore/…/mywifi/> leave
113113
```
114114

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
service <!> name:hostapd :%i \
2+
[2345] hostapd -P/var/run/hostapd-%i.pid /etc/hostapd-%i.conf \
3+
-- Wi-Fi Access Point @%i
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
service name:wpa_supplicant :%i \
22
[2345] wpa_supplicant -s -i %i -c /etc/wpa_supplicant-%i.conf -P/var/run/wpa_supplicant-%i.pid \
3-
-- WPA supplicant @%i
3+
-- Wi-Fi Station @%i
44

5-
task name:wifi-scanner :%i [2345] <pid/wpa_supplicant:%i> /usr/libexec/infix/wifi-scanner %i -- Start scanning for SSID @ %i
5+
task name:wifi-scanner :%i [2345] <pid/wpa_supplicant:%i> /usr/libexec/infix/wifi-scanner %i -- Start scanning for SSID @%i
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Rename WiFi PHY devices from phy0 to radio0 to avoid name clashes
2+
SUBSYSTEM=="ieee80211", ACTION=="add", KERNEL=="phy*", \
3+
RUN+="/bin/sh -c '/usr/sbin/iw phy %k set name radio%n'"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Remove kernel-created WiFi interfaces
2+
# All WiFi interfaces are now virtual interfaces created by confd
3+
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan*", \
4+
TEST=="/sys/class/net/$name/phy80211/name", \
5+
PROGRAM="/bin/cat /sys/class/net/%k/phy80211/name", \
6+
TEST!="/run/wifi-cleaned-%c", \
7+
RUN+="/bin/sh -c '/usr/sbin/iw dev %k del && touch /run/wifi-cleaned-%c'"

board/common/rootfs/etc/udev/rules.d/70-rename-wifi.rules

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)