mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Compare commits
2 Commits
v3.2.0-rc1
...
v3.1.0-rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e04833e902 | ||
|
|
21cb4de975 |
2
.github/workflows/build-dev.yml
vendored
2
.github/workflows/build-dev.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cybertan_eww631-a1', 'cybertan_eww631-b1','sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap630w-211g', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_eap112', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'sercomm_ap72tip', 'udaya_a6-id2', 'wallys_dr5018', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'sercomm_ap72tip', 'udaya_a5-id2', 'udaya_a6-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -32,12 +32,9 @@ ALLWIFIBOARDS:= \
|
||||
cybertan-eww622-a1 \
|
||||
cybertan-eww631-a1 \
|
||||
cybertan-eww631-b1 \
|
||||
sonicfi-rap630c-311g \
|
||||
sonicfi-rap630w-311g \
|
||||
edgecore-eap101 \
|
||||
gl-ax1800 \
|
||||
gl-axt1800 \
|
||||
gl-b3000 \
|
||||
sercomm-wallaby \
|
||||
edgecore-eap102 \
|
||||
edgecore-oap102 \
|
||||
@@ -48,7 +45,6 @@ ALLWIFIBOARDS:= \
|
||||
indio-um-510axm-v1 \
|
||||
muxi-ap3220l \
|
||||
plasmacloud-pax1800 \
|
||||
wallys-dr5018 \
|
||||
wallys-dr6018 \
|
||||
wallys-dr6018-v4 \
|
||||
tplink-ex227 \
|
||||
@@ -109,11 +105,6 @@ $(call Package/ath11k-wifi-default)
|
||||
TITLE:=gl-axt1800 bdf
|
||||
endef
|
||||
|
||||
define Package/ath11k-wifi-gl-b3000
|
||||
$(call Package/ath11k-wifi-default)
|
||||
TITLE:=gl-b3000 bdf
|
||||
endef
|
||||
|
||||
define Package/ath11k-wifi-motorola-q14
|
||||
$(call Package/ath11k-wifi-default)
|
||||
TITLE:=motorola q14 bdf
|
||||
@@ -299,13 +290,6 @@ define Package/ath11k-wifi-gl-axt1800/install
|
||||
$(INSTALL_DATA) ./board-gl-axt1800.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board-2.bin
|
||||
endef
|
||||
|
||||
define Package/ath11k-wifi-gl-b3000/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ5018/hw1.0/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/qcn6122/hw1.0/
|
||||
$(INSTALL_DATA) ./board-gl-b3000.bin.IPQ5018 $(1)/lib/firmware/ath11k/IPQ5018/hw1.0/board.bin
|
||||
$(INSTALL_DATA) ./board-gl-b3000.bin.QCN6122 $(1)/lib/firmware/ath11k/qcn6122/hw1.0/board.bin
|
||||
endef
|
||||
|
||||
define Package/ath11k-wifi-motorola-q14/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ5018/hw1.0/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/qcn6122/hw1.0/
|
||||
@@ -392,8 +376,6 @@ $(eval $(call generate-ath11k-wifi-package,cig-wf194c4,Cigtech WF194c4))
|
||||
$(eval $(call generate-ath11k-wifi-package,cybertan-eww622-a1,CyberTan EWW622 A1))
|
||||
$(eval $(call generate-ath11k-wifi-package,cybertan-eww631-a1,CyberTan EWW631 A1))
|
||||
$(eval $(call generate-ath11k-wifi-package,cybertan-eww631-b1,CyberTan EWW631 B1))
|
||||
$(eval $(call generate-ath11k-wifi-package,sonicfi-rap630c-311g,Sonicfi RAP630C 311G))
|
||||
$(eval $(call generate-ath11k-wifi-package,sonicfi-rap630w-311g,Sonicfi RAP630W 311G))
|
||||
$(eval $(call generate-ath11k-wifi-package,sercomm-wallaby,Sercomm Kiwi))
|
||||
$(eval $(call generate-ath11k-wifi-package,wallys-dr6018,Wallys DR6018))
|
||||
$(eval $(call generate-ath11k-wifi-package,wallys-dr6018-v4,Wallys DR6018 V4))
|
||||
@@ -413,7 +395,6 @@ $(eval $(call generate-ath11k-wifi-package,muxi-ap3220l,MUXI AP3220L))
|
||||
$(eval $(call generate-ath11k-wifi-package,yuncore-fap650,YunCore FAP650))
|
||||
$(eval $(call generate-ath11k-wifi-package,yuncore-fap655,YunCore FAP655))
|
||||
$(eval $(call generate-ath11k-wifi-package,udaya-a6-id2,Udaya A6-ID2))
|
||||
$(eval $(call generate-ath11k-wifi-package,wallys-dr5018,Wallys DR5018))
|
||||
|
||||
$(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))
|
||||
$(eval $(call BuildPackage,ath11k-wifi-qcom-ipq5018))
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -601,11 +601,10 @@ define Package/afcd/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/hostap $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/afcd.init $(1)/etc/init.d/afcd
|
||||
$(INSTALL_DATA) ./files/afcd.uc $(1)/usr/share/hostap/
|
||||
$(INSTALL_DATA) ./files/afc_location.uc $(1)/usr/share/hostap/
|
||||
endef
|
||||
|
||||
define Install/hostapd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap
|
||||
$(INSTALL_DATA) ./files/hostapd.uc $(1)/usr/share/hostap/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/etc/radius
|
||||
ln -sf hostapd $(1)/usr/sbin/hostapd-radius
|
||||
@@ -613,8 +612,6 @@ define Install/hostapd
|
||||
$(INSTALL_DATA) ./files/radius.config $(1)/etc/config/radius
|
||||
$(INSTALL_DATA) ./files/radius.clients $(1)/etc/radius/clients
|
||||
$(INSTALL_DATA) ./files/radius.users $(1)/etc/radius/users
|
||||
$(INSTALL_BIN) ./files/mpskd $(1)/usr/share/hostap/
|
||||
$(INSTALL_BIN) ./files/mpskd.init $(1)/etc/init.d/mpskd
|
||||
endef
|
||||
|
||||
define Install/supplicant
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env ucode
|
||||
'use strict';
|
||||
let fs = require("fs");
|
||||
let ubus = require('ubus').connect();
|
||||
|
||||
let gps_info = ubus.call('gps', 'info');
|
||||
let latitude = gps_info.latitude ?? 0;
|
||||
let longitude = gps_info.longitude ?? 0;
|
||||
|
||||
// afc-location.json file content
|
||||
let afc_location = {};
|
||||
afc_location.location_type = "ellipse";
|
||||
afc_location.location = longitude + ":" + latitude ;
|
||||
afc_location.height = gps_info.elevation ?? 0;
|
||||
afc_location.height_type = "AMSL";
|
||||
afc_location.major_axis = gps_info.major_axis ?? 0;
|
||||
afc_location.minor_axis = gps_info.minor_axis ?? 0;
|
||||
afc_location.orientation = gps_info.major_orientation ?? 0;
|
||||
afc_location.vertical_tolerance = gps_info.vdop ?? 0;
|
||||
|
||||
let afc_location_json = fs.open("/etc/ucentral/afc-location.json", "w");
|
||||
afc_location_json.write(afc_location);
|
||||
afc_location_json.close();
|
||||
@@ -4,7 +4,6 @@ START=19
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=afcd
|
||||
PROG=/usr/bin/ucode
|
||||
|
||||
add_afc() {
|
||||
config_get_bool disabled "$1" disabled 0
|
||||
@@ -15,16 +14,8 @@ add_afc() {
|
||||
[ -n "$url" ] || return
|
||||
|
||||
procd_open_instance afcd
|
||||
procd_set_param command "$PROG" /usr/share/hostap/afcd.uc -u "$url"
|
||||
[ -n "$cert" ] && procd_append_param command -c "$cert"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
_afc_location() {
|
||||
# create afc-location.json
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" /usr/share/hostap/afc_location.uc
|
||||
procd_set_param command /usr/bin/ucode /usr/share/hostap/afcd.uc -u "$url"
|
||||
[ -n "$cert" ] && procd_append_param command -c "$cert"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@@ -32,9 +23,6 @@ _afc_location() {
|
||||
start_service() {
|
||||
config_load wireless
|
||||
config_foreach add_afc afc-server
|
||||
|
||||
local gps_disabled=$(uci get gps.@gps[-1].disabled)
|
||||
[ "$gps_disabled" -eq 0 ] && _afc_location
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -72,7 +72,7 @@ function handle_request(req)
|
||||
|
||||
let cl = uclient.new(opts.url, null, cb);
|
||||
|
||||
if (!cl.ssl_init({ verify: !!opts.cert, ca_files: [ opts.cert ] })) {
|
||||
if (!cl.ssl_init({ verify: true, ca_files: [ opts.cert ] })) {
|
||||
warn(`Failed to initialize SSL\n`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ hostapd_append_wpa_key_mgmt() {
|
||||
[ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type_l}-SHA256"
|
||||
;;
|
||||
eap192)
|
||||
[ "${ieee80211r:-0}" -gt 0 ] || append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP-SHA384"
|
||||
append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP"
|
||||
;;
|
||||
eap-eap2)
|
||||
append wpa_key_mgmt "WPA-EAP"
|
||||
@@ -73,10 +73,6 @@ hostapd_append_wpa_key_mgmt() {
|
||||
owe)
|
||||
append wpa_key_mgmt "OWE"
|
||||
;;
|
||||
psk2-radius)
|
||||
append wpa_key_mgmt "WPA-PSK"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-PSK"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ "$fils" -gt 0 ] && {
|
||||
@@ -409,7 +405,7 @@ hostapd_common_add_bss_config() {
|
||||
|
||||
config_add_boolean ieee80211r pmk_r1_push ft_psk_generate_local ft_over_ds
|
||||
config_add_int r0_key_lifetime reassociation_deadline ft_l2_refresh
|
||||
config_add_string mobility_domain r1_key_holder ft_key
|
||||
config_add_string mobility_domain r1_key_holder
|
||||
config_add_array r0kh r1kh
|
||||
|
||||
config_add_int ieee80211w_max_timeout ieee80211w_retry_timeout
|
||||
@@ -1018,7 +1014,7 @@ hostapd_set_bss_options() {
|
||||
[ -n "$ft_l2_refresh" ] && append bss_conf "ft_l2_refresh=$ft_l2_refresh" "$N"
|
||||
|
||||
if [ "$skip_kh_setup" -eq "0" ]; then
|
||||
json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push ft_key
|
||||
json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push
|
||||
json_get_values r0kh r0kh
|
||||
json_get_values r1kh r1kh
|
||||
|
||||
@@ -1026,15 +1022,12 @@ hostapd_set_bss_options() {
|
||||
set_default pmk_r1_push 0
|
||||
|
||||
[ -n "$r0kh" -a -n "$r1kh" ] || {
|
||||
[ -z "$ft_key" ] && {
|
||||
key=`echo -n "$mobility_domain/$auth_secret" | md5sum | awk '{print $1}'`
|
||||
key=`echo -n "$mobility_domain/$auth_secret" | md5sum | awk '{print $1}'`
|
||||
|
||||
set_default r0kh "ff:ff:ff:ff:ff:ff,*,$key"
|
||||
set_default r1kh "00:00:00:00:00:00,00:00:00:00:00:00,$key"
|
||||
}
|
||||
set_default r0kh "ff:ff:ff:ff:ff:ff,*,$key"
|
||||
set_default r1kh "00:00:00:00:00:00,00:00:00:00:00:00,$key"
|
||||
}
|
||||
|
||||
[ -n "$ft_key" ] && append bss_conf "ft_key=$ft_key" "$N"
|
||||
[ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N"
|
||||
append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
|
||||
append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"
|
||||
|
||||
@@ -833,8 +833,6 @@ let main_obj = {
|
||||
hostapd.printf(`Set new config for phy ${phy}: ${file}`);
|
||||
iface_set_config(phy, config);
|
||||
|
||||
hostapd.data.auth_obj.notify("reload", { phy });
|
||||
|
||||
return {
|
||||
pid: hostapd.getpid()
|
||||
};
|
||||
@@ -874,9 +872,6 @@ let main_obj = {
|
||||
hostapd.data.ubus = ubus;
|
||||
hostapd.data.obj = ubus.publish("hostapd", main_obj);
|
||||
|
||||
let auth_obj = {};
|
||||
hostapd.data.auth_obj = ubus.publish("hostapd-auth", auth_obj);
|
||||
|
||||
function bss_event(type, name, data) {
|
||||
let ubus = hostapd.data.ubus;
|
||||
|
||||
@@ -906,23 +901,5 @@ return {
|
||||
},
|
||||
bss_remove: function(name, obj) {
|
||||
bss_event("remove", name);
|
||||
},
|
||||
sta_auth: function(iface, sta) {
|
||||
let msg = { iface, sta };
|
||||
let ret = {};
|
||||
let data_cb = (type, data) => {
|
||||
ret = { ...ret, ...data };
|
||||
};
|
||||
hostapd.data.auth_obj.notify("sta_auth", msg, data_cb, null, null, 1000);
|
||||
return ret;
|
||||
},
|
||||
sta_connected: function(iface, sta, data) {
|
||||
let msg = { iface, sta, ...data };
|
||||
let ret = {};
|
||||
let data_cb = (type, data) => {
|
||||
ret = { ...ret, ...data };
|
||||
};
|
||||
hostapd.data.auth_obj.notify("sta_connected", msg, data_cb, null, null, 1000);
|
||||
return ret;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,335 +0,0 @@
|
||||
#!/usr/bin/env ucode
|
||||
'use strict';
|
||||
import * as uloop from 'uloop';
|
||||
import * as libubus from 'ubus';
|
||||
|
||||
uloop.init();
|
||||
let ubus = libubus.connect();
|
||||
|
||||
let interfaces = {};
|
||||
let ssids = {};
|
||||
let cache = {};
|
||||
let sub_6g = [];
|
||||
let sub_6g_obj;
|
||||
let reload_timer;
|
||||
let gc_timer;
|
||||
|
||||
let timeout = 48 * 60 * 60;
|
||||
|
||||
function event_cb_6g(req) {
|
||||
//printf('6g %s %.J\n', req.data, req.type);
|
||||
if (req.type != 'auth' && req.type != 'probe')
|
||||
return 0;
|
||||
|
||||
let addr = req.data.address;
|
||||
let iface = interfaces[req.data.ifname];
|
||||
if (!iface)
|
||||
return 0;
|
||||
|
||||
let ssid = iface.ssid;
|
||||
if (!ssid || !length(ssids[ssid].keys))
|
||||
return 0;
|
||||
|
||||
let ssid_cache = cache[ssid];
|
||||
if (ssid_cache && ssid_cache[addr])
|
||||
return 0;
|
||||
|
||||
if (req.type == 'probe') {
|
||||
printf(`Ignore probe ${req.type} on ${req.data.ifname} from ${addr}\n`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf(`reject ${req.type} on ${req.data.ifname} from ${addr}\n`);
|
||||
return 5;
|
||||
}
|
||||
|
||||
function event_cb(req) {
|
||||
//printf('normal %s %.J\n', req.data, req.type);
|
||||
if (req.type != 'probe')
|
||||
return 0;
|
||||
|
||||
let addr = req.data.address;
|
||||
let iface = interfaces[req.data.ifname];
|
||||
if (!iface)
|
||||
return 0;
|
||||
|
||||
let ssid = iface.ssid;
|
||||
if (!ssid || !length(ssids[ssid].keys))
|
||||
return 0;
|
||||
|
||||
let ssid_cache = cache[ssid];
|
||||
if (ssid_cache && ssid_cache[addr])
|
||||
return 0;
|
||||
|
||||
printf(`reply to ${req.type} on ${req.data.ifname} from ${addr} without 6G RNR\n`);
|
||||
return 2;
|
||||
}
|
||||
|
||||
function create_6g_subscriber() {
|
||||
for (let cur_sub in sub_6g)
|
||||
cur_sub.remove();
|
||||
sub_6g = [];
|
||||
|
||||
for (let ifname, iface in interfaces) {
|
||||
let obj = 'hostapd.' + ifname;
|
||||
let cur_sub;
|
||||
if (iface.band == '6g')
|
||||
cur_sub = ubus.subscriber((req) => event_cb_6g(req));
|
||||
else
|
||||
cur_sub = ubus.subscriber((req) => event_cb(req));
|
||||
cur_sub.subscribe(obj);
|
||||
push(sub_6g, cur_sub);
|
||||
printf(`subscribe ${ifname}\n`);
|
||||
ubus.call(obj, 'notify_response', { notify_response: 1 });
|
||||
}
|
||||
}
|
||||
|
||||
function cache_gc() {
|
||||
let ts = time();
|
||||
|
||||
for (let ssid in keys(cache)) {
|
||||
if (!ssids[ssid]) {
|
||||
delete cache[ssid];
|
||||
continue;
|
||||
}
|
||||
|
||||
let ssid_cache = cache[ssid];
|
||||
ssid = ssids[ssid];
|
||||
|
||||
for (let addr in keys(ssid_cache)) {
|
||||
let sta = ssid_cache[addr];
|
||||
let keep = ts < cache.timeout;
|
||||
|
||||
if (keep && !ssid.keys[sta.key])
|
||||
keep = false;
|
||||
if (keep)
|
||||
sta.keydata = ssid.keys[sta.key];
|
||||
if (!keep)
|
||||
delete cache[addr];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function netifd_reload() {
|
||||
let data = ubus.call('network.wireless', 'status');
|
||||
|
||||
ssids = {};
|
||||
interfaces = {};
|
||||
|
||||
for (let radio_name, radio in data) {
|
||||
if (!radio.up)
|
||||
continue;
|
||||
|
||||
for (let iface in radio.interfaces) {
|
||||
let config = iface.config;
|
||||
|
||||
if (config.mode != 'ap' || !iface.ifname)
|
||||
continue;
|
||||
|
||||
let band = radio.config.band;
|
||||
let nr_data = ubus.call('hostapd.' + iface.ifname, 'rrm_nr_get_own');
|
||||
let nr;
|
||||
if (nr_data && nr_data.value && nr_data.value[2])
|
||||
nr = nr_data.value[2];
|
||||
interfaces[iface.ifname] = {
|
||||
band, nr,
|
||||
ssid: config.ssid,
|
||||
};
|
||||
|
||||
ssids[config.ssid] ??= {
|
||||
interfaces: [],
|
||||
keys: {},
|
||||
bands: {},
|
||||
};
|
||||
let ssid = ssids[config.ssid];
|
||||
|
||||
push(ssid.interfaces, iface.ifname);
|
||||
ssid.bands[band] = iface.ifname;
|
||||
for (let sta in iface.stations) {
|
||||
let stacfg = sta.config;
|
||||
|
||||
let key = stacfg.key;
|
||||
if (!key)
|
||||
continue;
|
||||
|
||||
let keydata = {};
|
||||
let vid = stacfg.vid;
|
||||
if (vid)
|
||||
keydata.vlan = +vid;
|
||||
let mac = stacfg.mac;
|
||||
if (mac)
|
||||
keydata.mac = mac;
|
||||
ssid.keys[key] = keydata;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf('New config: %.J\n', { ssids, interfaces });
|
||||
cache_gc();
|
||||
create_6g_subscriber();
|
||||
}
|
||||
|
||||
function iface_ssid(ifname) {
|
||||
let iface = interfaces[ifname];
|
||||
if (!iface)
|
||||
return;
|
||||
|
||||
return iface.ssid;
|
||||
}
|
||||
|
||||
function sta_cache_entry_get(ssid, addr) {
|
||||
let ssid_cache = cache[ssid] ?? {};
|
||||
|
||||
let entry = ssid_cache[addr];
|
||||
if (entry)
|
||||
entry.timeout = time() + timeout;
|
||||
|
||||
printf(`Get cache entry ssid=${ssid} addr=${addr}: ${entry}\n`);
|
||||
return entry;
|
||||
}
|
||||
|
||||
function sta_cache_entry_add(ssid, addr, key) {
|
||||
cache[ssid] ??= {};
|
||||
let ssid_cache = cache[ssid];
|
||||
let ssid_data = ssids[ssid];
|
||||
let keydata = ssid_data.keys[key];
|
||||
|
||||
let cache_data = {
|
||||
timeout: time() + timeout,
|
||||
ssid, key,
|
||||
data: keydata ?? {},
|
||||
};
|
||||
ssid_cache[addr] = cache_data;
|
||||
printf(`Added cache entry ssid=${ssid} addr=${addr}\n`);
|
||||
return cache_data;
|
||||
}
|
||||
|
||||
function ssid_psk(ssid, addr) {
|
||||
ssid = ssids[ssid];
|
||||
if (!ssid)
|
||||
return [];
|
||||
|
||||
let specific = [];
|
||||
let rest = [];
|
||||
for (let k, v in ssid.keys)
|
||||
if (v.mac == addr)
|
||||
push(specific, k);
|
||||
else if (!v.mac)
|
||||
push(rest, k);
|
||||
|
||||
if (length(specific))
|
||||
return specific;
|
||||
|
||||
return rest;
|
||||
}
|
||||
|
||||
function sta_auth_psk(ifname, addr) {
|
||||
let ssid = iface_ssid(ifname);
|
||||
if (!ssid)
|
||||
return;
|
||||
|
||||
let cache = sta_cache_entry_get(ssid, addr);
|
||||
if (cache)
|
||||
return [ cache.key ];
|
||||
|
||||
return ssid_psk(ssid, addr);
|
||||
}
|
||||
|
||||
function sta_auth_cache(ifname, addr, idx, phrase) {
|
||||
let ssid = iface_ssid(ifname);
|
||||
if (!ssid)
|
||||
return;
|
||||
|
||||
let cache = sta_cache_entry_get(ssid, addr);
|
||||
if (cache)
|
||||
return cache.data;
|
||||
|
||||
let psk = ssid_psk(ssid, addr);
|
||||
if (!psk)
|
||||
return;
|
||||
|
||||
psk = psk[idx];
|
||||
if (!psk)
|
||||
psk = phrase;
|
||||
|
||||
if (!psk)
|
||||
return;
|
||||
|
||||
cache = sta_cache_entry_add(ssid, addr, psk);
|
||||
if (!cache)
|
||||
return;
|
||||
|
||||
let ssid_data = ssids[ssid];
|
||||
if (!ssid_data)
|
||||
return cache.data;
|
||||
|
||||
let target_ifname = ssid_data.bands['6g'];
|
||||
if (!target_ifname)
|
||||
return cache.data;
|
||||
|
||||
let target_iface = interfaces[target_ifname];
|
||||
if (!target_iface)
|
||||
return cache.data;
|
||||
|
||||
cache.timer = uloop.timer(30 * 1000, () => {
|
||||
let msg = {
|
||||
addr,
|
||||
disassociation_imminent: false,
|
||||
neighbors: [
|
||||
target_iface.nr
|
||||
],
|
||||
abridged: false,
|
||||
};
|
||||
printf(`ubus call hostapd.${ifname} bss_transition_request '${msg}'\n`);
|
||||
ubus.call('hostapd.' + ifname, 'bss_transition_request', msg);
|
||||
delete cache.timer;
|
||||
});
|
||||
|
||||
return cache.data;
|
||||
}
|
||||
|
||||
function auth_cb(msg) {
|
||||
let data = msg.data;
|
||||
|
||||
printf(`Event ${msg.type}: ${msg.data}\n`);
|
||||
switch (msg.type) {
|
||||
case 'sta_auth':
|
||||
return {
|
||||
psk: sta_auth_psk(data.iface, data.sta),
|
||||
force_psk: true,
|
||||
};
|
||||
case 'sta_connected':
|
||||
if (data.psk_idx == null)
|
||||
return;
|
||||
return sta_auth_cache(data.iface, data.sta, data.psk_idx, data.psk);
|
||||
case 'reload':
|
||||
netifd_reload();
|
||||
reload_timer.set(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let ubus_methods = {
|
||||
state: {
|
||||
call: function(req) {
|
||||
return {
|
||||
interfaces,
|
||||
ssids,
|
||||
cache
|
||||
};
|
||||
},
|
||||
args: {
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
reload_timer = uloop.timer(-1, () => { netifd_reload(); });
|
||||
gc_timer = uloop.timer(1000, () => { gc_timer.set(30 * 1000); cache_gc(); });
|
||||
ubus.publish('mpsk', ubus_methods);
|
||||
let sub = ubus.subscriber(auth_cb);
|
||||
let listener = ubus.listener('ubus.object.add', (event, msg) => {
|
||||
if (msg.path == 'hostapd-auth')
|
||||
sub.subscribe(msg.path);
|
||||
});
|
||||
sub.subscribe('hostapd-auth');
|
||||
netifd_reload();
|
||||
uloop.run();
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=19
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=mpskd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance mpskd
|
||||
procd_set_param command /usr/share/hostap/mpskd
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@@ -14,6 +14,6 @@
|
||||
"methods": [ "request" ]
|
||||
}
|
||||
},
|
||||
"publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*", "hostapd-auth" ],
|
||||
"publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ],
|
||||
"send": [ "bss.*", "wps_credentials" ]
|
||||
}
|
||||
|
||||
@@ -585,146 +585,37 @@
|
||||
.send_mlme = driver_nl80211_send_mlme,
|
||||
.get_hw_feature_data = nl80211_get_hw_feature_data,
|
||||
.sta_add = wpa_driver_nl80211_sta_add,
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -494,11 +494,17 @@ static const char * sae_get_password(str
|
||||
struct sae_pt **s_pt,
|
||||
const struct sae_pk **s_pk)
|
||||
{
|
||||
+ struct hostapd_bss_config *conf = hapd->conf;
|
||||
+ struct hostapd_ssid *ssid = &conf->ssid;
|
||||
+ struct hostapd_sta_wpa_psk_short *psk;
|
||||
const char *password = NULL;
|
||||
- struct sae_password_entry *pw;
|
||||
+ struct sae_password_entry *pw = NULL;
|
||||
struct sae_pt *pt = NULL;
|
||||
const struct sae_pk *pk = NULL;
|
||||
--- a/src/ap/ucode.c
|
||||
+++ b/src/ap/ucode.c
|
||||
@@ -255,6 +255,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, s
|
||||
|
||||
+ if (sta && sta->use_sta_psk)
|
||||
+ goto use_sta_psk;
|
||||
+
|
||||
for (pw = hapd->conf->sae_passwords; pw; pw = pw->next) {
|
||||
if (!is_broadcast_ether_addr(pw->peer_addr) &&
|
||||
os_memcmp(pw->peer_addr, sta->addr, ETH_ALEN) != 0)
|
||||
@@ -519,6 +525,31 @@ static const char * sae_get_password(str
|
||||
pt = hapd->conf->ssid.pt;
|
||||
hostapd_setup_bss(hapd, hapd == iface->bss[0], true);
|
||||
hostapd_ucode_update_interfaces();
|
||||
+ hostapd_owe_update_trans(iface);
|
||||
|
||||
done:
|
||||
ret = 0;
|
||||
@@ -375,6 +376,7 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, si
|
||||
conf->bss[idx] = NULL;
|
||||
ret = hostapd_ucode_bss_get_uval(hapd);
|
||||
hostapd_ucode_update_interfaces();
|
||||
+ hostapd_owe_update_trans(iface);
|
||||
goto out;
|
||||
|
||||
deinit_ctrl:
|
||||
@@ -602,6 +604,7 @@ out:
|
||||
|
||||
ieee802_11_set_beacon(hapd);
|
||||
}
|
||||
+ hostapd_owe_update_trans(iface);
|
||||
|
||||
+use_sta_psk:
|
||||
+ if (!password && sta) {
|
||||
+ for (psk = sta->psk; psk; psk = psk->next) {
|
||||
+ if (!psk->is_passphrase)
|
||||
+ continue;
|
||||
+
|
||||
+ password = psk->passphrase;
|
||||
+ if (!sta->use_sta_psk)
|
||||
+ break;
|
||||
+
|
||||
+ if (sta->sae_pt) {
|
||||
+ pt = sta->sae_pt;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ pt = sae_derive_pt(conf->sae_groups, ssid->ssid,
|
||||
+ ssid->ssid_len,
|
||||
+ (const u8 *) password,
|
||||
+ os_strlen(password),
|
||||
+ NULL);
|
||||
+ sta->sae_pt = pt;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (pw_entry)
|
||||
*pw_entry = pw;
|
||||
if (s_pt)
|
||||
@@ -3698,6 +3729,12 @@ static void handle_auth(struct hostapd_d
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ res = hostapd_ucode_sta_auth(hapd, sta);
|
||||
+ if (res) {
|
||||
+ resp = res;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
sta->flags &= ~WLAN_STA_PREAUTH;
|
||||
ieee802_1x_notify_pre_auth(sta->eapol_sm, 0);
|
||||
|
||||
--- a/src/ap/sta_info.c
|
||||
+++ b/src/ap/sta_info.c
|
||||
@@ -412,6 +412,9 @@ void ap_free_sta(struct hostapd_data *ha
|
||||
os_free(sta->sae_postponed_commit);
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
|
||||
+ if (sta->sae_pt)
|
||||
+ sae_deinit_pt(sta->sae_pt);
|
||||
+
|
||||
os_free(sta);
|
||||
return ucv_boolean_new(true);
|
||||
}
|
||||
@@ -693,6 +696,7 @@ uc_hostapd_bss_rename(uc_vm_t *vm, size_
|
||||
hostapd_ubus_add_bss(hapd);
|
||||
|
||||
@@ -1280,6 +1283,8 @@ void ap_sta_set_authorized(struct hostap
|
||||
else
|
||||
sta->flags &= ~WLAN_STA_AUTHORIZED;
|
||||
|
||||
+ if (authorized)
|
||||
+ hostapd_ucode_sta_connected(hapd, sta);
|
||||
#ifdef CONFIG_P2P
|
||||
if (hapd->p2p_group == NULL) {
|
||||
if (sta->p2p_ie != NULL &&
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -201,6 +201,9 @@ struct sta_info {
|
||||
int vlan_id_bound; /* updated by ap_sta_bind_vlan() */
|
||||
/* PSKs from RADIUS authentication server */
|
||||
struct hostapd_sta_wpa_psk_short *psk;
|
||||
+ struct sae_pt *sae_pt;
|
||||
+ int use_sta_psk;
|
||||
+ int psk_idx;
|
||||
|
||||
char *identity; /* User-Name from RADIUS */
|
||||
char *radius_cui; /* Chargeable-User-Identity from RADIUS */
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -337,6 +337,7 @@ static const u8 * hostapd_wpa_auth_get_p
|
||||
struct sta_info *sta = ap_get_sta(hapd, addr);
|
||||
const u8 *psk;
|
||||
|
||||
+ sta->psk_idx = 0;
|
||||
if (vlan_id)
|
||||
*vlan_id = 0;
|
||||
if (psk_len)
|
||||
@@ -381,13 +382,18 @@ static const u8 * hostapd_wpa_auth_get_p
|
||||
* returned psk which should not be returned again.
|
||||
* logic list (all hostapd_get_psk; all sta->psk)
|
||||
*/
|
||||
+ if (sta && sta->use_sta_psk)
|
||||
+ psk = NULL;
|
||||
if (sta && sta->psk && !psk) {
|
||||
struct hostapd_sta_wpa_psk_short *pos;
|
||||
+ int psk_idx;
|
||||
|
||||
if (vlan_id)
|
||||
*vlan_id = 0;
|
||||
psk = sta->psk->psk;
|
||||
+ sta->psk_idx = psk_idx = 1;
|
||||
for (pos = sta->psk; pos; pos = pos->next) {
|
||||
+ psk_idx++;
|
||||
if (pos->is_passphrase) {
|
||||
pbkdf2_sha1(pos->passphrase,
|
||||
hapd->conf->ssid.ssid,
|
||||
@@ -396,10 +402,14 @@ static const u8 * hostapd_wpa_auth_get_p
|
||||
pos->is_passphrase = 0;
|
||||
}
|
||||
if (pos->psk == prev_psk) {
|
||||
+ sta->psk_idx = psk_idx;
|
||||
psk = pos->next ? pos->next->psk : NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (!psk)
|
||||
+ sta->psk_idx = 0;
|
||||
}
|
||||
return psk;
|
||||
}
|
||||
hostapd_ucode_update_interfaces();
|
||||
+ hostapd_owe_update_trans(hapd->iface);
|
||||
out:
|
||||
if (interfaces->ctrl_iface_init)
|
||||
interfaces->ctrl_iface_init(hapd);
|
||||
|
||||
@@ -1,552 +0,0 @@
|
||||
--- a/src/ap/wpa_auth.h
|
||||
+++ b/src/ap/wpa_auth.h
|
||||
@@ -15,6 +15,10 @@
|
||||
#include "common/ieee802_11_defs.h"
|
||||
|
||||
struct vlan_description;
|
||||
+struct rate_description {
|
||||
+ u32 rx;
|
||||
+ u32 tx;
|
||||
+};
|
||||
|
||||
#define MAX_OWN_IE_OVERRIDE 256
|
||||
|
||||
@@ -87,6 +91,7 @@ struct ft_rrb_frame {
|
||||
#define FT_RRB_IDENTITY 15
|
||||
#define FT_RRB_RADIUS_CUI 16
|
||||
#define FT_RRB_SESSION_TIMEOUT 17 /* le32 seconds */
|
||||
+#define FT_RRB_RATE_LIMIT 18
|
||||
|
||||
struct ft_rrb_tlv {
|
||||
le16 type;
|
||||
@@ -327,6 +332,10 @@ struct wpa_auth_callbacks {
|
||||
struct vlan_description *vlan);
|
||||
int (*get_vlan)(void *ctx, const u8 *sta_addr,
|
||||
struct vlan_description *vlan);
|
||||
+ int (*set_rate_limit)(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate);
|
||||
+ int (*get_rate_limit)(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate);
|
||||
int (*set_identity)(void *ctx, const u8 *sta_addr,
|
||||
const u8 *identity, size_t identity_len);
|
||||
size_t (*get_identity)(void *ctx, const u8 *sta_addr, const u8 **buf);
|
||||
@@ -479,7 +488,7 @@ int wpa_ft_fetch_pmk_r1(struct wpa_authe
|
||||
struct vlan_description *vlan,
|
||||
const u8 **identity, size_t *identity_len,
|
||||
const u8 **radius_cui, size_t *radius_cui_len,
|
||||
- int *session_timeout);
|
||||
+ int *session_timeout, struct rate_description *rate);
|
||||
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -1172,6 +1172,40 @@ static int hostapd_wpa_auth_get_vlan(voi
|
||||
}
|
||||
|
||||
|
||||
+static int hostapd_wpa_auth_set_rate_limit(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = ctx;
|
||||
+ struct sta_info *sta;
|
||||
+
|
||||
+ sta = ap_get_sta(hapd, sta_addr);
|
||||
+ if (!sta || !sta->wpa_sm)
|
||||
+ return -1;
|
||||
+
|
||||
+ memcpy(sta->bandwidth, rate, sizeof(*rate));
|
||||
+ hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
||||
+ HOSTAPD_LEVEL_INFO, "rate-limit %d %d", sta->bandwidth[0], sta->bandwidth[1]);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int hostapd_wpa_auth_get_rate_limit(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = ctx;
|
||||
+ struct sta_info *sta;
|
||||
+
|
||||
+ sta = ap_get_sta(hapd, sta_addr);
|
||||
+ if (!sta)
|
||||
+ return -1;
|
||||
+
|
||||
+ memcpy(rate, sta->bandwidth, sizeof(*rate));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
hostapd_wpa_auth_set_identity(void *ctx, const u8 *sta_addr,
|
||||
const u8 *identity, size_t identity_len)
|
||||
@@ -1490,6 +1524,8 @@ int hostapd_setup_wpa(struct hostapd_dat
|
||||
.add_tspec = hostapd_wpa_auth_add_tspec,
|
||||
.set_vlan = hostapd_wpa_auth_set_vlan,
|
||||
.get_vlan = hostapd_wpa_auth_get_vlan,
|
||||
+ .set_rate_limit = hostapd_wpa_auth_set_rate_limit,
|
||||
+ .get_rate_limit = hostapd_wpa_auth_get_rate_limit,
|
||||
.set_identity = hostapd_wpa_auth_set_identity,
|
||||
.get_identity = hostapd_wpa_auth_get_identity,
|
||||
.set_radius_cui = hostapd_wpa_auth_set_radius_cui,
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3215,7 +3215,7 @@ static void handle_auth_pasn_1(struct ho
|
||||
rsn_data.pmkid,
|
||||
pmk_r1, &pmk_r1_len, NULL,
|
||||
NULL, NULL, NULL,
|
||||
- NULL, NULL, NULL);
|
||||
+ NULL, NULL, NULL, NULL);
|
||||
if (ret) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"PASN: FT: Failed getting PMK-R1");
|
||||
--- a/src/ap/wpa_auth_ft.c
|
||||
+++ b/src/ap/wpa_auth_ft.c
|
||||
@@ -375,6 +375,14 @@ static size_t wpa_ft_vlan_len(const stru
|
||||
return tlv_len;
|
||||
}
|
||||
|
||||
+static size_t wpa_ft_rate_limit_len(const struct rate_description *rate)
|
||||
+{
|
||||
+ if (!rate || (!rate->rx && !rate->tx))
|
||||
+ return 0;
|
||||
+
|
||||
+ return (sizeof(struct ft_rrb_tlv) + 8);
|
||||
+}
|
||||
+
|
||||
|
||||
static size_t wpa_ft_vlan_lin(const struct vlan_description *vlan,
|
||||
u8 *start, u8 *endpos)
|
||||
@@ -430,10 +438,48 @@ static size_t wpa_ft_vlan_lin(const stru
|
||||
}
|
||||
|
||||
|
||||
+static size_t wpa_ft_rate_limit_lin(const struct rate_description *rate,
|
||||
+ u8 *start, u8 *endpos)
|
||||
+{
|
||||
+ size_t tlv_len;
|
||||
+ int i, len;
|
||||
+ struct ft_rrb_tlv *hdr;
|
||||
+ u8 *pos = start;
|
||||
+
|
||||
+ if (!rate)
|
||||
+ return 0;
|
||||
+
|
||||
+ tlv_len = 0;
|
||||
+ if (rate->rx || rate->tx) {
|
||||
+ tlv_len += sizeof(*hdr);
|
||||
+ if (start + tlv_len > endpos)
|
||||
+ return tlv_len;
|
||||
+ hdr = (struct ft_rrb_tlv *) pos;
|
||||
+ hdr->type = host_to_le16(FT_RRB_RATE_LIMIT);
|
||||
+ hdr->len = host_to_le16(2 * sizeof(le32));
|
||||
+ pos = start + tlv_len;
|
||||
+
|
||||
+ tlv_len += sizeof(u32);
|
||||
+ if (start + tlv_len > endpos)
|
||||
+ return tlv_len;
|
||||
+ WPA_PUT_LE32(pos, rate->rx);
|
||||
+ pos = start + tlv_len;
|
||||
+ tlv_len += sizeof(u32);
|
||||
+ if (start + tlv_len > endpos)
|
||||
+ return tlv_len;
|
||||
+ WPA_PUT_LE32(pos, rate->tx);
|
||||
+ pos = start + tlv_len;
|
||||
+ }
|
||||
+
|
||||
+ return tlv_len;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int wpa_ft_rrb_lin(const struct tlv_list *tlvs1,
|
||||
const struct tlv_list *tlvs2,
|
||||
const struct vlan_description *vlan,
|
||||
- u8 **plain, size_t *plain_len)
|
||||
+ u8 **plain, size_t *plain_len,
|
||||
+ const struct rate_description *rate)
|
||||
{
|
||||
u8 *pos, *endpos;
|
||||
size_t tlv_len;
|
||||
@@ -441,6 +487,7 @@ static int wpa_ft_rrb_lin(const struct t
|
||||
tlv_len = wpa_ft_tlv_len(tlvs1);
|
||||
tlv_len += wpa_ft_tlv_len(tlvs2);
|
||||
tlv_len += wpa_ft_vlan_len(vlan);
|
||||
+ tlv_len += wpa_ft_rate_limit_len(rate);
|
||||
|
||||
*plain_len = tlv_len;
|
||||
*plain = os_zalloc(tlv_len);
|
||||
@@ -454,6 +501,7 @@ static int wpa_ft_rrb_lin(const struct t
|
||||
pos += wpa_ft_tlv_lin(tlvs1, pos, endpos);
|
||||
pos += wpa_ft_tlv_lin(tlvs2, pos, endpos);
|
||||
pos += wpa_ft_vlan_lin(vlan, pos, endpos);
|
||||
+ pos += wpa_ft_rate_limit_lin(rate, pos, endpos);
|
||||
|
||||
/* sanity check */
|
||||
if (pos != endpos) {
|
||||
@@ -522,7 +570,8 @@ static int wpa_ft_rrb_build(const u8 *ke
|
||||
const struct tlv_list *tlvs_auth,
|
||||
const struct vlan_description *vlan,
|
||||
const u8 *src_addr, u8 type,
|
||||
- u8 **packet, size_t *packet_len)
|
||||
+ u8 **packet, size_t *packet_len,
|
||||
+ const struct rate_description *rate)
|
||||
{
|
||||
u8 *plain = NULL, *auth = NULL, *pos, *tmp;
|
||||
size_t plain_len = 0, auth_len = 0;
|
||||
@@ -530,10 +579,10 @@ static int wpa_ft_rrb_build(const u8 *ke
|
||||
size_t pad_len = 0;
|
||||
|
||||
*packet = NULL;
|
||||
- if (wpa_ft_rrb_lin(tlvs_enc0, tlvs_enc1, vlan, &plain, &plain_len) < 0)
|
||||
+ if (wpa_ft_rrb_lin(tlvs_enc0, tlvs_enc1, vlan, &plain, &plain_len, rate) < 0)
|
||||
goto out;
|
||||
|
||||
- if (wpa_ft_rrb_lin(tlvs_auth, NULL, NULL, &auth, &auth_len) < 0)
|
||||
+ if (wpa_ft_rrb_lin(tlvs_auth, NULL, NULL, &auth, &auth_len, NULL) < 0)
|
||||
goto out;
|
||||
|
||||
*packet_len = sizeof(u16) + auth_len + plain_len;
|
||||
@@ -696,6 +745,24 @@ static int wpa_ft_get_vlan(struct wpa_au
|
||||
}
|
||||
|
||||
|
||||
+static int wpa_ft_get_rate_limit(struct wpa_authenticator *wpa_auth,
|
||||
+ const u8 *sta_addr, struct rate_description *rate)
|
||||
+{
|
||||
+ if (!wpa_auth->cb->get_rate_limit)
|
||||
+ return -1;
|
||||
+ return wpa_auth->cb->get_rate_limit(wpa_auth->cb_ctx, sta_addr, rate);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int wpa_ft_set_rate_limit(struct wpa_authenticator *wpa_auth,
|
||||
+ const u8 *sta_addr, struct rate_description *rate)
|
||||
+{
|
||||
+ if (!wpa_auth->cb->set_rate_limit)
|
||||
+ return -1;
|
||||
+ return wpa_auth->cb->set_rate_limit(wpa_auth->cb_ctx, sta_addr, rate);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
wpa_ft_set_identity(struct wpa_authenticator *wpa_auth, const u8 *sta_addr,
|
||||
const u8 *identity, size_t identity_len)
|
||||
@@ -991,7 +1058,7 @@ wpa_ft_rrb_seq_req(struct wpa_authentica
|
||||
|
||||
if (wpa_ft_rrb_build(key, key_len, NULL, NULL, seq_req_auth, NULL,
|
||||
wpa_auth->addr, FT_PACKET_R0KH_R1KH_SEQ_REQ,
|
||||
- &packet, &packet_len) < 0) {
|
||||
+ &packet, &packet_len, NULL) < 0) {
|
||||
item = NULL; /* some other seq resp might still accept this */
|
||||
goto err;
|
||||
}
|
||||
@@ -1174,6 +1241,7 @@ struct wpa_ft_pmk_r0_sa {
|
||||
u8 spa[ETH_ALEN];
|
||||
int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
|
||||
struct vlan_description *vlan;
|
||||
+ struct rate_description *rate;
|
||||
os_time_t expiration; /* 0 for no expiration */
|
||||
u8 *identity;
|
||||
size_t identity_len;
|
||||
@@ -1192,6 +1260,7 @@ struct wpa_ft_pmk_r1_sa {
|
||||
u8 spa[ETH_ALEN];
|
||||
int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
|
||||
struct vlan_description *vlan;
|
||||
+ struct rate_description *rate;
|
||||
u8 *identity;
|
||||
size_t identity_len;
|
||||
u8 *radius_cui;
|
||||
@@ -1220,6 +1289,7 @@ static void wpa_ft_free_pmk_r0(struct wp
|
||||
|
||||
os_memset(r0->pmk_r0, 0, PMK_LEN_MAX);
|
||||
os_free(r0->vlan);
|
||||
+ os_free(r0->rate);
|
||||
os_free(r0->identity);
|
||||
os_free(r0->radius_cui);
|
||||
os_free(r0);
|
||||
@@ -1273,6 +1343,7 @@ static void wpa_ft_free_pmk_r1(struct wp
|
||||
eloop_cancel_timeout(wpa_ft_expire_pmk_r1, r1, NULL);
|
||||
|
||||
os_memset(r1->pmk_r1, 0, PMK_LEN_MAX);
|
||||
+ os_free(r1->rate);
|
||||
os_free(r1->vlan);
|
||||
os_free(r1->identity);
|
||||
os_free(r1->radius_cui);
|
||||
@@ -1326,7 +1397,8 @@ static int wpa_ft_store_pmk_r0(struct wp
|
||||
const struct vlan_description *vlan,
|
||||
int expires_in, int session_timeout,
|
||||
const u8 *identity, size_t identity_len,
|
||||
- const u8 *radius_cui, size_t radius_cui_len)
|
||||
+ const u8 *radius_cui, size_t radius_cui_len,
|
||||
+ struct rate_description *rate)
|
||||
{
|
||||
struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
|
||||
struct wpa_ft_pmk_r0_sa *r0;
|
||||
@@ -1354,6 +1426,14 @@ static int wpa_ft_store_pmk_r0(struct wp
|
||||
}
|
||||
*r0->vlan = *vlan;
|
||||
}
|
||||
+ if (rate) {
|
||||
+ r0->rate = os_zalloc(sizeof(*rate));
|
||||
+ if (!r0->rate) {
|
||||
+ bin_clear_free(r0, sizeof(*r0));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *r0->rate = *rate;
|
||||
+ }
|
||||
if (identity) {
|
||||
r0->identity = os_malloc(identity_len);
|
||||
if (r0->identity) {
|
||||
@@ -1413,7 +1493,8 @@ static int wpa_ft_store_pmk_r1(struct wp
|
||||
const struct vlan_description *vlan,
|
||||
int expires_in, int session_timeout,
|
||||
const u8 *identity, size_t identity_len,
|
||||
- const u8 *radius_cui, size_t radius_cui_len)
|
||||
+ const u8 *radius_cui, size_t radius_cui_len,
|
||||
+ struct rate_description *rate)
|
||||
{
|
||||
struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
|
||||
int max_expires_in = wpa_auth->conf.r1_max_key_lifetime;
|
||||
@@ -1443,6 +1524,14 @@ static int wpa_ft_store_pmk_r1(struct wp
|
||||
}
|
||||
*r1->vlan = *vlan;
|
||||
}
|
||||
+ if (rate) {
|
||||
+ r1->rate = os_zalloc(sizeof(*rate));
|
||||
+ if (!r1->rate) {
|
||||
+ bin_clear_free(r1, sizeof(*r1));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *r1->rate = *rate;
|
||||
+ }
|
||||
if (identity) {
|
||||
r1->identity = os_malloc(identity_len);
|
||||
if (r1->identity) {
|
||||
@@ -1479,7 +1568,7 @@ int wpa_ft_fetch_pmk_r1(struct wpa_authe
|
||||
struct vlan_description *vlan,
|
||||
const u8 **identity, size_t *identity_len,
|
||||
const u8 **radius_cui, size_t *radius_cui_len,
|
||||
- int *session_timeout)
|
||||
+ int *session_timeout, struct rate_description *rate)
|
||||
{
|
||||
struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
|
||||
struct wpa_ft_pmk_r1_sa *r1;
|
||||
@@ -1499,6 +1588,12 @@ int wpa_ft_fetch_pmk_r1(struct wpa_authe
|
||||
*vlan = *r1->vlan;
|
||||
if (vlan && !r1->vlan)
|
||||
os_memset(vlan, 0, sizeof(*vlan));
|
||||
+ if (rate) {
|
||||
+ if (r1->rate)
|
||||
+ *rate = *r1->rate;
|
||||
+ else
|
||||
+ memset(rate, 0, sizeof(*rate));
|
||||
+ }
|
||||
if (identity && identity_len) {
|
||||
*identity = r1->identity;
|
||||
*identity_len = r1->identity_len;
|
||||
@@ -2025,7 +2120,7 @@ static int wpa_ft_pull_pmk_r1(struct wpa
|
||||
|
||||
if (wpa_ft_rrb_build(key, key_len, req_enc, NULL, req_auth, NULL,
|
||||
sm->wpa_auth->addr, FT_PACKET_R0KH_R1KH_PULL,
|
||||
- &packet, &packet_len) < 0)
|
||||
+ &packet, &packet_len, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
ft_pending_req_ies = wpabuf_alloc_copy(ies, ies_len);
|
||||
@@ -2054,6 +2149,7 @@ int wpa_ft_store_pmk_fils(struct wpa_sta
|
||||
{
|
||||
int expires_in = sm->wpa_auth->conf.r0_key_lifetime;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate;
|
||||
const u8 *identity, *radius_cui;
|
||||
size_t identity_len, radius_cui_len;
|
||||
int session_timeout;
|
||||
@@ -2065,6 +2161,7 @@ int wpa_ft_store_pmk_fils(struct wpa_sta
|
||||
MAC2STR(sm->addr));
|
||||
return -1;
|
||||
}
|
||||
+ wpa_ft_get_rate_limit(sm->wpa_auth, sm->addr, &rate);
|
||||
|
||||
identity_len = wpa_ft_get_identity(sm->wpa_auth, sm->addr, &identity);
|
||||
radius_cui_len = wpa_ft_get_radius_cui(sm->wpa_auth, sm->addr,
|
||||
@@ -2074,7 +2171,7 @@ int wpa_ft_store_pmk_fils(struct wpa_sta
|
||||
return wpa_ft_store_pmk_r0(sm->wpa_auth, sm->addr, pmk_r0, pmk_r0_len,
|
||||
pmk_r0_name, sm->pairwise, &vlan, expires_in,
|
||||
session_timeout, identity, identity_len,
|
||||
- radius_cui, radius_cui_len);
|
||||
+ radius_cui, radius_cui_len, &rate);
|
||||
}
|
||||
|
||||
|
||||
@@ -2095,6 +2192,7 @@ int wpa_auth_derive_ptk_ft(struct wpa_st
|
||||
int psk_local = sm->wpa_auth->conf.ft_psk_generate_local;
|
||||
int expires_in = sm->wpa_auth->conf.r0_key_lifetime;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate;
|
||||
const u8 *identity, *radius_cui;
|
||||
size_t identity_len, radius_cui_len;
|
||||
int session_timeout;
|
||||
@@ -2119,6 +2217,8 @@ int wpa_auth_derive_ptk_ft(struct wpa_st
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ wpa_ft_get_rate_limit(sm->wpa_auth, sm->addr, &rate);
|
||||
+
|
||||
identity_len = wpa_ft_get_identity(sm->wpa_auth, sm->addr, &identity);
|
||||
radius_cui_len = wpa_ft_get_radius_cui(sm->wpa_auth, sm->addr,
|
||||
&radius_cui);
|
||||
@@ -2134,7 +2234,7 @@ int wpa_auth_derive_ptk_ft(struct wpa_st
|
||||
pmk_r0_name,
|
||||
sm->pairwise, &vlan, expires_in,
|
||||
session_timeout, identity, identity_len,
|
||||
- radius_cui, radius_cui_len);
|
||||
+ radius_cui, radius_cui_len, &rate);
|
||||
|
||||
if (wpa_derive_pmk_r1(pmk_r0, pmk_r0_len, pmk_r0_name, r1kh, sm->addr,
|
||||
pmk_r1, sm->pmk_r1_name) < 0)
|
||||
@@ -2143,7 +2243,8 @@ int wpa_auth_derive_ptk_ft(struct wpa_st
|
||||
wpa_ft_store_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1, pmk_r1_len,
|
||||
sm->pmk_r1_name, sm->pairwise, &vlan,
|
||||
expires_in, session_timeout, identity,
|
||||
- identity_len, radius_cui, radius_cui_len);
|
||||
+ identity_len, radius_cui, radius_cui_len,
|
||||
+ &rate);
|
||||
|
||||
return wpa_pmk_r1_to_ptk(pmk_r1, pmk_r1_len, sm->SNonce, sm->ANonce,
|
||||
sm->addr, sm->wpa_auth->addr, sm->pmk_r1_name,
|
||||
@@ -2986,7 +3087,8 @@ static int wpa_ft_local_derive_pmk_r1(st
|
||||
const u8 **identity, size_t *identity_len,
|
||||
const u8 **radius_cui,
|
||||
size_t *radius_cui_len,
|
||||
- int *out_session_timeout)
|
||||
+ int *out_session_timeout,
|
||||
+ struct rate_description *rate)
|
||||
{
|
||||
struct wpa_auth_config *conf = &wpa_auth->conf;
|
||||
const struct wpa_ft_pmk_r0_sa *r0;
|
||||
@@ -3023,7 +3125,8 @@ static int wpa_ft_local_derive_pmk_r1(st
|
||||
pmk_r1_name,
|
||||
sm->pairwise, r0->vlan, expires_in, session_timeout,
|
||||
r0->identity, r0->identity_len,
|
||||
- r0->radius_cui, r0->radius_cui_len);
|
||||
+ r0->radius_cui, r0->radius_cui_len,
|
||||
+ r0->rate);
|
||||
|
||||
*out_pairwise = sm->pairwise;
|
||||
if (vlan) {
|
||||
@@ -3033,6 +3136,13 @@ static int wpa_ft_local_derive_pmk_r1(st
|
||||
os_memset(vlan, 0, sizeof(*vlan));
|
||||
}
|
||||
|
||||
+ if (rate) {
|
||||
+ if (r0->rate)
|
||||
+ *rate = *r0->rate;
|
||||
+ else
|
||||
+ os_memset(rate, 0, sizeof(*rate));
|
||||
+ }
|
||||
+
|
||||
if (identity && identity_len) {
|
||||
*identity = r0->identity;
|
||||
*identity_len = r0->identity_len;
|
||||
@@ -3063,6 +3173,7 @@ static int wpa_ft_process_auth_req(struc
|
||||
u8 *pos, *end;
|
||||
int pairwise, session_timeout = 0;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate = {};
|
||||
const u8 *identity, *radius_cui;
|
||||
size_t identity_len = 0, radius_cui_len = 0;
|
||||
int use_sha384;
|
||||
@@ -3152,7 +3263,7 @@ static int wpa_ft_process_auth_req(struc
|
||||
} else if (wpa_ft_fetch_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1_name,
|
||||
pmk_r1, &pmk_r1_len, &pairwise, &vlan,
|
||||
&identity, &identity_len, &radius_cui,
|
||||
- &radius_cui_len, &session_timeout) < 0) {
|
||||
+ &radius_cui_len, &session_timeout, &rate) < 0) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"FT: No PMK-R1 available in local cache for the requested PMKR1Name");
|
||||
if (wpa_ft_local_derive_pmk_r1(sm->wpa_auth, sm,
|
||||
@@ -3161,7 +3272,7 @@ static int wpa_ft_process_auth_req(struc
|
||||
pmk_r1_name, pmk_r1, &pairwise,
|
||||
&vlan, &identity, &identity_len,
|
||||
&radius_cui, &radius_cui_len,
|
||||
- &session_timeout) == 0) {
|
||||
+ &session_timeout, &rate) == 0) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"FT: Generated PMK-R1 based on local PMK-R0");
|
||||
goto pmk_r1_derived;
|
||||
@@ -3219,6 +3330,7 @@ pmk_r1_derived:
|
||||
wpa_printf(MSG_DEBUG, "FT: Failed to configure VLAN");
|
||||
return WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
}
|
||||
+ wpa_ft_set_rate_limit(sm->wpa_auth, sm->addr, &rate);
|
||||
if (wpa_ft_set_identity(sm->wpa_auth, sm->addr,
|
||||
identity, identity_len) < 0 ||
|
||||
wpa_ft_set_radius_cui(sm->wpa_auth, sm->addr,
|
||||
@@ -3791,7 +3903,7 @@ static int wpa_ft_rrb_build_r0(const u8
|
||||
|
||||
ret = wpa_ft_rrb_build(key, key_len, tlvs, sess_tlv, tlv_auth,
|
||||
pmk_r0->vlan, src_addr, type,
|
||||
- packet, packet_len);
|
||||
+ packet, packet_len, pmk_r0->rate);
|
||||
|
||||
forced_memzero(pmk_r1, sizeof(pmk_r1));
|
||||
|
||||
@@ -3931,7 +4043,7 @@ static int wpa_ft_rrb_rx_pull(struct wpa
|
||||
ret = wpa_ft_rrb_build(key, key_len, resp, NULL, resp_auth,
|
||||
NULL, wpa_auth->addr,
|
||||
FT_PACKET_R0KH_R1KH_RESP,
|
||||
- &packet, &packet_len);
|
||||
+ &packet, &packet_len, NULL);
|
||||
} else {
|
||||
ret = wpa_ft_rrb_build_r0(key, key_len, resp, r0, f_r1kh_id,
|
||||
f_s1kh_id, resp_auth, wpa_auth->addr,
|
||||
@@ -3983,11 +4095,15 @@ static int wpa_ft_rrb_rx_r1(struct wpa_a
|
||||
size_t f_expires_in_len;
|
||||
size_t f_identity_len, f_radius_cui_len;
|
||||
size_t f_session_timeout_len;
|
||||
+ size_t f_rate_len;
|
||||
+ const u8 *f_rate;
|
||||
int pairwise;
|
||||
int ret = -1;
|
||||
int expires_in;
|
||||
int session_timeout;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate;
|
||||
+ int has_rate = 0;
|
||||
size_t pmk_r1_len;
|
||||
|
||||
RRB_GET_AUTH(FT_RRB_R0KH_ID, r0kh_id, msgtype, -1);
|
||||
@@ -4096,6 +4212,13 @@ static int wpa_ft_rrb_rx_r1(struct wpa_a
|
||||
wpa_printf(MSG_DEBUG, "FT: vlan %d%s",
|
||||
le_to_host16(vlan.untagged), vlan.tagged[0] ? "+" : "");
|
||||
|
||||
+ RRB_GET_OPTIONAL(FT_RRB_RATE_LIMIT, rate, msgtype, 2 * sizeof(le32));
|
||||
+ if (f_rate) {
|
||||
+ memcpy(&rate, f_rate, sizeof(rate));
|
||||
+ rate.rx = le_to_host32(rate.rx);
|
||||
+ rate.tx = le_to_host32(rate.tx);
|
||||
+ has_rate = 1;
|
||||
+ };
|
||||
RRB_GET_OPTIONAL(FT_RRB_IDENTITY, identity, msgtype, -1);
|
||||
if (f_identity)
|
||||
wpa_hexdump_ascii(MSG_DEBUG, "FT: Identity", f_identity,
|
||||
@@ -4118,7 +4241,7 @@ static int wpa_ft_rrb_rx_r1(struct wpa_a
|
||||
f_pmk_r1_name,
|
||||
pairwise, &vlan, expires_in, session_timeout,
|
||||
f_identity, f_identity_len, f_radius_cui,
|
||||
- f_radius_cui_len) < 0)
|
||||
+ f_radius_cui_len, has_rate ? &rate : 0) < 0)
|
||||
goto out;
|
||||
|
||||
ret = 0;
|
||||
@@ -4431,7 +4554,7 @@ static int wpa_ft_rrb_rx_seq_req(struct
|
||||
|
||||
if (wpa_ft_rrb_build(key, key_len, NULL, NULL, seq_resp_auth, NULL,
|
||||
wpa_auth->addr, FT_PACKET_R0KH_R1KH_SEQ_RESP,
|
||||
- &packet, &packet_len) < 0)
|
||||
+ &packet, &packet_len, NULL) < 0)
|
||||
goto out;
|
||||
|
||||
wpa_ft_rrb_oui_send(wpa_auth, src_addr,
|
||||
@@ -1,147 +0,0 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -469,6 +469,7 @@ static void handle_auth_ft_finish(void *
|
||||
|
||||
hostapd_logger(hapd, dst, HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_DEBUG, "authentication OK (FT)");
|
||||
+ hostapd_ubus_notify(hapd, "ft-finish", sta->addr);
|
||||
sta->flags |= WLAN_STA_AUTH;
|
||||
mlme_authenticate_indication(hapd, sta);
|
||||
}
|
||||
@@ -5435,6 +5436,8 @@ static void handle_assoc(struct hostapd_
|
||||
}
|
||||
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
+ if (sta && reassoc)
|
||||
+ memcpy(sta->origin_ap, mgmt->u.reassoc_req.current_ap, 6);
|
||||
#ifdef CONFIG_IEEE80211R_AP
|
||||
if (sta && sta->auth_alg == WLAN_AUTH_FT &&
|
||||
(sta->flags & WLAN_STA_AUTH) == 0) {
|
||||
@@ -5588,6 +5591,7 @@ static void handle_assoc(struct hostapd_
|
||||
.type = HOSTAPD_UBUS_ASSOC_REQ,
|
||||
.mgmt_frame = mgmt,
|
||||
.ssi_signal = rssi,
|
||||
+ .reassoc = reassoc,
|
||||
};
|
||||
|
||||
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
|
||||
@@ -6414,7 +6418,7 @@ static void handle_assoc_cb(struct hosta
|
||||
* Open, static WEP, FT protocol, or FILS; no separate
|
||||
* authorization step.
|
||||
*/
|
||||
- ap_sta_set_authorized(hapd, sta, 1);
|
||||
+ _ap_sta_set_authorized(hapd, sta, 1, reassoc);
|
||||
}
|
||||
|
||||
if (reassoc)
|
||||
--- a/src/ap/ubus.c
|
||||
+++ b/src/ap/ubus.c
|
||||
@@ -1870,6 +1870,8 @@ int hostapd_ubus_handle_event(struct hos
|
||||
if (req->ssi_signal)
|
||||
blobmsg_add_u32(&b, "signal", req->ssi_signal);
|
||||
blobmsg_add_u32(&b, "freq", hapd->iface->freq);
|
||||
+ if (req->reassoc && req->mgmt_frame)
|
||||
+ blobmsg_add_macaddr(&b, "origin", req->mgmt_frame->u.reassoc_req.current_ap);
|
||||
|
||||
if (req->elems) {
|
||||
if(req->elems->ht_capabilities)
|
||||
@@ -1940,6 +1942,7 @@ void hostapd_ubus_notify(struct hostapd_
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "address", addr);
|
||||
blobmsg_add_string(&b, "ifname", hapd->conf->iface);
|
||||
+ blobmsg_printf(&b, "target", MACSTR, MAC2STR(hapd->conf->bssid));
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1);
|
||||
}
|
||||
@@ -1958,7 +1961,7 @@ void hostapd_ubus_notify_csa(struct host
|
||||
}
|
||||
|
||||
|
||||
-void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
+void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta, int reassoc)
|
||||
{
|
||||
if (!hapd->ubus.obj.has_subscribers)
|
||||
return;
|
||||
@@ -1975,6 +1978,9 @@ void hostapd_ubus_notify_authorized(stru
|
||||
blobmsg_add_u32(&b, "", sta->bandwidth[1]);
|
||||
blobmsg_close_array(&b, r);
|
||||
}
|
||||
+ if (reassoc)
|
||||
+ blobmsg_add_macaddr(&b, "origin", sta->origin_ap);
|
||||
+ blobmsg_printf(&b, "target", MACSTR, MAC2STR(hapd->conf->bssid));
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "sta-authorized", b.head, -1);
|
||||
}
|
||||
--- a/src/ap/ubus.h
|
||||
+++ b/src/ap/ubus.h
|
||||
@@ -22,6 +22,7 @@ struct hostapd_ubus_request {
|
||||
const struct ieee802_11_elems *elems;
|
||||
int ssi_signal; /* dBm */
|
||||
const u8 *addr;
|
||||
+ int reassoc;
|
||||
};
|
||||
|
||||
struct hostapd_iface;
|
||||
@@ -49,7 +50,7 @@ void hostapd_ubus_remove_vlan(struct hos
|
||||
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req);
|
||||
void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac);
|
||||
-void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
+void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta, int reassoc);
|
||||
void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
|
||||
const u8 *addr, u8 token, u8 rep_mode,
|
||||
struct rrm_measurement_beacon_report *rep,
|
||||
--- a/src/ap/sta_info.c
|
||||
+++ b/src/ap/sta_info.c
|
||||
@@ -1265,8 +1265,8 @@ const char * ap_sta_wpa_get_keyid(struct
|
||||
}
|
||||
|
||||
|
||||
-void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
- int authorized)
|
||||
+void _ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
+ int authorized, int reassoc)
|
||||
{
|
||||
const u8 *dev_addr = NULL;
|
||||
char buf[100];
|
||||
@@ -1346,7 +1346,7 @@ void ap_sta_set_authorized(struct hostap
|
||||
" keyid=%s", keyid);
|
||||
}
|
||||
|
||||
- hostapd_ubus_notify_authorized(hapd, sta);
|
||||
+ hostapd_ubus_notify_authorized(hapd, sta, reassoc);
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s",
|
||||
buf, ip_addr, keyid_buf, alg_buf);
|
||||
|
||||
@@ -1375,6 +1375,11 @@ void ap_sta_set_authorized(struct hostap
|
||||
}
|
||||
#endif /* CONFIG_FST */
|
||||
}
|
||||
+void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
+ int authorized)
|
||||
+{
|
||||
+ _ap_sta_set_authorized(hapd, sta, authorized, 0);
|
||||
+}
|
||||
|
||||
|
||||
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -106,6 +106,7 @@ struct sta_info {
|
||||
struct sta_info *next; /* next entry in sta list */
|
||||
struct sta_info *hnext; /* next entry in hash table list */
|
||||
u8 addr[6];
|
||||
+ u8 origin_ap[6];
|
||||
be32 ipaddr;
|
||||
struct dl_list ip6addr; /* list head for struct ip6addr */
|
||||
u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
|
||||
@@ -392,6 +393,9 @@ const char * ap_sta_wpa_get_keyid(struct
|
||||
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
const u8 *addr, u16 reason);
|
||||
|
||||
+void _ap_sta_set_authorized(struct hostapd_data *hapd,
|
||||
+ struct sta_info *sta, int authorized,
|
||||
+ int reassoc);
|
||||
void ap_sta_set_authorized(struct hostapd_data *hapd,
|
||||
struct sta_info *sta, int authorized);
|
||||
static inline int ap_sta_is_authorized(struct sta_info *sta)
|
||||
@@ -1,53 +0,0 @@
|
||||
From 98b6503b87bb36bf2f5ae16e52e230e8870c867f Mon Sep 17 00:00:00 2001
|
||||
From: Venkat Chimata <venkata@shasta.cloud>
|
||||
Date: Fri, 28 Jun 2024 14:39:31 +0530
|
||||
Subject: [PATCH] hostapd: Fix DVLAN + 802.1x issue
|
||||
|
||||
In case of swconfig switches, the basename of the interface should be based on the last dot.
|
||||
Earlier it was done based on the first dot, which would result in incorrect basename.
|
||||
For example if the interface name is eth0.4087 then the vlan->ifname would be eth0.4087. (A dot at the end) .
|
||||
Before this patch, the basename was returned as eth0. It should be eth0.4087
|
||||
|
||||
Also fixed the return code by adding a default value of 0 and removed an unncessary check
|
||||
for if_add before ubus add call.
|
||||
|
||||
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
|
||||
---
|
||||
src/ap/vlan_init.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/ap/vlan_init.c b/src/ap/vlan_init.c
|
||||
index 3e27671..cfeb1e5 100644
|
||||
--- a/src/ap/vlan_init.c
|
||||
+++ b/src/ap/vlan_init.c
|
||||
@@ -23,7 +23,8 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
int existsok)
|
||||
{
|
||||
bool vlan_exists = iface_exists(vlan->ifname);
|
||||
- int ret;
|
||||
+ int ret = 0;
|
||||
+
|
||||
#ifdef CONFIG_WEP
|
||||
int i;
|
||||
|
||||
@@ -38,7 +39,7 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (!hapd->driver || !hapd->driver->if_add) {
|
||||
- char *dot = strstr(vlan->ifname, ".");
|
||||
+ char *dot = strrchr(vlan->ifname, '.');
|
||||
if (dot)
|
||||
*dot = '\0';
|
||||
ret = 0;
|
||||
@@ -59,7 +60,7 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
if (hapd->wpa_auth)
|
||||
ret = wpa_auth_ensure_group(hapd->wpa_auth, vlan->vlan_id);
|
||||
|
||||
- if (!ret && !vlan_exists && hapd->driver->if_add)
|
||||
+ if (!ret && !vlan_exists)
|
||||
hostapd_ubus_add_vlan(hapd, vlan);
|
||||
|
||||
if (ret == 0)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -7740,7 +7740,7 @@ enum colocation_mode get_colocation_mode
|
||||
}
|
||||
|
||||
|
||||
-size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type)
|
||||
+size_t _hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type, int add_6g)
|
||||
{
|
||||
size_t len = 0, current_len = 0;
|
||||
enum colocation_mode mode = get_colocation_mode(hapd);
|
||||
@@ -7753,7 +7753,7 @@ size_t hostapd_eid_rnr_len(struct hostap
|
||||
/* fallthrough */
|
||||
|
||||
case WLAN_FC_STYPE_PROBE_RESP:
|
||||
- if (mode == COLOCATED_LOWER_BAND)
|
||||
+ if (add_6g && mode == COLOCATED_LOWER_BAND)
|
||||
len += hostapd_eid_rnr_colocation_len(hapd,
|
||||
¤t_len);
|
||||
|
||||
@@ -7776,6 +7776,10 @@ size_t hostapd_eid_rnr_len(struct hostap
|
||||
return len;
|
||||
}
|
||||
|
||||
+size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type)
|
||||
+{
|
||||
+ return _hostapd_eid_rnr_len(hapd, type, 1);
|
||||
+}
|
||||
|
||||
static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd,
|
||||
struct hostapd_data *reporting_hapd,
|
||||
@@ -7938,7 +7942,7 @@ static u8 *hostapd_eid_neighbor_report_d
|
||||
}
|
||||
|
||||
|
||||
-u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type)
|
||||
+u8 * _hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type, int add_6g)
|
||||
{
|
||||
u8 *eid_start = eid;
|
||||
size_t current_len = 0;
|
||||
@@ -7955,7 +7959,7 @@ u8 * hostapd_eid_rnr(struct hostapd_data
|
||||
/* fallthrough */
|
||||
|
||||
case WLAN_FC_STYPE_PROBE_RESP:
|
||||
- if (mode == COLOCATED_LOWER_BAND)
|
||||
+ if (add_6g && mode == COLOCATED_LOWER_BAND)
|
||||
eid = hostapd_eid_rnr_colocation(hapd, eid,
|
||||
¤t_len);
|
||||
|
||||
@@ -7981,4 +7985,9 @@ u8 * hostapd_eid_rnr(struct hostapd_data
|
||||
return eid;
|
||||
}
|
||||
|
||||
+u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type)
|
||||
+{
|
||||
+ return _hostapd_eid_rnr(hapd, eid, type, 1);
|
||||
+}
|
||||
+
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
--- a/src/ap/ieee802_11.h
|
||||
+++ b/src/ap/ieee802_11.h
|
||||
@@ -135,6 +135,7 @@ u8 * hostapd_eid_time_zone(struct hostap
|
||||
int hostapd_update_time_adv(struct hostapd_data *hapd);
|
||||
void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr);
|
||||
u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid);
|
||||
+u8 * _hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type, int add_6g);
|
||||
u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type);
|
||||
u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd,
|
||||
struct hostapd_data *req_bss, u8 *eid, u8 *end,
|
||||
@@ -146,6 +147,7 @@ size_t hostapd_eid_multiple_bssid_len(st
|
||||
struct hostapd_data *req_bss, u32 type,
|
||||
const u8 *known_bssids,
|
||||
u8 known_bssids_len, size_t *rnr_len);
|
||||
+size_t _hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type, int add_6g);
|
||||
size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type);
|
||||
int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
#ifdef CONFIG_SAE
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -463,7 +463,8 @@ static u8 * hostapd_eid_supported_op_cla
|
||||
static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
|
||||
const struct ieee80211_mgmt *req,
|
||||
int is_p2p, size_t *resp_len,
|
||||
- const u8 *known_bssids, u8 known_bssids_len)
|
||||
+ const u8 *known_bssids, u8 known_bssids_len,
|
||||
+ int add_6g)
|
||||
{
|
||||
struct hostapd_data *req_bss = NULL;
|
||||
struct ieee80211_mgmt *resp;
|
||||
@@ -523,7 +524,7 @@ static u8 * hostapd_gen_probe_resp(struc
|
||||
known_bssids,
|
||||
known_bssids_len,
|
||||
NULL);
|
||||
- buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP);
|
||||
+ buflen += _hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP, add_6g);
|
||||
|
||||
resp = os_zalloc(buflen);
|
||||
if (resp == NULL)
|
||||
@@ -706,7 +707,7 @@ static u8 * hostapd_gen_probe_resp(struc
|
||||
pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos);
|
||||
pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos);
|
||||
pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos);
|
||||
- pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP);
|
||||
+ pos = _hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP, add_6g);
|
||||
|
||||
if (hapd->conf->vendor_elements) {
|
||||
os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements),
|
||||
@@ -930,6 +931,7 @@ void handle_probe_req(struct hostapd_dat
|
||||
.ssi_signal = ssi_signal,
|
||||
.elems = &elems,
|
||||
};
|
||||
+ int ubus_response;
|
||||
|
||||
if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
|
||||
ssi_signal < hapd->iconf->rssi_ignore_probe_request)
|
||||
@@ -1118,7 +1120,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
- if (hostapd_ubus_handle_event(hapd, &req)) {
|
||||
+ ubus_response = hostapd_ubus_handle_event(hapd, &req);
|
||||
+
|
||||
+ if (ubus_response == 2) {
|
||||
+ wpa_printf(MSG_DEBUG, "Probe request for " MACSTR " without 6G RNR.\n",
|
||||
+ MAC2STR(mgmt->sa));
|
||||
+ } else if (ubus_response) {
|
||||
wpa_printf(MSG_DEBUG, "Probe request for " MACSTR " rejected by ubus handler.\n",
|
||||
MAC2STR(mgmt->sa));
|
||||
return;
|
||||
@@ -1170,7 +1177,7 @@ void handle_probe_req(struct hostapd_dat
|
||||
|
||||
resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
|
||||
&resp_len, elems.known_bssids,
|
||||
- elems.known_bssids_len);
|
||||
+ elems.known_bssids_len, ubus_response == 2 ? 0 : 1);
|
||||
if (resp == NULL)
|
||||
return;
|
||||
|
||||
@@ -1239,7 +1246,7 @@ static u8 * hostapd_probe_resp_offloads(
|
||||
"this");
|
||||
|
||||
/* Generate a Probe Response template for the non-P2P case */
|
||||
- return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, NULL, 0);
|
||||
+ return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, NULL, 0, 1);
|
||||
}
|
||||
|
||||
#endif /* NEED_AP_MLME */
|
||||
@@ -1269,7 +1276,7 @@ static u8 * hostapd_unsol_bcast_probe_re
|
||||
|
||||
return hostapd_gen_probe_resp(hapd, NULL, 0,
|
||||
¶ms->unsol_bcast_probe_resp_tmpl_len,
|
||||
- NULL, 0);
|
||||
+ NULL, 0, 1);
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211AX */
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/src/radius/radius.c
|
||||
+++ b/src/radius/radius.c
|
||||
@@ -755,7 +755,7 @@ struct radius_attr_hdr * radius_msg_add_
|
||||
ext->length = sizeof(*ext) + 1 + alen;
|
||||
ext->ext_type = ext_type;
|
||||
wpabuf_put_u8(msg->buf, data_len > alen ? 0x80 : 0);
|
||||
- wpabuf_put_data(msg->buf, data, data_len);
|
||||
+ wpabuf_put_data(msg->buf, data, alen);
|
||||
data += alen;
|
||||
data_len -= alen;
|
||||
if (radius_msg_add_attr_to_array(
|
||||
@@ -1,69 +0,0 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3154,6 +3154,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->ft_psk_generate_local = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ft_l2_refresh") == 0) {
|
||||
bss->ft_l2_refresh = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "ft_key") == 0) {
|
||||
+ strncpy(bss->ft_key, pos, sizeof(bss->ft_key));
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
#ifndef CONFIG_NO_CTRL_IFACE
|
||||
} else if (os_strcmp(buf, "ctrl_interface") == 0) {
|
||||
@@ -4996,8 +4998,22 @@ struct hostapd_config * hostapd_config_r
|
||||
|
||||
fclose(f);
|
||||
|
||||
- for (i = 0; i < conf->num_bss; i++)
|
||||
+ for (i = 0; i < conf->num_bss; i++) {
|
||||
+ if (*conf->bss[i]->ft_key) {
|
||||
+ u8 buffer[128];
|
||||
+ sprintf(buffer, "%02X:%02X:%02X:%02X:%02X:%02X %02X%02X%02X%02X%02X%02X %s", MAC2STR(conf->bss[i]->bssid), MAC2STR(conf->bss[i]->bssid), conf->bss[i]->ft_key);
|
||||
+ add_r0kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "%02X:%02X:%02X:%02X:%02X:%02X %02X:%02X:%02X:%02X:%02X:%02X %s", MAC2STR(conf->bss[i]->bssid), MAC2STR(conf->bss[i]->bssid), conf->bss[i]->ft_key);
|
||||
+ add_r1kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "ff:ff:ff:ff:ff:ff * %s", conf->bss[i]->ft_key);
|
||||
+ add_r0kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "00:00:00:00:00:00 00:00:00:00:00:00 %s", conf->bss[i]->ft_key);
|
||||
+ add_r1kh(conf->bss[i], buffer);
|
||||
+ hexstr2bin(conf->bss[i]->bssid, conf->bss[i]->r1_key_holder, FT_R1KH_ID_LEN);
|
||||
+ conf->bss[i]->r0_key_holder_bssid = 1;
|
||||
+ }
|
||||
hostapd_set_security_params(conf->bss[i], 1);
|
||||
+ }
|
||||
|
||||
if (hostapd_config_check(conf, 1))
|
||||
errors++;
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -403,6 +403,7 @@ struct hostapd_bss_config {
|
||||
int ft_psk_generate_local;
|
||||
int ft_l2_refresh;
|
||||
int r1_max_key_lifetime;
|
||||
+ u8 ft_key[65];
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
char *ctrl_interface; /* directory for UNIX domain sockets */
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -390,6 +390,7 @@ struct hostapd_bss_config {
|
||||
/* IEEE 802.11r - Fast BSS Transition */
|
||||
u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
|
||||
u8 r1_key_holder[FT_R1KH_ID_LEN];
|
||||
+ int r0_key_holder_bssid;
|
||||
u32 r0_key_lifetime; /* PMK-R0 lifetime seconds */
|
||||
int rkh_pos_timeout;
|
||||
int rkh_neg_timeout;
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -80,7 +80,10 @@ static void hostapd_wpa_auth_conf(struct
|
||||
os_memcpy(wconf->ssid, conf->ssid.ssid, wconf->ssid_len);
|
||||
os_memcpy(wconf->mobility_domain, conf->mobility_domain,
|
||||
MOBILITY_DOMAIN_ID_LEN);
|
||||
- if (conf->nas_identifier &&
|
||||
+ if (1 || conf->r0_key_holder_bssid) {
|
||||
+ sprintf(wconf->r0_key_holder, "%02X%02X%02X%02X%02X%02X", MAC2STR(conf->bssid));
|
||||
+ wconf->r0_key_holder_len = 12;
|
||||
+ } else if (conf->nas_identifier &&
|
||||
os_strlen(conf->nas_identifier) <= FT_R0KH_ID_MAX_LEN) {
|
||||
wconf->r0_key_holder_len = os_strlen(conf->nas_identifier);
|
||||
os_memcpy(wconf->r0_key_holder, conf->nas_identifier,
|
||||
@@ -1830,8 +1830,7 @@ ubus_event_cb(struct ubus_notify_request *req, int idx, int ret)
|
||||
{
|
||||
struct ubus_event_req *ureq = container_of(req, struct ubus_event_req, nreq);
|
||||
|
||||
if (!ureq->resp)
|
||||
ureq->resp = ret;
|
||||
ureq->resp = ret;
|
||||
}
|
||||
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
|
||||
@@ -1864,7 +1863,6 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "address", addr);
|
||||
blobmsg_add_string(&b, "ifname", hapd->conf->iface);
|
||||
if (req->mgmt_frame)
|
||||
blobmsg_add_macaddr(&b, "target", req->mgmt_frame->da);
|
||||
if (req->ssi_signal)
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "ap_drv_ops.h"
|
||||
#include "dfs.h"
|
||||
#include "acs.h"
|
||||
#include "ieee802_11_auth.h"
|
||||
#include <libubox/uloop.h>
|
||||
|
||||
static uc_resource_type_t *global_type, *bss_type, *iface_type;
|
||||
@@ -256,7 +255,6 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
|
||||
|
||||
hostapd_setup_bss(hapd, hapd == iface->bss[0], true);
|
||||
hostapd_ucode_update_interfaces();
|
||||
hostapd_owe_update_trans(iface);
|
||||
|
||||
done:
|
||||
ret = 0;
|
||||
@@ -377,7 +375,6 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs)
|
||||
conf->bss[idx] = NULL;
|
||||
ret = hostapd_ucode_bss_get_uval(hapd);
|
||||
hostapd_ucode_update_interfaces();
|
||||
hostapd_owe_update_trans(iface);
|
||||
goto out;
|
||||
|
||||
deinit_ctrl:
|
||||
@@ -605,7 +602,6 @@ out:
|
||||
|
||||
ieee802_11_set_beacon(hapd);
|
||||
}
|
||||
hostapd_owe_update_trans(iface);
|
||||
|
||||
return ucv_boolean_new(true);
|
||||
}
|
||||
@@ -697,7 +693,6 @@ uc_hostapd_bss_rename(uc_vm_t *vm, size_t nargs)
|
||||
hostapd_ubus_add_bss(hapd);
|
||||
|
||||
hostapd_ucode_update_interfaces();
|
||||
hostapd_owe_update_trans(hapd->iface);
|
||||
out:
|
||||
if (interfaces->ctrl_iface_init)
|
||||
interfaces->ctrl_iface_init(hapd);
|
||||
@@ -705,113 +700,6 @@ out:
|
||||
return ret ? NULL : ucv_boolean_new(true);
|
||||
}
|
||||
|
||||
int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
char addr[sizeof(MACSTR)];
|
||||
uc_value_t *val, *cur;
|
||||
int ret = 0;
|
||||
|
||||
if (wpa_ucode_call_prepare("sta_auth"))
|
||||
return 0;
|
||||
|
||||
uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface)));
|
||||
|
||||
snprintf(addr, sizeof(addr), MACSTR, MAC2STR(sta->addr));
|
||||
val = ucv_string_new(addr);
|
||||
uc_value_push(ucv_get(val));
|
||||
|
||||
val = wpa_ucode_call(2);
|
||||
|
||||
cur = ucv_object_get(val, "psk", NULL);
|
||||
if (ucv_type(cur) == UC_ARRAY) {
|
||||
struct hostapd_sta_wpa_psk_short *p, **next;
|
||||
size_t len = ucv_array_length(cur);
|
||||
|
||||
next = &sta->psk;
|
||||
hostapd_free_psk_list(*next);
|
||||
*next = NULL;
|
||||
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
uc_value_t *cur_psk;
|
||||
const char *str;
|
||||
size_t str_len;
|
||||
|
||||
cur_psk = ucv_array_get(cur, i);
|
||||
str = ucv_string_get(cur_psk);
|
||||
str_len = strlen(str);
|
||||
if (!str || str_len < 8 || str_len > 64)
|
||||
continue;
|
||||
|
||||
p = os_zalloc(sizeof(*p));
|
||||
if (len == 64) {
|
||||
if (hexstr2bin(str, p->psk, PMK_LEN) < 0) {
|
||||
free(p);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
p->is_passphrase = 1;
|
||||
memcpy(p->passphrase, str, str_len + 1);
|
||||
}
|
||||
|
||||
*next = p;
|
||||
next = &p->next;
|
||||
}
|
||||
}
|
||||
|
||||
cur = ucv_object_get(val, "force_psk", NULL);
|
||||
sta->use_sta_psk = ucv_is_truish(cur);
|
||||
|
||||
cur = ucv_object_get(val, "status", NULL);
|
||||
if (ucv_type(cur) == UC_INTEGER)
|
||||
ret = ucv_int64_get(cur);
|
||||
|
||||
ucv_put(val);
|
||||
ucv_gc(vm);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
struct hostapd_sta_wpa_psk_short *psk = sta->psk;
|
||||
char addr[sizeof(MACSTR)];
|
||||
uc_value_t *val, *cur;
|
||||
int ret = 0;
|
||||
|
||||
if (wpa_ucode_call_prepare("sta_connected"))
|
||||
return;
|
||||
|
||||
uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface)));
|
||||
|
||||
snprintf(addr, sizeof(addr), MACSTR, MAC2STR(sta->addr));
|
||||
val = ucv_string_new(addr);
|
||||
uc_value_push(ucv_get(val));
|
||||
|
||||
val = ucv_object_new(vm);
|
||||
if (sta->psk_idx)
|
||||
ucv_object_add(val, "psk_idx", ucv_int64_new(sta->psk_idx - 1));
|
||||
if (sta->psk)
|
||||
ucv_object_add(val, "psk", ucv_string_new(sta->psk->passphrase));
|
||||
uc_value_push(ucv_get(val));
|
||||
|
||||
val = wpa_ucode_call(3);
|
||||
if (ucv_type(val) != UC_OBJECT)
|
||||
goto out;
|
||||
|
||||
cur = ucv_object_get(val, "vlan", NULL);
|
||||
if (ucv_type(cur) == UC_INTEGER) {
|
||||
struct vlan_description vdesc = {
|
||||
.notempty = 1,
|
||||
.untagged = ucv_int64_get(cur),
|
||||
};
|
||||
|
||||
ap_sta_set_vlan(hapd, sta, &vdesc);
|
||||
ap_sta_bind_vlan(hapd, sta);
|
||||
}
|
||||
|
||||
out:
|
||||
ucv_put(val);
|
||||
}
|
||||
|
||||
int hostapd_ucode_init(struct hapd_interfaces *ifaces)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,6 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces);
|
||||
|
||||
void hostapd_ucode_free(void);
|
||||
void hostapd_ucode_free_iface(struct hostapd_iface *iface);
|
||||
int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
void hostapd_ucode_add_bss(struct hostapd_data *hapd);
|
||||
void hostapd_ucode_free_bss(struct hostapd_data *hapd);
|
||||
void hostapd_ucode_reload_bss(struct hostapd_data *hapd);
|
||||
@@ -46,13 +44,6 @@ static inline void hostapd_ucode_free_iface(struct hostapd_iface *iface)
|
||||
static inline void hostapd_ucode_reload_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
}
|
||||
static inline int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
}
|
||||
static inline void hostapd_ucode_add_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -7,29 +7,16 @@ board_config_update
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
wallys,dr5018)
|
||||
ucidef_set_led_netdev "wan" "wan" "green:uplink" "eth0"
|
||||
;;
|
||||
edgecore,eap104)
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt"
|
||||
ucidef_set_led_netdev "wan" "wan" "yellow:uplink" "eth0"
|
||||
ucidef_set_led_default "power" "POWER" "green:power" "on"
|
||||
;;
|
||||
cig,wf186h|\
|
||||
cig,wf186w)
|
||||
ucidef_set_led_default "power" "POWER" "green:status" "on"
|
||||
;;
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1)
|
||||
ucidef_set_led_default "power" "POWER" "sys:blue" "on"
|
||||
;;
|
||||
edgecore,oap101|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e|\
|
||||
edgecore,oap101e-6e)
|
||||
ucidef_set_led_netdev "wan" "wan" "red:ethernet" "eth1"
|
||||
ucidef_set_led_default "power" "POWER" "blue:management" "on"
|
||||
;;
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w)
|
||||
|
||||
@@ -18,12 +18,10 @@ qcom_setup_interfaces()
|
||||
cig,wf186h)
|
||||
ucidef_add_switch "switch0" "4:wan" "1:lan" "2:lan" "6@eth0"
|
||||
;;
|
||||
sonicfi,rap630c-311g|\
|
||||
cybertan,eww631-a1)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_set_interface_lan ""
|
||||
;;
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-b1)
|
||||
ucidef_add_switch "switch1" "5:wan" "2:lan" "3:lan" "4:lan" "6@eth0"
|
||||
;;
|
||||
@@ -38,7 +36,6 @@ qcom_setup_interfaces()
|
||||
ucidef_set_interface_lan "eth1"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
wallys,dr5018|\
|
||||
edgecore,eap104)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch1" \
|
||||
@@ -59,9 +56,6 @@ qcom_setup_interfaces()
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
||||
;;
|
||||
glinet,b3000)
|
||||
ucidef_add_switch "switch1" "6@eth1" "1:wan" "2:lan" "3:lan"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -80,8 +74,6 @@ qcom_setup_macs()
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
;;
|
||||
sonicfi,rap630c-311g|\
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1)
|
||||
mtd=$(find_mtd_chardev "0:APPSBLENV")
|
||||
@@ -94,10 +86,6 @@ qcom_setup_macs()
|
||||
ip link set eth0 address $wan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
glinet,b3000)
|
||||
wan_mac=$(cat /sys/class/net/eth1/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 2)
|
||||
;;
|
||||
*)
|
||||
wan_mac=$(cat /sys/class/net/eth0/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
|
||||
@@ -61,39 +61,6 @@ ath11k_generate_macs_eww631_b1() {
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_rap630c_311g() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
local dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
mac=$(grep BaseMacAddress= $dev | cut -d '=' -f2)
|
||||
eth=$(macaddr_canonicalize $mac)
|
||||
mac1=$(macaddr_add $eth 1)
|
||||
mac2=$(macaddr_add $eth 2)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_rap630w_311g() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
local dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
mac=$(grep BaseMacAddress= $dev | cut -d '=' -f2)
|
||||
eth=$(macaddr_canonicalize $mac)
|
||||
mac1=$(macaddr_add $eth 2)
|
||||
mac2=$(macaddr_add $eth 3)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_gl_b3000() {
|
||||
mac=$(cat /proc/gl-hw-info/device_mac)
|
||||
[ -z "$mac" ] && ath11k_generate_macs || {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
mac1=$(macaddr_add $mac 2)
|
||||
mac2=$(macaddr_add $mac 3)
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
}
|
||||
|
||||
caldata_die() {
|
||||
echo "caldata: " "$*"
|
||||
exit 1
|
||||
@@ -119,8 +86,6 @@ ath11k/IPQ5018/hw1.0/caldata.bin)
|
||||
case "$board" in
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
sonicfi,rap630c-311g|\
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
edgecore,eap104|\
|
||||
@@ -135,9 +100,7 @@ ath11k/IPQ5018/hw1.0/caldata.bin)
|
||||
optimcloud,d50|\
|
||||
optimcloud,d50-5g|\
|
||||
udaya,a6-id2|\
|
||||
wallys,dr5018|\
|
||||
yuncore,fap655|\
|
||||
glinet,b3000)
|
||||
yuncore,fap655)
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
;;
|
||||
esac
|
||||
@@ -146,8 +109,6 @@ ath11k/qcn6122/hw1.0/caldata_1.bin)
|
||||
case "$board" in
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
sonicfi,rap630c-311g|\
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
edgecore,oap101|\
|
||||
@@ -156,7 +117,6 @@ ath11k/qcn6122/hw1.0/caldata_1.bin)
|
||||
edgecore,oap101e-6e|\
|
||||
udaya,a6-id2|\
|
||||
hfcl,ion4xi_w|\
|
||||
wallys,dr5018|\
|
||||
yuncore,fap655)
|
||||
caldata_extract "0:ART" 0x26800 0x20000
|
||||
;;
|
||||
@@ -164,17 +124,13 @@ ath11k/qcn6122/hw1.0/caldata_1.bin)
|
||||
;;
|
||||
ath11k/qcn6122/hw1.0/caldata_2.bin)
|
||||
case "$board" in
|
||||
wallys,dr5018|\
|
||||
edgecore,eap104|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e-6e)
|
||||
caldata_extract "0:ART" 0x4c000 0x20000
|
||||
;;
|
||||
sonicfi,rap630c-311g|\
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
glinet,b3000)
|
||||
cybertan,eww631-b1)
|
||||
caldata_extract "0:ART" 0x26800 0x20000
|
||||
;;
|
||||
esac
|
||||
@@ -195,12 +151,6 @@ ath11k-macs)
|
||||
cig,wf186h)
|
||||
ath11k_generate_macs_wf186w
|
||||
;;
|
||||
sonicfi,rap630c-311g)
|
||||
ath11k_generate_macs_rap630c_311g
|
||||
;;
|
||||
sonicfi,rap630w-311g)
|
||||
ath11k_generate_macs_rap630w_311g
|
||||
;;
|
||||
cybertan,eww631-a1)
|
||||
ath11k_generate_macs_eww631_a1
|
||||
;;
|
||||
@@ -208,7 +158,6 @@ ath11k-macs)
|
||||
ath11k_generate_macs_eww631_b1
|
||||
;;
|
||||
edgecore,eap104|\
|
||||
edgecore,oap101|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e-6e|\
|
||||
optimcloud,d60|\
|
||||
@@ -222,9 +171,6 @@ ath11k-macs)
|
||||
hfcl,ion4xi_w)
|
||||
ath11k_generate_macs_ion4x
|
||||
;;
|
||||
glinet,b3000)
|
||||
ath11k_generate_macs_gl_b3000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
"edgecore,eap101")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq6018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/ipq6018\ hw1.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,eap102")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq8074\ hw2.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/ipq8074\ hw2.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,oap101e-6e"|\
|
||||
"edgecore,oap101-6e")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_1/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_2/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy2
|
||||
;;
|
||||
"edgecore,oap101e"|\
|
||||
"edgecore,oap101")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_1/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,eap104")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_2/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
esac
|
||||
@@ -7,11 +7,5 @@ boot() {
|
||||
hfcl,ion4xi_w)
|
||||
fw_setenv boot_count 0
|
||||
;;
|
||||
edgecore,oap101|\
|
||||
edgecore,eap104)
|
||||
avail=$(fw_printenv -n upgrade_available)
|
||||
[ "${avail}" -eq 0 ] && fw_setenv upgrade_available 1
|
||||
fw_setenv bootcount 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -70,12 +70,9 @@ platform_check_image() {
|
||||
case $board in
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
sonicfi,rap630c-311g|\
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
edgecore,eap104|\
|
||||
wallys,dr5018|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w|\
|
||||
optimcloud,d60|\
|
||||
@@ -83,7 +80,6 @@ platform_check_image() {
|
||||
optimcloud,d50|\
|
||||
optimcloud,d50-5g|\
|
||||
yuncore,fap655|\
|
||||
glinet,b3000|\
|
||||
udaya,a6-id2|\
|
||||
edgecore,oap101|\
|
||||
edgecore,oap101-6e|\
|
||||
@@ -102,7 +98,6 @@ platform_do_upgrade() {
|
||||
|
||||
board=$(board_name)
|
||||
case $board in
|
||||
glinet,b3000|\
|
||||
edgecore,oap101|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e|\
|
||||
@@ -128,7 +123,6 @@ platform_do_upgrade() {
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
udaya,a6-id2|\
|
||||
wallys,dr5018|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
@@ -140,8 +134,6 @@ platform_do_upgrade() {
|
||||
}
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
sonicfi,rap630c-311g|\
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1)
|
||||
boot_part=$(fw_printenv bootfrom | cut -d = -f2)
|
||||
|
||||
@@ -1,801 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "GL.iNet B3000";
|
||||
compatible = "glinet,b3000", "qcom,ipq5018-mp03.5", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart1;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
led-upgrade = &led_system;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
gl-hw {
|
||||
compatible = "gl-hw-info";
|
||||
model = "b3000";
|
||||
radio = "radio0";
|
||||
wan = "eth1.1";
|
||||
lan = "eth1.2 eth1.3";
|
||||
secondwan_vlan_port = "2";
|
||||
dfs;
|
||||
reset-button = "gpio-27";
|
||||
flash_size = <128>;
|
||||
temperature = "/sys/devices/virtual/thermal/thermal_zone0/temp";
|
||||
factory_data {
|
||||
device_mac = "0:ART", "0x6";
|
||||
device_ddns = "0:ART", "0x10";
|
||||
device_sn_bak = "0:ART", "0x20";
|
||||
device_sn = "0:ART", "0x30";
|
||||
country_code = "0:ART", "0x88";
|
||||
device_cert = "0:ART", "0x50000";
|
||||
};
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E200000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4EF00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4100000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4EF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4EF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D300000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D500000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E400000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E900000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4F800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4D00000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D500000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D500000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4F800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
ethernet-phy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
ethernet-phy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x2>;
|
||||
ess-switch@0x39c00000 {
|
||||
compatible = "qcom,ess-switch-ipq50xx";
|
||||
device_id = <0>;
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
forced-speed = <1000>;
|
||||
forced-duplex = <1>;
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <&tlmm 0x27 0>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0xc>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x2>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
qcom,rx-page-mode = <0>;
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
qcom,rx-page-mode = <0>;
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-names = "default";
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_data {
|
||||
pins = "gpio4", "gpio5", "gpio6", "gpio7";
|
||||
function = "qspi_data";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio27";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_system {
|
||||
pins = "gpio24";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_white {
|
||||
pins = "gpio23";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_system: led@24 {
|
||||
label = "blue_led";
|
||||
gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
led@23 {
|
||||
label = "white_led";
|
||||
gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x23>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4E900000 0x4E900000 0x4E200000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4F800000 0x4F800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
@@ -1,915 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Sonicfi RAP630C-311G";
|
||||
compatible = "sonicfi,rap630c-311g", "qcom,ipq5018-mp03.5", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E200000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4EF00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4100000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4EF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4EF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D300000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D500000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E400000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E900000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4F800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4D00000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D500000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D500000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4F800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "disabled";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
/*
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
qcom,rx-page-mode = <0>;
|
||||
};
|
||||
/*
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
qcom,rx-page-mode = <0>;
|
||||
};
|
||||
*/
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: blsp0_uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio23", "gpio25", "gpio24", "gpio26";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_data {
|
||||
pins = "gpio4", "gpio5", "gpio6", "gpio7";
|
||||
function = "qspi_data";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
audio_pins: audio_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio24";
|
||||
function = "audio_rxbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_2 {
|
||||
pins = "gpio25";
|
||||
function = "audio_rxfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_3 {
|
||||
pins = "gpio26";
|
||||
function = "audio_rxd";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_4 {
|
||||
pins = "gpio27";
|
||||
function = "audio_txmclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_5 {
|
||||
pins = "gpio28";
|
||||
function = "audio_txbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_6 {
|
||||
pins = "gpio29";
|
||||
function = "audio_txfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_7 {
|
||||
pins = "gpio30";
|
||||
function = "audio_txd";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
leds_pins: leds_pinmux {
|
||||
sys_blue {
|
||||
pins = "gpio30";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
sys_red {
|
||||
pins = "gpio36";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
sys_green {
|
||||
pins = "gpio37";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
gpio_leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@30 {
|
||||
label = "sys:blue";
|
||||
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */
|
||||
default-state="on";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
led@36 {
|
||||
label = "sys:red";
|
||||
gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; /* GPIO_36 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
led@37 {
|
||||
label = "sys:green";
|
||||
gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; /* GPIO_37 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
1235
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4E900000 0x4E900000 0x4E200000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4F800000 0x4F800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
@@ -1,981 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Sonicfi RAP630W-311G";
|
||||
compatible = "sonicfi,rap630w-311g", "qcom,ipq5018-mp03.5", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E200000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4EF00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4100000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4EF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4EF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
/*
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
*/
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 38 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
ethernet-phy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
ethernet-phy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
|
||||
ethernet-phy@4 {
|
||||
reg = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x2>;
|
||||
ess-switch@0x39c00000 {
|
||||
compatible = "qcom,ess-switch-ipq50xx";
|
||||
device_id = <0>;
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
forced-speed = <1000>;
|
||||
forced-duplex = <1>;
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <&tlmm 0x26 0>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap (Port 6 GMAC) */
|
||||
switch_lan_bmp = <0x3c>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <5>;
|
||||
phy_address = <4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
/*
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins>; //<&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: blsp0_uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
/*
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio23", "gpio25", "gpio24", "gpio26";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
*/
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_data {
|
||||
pins = "gpio4", "gpio5", "gpio6", "gpio7";
|
||||
function = "qspi_data";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
/*
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
*/
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
/*
|
||||
audio_pins: audio_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio24";
|
||||
function = "audio_rxbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_2 {
|
||||
pins = "gpio25";
|
||||
function = "audio_rxfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_3 {
|
||||
pins = "gpio26";
|
||||
function = "audio_rxd";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_4 {
|
||||
pins = "gpio27";
|
||||
function = "audio_txmclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_5 {
|
||||
pins = "gpio28";
|
||||
function = "audio_txbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_6 {
|
||||
pins = "gpio29";
|
||||
function = "audio_txfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_7 {
|
||||
pins = "gpio30";
|
||||
function = "audio_txd";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
*/
|
||||
poe_pins: poe_pinmux {
|
||||
/*
|
||||
LAN port PoE output enable
|
||||
H --> enable; L --> disable (Default setting to H)
|
||||
*/
|
||||
mux_0 { /* PoE_OUT_EN */
|
||||
pins = "gpio24";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
output-high;
|
||||
};
|
||||
|
||||
mux_1 { /* PSE_INT_N */
|
||||
pins = "gpio27";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
input;
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pinmux {
|
||||
sys_green {
|
||||
pins = "gpio1";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
sys_blue {
|
||||
pins = "gpio30";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
sys_red {
|
||||
pins = "gpio46";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio_leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@1 {
|
||||
label = "sys:green";
|
||||
gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; /* GPIO_1/ATST_QP0 */
|
||||
default-state="off";
|
||||
};
|
||||
led@30 {
|
||||
label = "sys:blue";
|
||||
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */
|
||||
default-state="on";
|
||||
};
|
||||
led@46 {
|
||||
label = "sys:red";
|
||||
gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; /* GPIO_46 */
|
||||
default-state="off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4E900000 0x4E900000 0x4E200000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4F800000 0x4F800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
@@ -425,7 +425,7 @@
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
reset {
|
||||
wps {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
@@ -550,7 +550,7 @@
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
wps_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
@@ -625,9 +625,9 @@
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
button@1 {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
|
||||
@@ -1,915 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Wallys DR5018";
|
||||
compatible = "wallys,dr5018", "qcom,ipq5018-mp03.5", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
led-running = &led_power;
|
||||
led-upgrade = &led_power;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E200000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4EF00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F000000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4100000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4EF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4EF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D300000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D500000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E400000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E900000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4F800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4D00000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D500000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D500000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4F800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
ethernet-phy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
ethernet-phy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x2>;
|
||||
ess-switch@0x39c00000 {
|
||||
compatible = "qcom,ess-switch-ipq50xx";
|
||||
device_id = <0>;
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
forced-speed = <1000>;
|
||||
forced-duplex = <1>;
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <&tlmm 0x27 0>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
qcom,rx-page-mode = <0>;
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
qcom,rx-page-mode = <0>;
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &mcu_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
mcu_pins: mcu_pins {
|
||||
mcu_rst {
|
||||
pins = "gpio31";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-low;
|
||||
};
|
||||
|
||||
mcu_sbl {
|
||||
pins = "gpio35";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_uart_pins: uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio23", "gpio25", "gpio24", "gpio26";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
qspi_data {
|
||||
pins = "gpio4", "gpio5", "gpio6", "gpio7";
|
||||
function = "qspi_data";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_power {
|
||||
pins = "gpio30";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_uplink {
|
||||
pins = "gpio46";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio33";
|
||||
function = "blsp2_i2c0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio34";
|
||||
function = "blsp2_i2c0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
#size-cells = <0>;
|
||||
|
||||
mcu-bootloader {
|
||||
gpio-export,name = "mcu-bootloader";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
mcu-enable {
|
||||
gpio-export,name = "mcu-enable";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&tlmm 31 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
wps {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_power: led@30 {
|
||||
label = "green:power";
|
||||
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
led@46 {
|
||||
label = "green:uplink";
|
||||
gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x23>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
qcom,rproc = <&q6_wcss_pd2>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4D500000 0x4D500000 0x4D300000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4E400000 0x4E400000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>;
|
||||
#endif
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4E900000 0x4E900000 0x4E200000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4F800000 0x4F800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
@@ -40,28 +40,6 @@ define Device/cybertan_eww631_b1
|
||||
endef
|
||||
TARGET_DEVICES += cybertan_eww631_b1
|
||||
|
||||
define Device/sonicfi_rap630c_311g
|
||||
DEVICE_TITLE := Sonicfi RAP630C-311G
|
||||
DEVICE_DTS := qcom-ipq5018-rap630c-311g
|
||||
SUPPORTED_DEVICES := sonicfi,rap630c-311g
|
||||
DEVICE_PACKAGES := ath11k-wifi-sonicfi-rap630c-311g ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi
|
||||
IMAGE/nand-factory.ubi := append-ubi
|
||||
endef
|
||||
TARGET_DEVICES += sonicfi_rap630c_311g
|
||||
|
||||
define Device/sonicfi_rap630w_311g
|
||||
DEVICE_TITLE := Sonicfi RAP630W-311G
|
||||
DEVICE_DTS := qcom-ipq5018-rap630w-311g
|
||||
SUPPORTED_DEVICES := sonicfi,rap630w-311g
|
||||
DEVICE_PACKAGES := ath11k-wifi-sonicfi-rap630w-311g ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi
|
||||
IMAGE/nand-factory.ubi := append-ubi
|
||||
endef
|
||||
TARGET_DEVICES += sonicfi_rap630w_311g
|
||||
|
||||
define Device/edgecore_eap104
|
||||
DEVICE_TITLE := EdgeCore EAP104
|
||||
DEVICE_DTS := qcom-ipq5018-eap104
|
||||
@@ -80,15 +58,6 @@ define Device/udaya_a6_id2
|
||||
endef
|
||||
TARGET_DEVICES += udaya_a6_id2
|
||||
|
||||
define Device/wallys_dr5018
|
||||
DEVICE_TITLE := Wallys DR5018
|
||||
DEVICE_DTS := qcom-ipq5018-wallys-dr5018
|
||||
SUPPORTED_DEVICES := wallys,dr5018
|
||||
DEVICE_PACKAGES := ath11k-wifi-wallys-dr5018 uboot-envtools ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
endef
|
||||
TARGET_DEVICES += wallys_dr5018
|
||||
|
||||
define Device/yuncore_fap655
|
||||
DEVICE_TITLE := Yuncore FAP650
|
||||
DEVICE_DTS := qcom-ipq5018-yuncore-fap655
|
||||
@@ -187,15 +156,3 @@ define Device/optimcloud_d60
|
||||
DEVICE_DTS_CONFIG := config@mp03.1
|
||||
endef
|
||||
TARGET_DEVICES += optimcloud_d60
|
||||
|
||||
define Device/glinet_b3000
|
||||
DEVICE_TITLE := GL.iNet B3000
|
||||
DEVICE_DTS := qcom-ipq5018-gl-b3000
|
||||
SUPPORTED_DEVICES := glinet,b3000
|
||||
DEVICE_PACKAGES := ath11k-wifi-gl-b3000 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
IMAGES := sysupgrade.tar nand-factory.bin
|
||||
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
|
||||
IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
|
||||
endef
|
||||
TARGET_DEVICES += glinet_b3000
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/mtd/nand/raw/nand_ids.c
|
||||
===================================================================
|
||||
--- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/mtd/nand/raw/nand_ids.c
|
||||
+++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/mtd/nand/raw/nand_ids.c
|
||||
@@ -86,6 +86,12 @@ struct nand_flash_dev nand_flash_ids[] =
|
||||
{"GD5F1GQ5REYIH SPI NAND 1G 1.8V",
|
||||
{ .id = {0xc8, 0x21} },
|
||||
SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512), 0},
|
||||
+ {"GD5F1GM7REYIG SPI NAND 1G-BIT",
|
||||
+ {.id = {0xc8, 0x81}},
|
||||
+ SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(8,SZ_512), 0},
|
||||
+ {"GD5F2GM7REYIG SPI NAND 2G 8-bit",
|
||||
+ {.id = {0xc8, 0x82}},
|
||||
+ SZ_2K, SZ_256, SZ_128K, 0, 2, 128, NAND_ECC_INFO(8,SZ_512), 0},
|
||||
{"W25N01JW SPI NAND 1.8V 1G-BIT",
|
||||
{ .id = {0xef, 0xbc} },
|
||||
SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512), 0},
|
||||
@@ -13,7 +13,6 @@ cig,wf188n)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" "tx rx link"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt"
|
||||
ucidef_set_led_default "power" "POWER" "green:power" "on"
|
||||
;;
|
||||
edgecore,eap101)
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt"
|
||||
@@ -21,7 +20,6 @@ edgecore,eap101)
|
||||
ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "eth1"
|
||||
ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "eth2"
|
||||
ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0"
|
||||
ucidef_set_led_default "power" "POWER" "green:led_pwr" "on"
|
||||
;;
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4x|\
|
||||
|
||||
@@ -34,10 +34,6 @@ qcom_setup_interfaces()
|
||||
ucidef_set_interface_lan "eth1"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
cig,wf660a)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
|
||||
yuncore,fap650)
|
||||
ucidef_set_interface_lan "eth3 eth2 eth1 eth0"
|
||||
ucidef_set_interface_wan "eth4"
|
||||
@@ -64,17 +60,7 @@ qcom_setup_macs()
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ucidef_set_network_device_mac eth1 $lan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
cig,wf660a)
|
||||
mmc_dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mmc_dev" ] && mmc_dev=$(find_mmc_part "0:APPSBLENV")
|
||||
[ -z "$mmc_dev" ] && return
|
||||
mac=$(grep BaseMacAddress= $mmc_dev | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
yuncore,ax840)
|
||||
wan_mac=$(cat /sys/class/net/eth1/address)
|
||||
|
||||
@@ -36,20 +36,6 @@ ath11k_generate_macs_ion4x() {
|
||||
echo -ne \\x${wifimac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_wf660a() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
mmc_dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mmc_dev" ] && mmc_dev=$(find_mmc_part "0:APPSBLENV")
|
||||
[ -n "$mmc_dev" ] && mac=$(grep BaseMacAddress= $mmc_dev | cut -dx -f2)
|
||||
eth=$(macaddr_canonicalize $mac)
|
||||
mac1=$(macaddr_add $eth 1)
|
||||
mac2=$(macaddr_add $eth 2)
|
||||
mac3=$(macaddr_add $eth 3)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
caldata_die() {
|
||||
echo "caldata: " "$*"
|
||||
exit 1
|
||||
@@ -74,7 +60,6 @@ case "$FIRMWARE" in
|
||||
"ath11k/IPQ6018/hw1.0/caldata.bin")
|
||||
case "$board" in
|
||||
cig,wf188n|\
|
||||
cig,wf660a|\
|
||||
edgecore,eap101|\
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4x|\
|
||||
@@ -112,9 +97,6 @@ ath11k-macs)
|
||||
cig,wf188n)
|
||||
ath11k_generate_macs
|
||||
;;
|
||||
cig,wf660a)
|
||||
ath11k_generate_macs_wf660a
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ath11k/IPQ6018/hw1.0/board.bin)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
"edgecore,eap101")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq6018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/ipq6018\ hw1.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,eap102")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq8074\ hw2.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/ipq8074\ hw2.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,oap101e-6e"|\
|
||||
"edgecore,oap101-6e")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_1/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_2/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy2
|
||||
;;
|
||||
"edgecore,oap101e"|\
|
||||
"edgecore,oap101")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_1/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,eap104")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_2/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
esac
|
||||
@@ -49,52 +49,6 @@ do_flash_emmc() {
|
||||
tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock}
|
||||
}
|
||||
|
||||
spi_nor_emmc_do_upgrade_bootconfig() {
|
||||
local tar_file="$1"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
[ -f /proc/boot_info/getbinary_bootconfig ] || {
|
||||
echo "bootconfig does not exist"
|
||||
exit
|
||||
}
|
||||
CI_ROOTPART="$(cat /proc/boot_info/rootfs/upgradepartition)"
|
||||
CI_KERNPART="$(cat /proc/boot_info/0:HLOS/upgradepartition)"
|
||||
|
||||
[ -n "$CI_KERNPART" -a -n "$CI_ROOTPART" ] || {
|
||||
echo "kernel or rootfs partition is unknown"
|
||||
exit
|
||||
}
|
||||
|
||||
local primary="0"
|
||||
[ "$(cat /proc/boot_info/rootfs/primaryboot)" = "0" ] && primary="1"
|
||||
echo "$primary" > /proc/boot_info/rootfs/primaryboot 2>/dev/null
|
||||
echo "$primary" > /proc/boot_info/0:HLOS/primaryboot 2>/dev/null
|
||||
cp /proc/boot_info/getbinary_bootconfig /tmp/bootconfig
|
||||
|
||||
do_flash_emmc $tar_file $CI_KERNPART $board_dir kernel
|
||||
do_flash_emmc $tar_file $CI_ROOTPART $board_dir root
|
||||
|
||||
local emmcblock="$(find_mmc_part "rootfs_data")"
|
||||
if [ -e "$emmcblock" ]; then
|
||||
mkfs.ext4 -F "$emmcblock"
|
||||
fi
|
||||
|
||||
for part in "0:BOOTCONFIG" "0:BOOTCONFIG1"; do
|
||||
local mtdchar=$(echo $(find_mtd_chardev $part) | sed 's/^.\{5\}//')
|
||||
if [ -n "$mtdchar" ]; then
|
||||
echo start to update $mtdchar
|
||||
mtd -qq write /proc/boot_info/getbinary_bootconfig "/dev/${mtdchar}" 2>/dev/null && echo update mtd $mtdchar
|
||||
else
|
||||
emmcblock=$(find_mmc_part $part)
|
||||
echo erase ${emmcblock}
|
||||
dd if=/dev/zero of=${emmcblock} 2> /dev/null
|
||||
echo update $emmcblock
|
||||
dd if=/tmp/bootconfig of=${emmcblock} 2> /dev/null
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
emmc_do_upgrade() {
|
||||
local tar_file="$1"
|
||||
|
||||
@@ -113,7 +67,6 @@ platform_check_image() {
|
||||
local magic_long="$(get_magic_long "$1")"
|
||||
board=$(board_name)
|
||||
case $board in
|
||||
cig,wf660a|\
|
||||
cig,wf188n|\
|
||||
cig,wf194c4|\
|
||||
cig,wf196|\
|
||||
@@ -142,9 +95,6 @@ platform_do_upgrade() {
|
||||
|
||||
board=$(board_name)
|
||||
case $board in
|
||||
cig,wf660a)
|
||||
spi_nor_emmc_do_upgrade_bootconfig $1
|
||||
;;
|
||||
cig,wf188n|\
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800|\
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* IPQ6018 CP01 board device tree source
|
||||
*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "qcom-ipq6018-cp01-cig-wf660a.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Cigtech WF-660a";
|
||||
compatible = "cig,wf660a", "qcom,ipq6018-ap-cp01-c1", "qcom,ipq6018-ap-cp01", "qcom,ipq6018";
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
i2c_1_pins: i2c_1_pins {
|
||||
mux {
|
||||
pins = "gpio42", "gpio43";
|
||||
function = "blsp2_i2c";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_1 {
|
||||
pinctrl-0 = <&i2c_1_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&sdhc_1 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&sdhc_2 {
|
||||
status = "disable";
|
||||
};
|
||||
@@ -1,475 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* IPQ6018 CP01 board device tree source
|
||||
*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "ipq6018.dtsi"
|
||||
#include "ipq6018-cpr-regulator.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
|
||||
/ {
|
||||
compatible = "cig,wf660a", "qcom,ipq6018-ap-cp01", "qcom,ipq6018";
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart3;
|
||||
serial1 = &blsp1_uart2;
|
||||
sdhc1 = &sdhc_1;
|
||||
/*
|
||||
* Aliases as required by u-boot
|
||||
* to patch MAC addresses
|
||||
*/
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
ethernet2 = "/soc/dp3";
|
||||
ethernet3 = "/soc/dp4";
|
||||
ethernet4 = "/soc/dp5";
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
bootargs-append = " swiotlb=1";
|
||||
};
|
||||
};
|
||||
|
||||
&blsp1_uart2 {
|
||||
pinctrl-0 = <&hsuart_pins>;
|
||||
pinctrl-names = "default";
|
||||
qca,bt-rfr-fixup;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&blsp1_uart3 {
|
||||
pinctrl-0 = <&serial_3_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&spi_0 {
|
||||
pinctrl-0 = <&spi_0_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
&spi_1 { /* BLSP1 QUP1 */
|
||||
pinctrl-0 = <&spi_1_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
quartz-reset-gpio = <&tlmm 79 1>;
|
||||
status = "disabled";
|
||||
spidev1: spi@1 {
|
||||
compatible = "qca,spidev";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <24000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_0_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
i2c_0_pins: i2c_0_pins {
|
||||
mux {
|
||||
pins = "gpio69", "gpio70";
|
||||
function = "blsp1_i2c";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_1_pins: i2c_1_pins {
|
||||
mux {
|
||||
pins = "gpio42", "gpio43";
|
||||
function = "blsp2_i2c";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_4_pins: i2c_4_pins {
|
||||
mux {
|
||||
pins = "gpio55", "gpio56";
|
||||
function = "blsp4_i2c";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
spi_0_pins: spi-0-pins {
|
||||
pins = "gpio38", "gpio39", "gpio40", "gpio41";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
spi_1_pins: spi_1_pins {
|
||||
mux {
|
||||
pins = "gpio69", "gpio71", "gpio72";
|
||||
function = "blsp1_spi";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
spi_cs {
|
||||
pins = "gpio70";
|
||||
function = "blsp1_spi";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
quartz_interrupt {
|
||||
pins = "gpio78";
|
||||
function = "gpio";
|
||||
input;
|
||||
bias-disable;
|
||||
};
|
||||
quartz_reset {
|
||||
pins = "gpio79";
|
||||
function = "gpio";
|
||||
output-low;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
sd_pins: sd-pinmux {
|
||||
pins = "gpio62";
|
||||
function = "sd_card";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mdio_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio64";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_1 {
|
||||
pins = "gpio65";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio75";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_3 {
|
||||
pins = "gpio77";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
pwm_pins: pwm_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio22";
|
||||
function = "pwm02";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio23";
|
||||
function = "pwm12";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_3 {
|
||||
pins = "gpio24";
|
||||
function = "pwm22";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
hsuart_pins: hsuart_pins {
|
||||
mux {
|
||||
pins = "gpio71", "gpio72";
|
||||
function = "blsp1_uart";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_5g {
|
||||
pins = "gpio35";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_2g {
|
||||
pins = "gpio37";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_usb0 {
|
||||
pins = "gpio50";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
btcoex_pins: btcoex_pins {
|
||||
mux_0 {
|
||||
pins = "gpio51";
|
||||
function = "pta1_1";
|
||||
drive-strength = <6>;
|
||||
bias-pull-down;
|
||||
};
|
||||
mux_1 {
|
||||
pins = "gpio53";
|
||||
function = "pta1_0";
|
||||
drive-strength = <6>;
|
||||
bias-pull-down;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio52";
|
||||
function = "pta1_2";
|
||||
drive-strength = <6>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
mdio: mdio@90000 {
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 77 0>;
|
||||
status = "ok";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
phy1: ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
phy2: ethernet-phy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
phy3: ethernet-phy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
phy4: ethernet-phy@4 {
|
||||
reg = <0x1c>;
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <1>;
|
||||
reg = <0x3a001000 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <0>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <2>;
|
||||
reg = <0x3a001200 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <1>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp3 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <3>;
|
||||
reg = <0x3a001400 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <2>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp4 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <4>;
|
||||
reg = <0x3a001600 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <3>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp5 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <5>;
|
||||
reg = <0x3a001800 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
i2c_4: i2c@78b9000 {
|
||||
compatible = "qcom,i2c-qup-v2.2.1";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x78b9000 0x600>;
|
||||
interrupts = <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&gcc GCC_BLSP1_AHB_CLK>,
|
||||
<&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>;
|
||||
clock-names = "iface", "core";
|
||||
clock-frequency = <100000>;
|
||||
dmas = <&blsp_dma 21>, <&blsp_dma 20>;
|
||||
dma-names = "rx", "tx";
|
||||
pinctrl-0 = <&i2c_4_pins>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
ess-switch@3a000000 {
|
||||
switch_cpu_bmp = <0x1>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x0>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x20>; /* wan port bitmap */
|
||||
switch_inner_bmp = <0xc0>; /*inner port bitmap*/
|
||||
switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
|
||||
switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/
|
||||
switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <5>;
|
||||
phy_address = <0x1c>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nss-macsec0 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
phy_access_mode = <0>;
|
||||
mdiobus = <&mdio>;
|
||||
};
|
||||
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm_pins>;
|
||||
pinctrl-names = "default";
|
||||
used-pwm-indices = <1>, <1>, <1>, <0>;
|
||||
dft-pwm-status = <0>, <1>, <0>, <0>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@35 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
};
|
||||
led@37 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
};
|
||||
led@50 {
|
||||
label = "led_usb0";
|
||||
gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "usb-host";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&qpic_bam {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qpic_nand {
|
||||
status = "disable";
|
||||
};
|
||||
|
||||
&pcie_phy {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
#if defined(__CNSS2__)
|
||||
status = "ok";
|
||||
#endif
|
||||
};
|
||||
|
||||
&qusb_phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qusb_phy_1 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&usb2 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&ssphy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&nss_crypto {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&sd_pwrseq {
|
||||
status = "disable";
|
||||
};
|
||||
|
||||
&ipq6018_l2 {
|
||||
status = "disable";
|
||||
};
|
||||
@@ -2,17 +2,6 @@ KERNEL_LOADADDR := 0x41080000
|
||||
|
||||
DEVICE_VARS += CE_TYPE
|
||||
|
||||
define Device/cig_wf660a
|
||||
DEVICE_TITLE := Cigtech WF-660a
|
||||
DEVICE_DTS := qcom-ipq6018-cig-wf660a
|
||||
SUPPORTED_DEVICES := cig,wf660a
|
||||
DEVICE_DTS_CONFIG := config@cp01-c1
|
||||
DEVICE_PACKAGES := ath11k-wifi-cig-wf660a uboot-env uboot-envtools
|
||||
IMAGES := sysupgrade.tar mmc-factory.bin
|
||||
IMAGE/mmc-factory.bin := append-ubi | qsdk-ipq-factory-mmc
|
||||
endef
|
||||
TARGET_DEVICES += cig_wf660a
|
||||
|
||||
define Device/cig_wf188n
|
||||
DEVICE_TITLE := Cigtech WF-188n
|
||||
DEVICE_DTS := qcom-ipq6018-cig-wf188n
|
||||
|
||||
@@ -77,23 +77,6 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,usb-dwc3-qcom-internal))
|
||||
|
||||
define KernelPackage/diag-char
|
||||
TITLE:=CHAR DIAG
|
||||
KCONFIG:= CONFIG_DIAG_MHI=y@ge5.4 \
|
||||
CONFIG_DIAG_OVER_PCIE=n@ge5.4 \
|
||||
CONFIG_DIAGFWD_BRIDGE_CODE=y \
|
||||
CONFIG_DIAG_CHAR=m
|
||||
DEPENDS:=+kmod-lib-crc-ccitt
|
||||
FILES:=$(LINUX_DIR)/drivers/char/diag/diagchar.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/diag-char/description
|
||||
CHAR DIAG
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,diag-char))
|
||||
|
||||
|
||||
define KernelPackage/bootconfig
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Bootconfig partition for failsafe
|
||||
|
||||
@@ -17,15 +17,10 @@ edgecore,oap102)
|
||||
ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt"
|
||||
ucidef_set_led_wlan "power" "POWER" "green:power" "default-on"
|
||||
;;
|
||||
sonicfi,rap630w-311g|\
|
||||
cybertan,eww631-b1)
|
||||
ucidef_set_led_default "power" "POWER" "sys:blue" "on"
|
||||
;;
|
||||
cig,wf196)
|
||||
ucidef_set_led_default "power" "POWER" "green:status" "on"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
"edgecore,eap101")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq6018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/ipq6018\ hw1.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,eap102")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq8074\ hw2.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/ipq8074\ hw2.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,oap101e-6e"|\
|
||||
"edgecore,oap101-6e")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_1/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_2/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy2
|
||||
;;
|
||||
"edgecore,oap101e"|\
|
||||
"edgecore,oap101")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_1/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
"edgecore,eap104")
|
||||
ln -s /sys/kernel/debug/ath11k/ipq5018\ hw1.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath11k/qcn6122_2/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
;;
|
||||
esac
|
||||
@@ -1,30 +0,0 @@
|
||||
From f3eaf64231edde8b6553f869cf33ff2b2897be38 Mon Sep 17 00:00:00 2001
|
||||
From: Venkat Chimata <venkata@shasta.cloud>
|
||||
Date: Mon, 8 Jul 2024 19:23:34 +0530
|
||||
Subject: [PATCH] mac80211: Update tx stats correctly in case of AP mode
|
||||
|
||||
In the backports driver the tx stats are updated in ieee80211_8023_xmit.
|
||||
However in AP mode the packets are transmitted in ieee80211_8023_xmit_ap.
|
||||
ieee80211_8023_xmit is not hit in case of AP mode. Update the stats just
|
||||
before calling ieee80211_8023_xmit_ap
|
||||
|
||||
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
|
||||
---
|
||||
net/mac80211/tx.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
|
||||
index d6181be..9e978f9 100644
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -4526,6 +4526,7 @@ void ieee80211_8023_xmit_ap(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
control.sta = pubsta;
|
||||
|
||||
+ ieee80211_tx_stats(dev, skb->len);
|
||||
drv_tx(local, &control, skb);
|
||||
|
||||
if (sta)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/rx_desc.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/rx_desc.h
|
||||
@@ -1375,11 +1375,9 @@ struct hal_rx_desc_ipq8074 {
|
||||
__le32 mpdu_end_tag;
|
||||
struct rx_mpdu_end mpdu_end;
|
||||
u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
|
||||
-#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M
|
||||
__le32 hdr_status_tag;
|
||||
__le32 phy_ppdu_id;
|
||||
u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN];
|
||||
-#endif
|
||||
u8 msdu_payload[0];
|
||||
} __packed;
|
||||
|
||||
@@ -1396,11 +1394,9 @@ struct hal_rx_desc_qcn9074 {
|
||||
__le32 mpdu_end_tag;
|
||||
struct rx_mpdu_end mpdu_end;
|
||||
u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
|
||||
-#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M
|
||||
__le32 hdr_status_tag;
|
||||
__le32 phy_ppdu_id;
|
||||
u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN];
|
||||
-#endif
|
||||
u8 msdu_payload[0];
|
||||
} __packed;
|
||||
|
||||
@@ -57,9 +57,9 @@ Index: qca-ssdk/src/init/ssdk_init.c
|
||||
+ entry.fid = fdb_entry.fid;
|
||||
+
|
||||
+ if (SW_OK != fal_fdb_entry_del_bymac(0, &entry))
|
||||
+ SSDK_INFO("failed to delete FDB entry\n");
|
||||
+ printk("failed to delete FDB entry\n");
|
||||
+ else
|
||||
+ SSDK_INFO("deleted %s/%d\n", data, entry.fid);
|
||||
+ printk("deleted %s/%d\n", data, entry.fid);
|
||||
+ }
|
||||
+
|
||||
+ ret = fal_fdb_entry_extend_getnext(0, &fdb_op, &fdb_entry);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -252,7 +252,7 @@ hostapd_prepare_device_config() {
|
||||
[ "$maxassoc_ignore_probe" -gt 0 ] && append base_cfg "no_probe_resp_if_max_sta=1" "$N"
|
||||
[ "$rnr_beacon" -gt 0 ] && append base_cfg "rnr_beacon=$rnr_beacon" "$N"
|
||||
# [ "$he_co_locate" -gt 0 ] && append base_cfg "he_co_locate=$he_co_locate" "$N"
|
||||
[ "$multiple_bssid" -gt 0 ] && append base_cfg "mbssid=$multiple_bssid" "$N"
|
||||
[ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N"
|
||||
[ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$N"
|
||||
[ "$mlo" -gt 0 ] && append base_cfg "mlo=1" "$N"
|
||||
[ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=$acs_exclude_dfs" "$N"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
ipq53xx_setup_interfaces()
|
||||
{
|
||||
@@ -12,9 +10,7 @@ ipq53xx_setup_interfaces()
|
||||
qcom,ipq9574-ap-al02-c4)
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
|
||||
;;
|
||||
cig,wf189)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
cig,wf189|\
|
||||
edgecore,eap105|\
|
||||
sercomm,ap72tip)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
@@ -22,36 +18,9 @@ ipq53xx_setup_interfaces()
|
||||
esac
|
||||
}
|
||||
|
||||
qcom_setup_macs()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case $board in
|
||||
cig,wf189)
|
||||
mtd=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mtd" ] && return;
|
||||
mac=$(grep BaseMacAddress= $mtd | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth0 $lan_mac
|
||||
ucidef_set_network_device_mac eth1 $wan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
*)
|
||||
wan_mac=$(cat /sys/class/net/eth1/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
;;
|
||||
esac
|
||||
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
||||
[ -n "$wan_mac" ] && ucidef_set_label_macaddr "$wan_mac"
|
||||
}
|
||||
|
||||
board_config_update
|
||||
board=$(board_name)
|
||||
ipq53xx_setup_interfaces $board
|
||||
qcom_setup_macs $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
"edgecore,eap105")
|
||||
ln -s /sys/kernel/debug/ath12k/ipq5332\ hw1.0_c000000.wifi/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy0
|
||||
ln -s /sys/kernel/debug/ath12k/qcn9274\ hw2.0_0001:01:00.0/mac0/fw_stats/pdev_stats /tmp/pdev_stats_phy1
|
||||
ln -s /sys/kernel/debug/ath12k/qcn9274\ hw2.0_0001:01:00.0/mac1/fw_stats/pdev_stats /tmp/pdev_stats_phy2
|
||||
;;
|
||||
esac
|
||||
@@ -47,8 +47,8 @@ hostapd_append_wpa_key_mgmt() {
|
||||
[ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type_l}-SHA256"
|
||||
;;
|
||||
eap192)
|
||||
[ "${ieee80211r:-0}" -gt 0 ] || append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP-SHA384"
|
||||
append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP"
|
||||
;;
|
||||
eap-eap2)
|
||||
append wpa_key_mgmt "WPA-EAP"
|
||||
@@ -73,10 +73,6 @@ hostapd_append_wpa_key_mgmt() {
|
||||
owe)
|
||||
append wpa_key_mgmt "OWE"
|
||||
;;
|
||||
psk2-radius)
|
||||
append wpa_key_mgmt "WPA-PSK"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-PSK"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ "$fils" -gt 0 ] && {
|
||||
@@ -130,30 +126,9 @@ hostapd_common_add_device_config() {
|
||||
|
||||
config_add_boolean multiple_bssid rnr_beacon he_co_locate ema
|
||||
|
||||
config_add_boolean afc
|
||||
config_add_string \
|
||||
afc_request_version afc_request_id afc_serial_number \
|
||||
afc_location_type afc_location afc_height afc_height_type
|
||||
config_add_array afc_cert_ids afc_freq_range afc_op_class
|
||||
config_add_int \
|
||||
afc_min_power afc_major_axis afc_minor_axis afc_orientation \
|
||||
afc_vertical_tolerance
|
||||
|
||||
hostapd_add_log_config
|
||||
}
|
||||
|
||||
|
||||
hostapd_get_list() {
|
||||
local var="$1"
|
||||
local field="$2"
|
||||
|
||||
local cur __val_list
|
||||
json_get_values __val_list "$field"
|
||||
for cur in $__val_list; do
|
||||
append "$var" "$cur" ","
|
||||
done
|
||||
}
|
||||
|
||||
hostapd_prepare_device_config() {
|
||||
local config="$1"
|
||||
local driver="$2"
|
||||
@@ -164,7 +139,7 @@ hostapd_prepare_device_config() {
|
||||
acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
|
||||
rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \
|
||||
multiple_bssid he_co_locate rnr_beacon ema acs_exclude_dfs \
|
||||
maxassoc_ignore_probe band
|
||||
maxassoc_ignore_probe
|
||||
|
||||
hostapd_set_log_options base_cfg
|
||||
|
||||
@@ -277,45 +252,6 @@ hostapd_prepare_device_config() {
|
||||
[ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N"
|
||||
[ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$N"
|
||||
[ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=$acs_exclude_dfs" "$N"
|
||||
if [ "$band" = "6g" ]; then
|
||||
json_get_vars afc he_6ghz_reg_pwr_type
|
||||
else
|
||||
afc=0
|
||||
he_6ghz_reg_pwr_type=
|
||||
fi
|
||||
set_default afc 0
|
||||
[ "$afc" -gt 0 ] && {
|
||||
for v in afc_request_version afc_request_id afc_serial_number afc_min_power afc_height afc_height_type afc_vertical_tolerance \
|
||||
afc_major_axis afc_minor_axis afc_orientation; do
|
||||
json_get_var val $v
|
||||
append base_cfg "$v=$val" "$N"
|
||||
done
|
||||
|
||||
for v in afc_cert_ids afc_op_class afc_freq_range; do
|
||||
val=
|
||||
hostapd_get_list val $v
|
||||
append base_cfg "$v=$val" "$N"
|
||||
done
|
||||
|
||||
json_get_vars afc_location_type afc_location
|
||||
case "$afc_location_type" in
|
||||
ellipse)
|
||||
append base_cfg "afc_location_type=0" "$N"
|
||||
append base_cfg "afc_linear_polygon=$afc_location" "$N"
|
||||
;;
|
||||
linear_polygon)
|
||||
append base_cfg "afc_location_type=1" "$N"
|
||||
append base_cfg "afc_linear_polygon=$afc_location" "$N"
|
||||
;;
|
||||
radial_polygon)
|
||||
append base_cfg "afc_location_type=2" "$N"
|
||||
append base_cfg "afc_radial_polygon=$afc_location" "$N"
|
||||
;;
|
||||
esac
|
||||
|
||||
he_6ghz_reg_pwr_type=1
|
||||
}
|
||||
[ -n "$he_6ghz_reg_pwr_type" ] && append base_cfg "he_6ghz_reg_pwr_type=$he_6ghz_reg_pwr_type" "$N"
|
||||
|
||||
json_get_values opts hostapd_options
|
||||
for val in $opts; do
|
||||
@@ -408,8 +344,8 @@ hostapd_common_add_bss_config() {
|
||||
config_add_string lci civic
|
||||
|
||||
config_add_boolean ieee80211r pmk_r1_push ft_psk_generate_local ft_over_ds
|
||||
config_add_int r0_key_lifetime reassociation_deadline ft_l2_refresh
|
||||
config_add_string mobility_domain r1_key_holder ft_key
|
||||
config_add_int r0_key_lifetime reassociation_deadline
|
||||
config_add_string mobility_domain r1_key_holder
|
||||
config_add_array r0kh r1kh
|
||||
|
||||
config_add_int ieee80211w_max_timeout ieee80211w_retry_timeout
|
||||
@@ -503,7 +439,6 @@ hostapd_set_psk() {
|
||||
local ifname="$1"
|
||||
|
||||
rm -f /var/run/hostapd-${ifname}.psk
|
||||
touch /var/run/hostapd-${ifname}.psk
|
||||
for_each_station hostapd_set_psk_file ${ifname}
|
||||
}
|
||||
|
||||
@@ -667,7 +602,7 @@ append_radius_server() {
|
||||
set_default dae_port 3799
|
||||
set_default request_cui 0
|
||||
|
||||
[ "$eap_server" -eq 0 -a -n "$auth_server" ] && {
|
||||
[ "$eap_server" -eq 0 ] && {
|
||||
append bss_conf "auth_server_addr=$auth_server" "$N"
|
||||
append bss_conf "auth_server_port=$auth_port" "$N"
|
||||
append bss_conf "auth_server_shared_secret=$auth_secret" "$N"
|
||||
@@ -789,7 +724,8 @@ hostapd_set_bss_options() {
|
||||
[ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N"
|
||||
}
|
||||
|
||||
[ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
|
||||
set_default nasid "${macaddr//\:}"
|
||||
append bss_conf "nas_identifier=$nasid" "$N"
|
||||
|
||||
[ -n "$acct_server" ] && {
|
||||
append bss_conf "acct_server_addr=$acct_server" "$N"
|
||||
@@ -836,7 +772,9 @@ hostapd_set_bss_options() {
|
||||
# with WPS enabled, we got to be in unconfigured state.
|
||||
wps_not_configured=1
|
||||
vlan_possible=1
|
||||
append_radius_server
|
||||
[ "$macfilter" = radius ] && {
|
||||
append_radius_server
|
||||
}
|
||||
;;
|
||||
psk|sae|psk-sae)
|
||||
json_get_vars key wpa_psk_file
|
||||
@@ -855,7 +793,6 @@ hostapd_set_bss_options() {
|
||||
}
|
||||
[ "$eapol_version" -ge "1" -a "$eapol_version" -le "2" ] && append bss_conf "eapol_version=$eapol_version" "$N"
|
||||
|
||||
append_radius_server
|
||||
set_default dynamic_vlan 0
|
||||
vlan_possible=1
|
||||
wps_possible=1
|
||||
@@ -988,11 +925,10 @@ hostapd_set_bss_options() {
|
||||
set_default ieee80211r 0
|
||||
|
||||
if [ "$ieee80211r" -gt "0" ]; then
|
||||
json_get_vars mobility_domain ft_psk_generate_local ft_over_ds reassociation_deadline ft_l2_refresh
|
||||
json_get_vars mobility_domain ft_psk_generate_local ft_over_ds reassociation_deadline
|
||||
|
||||
set_default mobility_domain "$(echo "$ssid" | md5sum | head -c 4)"
|
||||
set_default ft_over_ds 1
|
||||
set_default ft_l2_refresh 30
|
||||
set_default reassociation_deadline 1000
|
||||
skip_kh_setup=0
|
||||
|
||||
@@ -1015,10 +951,9 @@ hostapd_set_bss_options() {
|
||||
append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N"
|
||||
append bss_conf "ft_over_ds=$ft_over_ds" "$N"
|
||||
append bss_conf "reassociation_deadline=$reassociation_deadline" "$N"
|
||||
[ -n "$ft_l2_refresh" ] && append bss_conf "ft_l2_refresh=$ft_l2_refresh" "$N"
|
||||
|
||||
if [ "$skip_kh_setup" -eq "0" ]; then
|
||||
json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push ft_key
|
||||
json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push
|
||||
json_get_values r0kh r0kh
|
||||
json_get_values r1kh r1kh
|
||||
|
||||
@@ -1026,15 +961,12 @@ hostapd_set_bss_options() {
|
||||
set_default pmk_r1_push 0
|
||||
|
||||
[ -n "$r0kh" -a -n "$r1kh" ] || {
|
||||
[ -z "$ft_key" ] && {
|
||||
key=`echo -n "$mobility_domain/$auth_secret" | md5sum | awk '{print $1}'`
|
||||
key=`echo -n "$mobility_domain/$auth_secret" | md5sum | awk '{print $1}'`
|
||||
|
||||
set_default r0kh "ff:ff:ff:ff:ff:ff,*,$key"
|
||||
set_default r1kh "00:00:00:00:00:00,00:00:00:00:00:00,$key"
|
||||
}
|
||||
set_default r0kh "ff:ff:ff:ff:ff:ff,*,$key"
|
||||
set_default r1kh "00:00:00:00:00:00,00:00:00:00:00:00,$key"
|
||||
}
|
||||
|
||||
[ -n "$ft_key" ] && append bss_conf "ft_key=$ft_key" "$N"
|
||||
[ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N"
|
||||
append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
|
||||
append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
- wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s",
|
||||
- buf, ip_addr, keyid_buf, dpp_pkhash_buf);
|
||||
+ hostapd_ubus_notify_authorized(hapd, sta);
|
||||
+ hostapd_ubus_notify_authorized(hapd, sta, auth_alg);
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s%s",
|
||||
+ buf, ip_addr, keyid_buf, dpp_pkhash_buf, alg_buf);
|
||||
|
||||
@@ -458,6 +458,16 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -352,6 +355,9 @@ void hostapd_handle_radio_measurement(st
|
||||
mgmt->u.action.u.rrm.action, MAC2STR(mgmt->sa));
|
||||
|
||||
switch (mgmt->u.action.u.rrm.action) {
|
||||
+ case WLAN_RRM_LINK_MEASUREMENT_REPORT:
|
||||
+ hostapd_ubus_handle_link_measurement(hapd, buf, len);
|
||||
+ break;
|
||||
case WLAN_RRM_RADIO_MEASUREMENT_REPORT:
|
||||
hostapd_handle_radio_msmt_report(hapd, buf, len);
|
||||
break;
|
||||
--- a/src/ap/vlan_init.c
|
||||
+++ b/src/ap/vlan_init.c
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
@@ -88,14 +88,6 @@
|
||||
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
int reassoc);
|
||||
void hostapd_interface_deinit_free(struct hostapd_iface *iface);
|
||||
@@ -732,6 +741,7 @@ hostapd_switch_channel_fallback(struct h
|
||||
void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
|
||||
void hostapd_periodic_iface(struct hostapd_iface *iface);
|
||||
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
|
||||
+void hostapd_owe_update_trans(struct hostapd_iface *iface);
|
||||
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
|
||||
|
||||
void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -252,6 +252,8 @@ int hostapd_reload_config(struct hostapd
|
||||
@@ -115,15 +107,6 @@
|
||||
hostapd_ubus_free_bss(hapd);
|
||||
accounting_deinit(hapd);
|
||||
hostapd_deinit_wpa(hapd);
|
||||
@@ -538,7 +541,7 @@ void hostapd_free_hapd_data(struct hosta
|
||||
* Most of the modules that are initialized in hostapd_setup_bss() are
|
||||
* deinitialized here.
|
||||
*/
|
||||
-static void hostapd_cleanup(struct hostapd_data *hapd)
|
||||
+void hostapd_cleanup(struct hostapd_data *hapd)
|
||||
{
|
||||
wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s))", __func__, hapd,
|
||||
hapd->conf ? hapd->conf->iface : "N/A");
|
||||
@@ -600,6 +603,7 @@ void hostapd_cleanup_iface_partial(struc
|
||||
static void hostapd_cleanup_iface(struct hostapd_iface *iface)
|
||||
{
|
||||
@@ -140,25 +123,17 @@
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1211,7 +1216,7 @@ static int hostapd_start_beacon(struct h
|
||||
@@ -1211,8 +1216,7 @@ static int hostapd_start_beacon(struct h
|
||||
* initialized. Most of the modules that are initialized here will be
|
||||
* deinitialized in hostapd_cleanup().
|
||||
*/
|
||||
-static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
|
||||
+int hostapd_setup_bss(struct hostapd_data *hapd, int first,
|
||||
bool start_beacon)
|
||||
- bool start_beacon)
|
||||
+int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
|
||||
{
|
||||
struct hostapd_bss_config *conf = hapd->conf;
|
||||
@@ -2237,7 +2242,7 @@ static int hostapd_owe_iface_iter2(struc
|
||||
#endif /* CONFIG_OWE */
|
||||
|
||||
|
||||
-static void hostapd_owe_update_trans(struct hostapd_iface *iface)
|
||||
+void hostapd_owe_update_trans(struct hostapd_iface *iface)
|
||||
{
|
||||
#ifdef CONFIG_OWE
|
||||
/* Check whether the enabled BSS can complete OWE transition mode
|
||||
@@ -2698,7 +2703,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
u8 ssid[SSID_MAX_LEN + 1];
|
||||
@@ -2698,7 +2702,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +142,7 @@
|
||||
{
|
||||
if (!hapd)
|
||||
return;
|
||||
@@ -3491,7 +3496,8 @@ int hostapd_remove_iface(struct hapd_int
|
||||
@@ -3491,7 +3495,8 @@ int hostapd_remove_iface(struct hapd_int
|
||||
hapd_iface = interfaces->iface[i];
|
||||
if (hapd_iface == NULL)
|
||||
return -1;
|
||||
@@ -378,7 +353,7 @@
|
||||
tb[NL80211_ATTR_CENTER_FREQ1],
|
||||
tb[NL80211_ATTR_CENTER_FREQ2],
|
||||
tb[NL80211_ATTR_PUNCT_BITMAP],
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
1);
|
||||
break;
|
||||
case NL80211_CMD_DISCONNECT:
|
||||
@@ -576,148 +551,3 @@
|
||||
.send_mlme = driver_nl80211_send_mlme,
|
||||
.get_hw_feature_data = nl80211_get_hw_feature_data,
|
||||
.sta_add = wpa_driver_nl80211_sta_add,
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -547,11 +547,16 @@ static const char * sae_get_password(str
|
||||
struct sae_pt **s_pt,
|
||||
const struct sae_pk **s_pk)
|
||||
{
|
||||
+ struct hostapd_bss_config *conf = hapd->conf;
|
||||
+ struct hostapd_ssid *ssid = &conf->ssid;
|
||||
+ struct hostapd_sta_wpa_psk_short *psk;
|
||||
const char *password = NULL;
|
||||
- struct sae_password_entry *pw;
|
||||
- struct sae_pt *pt = NULL;
|
||||
- const struct sae_pk *pk = NULL;
|
||||
- struct hostapd_sta_wpa_psk_short *psk = NULL;
|
||||
+ struct sae_password_entry *pw = NULL;
|
||||
+ struct sae_pt *pt = NULL;
|
||||
+ const struct sae_pk *pk = NULL;
|
||||
+
|
||||
+ if (sta && sta->use_sta_psk)
|
||||
+ goto use_sta_psk;
|
||||
|
||||
for (pw = hapd->conf->sae_passwords; pw; pw = pw->next) {
|
||||
if (!is_broadcast_ether_addr(pw->peer_addr) &&
|
||||
@@ -582,6 +587,31 @@ static const char * sae_get_password(str
|
||||
}
|
||||
}
|
||||
|
||||
+use_sta_psk:
|
||||
+ if (!password && sta) {
|
||||
+ for (psk = sta->psk; psk; psk = psk->next) {
|
||||
+ if (!psk->is_passphrase)
|
||||
+ continue;
|
||||
+
|
||||
+ password = psk->passphrase;
|
||||
+ if (!sta->use_sta_psk)
|
||||
+ break;
|
||||
+
|
||||
+ if (sta->sae_pt) {
|
||||
+ pt = sta->sae_pt;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ pt = sae_derive_pt(conf->sae_groups, ssid->ssid,
|
||||
+ ssid->ssid_len,
|
||||
+ (const u8 *) password,
|
||||
+ os_strlen(password),
|
||||
+ NULL);
|
||||
+ sta->sae_pt = pt;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (pw_entry)
|
||||
*pw_entry = pw;
|
||||
if (s_pt)
|
||||
@@ -3105,6 +3135,12 @@ static void handle_auth(struct hostapd_d
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ res = hostapd_ucode_sta_auth(hapd, sta);
|
||||
+ if (res) {
|
||||
+ resp = res;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
sta->flags &= ~WLAN_STA_PREAUTH;
|
||||
ieee802_1x_notify_pre_auth(sta->eapol_sm, 0);
|
||||
|
||||
--- a/src/ap/sta_info.c
|
||||
+++ b/src/ap/sta_info.c
|
||||
@@ -425,6 +425,9 @@ void ap_free_sta(struct hostapd_data *ha
|
||||
forced_memzero(sta->last_tk, WPA_TK_MAX_LEN);
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
|
||||
+ if (sta->sae_pt)
|
||||
+ sae_deinit_pt(sta->sae_pt);
|
||||
+
|
||||
os_free(sta);
|
||||
}
|
||||
|
||||
@@ -1326,6 +1329,8 @@ void ap_sta_set_authorized(struct hostap
|
||||
sta->flags &= ~WLAN_STA_AUTHORIZED;
|
||||
}
|
||||
|
||||
+ if (authorized)
|
||||
+ hostapd_ucode_sta_connected(hapd, sta);
|
||||
#ifdef CONFIG_P2P
|
||||
if (hapd->p2p_group == NULL) {
|
||||
if (sta->p2p_ie != NULL &&
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -198,6 +198,9 @@ struct sta_info {
|
||||
int vlan_id_bound; /* updated by ap_sta_bind_vlan() */
|
||||
/* PSKs from RADIUS authentication server */
|
||||
struct hostapd_sta_wpa_psk_short *psk;
|
||||
+ struct sae_pt *sae_pt;
|
||||
+ int use_sta_psk;
|
||||
+ int psk_idx;
|
||||
|
||||
char *identity; /* User-Name from RADIUS */
|
||||
char *radius_cui; /* Chargeable-User-Identity from RADIUS */
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -341,6 +341,7 @@ static const u8 * hostapd_wpa_auth_get_p
|
||||
struct sta_info *sta = ap_get_sta(hapd, addr);
|
||||
const u8 *psk;
|
||||
|
||||
+ sta->psk_idx = 0;
|
||||
if (vlan_id)
|
||||
*vlan_id = 0;
|
||||
if (psk_len)
|
||||
@@ -387,13 +388,18 @@ static const u8 * hostapd_wpa_auth_get_p
|
||||
* returned psk which should not be returned again.
|
||||
* logic list (all hostapd_get_psk; all sta->psk)
|
||||
*/
|
||||
+ if (sta && sta->use_sta_psk)
|
||||
+ psk = NULL;
|
||||
if (sta && sta->psk && !psk) {
|
||||
struct hostapd_sta_wpa_psk_short *pos;
|
||||
+ int psk_idx;
|
||||
|
||||
if (vlan_id)
|
||||
*vlan_id = 0;
|
||||
psk = sta->psk->psk;
|
||||
+ sta->psk_idx = psk_idx = 1;
|
||||
for (pos = sta->psk; pos; pos = pos->next) {
|
||||
+ psk_idx++;
|
||||
if (pos->is_passphrase) {
|
||||
if (pbkdf2_sha1(pos->passphrase,
|
||||
hapd->conf->ssid.ssid,
|
||||
@@ -406,10 +412,14 @@ static const u8 * hostapd_wpa_auth_get_p
|
||||
pos->is_passphrase = 0;
|
||||
}
|
||||
if (pos->psk == prev_psk) {
|
||||
+ sta->psk_idx = psk_idx;
|
||||
psk = pos->next ? pos->next->psk : NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (!psk)
|
||||
+ sta->psk_idx = 0;
|
||||
}
|
||||
return psk;
|
||||
}
|
||||
|
||||
@@ -1,539 +0,0 @@
|
||||
--- a/src/ap/wpa_auth.h
|
||||
+++ b/src/ap/wpa_auth.h
|
||||
@@ -16,7 +16,11 @@
|
||||
|
||||
struct vlan_description;
|
||||
struct mld_info;
|
||||
-
|
||||
+struct rate_description {
|
||||
+ u32 rx;
|
||||
+ u32 tx;
|
||||
+};
|
||||
+
|
||||
#define MAX_OWN_IE_OVERRIDE 256
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@@ -88,6 +92,7 @@ struct ft_rrb_frame {
|
||||
#define FT_RRB_IDENTITY 15
|
||||
#define FT_RRB_RADIUS_CUI 16
|
||||
#define FT_RRB_SESSION_TIMEOUT 17 /* le32 seconds */
|
||||
+#define FT_RRB_RATE_LIMIT 18
|
||||
|
||||
struct ft_rrb_tlv {
|
||||
le16 type;
|
||||
@@ -368,6 +373,10 @@ struct wpa_auth_callbacks {
|
||||
struct vlan_description *vlan);
|
||||
int (*get_vlan)(void *ctx, const u8 *sta_addr,
|
||||
struct vlan_description *vlan);
|
||||
+ int (*set_rate_limit)(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate);
|
||||
+ int (*get_rate_limit)(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate);
|
||||
int (*set_identity)(void *ctx, const u8 *sta_addr,
|
||||
const u8 *identity, size_t identity_len);
|
||||
size_t (*get_identity)(void *ctx, const u8 *sta_addr, const u8 **buf);
|
||||
@@ -536,7 +545,7 @@ int wpa_ft_fetch_pmk_r1(struct wpa_authe
|
||||
struct vlan_description *vlan,
|
||||
const u8 **identity, size_t *identity_len,
|
||||
const u8 **radius_cui, size_t *radius_cui_len,
|
||||
- int *session_timeout);
|
||||
+ int *session_timeout, struct rate_description *rate);
|
||||
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -1200,6 +1200,40 @@ static int hostapd_wpa_auth_get_vlan(voi
|
||||
}
|
||||
|
||||
|
||||
+static int hostapd_wpa_auth_set_rate_limit(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = ctx;
|
||||
+ struct sta_info *sta;
|
||||
+
|
||||
+ sta = ap_get_sta(hapd, sta_addr);
|
||||
+ if (!sta || !sta->wpa_sm)
|
||||
+ return -1;
|
||||
+
|
||||
+ memcpy(sta->bandwidth, rate, sizeof(*rate));
|
||||
+ hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
||||
+ HOSTAPD_LEVEL_INFO, "rate-limit %d %d", sta->bandwidth[0], sta->bandwidth[1]);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int hostapd_wpa_auth_get_rate_limit(void *ctx, const u8 *sta_addr,
|
||||
+ struct rate_description *rate)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = ctx;
|
||||
+ struct sta_info *sta;
|
||||
+
|
||||
+ sta = ap_get_sta(hapd, sta_addr);
|
||||
+ if (!sta)
|
||||
+ return -1;
|
||||
+
|
||||
+ memcpy(rate, sta->bandwidth, sizeof(*rate));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
hostapd_wpa_auth_set_identity(void *ctx, const u8 *sta_addr,
|
||||
const u8 *identity, size_t identity_len)
|
||||
@@ -1640,6 +1674,8 @@ int hostapd_setup_wpa(struct hostapd_dat
|
||||
.add_tspec = hostapd_wpa_auth_add_tspec,
|
||||
.set_vlan = hostapd_wpa_auth_set_vlan,
|
||||
.get_vlan = hostapd_wpa_auth_get_vlan,
|
||||
+ .set_rate_limit = hostapd_wpa_auth_set_rate_limit,
|
||||
+ .get_rate_limit = hostapd_wpa_auth_get_rate_limit,
|
||||
.set_identity = hostapd_wpa_auth_set_identity,
|
||||
.get_identity = hostapd_wpa_auth_get_identity,
|
||||
.set_radius_cui = hostapd_wpa_auth_set_radius_cui,
|
||||
--- a/src/ap/wpa_auth_ft.c
|
||||
+++ b/src/ap/wpa_auth_ft.c
|
||||
@@ -379,6 +379,14 @@ static size_t wpa_ft_vlan_len(const stru
|
||||
return tlv_len;
|
||||
}
|
||||
|
||||
+static size_t wpa_ft_rate_limit_len(const struct rate_description *rate)
|
||||
+{
|
||||
+ if (!rate || (!rate->rx && !rate->tx))
|
||||
+ return 0;
|
||||
+
|
||||
+ return (sizeof(struct ft_rrb_tlv) + 8);
|
||||
+}
|
||||
+
|
||||
|
||||
static size_t wpa_ft_vlan_lin(const struct vlan_description *vlan,
|
||||
u8 *start, u8 *endpos)
|
||||
@@ -434,10 +442,48 @@ static size_t wpa_ft_vlan_lin(const stru
|
||||
}
|
||||
|
||||
|
||||
+static size_t wpa_ft_rate_limit_lin(const struct rate_description *rate,
|
||||
+ u8 *start, u8 *endpos)
|
||||
+{
|
||||
+ size_t tlv_len;
|
||||
+ int i, len;
|
||||
+ struct ft_rrb_tlv *hdr;
|
||||
+ u8 *pos = start;
|
||||
+
|
||||
+ if (!rate)
|
||||
+ return 0;
|
||||
+
|
||||
+ tlv_len = 0;
|
||||
+ if (rate->rx || rate->tx) {
|
||||
+ tlv_len += sizeof(*hdr);
|
||||
+ if (start + tlv_len > endpos)
|
||||
+ return tlv_len;
|
||||
+ hdr = (struct ft_rrb_tlv *) pos;
|
||||
+ hdr->type = host_to_le16(FT_RRB_RATE_LIMIT);
|
||||
+ hdr->len = host_to_le16(2 * sizeof(le32));
|
||||
+ pos = start + tlv_len;
|
||||
+
|
||||
+ tlv_len += sizeof(u32);
|
||||
+ if (start + tlv_len > endpos)
|
||||
+ return tlv_len;
|
||||
+ WPA_PUT_LE32(pos, rate->rx);
|
||||
+ pos = start + tlv_len;
|
||||
+ tlv_len += sizeof(u32);
|
||||
+ if (start + tlv_len > endpos)
|
||||
+ return tlv_len;
|
||||
+ WPA_PUT_LE32(pos, rate->tx);
|
||||
+ pos = start + tlv_len;
|
||||
+ }
|
||||
+
|
||||
+ return tlv_len;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int wpa_ft_rrb_lin(const struct tlv_list *tlvs1,
|
||||
const struct tlv_list *tlvs2,
|
||||
const struct vlan_description *vlan,
|
||||
- u8 **plain, size_t *plain_len)
|
||||
+ u8 **plain, size_t *plain_len,
|
||||
+ const struct rate_description *rate)
|
||||
{
|
||||
u8 *pos, *endpos;
|
||||
size_t tlv_len;
|
||||
@@ -445,6 +491,7 @@ static int wpa_ft_rrb_lin(const struct t
|
||||
tlv_len = wpa_ft_tlv_len(tlvs1);
|
||||
tlv_len += wpa_ft_tlv_len(tlvs2);
|
||||
tlv_len += wpa_ft_vlan_len(vlan);
|
||||
+ tlv_len += wpa_ft_rate_limit_len(rate);
|
||||
|
||||
*plain_len = tlv_len;
|
||||
*plain = os_zalloc(tlv_len);
|
||||
@@ -458,6 +505,7 @@ static int wpa_ft_rrb_lin(const struct t
|
||||
pos += wpa_ft_tlv_lin(tlvs1, pos, endpos);
|
||||
pos += wpa_ft_tlv_lin(tlvs2, pos, endpos);
|
||||
pos += wpa_ft_vlan_lin(vlan, pos, endpos);
|
||||
+ pos += wpa_ft_rate_limit_lin(rate, pos, endpos);
|
||||
|
||||
/* validity check */
|
||||
if (pos != endpos) {
|
||||
@@ -526,7 +574,8 @@ static int wpa_ft_rrb_build(const u8 *ke
|
||||
const struct tlv_list *tlvs_auth,
|
||||
const struct vlan_description *vlan,
|
||||
const u8 *src_addr, u8 type,
|
||||
- u8 **packet, size_t *packet_len)
|
||||
+ u8 **packet, size_t *packet_len,
|
||||
+ const struct rate_description *rate)
|
||||
{
|
||||
u8 *plain = NULL, *auth = NULL, *pos, *tmp;
|
||||
size_t plain_len = 0, auth_len = 0;
|
||||
@@ -534,10 +583,10 @@ static int wpa_ft_rrb_build(const u8 *ke
|
||||
size_t pad_len = 0;
|
||||
|
||||
*packet = NULL;
|
||||
- if (wpa_ft_rrb_lin(tlvs_enc0, tlvs_enc1, vlan, &plain, &plain_len) < 0)
|
||||
+ if (wpa_ft_rrb_lin(tlvs_enc0, tlvs_enc1, vlan, &plain, &plain_len, rate) < 0)
|
||||
goto out;
|
||||
|
||||
- if (wpa_ft_rrb_lin(tlvs_auth, NULL, NULL, &auth, &auth_len) < 0)
|
||||
+ if (wpa_ft_rrb_lin(tlvs_auth, NULL, NULL, &auth, &auth_len, NULL) < 0)
|
||||
goto out;
|
||||
|
||||
*packet_len = sizeof(u16) + auth_len + plain_len;
|
||||
@@ -700,6 +749,24 @@ static int wpa_ft_get_vlan(struct wpa_au
|
||||
}
|
||||
|
||||
|
||||
+static int wpa_ft_get_rate_limit(struct wpa_authenticator *wpa_auth,
|
||||
+ const u8 *sta_addr, struct rate_description *rate)
|
||||
+{
|
||||
+ if (!wpa_auth->cb->get_rate_limit)
|
||||
+ return -1;
|
||||
+ return wpa_auth->cb->get_rate_limit(wpa_auth->cb_ctx, sta_addr, rate);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int wpa_ft_set_rate_limit(struct wpa_authenticator *wpa_auth,
|
||||
+ const u8 *sta_addr, struct rate_description *rate)
|
||||
+{
|
||||
+ if (!wpa_auth->cb->set_rate_limit)
|
||||
+ return -1;
|
||||
+ return wpa_auth->cb->set_rate_limit(wpa_auth->cb_ctx, sta_addr, rate);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
wpa_ft_set_identity(struct wpa_authenticator *wpa_auth, const u8 *sta_addr,
|
||||
const u8 *identity, size_t identity_len)
|
||||
@@ -1025,7 +1092,7 @@ wpa_ft_rrb_seq_req(struct wpa_authentica
|
||||
|
||||
if (wpa_ft_rrb_build(key, key_len, NULL, NULL, seq_req_auth, NULL,
|
||||
wpa_auth->addr, FT_PACKET_R0KH_R1KH_SEQ_REQ,
|
||||
- &packet, &packet_len) < 0) {
|
||||
+ &packet, &packet_len, NULL) < 0) {
|
||||
item = NULL; /* some other seq resp might still accept this */
|
||||
goto err;
|
||||
}
|
||||
@@ -1208,6 +1275,7 @@ struct wpa_ft_pmk_r0_sa {
|
||||
u8 spa[ETH_ALEN];
|
||||
int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
|
||||
struct vlan_description *vlan;
|
||||
+ struct rate_description *rate;
|
||||
os_time_t expiration; /* 0 for no expiration */
|
||||
u8 *identity;
|
||||
size_t identity_len;
|
||||
@@ -1226,6 +1294,7 @@ struct wpa_ft_pmk_r1_sa {
|
||||
u8 spa[ETH_ALEN];
|
||||
int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
|
||||
struct vlan_description *vlan;
|
||||
+ struct rate_description *rate;
|
||||
u8 *identity;
|
||||
size_t identity_len;
|
||||
u8 *radius_cui;
|
||||
@@ -1254,6 +1323,7 @@ static void wpa_ft_free_pmk_r0(struct wp
|
||||
|
||||
os_memset(r0->pmk_r0, 0, PMK_LEN_MAX);
|
||||
os_free(r0->vlan);
|
||||
+ os_free(r0->rate);
|
||||
os_free(r0->identity);
|
||||
os_free(r0->radius_cui);
|
||||
os_free(r0);
|
||||
@@ -1307,6 +1377,7 @@ static void wpa_ft_free_pmk_r1(struct wp
|
||||
eloop_cancel_timeout(wpa_ft_expire_pmk_r1, r1, NULL);
|
||||
|
||||
os_memset(r1->pmk_r1, 0, PMK_LEN_MAX);
|
||||
+ os_free(r1->rate);
|
||||
os_free(r1->vlan);
|
||||
os_free(r1->identity);
|
||||
os_free(r1->radius_cui);
|
||||
@@ -1360,7 +1431,8 @@ static int wpa_ft_store_pmk_r0(struct wp
|
||||
const struct vlan_description *vlan,
|
||||
int expires_in, int session_timeout,
|
||||
const u8 *identity, size_t identity_len,
|
||||
- const u8 *radius_cui, size_t radius_cui_len)
|
||||
+ const u8 *radius_cui, size_t radius_cui_len,
|
||||
+ struct rate_description *rate)
|
||||
{
|
||||
struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
|
||||
struct wpa_ft_pmk_r0_sa *r0;
|
||||
@@ -1388,6 +1460,14 @@ static int wpa_ft_store_pmk_r0(struct wp
|
||||
}
|
||||
*r0->vlan = *vlan;
|
||||
}
|
||||
+ if (rate) {
|
||||
+ r0->rate = os_zalloc(sizeof(*rate));
|
||||
+ if (!r0->rate) {
|
||||
+ bin_clear_free(r0, sizeof(*r0));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *r0->rate = *rate;
|
||||
+ }
|
||||
if (identity) {
|
||||
r0->identity = os_malloc(identity_len);
|
||||
if (r0->identity) {
|
||||
@@ -1447,7 +1527,8 @@ static int wpa_ft_store_pmk_r1(struct wp
|
||||
const struct vlan_description *vlan,
|
||||
int expires_in, int session_timeout,
|
||||
const u8 *identity, size_t identity_len,
|
||||
- const u8 *radius_cui, size_t radius_cui_len)
|
||||
+ const u8 *radius_cui, size_t radius_cui_len,
|
||||
+ struct rate_description *rate)
|
||||
{
|
||||
struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
|
||||
int max_expires_in = wpa_auth->conf.r1_max_key_lifetime;
|
||||
@@ -1477,6 +1558,14 @@ static int wpa_ft_store_pmk_r1(struct wp
|
||||
}
|
||||
*r1->vlan = *vlan;
|
||||
}
|
||||
+ if (rate) {
|
||||
+ r1->rate = os_zalloc(sizeof(*rate));
|
||||
+ if (!r1->rate) {
|
||||
+ bin_clear_free(r1, sizeof(*r1));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *r1->rate = *rate;
|
||||
+ }
|
||||
if (identity) {
|
||||
r1->identity = os_malloc(identity_len);
|
||||
if (r1->identity) {
|
||||
@@ -1513,7 +1602,7 @@ int wpa_ft_fetch_pmk_r1(struct wpa_authe
|
||||
struct vlan_description *vlan,
|
||||
const u8 **identity, size_t *identity_len,
|
||||
const u8 **radius_cui, size_t *radius_cui_len,
|
||||
- int *session_timeout)
|
||||
+ int *session_timeout, struct rate_description *rate)
|
||||
{
|
||||
struct wpa_ft_pmk_cache *cache = wpa_auth->ft_pmk_cache;
|
||||
struct wpa_ft_pmk_r1_sa *r1;
|
||||
@@ -1533,6 +1622,12 @@ int wpa_ft_fetch_pmk_r1(struct wpa_authe
|
||||
*vlan = *r1->vlan;
|
||||
if (vlan && !r1->vlan)
|
||||
os_memset(vlan, 0, sizeof(*vlan));
|
||||
+ if (rate) {
|
||||
+ if (r1->rate)
|
||||
+ *rate = *r1->rate;
|
||||
+ else
|
||||
+ memset(rate, 0, sizeof(*rate));
|
||||
+ }
|
||||
if (identity && identity_len) {
|
||||
*identity = r1->identity;
|
||||
*identity_len = r1->identity_len;
|
||||
@@ -2059,7 +2154,7 @@ static int wpa_ft_pull_pmk_r1(struct wpa
|
||||
|
||||
if (wpa_ft_rrb_build(key, key_len, req_enc, NULL, req_auth, NULL,
|
||||
sm->wpa_auth->addr, FT_PACKET_R0KH_R1KH_PULL,
|
||||
- &packet, &packet_len) < 0)
|
||||
+ &packet, &packet_len, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
ft_pending_req_ies = wpabuf_alloc_copy(ies, ies_len);
|
||||
@@ -2088,6 +2183,7 @@ int wpa_ft_store_pmk_fils(struct wpa_sta
|
||||
{
|
||||
int expires_in = sm->wpa_auth->conf.r0_key_lifetime;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate;
|
||||
const u8 *identity, *radius_cui;
|
||||
size_t identity_len, radius_cui_len;
|
||||
int session_timeout;
|
||||
@@ -2099,6 +2195,7 @@ int wpa_ft_store_pmk_fils(struct wpa_sta
|
||||
MAC2STR(sm->addr));
|
||||
return -1;
|
||||
}
|
||||
+ wpa_ft_get_rate_limit(sm->wpa_auth, sm->addr, &rate);
|
||||
|
||||
identity_len = wpa_ft_get_identity(sm->wpa_auth, sm->addr, &identity);
|
||||
radius_cui_len = wpa_ft_get_radius_cui(sm->wpa_auth, sm->addr,
|
||||
@@ -2108,7 +2205,7 @@ int wpa_ft_store_pmk_fils(struct wpa_sta
|
||||
return wpa_ft_store_pmk_r0(sm->wpa_auth, sm->addr, pmk_r0, pmk_r0_len,
|
||||
pmk_r0_name, sm->pairwise, &vlan, expires_in,
|
||||
session_timeout, identity, identity_len,
|
||||
- radius_cui, radius_cui_len);
|
||||
+ radius_cui, radius_cui_len, &rate);
|
||||
}
|
||||
|
||||
|
||||
@@ -2172,6 +2269,7 @@ void wpa_auth_ft_store_keys(struct wpa_s
|
||||
int psk_local = sm->wpa_auth->conf.ft_psk_generate_local;
|
||||
int expires_in = sm->wpa_auth->conf.r0_key_lifetime;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate;
|
||||
const u8 *identity, *radius_cui;
|
||||
size_t identity_len, radius_cui_len;
|
||||
int session_timeout;
|
||||
@@ -2185,6 +2283,8 @@ void wpa_auth_ft_store_keys(struct wpa_s
|
||||
return;
|
||||
}
|
||||
|
||||
+ wpa_ft_get_rate_limit(sm->wpa_auth, sm->addr, &rate);
|
||||
+
|
||||
identity_len = wpa_ft_get_identity(sm->wpa_auth, sm->addr, &identity);
|
||||
radius_cui_len = wpa_ft_get_radius_cui(sm->wpa_auth, sm->addr,
|
||||
&radius_cui);
|
||||
@@ -2195,11 +2295,12 @@ void wpa_auth_ft_store_keys(struct wpa_s
|
||||
pmk_r0_name,
|
||||
sm->pairwise, &vlan, expires_in,
|
||||
session_timeout, identity, identity_len,
|
||||
- radius_cui, radius_cui_len);
|
||||
+ radius_cui, radius_cui_len, &rate);
|
||||
wpa_ft_store_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1, key_len,
|
||||
sm->pmk_r1_name, sm->pairwise, &vlan,
|
||||
expires_in, session_timeout, identity,
|
||||
- identity_len, radius_cui, radius_cui_len);
|
||||
+ identity_len, radius_cui, radius_cui_len,
|
||||
+ &rate);
|
||||
}
|
||||
|
||||
|
||||
@@ -3100,7 +3201,8 @@ static int wpa_ft_local_derive_pmk_r1(st
|
||||
const u8 **radius_cui,
|
||||
size_t *radius_cui_len,
|
||||
int *out_session_timeout,
|
||||
- size_t *pmk_r1_len)
|
||||
+ size_t *pmk_r1_len,
|
||||
+ struct rate_description *rate)
|
||||
{
|
||||
struct wpa_auth_config *conf = &wpa_auth->conf;
|
||||
const struct wpa_ft_pmk_r0_sa *r0;
|
||||
@@ -3136,7 +3238,8 @@ static int wpa_ft_local_derive_pmk_r1(st
|
||||
out_pmk_r1_name,
|
||||
sm->pairwise, r0->vlan, expires_in, session_timeout,
|
||||
r0->identity, r0->identity_len,
|
||||
- r0->radius_cui, r0->radius_cui_len);
|
||||
+ r0->radius_cui, r0->radius_cui_len,
|
||||
+ r0->rate);
|
||||
|
||||
*out_pairwise = sm->pairwise;
|
||||
if (vlan) {
|
||||
@@ -3146,6 +3249,13 @@ static int wpa_ft_local_derive_pmk_r1(st
|
||||
os_memset(vlan, 0, sizeof(*vlan));
|
||||
}
|
||||
|
||||
+ if (rate) {
|
||||
+ if (r0->rate)
|
||||
+ *rate = *r0->rate;
|
||||
+ else
|
||||
+ os_memset(rate, 0, sizeof(*rate));
|
||||
+ }
|
||||
+
|
||||
if (identity && identity_len) {
|
||||
*identity = r0->identity;
|
||||
*identity_len = r0->identity_len;
|
||||
@@ -3178,6 +3288,7 @@ static int wpa_ft_process_auth_req(struc
|
||||
u8 *pos, *end;
|
||||
int pairwise, session_timeout = 0;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate = {};
|
||||
const u8 *identity, *radius_cui;
|
||||
size_t identity_len = 0, radius_cui_len = 0;
|
||||
size_t pmk_r1_len, kdk_len, len;
|
||||
@@ -3274,7 +3385,7 @@ static int wpa_ft_process_auth_req(struc
|
||||
pmk_r1, &pmk_r1_len, &pairwise, &vlan,
|
||||
&identity, &identity_len, &radius_cui,
|
||||
&radius_cui_len,
|
||||
- &session_timeout) == 0) {
|
||||
+ &session_timeout, &rate) == 0) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"FT: Found PMKR1Name (using SHA%zu) from local cache",
|
||||
pmk_r1_len * 8);
|
||||
@@ -3290,7 +3401,7 @@ static int wpa_ft_process_auth_req(struc
|
||||
pmk_r1_name, pmk_r1, &pairwise,
|
||||
&vlan, &identity, &identity_len,
|
||||
&radius_cui, &radius_cui_len,
|
||||
- &session_timeout, &pmk_r1_len) == 0) {
|
||||
+ &session_timeout, &pmk_r1_len, &rate) == 0) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"FT: Generated PMK-R1 based on local PMK-R0");
|
||||
goto pmk_r1_derived;
|
||||
@@ -3392,6 +3503,7 @@ pmk_r1_derived:
|
||||
wpa_printf(MSG_DEBUG, "FT: Failed to configure VLAN");
|
||||
goto out;
|
||||
}
|
||||
+ wpa_ft_set_rate_limit(sm->wpa_auth, sm->addr, &rate);
|
||||
if (wpa_ft_set_identity(sm->wpa_auth, sm->addr,
|
||||
identity, identity_len) < 0 ||
|
||||
wpa_ft_set_radius_cui(sm->wpa_auth, sm->addr,
|
||||
@@ -3973,7 +4085,7 @@ static int wpa_ft_rrb_build_r0(const u8
|
||||
|
||||
ret = wpa_ft_rrb_build(key, key_len, tlvs, sess_tlv, tlv_auth,
|
||||
pmk_r0->vlan, src_addr, type,
|
||||
- packet, packet_len);
|
||||
+ packet, packet_len, pmk_r0->rate);
|
||||
|
||||
forced_memzero(pmk_r1, sizeof(pmk_r1));
|
||||
|
||||
@@ -4113,7 +4225,7 @@ static int wpa_ft_rrb_rx_pull(struct wpa
|
||||
ret = wpa_ft_rrb_build(key, key_len, resp, NULL, resp_auth,
|
||||
NULL, wpa_auth->addr,
|
||||
FT_PACKET_R0KH_R1KH_RESP,
|
||||
- &packet, &packet_len);
|
||||
+ &packet, &packet_len, NULL);
|
||||
} else {
|
||||
ret = wpa_ft_rrb_build_r0(key, key_len, resp, r0, f_r1kh_id,
|
||||
f_s1kh_id, resp_auth, wpa_auth->addr,
|
||||
@@ -4165,11 +4277,15 @@ static int wpa_ft_rrb_rx_r1(struct wpa_a
|
||||
size_t f_expires_in_len;
|
||||
size_t f_identity_len, f_radius_cui_len;
|
||||
size_t f_session_timeout_len;
|
||||
+ size_t f_rate_len;
|
||||
+ const u8 *f_rate;
|
||||
int pairwise;
|
||||
int ret = -1;
|
||||
int expires_in;
|
||||
int session_timeout;
|
||||
struct vlan_description vlan;
|
||||
+ struct rate_description rate;
|
||||
+ int has_rate = 0;
|
||||
size_t pmk_r1_len;
|
||||
|
||||
RRB_GET_AUTH(FT_RRB_R0KH_ID, r0kh_id, msgtype, -1);
|
||||
@@ -4279,6 +4395,13 @@ static int wpa_ft_rrb_rx_r1(struct wpa_a
|
||||
wpa_printf(MSG_DEBUG, "FT: vlan %d%s",
|
||||
le_to_host16(vlan.untagged), vlan.tagged[0] ? "+" : "");
|
||||
|
||||
+ RRB_GET_OPTIONAL(FT_RRB_RATE_LIMIT, rate, msgtype, 2 * sizeof(le32));
|
||||
+ if (f_rate) {
|
||||
+ memcpy(&rate, f_rate, sizeof(rate));
|
||||
+ rate.rx = le_to_host32(rate.rx);
|
||||
+ rate.tx = le_to_host32(rate.tx);
|
||||
+ has_rate = 1;
|
||||
+ };
|
||||
RRB_GET_OPTIONAL(FT_RRB_IDENTITY, identity, msgtype, -1);
|
||||
if (f_identity)
|
||||
wpa_hexdump_ascii(MSG_DEBUG, "FT: Identity", f_identity,
|
||||
@@ -4301,7 +4424,7 @@ static int wpa_ft_rrb_rx_r1(struct wpa_a
|
||||
f_pmk_r1_name,
|
||||
pairwise, &vlan, expires_in, session_timeout,
|
||||
f_identity, f_identity_len, f_radius_cui,
|
||||
- f_radius_cui_len) < 0)
|
||||
+ f_radius_cui_len, has_rate ? &rate : 0) < 0)
|
||||
goto out;
|
||||
|
||||
ret = 0;
|
||||
@@ -4614,7 +4737,7 @@ static int wpa_ft_rrb_rx_seq_req(struct
|
||||
|
||||
if (wpa_ft_rrb_build(key, key_len, NULL, NULL, seq_resp_auth, NULL,
|
||||
wpa_auth->addr, FT_PACKET_R0KH_R1KH_SEQ_RESP,
|
||||
- &packet, &packet_len) < 0)
|
||||
+ &packet, &packet_len, NULL) < 0)
|
||||
goto out;
|
||||
|
||||
wpa_ft_rrb_oui_send(wpa_auth, src_addr,
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/src/ap/wpa_auth_i.h
|
||||
+++ b/src/ap/wpa_auth_i.h
|
||||
@@ -54,6 +54,7 @@ struct wpa_state_machine {
|
||||
bool MICVerified;
|
||||
bool GUpdateStationKeys;
|
||||
u8 ANonce[WPA_NONCE_LEN];
|
||||
+ struct os_reltime ANonce_time;
|
||||
u8 SNonce[WPA_NONCE_LEN];
|
||||
u8 alt_SNonce[WPA_NONCE_LEN];
|
||||
u8 alt_replay_counter[WPA_REPLAY_COUNTER_LEN];
|
||||
@@ -1,147 +0,0 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -522,6 +522,7 @@ static void handle_auth_ft_finish(void *
|
||||
|
||||
hostapd_logger(hapd, dst, HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_DEBUG, "authentication OK (FT)");
|
||||
+ hostapd_ubus_notify(hapd, "ft-finish", sta->addr);
|
||||
sta->flags |= WLAN_STA_AUTH;
|
||||
mlme_authenticate_indication(hapd, sta);
|
||||
}
|
||||
@@ -5273,6 +5274,8 @@ static void handle_assoc(struct hostapd_
|
||||
}
|
||||
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
+ if (sta && reassoc)
|
||||
+ memcpy(sta->origin_ap, mgmt->u.reassoc_req.current_ap, 6);
|
||||
#ifdef CONFIG_IEEE80211R_AP
|
||||
if (sta && sta->auth_alg == WLAN_AUTH_FT &&
|
||||
(sta->flags & WLAN_STA_AUTH) == 0) {
|
||||
@@ -5426,6 +5429,7 @@ static void handle_assoc(struct hostapd_
|
||||
.type = HOSTAPD_UBUS_ASSOC_REQ,
|
||||
.mgmt_frame = mgmt,
|
||||
.ssi_signal = rssi,
|
||||
+ .reassoc = reassoc,
|
||||
};
|
||||
|
||||
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
|
||||
@@ -6496,7 +6500,7 @@ static void handle_assoc_cb(struct hosta
|
||||
* Open, static WEP, FT protocol, or FILS; no separate
|
||||
* authorization step.
|
||||
*/
|
||||
- ap_sta_set_authorized(hapd, sta, 1);
|
||||
+ _ap_sta_set_authorized(hapd, sta, 1, reassoc);
|
||||
}
|
||||
|
||||
if (reassoc)
|
||||
--- a/src/ap/ubus.c
|
||||
+++ b/src/ap/ubus.c
|
||||
@@ -1870,6 +1870,8 @@ int hostapd_ubus_handle_event(struct hos
|
||||
if (req->ssi_signal)
|
||||
blobmsg_add_u32(&b, "signal", req->ssi_signal);
|
||||
blobmsg_add_u32(&b, "freq", hapd->iface->freq);
|
||||
+ if (req->reassoc && req->mgmt_frame)
|
||||
+ blobmsg_add_macaddr(&b, "origin", req->mgmt_frame->u.reassoc_req.current_ap);
|
||||
|
||||
if (req->elems) {
|
||||
if(req->elems->ht_capabilities)
|
||||
@@ -1940,6 +1942,7 @@ void hostapd_ubus_notify(struct hostapd_
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "address", addr);
|
||||
blobmsg_add_string(&b, "ifname", hapd->conf->iface);
|
||||
+ blobmsg_printf(&b, "target", MACSTR, MAC2STR(hapd->conf->bssid));
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1);
|
||||
}
|
||||
@@ -1958,7 +1961,7 @@ void hostapd_ubus_notify_csa(struct host
|
||||
}
|
||||
|
||||
|
||||
-void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
+void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta, int reassoc)
|
||||
{
|
||||
if (!hapd->ubus.obj.has_subscribers)
|
||||
return;
|
||||
@@ -1975,6 +1978,9 @@ void hostapd_ubus_notify_authorized(stru
|
||||
blobmsg_add_u32(&b, "", sta->bandwidth[1]);
|
||||
blobmsg_close_array(&b, r);
|
||||
}
|
||||
+ if (reassoc)
|
||||
+ blobmsg_add_macaddr(&b, "origin", sta->origin_ap);
|
||||
+ blobmsg_printf(&b, "target", MACSTR, MAC2STR(hapd->conf->bssid));
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "sta-authorized", b.head, -1);
|
||||
}
|
||||
--- a/src/ap/ubus.h
|
||||
+++ b/src/ap/ubus.h
|
||||
@@ -22,6 +22,7 @@ struct hostapd_ubus_request {
|
||||
const struct ieee802_11_elems *elems;
|
||||
int ssi_signal; /* dBm */
|
||||
const u8 *addr;
|
||||
+ int reassoc;
|
||||
};
|
||||
|
||||
struct hostapd_iface;
|
||||
@@ -49,7 +50,7 @@ void hostapd_ubus_remove_vlan(struct hos
|
||||
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req);
|
||||
void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac);
|
||||
-void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
+void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta, int reassoc);
|
||||
void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
|
||||
const u8 *addr, u8 token, u8 rep_mode,
|
||||
struct rrm_measurement_beacon_report *rep,
|
||||
--- a/src/ap/sta_info.c
|
||||
+++ b/src/ap/sta_info.c
|
||||
@@ -1297,8 +1297,8 @@ const u8 * ap_sta_wpa_get_dpp_pkhash(str
|
||||
}
|
||||
|
||||
|
||||
-void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
- int authorized)
|
||||
+void _ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
+ int authorized, int reassoc)
|
||||
{
|
||||
const u8 *dev_addr = NULL;
|
||||
char buf[100];
|
||||
@@ -1404,7 +1404,7 @@ void ap_sta_set_authorized(struct hostap
|
||||
dpp_pkhash, SHA256_MAC_LEN);
|
||||
}
|
||||
|
||||
- hostapd_ubus_notify_authorized(hapd, sta);
|
||||
+ hostapd_ubus_notify_authorized(hapd, sta, reassoc);
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s%s",
|
||||
buf, ip_addr, keyid_buf, dpp_pkhash_buf, alg_buf);
|
||||
|
||||
@@ -1434,6 +1434,11 @@ void ap_sta_set_authorized(struct hostap
|
||||
}
|
||||
#endif /* CONFIG_FST */
|
||||
}
|
||||
+void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
+ int authorized)
|
||||
+{
|
||||
+ _ap_sta_set_authorized(hapd, sta, authorized, 0);
|
||||
+}
|
||||
|
||||
|
||||
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -102,6 +102,7 @@ struct sta_info {
|
||||
struct sta_info *next; /* next entry in sta list */
|
||||
struct sta_info *hnext; /* next entry in hash table list */
|
||||
u8 addr[6];
|
||||
+ u8 origin_ap[6];
|
||||
be32 ipaddr;
|
||||
struct dl_list ip6addr; /* list head for struct ip6addr */
|
||||
u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
|
||||
@@ -398,6 +399,9 @@ const u8 * ap_sta_wpa_get_dpp_pkhash(str
|
||||
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
const u8 *addr, u16 reason);
|
||||
|
||||
+void _ap_sta_set_authorized(struct hostapd_data *hapd,
|
||||
+ struct sta_info *sta, int authorized,
|
||||
+ int reassoc);
|
||||
void ap_sta_set_authorized(struct hostapd_data *hapd,
|
||||
struct sta_info *sta, int authorized);
|
||||
static inline int ap_sta_is_authorized(struct sta_info *sta)
|
||||
@@ -1,86 +0,0 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3152,6 +3152,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->ft_over_ds = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ft_psk_generate_local") == 0) {
|
||||
bss->ft_psk_generate_local = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "ft_l2_refresh") == 0) {
|
||||
+ bss->ft_l2_refresh = atoi(pos);
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
#ifndef CONFIG_NO_CTRL_IFACE
|
||||
} else if (os_strcmp(buf, "ctrl_interface") == 0) {
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -401,6 +401,7 @@ struct hostapd_bss_config {
|
||||
int pmk_r1_push;
|
||||
int ft_over_ds;
|
||||
int ft_psk_generate_local;
|
||||
+ int ft_l2_refresh;
|
||||
int r1_max_key_lifetime;
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -1495,6 +1495,28 @@ static void hostapd_request_radius_psk(v
|
||||
#endif /* CONFIG_NO_RADIUS */
|
||||
|
||||
|
||||
+static void wpa_ft_refresh(void *eloop_data, void *user_data)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = eloop_data;
|
||||
+ struct ft_rrb_frame *frame;
|
||||
+ struct l2_ethhdr *buf;
|
||||
+ size_t len;
|
||||
+
|
||||
+ len = sizeof(*buf) + sizeof(*frame);
|
||||
+ buf = os_zalloc(len);
|
||||
+ frame = (struct ft_rrb_frame *)(buf + 1);
|
||||
+ frame->frame_type = RSN_REMOTE_FRAME_TYPE_FT_RRB;
|
||||
+ frame->packet_type = FT_PACKET_REQUEST;
|
||||
+ memset(buf->h_dest, 0xff, ETH_ALEN);
|
||||
+ os_memcpy(buf->h_source, hapd->own_addr, ETH_ALEN);
|
||||
+ buf->h_proto = host_to_be16(ETH_P_RRB);
|
||||
+ l2_packet_send(hapd->l2, buf->h_dest, ETH_P_RRB, (u8 *) buf, len);
|
||||
+ os_free(buf);
|
||||
+
|
||||
+ eloop_register_timeout(hapd->conf->ft_l2_refresh, 0, wpa_ft_refresh,
|
||||
+ hapd, NULL);
|
||||
+}
|
||||
+
|
||||
int hostapd_setup_wpa(struct hostapd_data *hapd)
|
||||
{
|
||||
struct wpa_auth_config _conf;
|
||||
@@ -1640,6 +1662,9 @@ int hostapd_setup_wpa(struct hostapd_dat
|
||||
"Failed to open ETH_P_OUI interface");
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ if (hapd->conf->ft_l2_refresh)
|
||||
+ wpa_ft_refresh(hapd, NULL);
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
@@ -1655,7 +1680,6 @@ void hostapd_reconfig_wpa(struct hostapd
|
||||
wpa_reconfig(hapd->wpa_auth, &wpa_auth_conf);
|
||||
}
|
||||
|
||||
-
|
||||
void hostapd_deinit_wpa(struct hostapd_data *hapd)
|
||||
{
|
||||
ieee80211_tkip_countermeasures_deinit(hapd);
|
||||
@@ -1679,6 +1703,7 @@ void hostapd_deinit_wpa(struct hostapd_d
|
||||
"information element from interface %s",
|
||||
hapd->conf->iface);
|
||||
}
|
||||
+
|
||||
}
|
||||
ieee802_1x_deinit(hapd);
|
||||
|
||||
@@ -1687,6 +1712,7 @@ void hostapd_deinit_wpa(struct hostapd_d
|
||||
hostapd_wpa_ft_rrb_rx_later(hapd, NULL); /* flush without delivering */
|
||||
eloop_cancel_timeout(hostapd_oui_deliver_later, hapd, ELOOP_ALL_CTX);
|
||||
hostapd_oui_deliver_later(hapd, NULL); /* flush without delivering */
|
||||
+ eloop_cancel_timeout(wpa_ft_refresh, hapd, ELOOP_ALL_CTX);
|
||||
l2_packet_deinit(hapd->l2);
|
||||
hapd->l2 = NULL;
|
||||
hostapd_wpa_unregister_ft_oui(hapd);
|
||||
@@ -1,27 +0,0 @@
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -1995,6 +1995,13 @@ static int hostapd_owe_iface_iter(struct
|
||||
is_zero_ether_addr(bss->own_addr))
|
||||
continue;
|
||||
|
||||
+ if (!os_memcmp(hapd->conf->owe_transition_bssid, bss->own_addr,
|
||||
+ ETH_ALEN) &&
|
||||
+ hapd->conf->owe_transition_ssid_len == bss->conf->ssid.ssid_len &&
|
||||
+ !os_memcmp(hapd->conf->owe_transition_ssid, bss->conf->ssid.ssid,
|
||||
+ bss->conf->ssid.ssid_len))
|
||||
+ return 0;
|
||||
+
|
||||
os_memcpy(hapd->conf->owe_transition_bssid, bss->own_addr,
|
||||
ETH_ALEN);
|
||||
os_memcpy(hapd->conf->owe_transition_ssid,
|
||||
@@ -2011,10 +2018,6 @@ static int hostapd_owe_iface_iter(struct
|
||||
|
||||
int hostapd_owe_trans_get_info(struct hostapd_data *hapd)
|
||||
{
|
||||
- if (hapd->conf->owe_transition_ssid_len > 0 &&
|
||||
- !is_zero_ether_addr(hapd->conf->owe_transition_bssid))
|
||||
- return 0;
|
||||
-
|
||||
/* Find transition mode SSID/BSSID information from a BSS operated by
|
||||
* this hostapd instance. */
|
||||
if (!hapd->iface->interfaces ||
|
||||
@@ -1,53 +0,0 @@
|
||||
From 98b6503b87bb36bf2f5ae16e52e230e8870c867f Mon Sep 17 00:00:00 2001
|
||||
From: Venkat Chimata <venkata@shasta.cloud>
|
||||
Date: Fri, 28 Jun 2024 14:39:31 +0530
|
||||
Subject: [PATCH] hostapd: Fix DVLAN + 802.1x issue
|
||||
|
||||
In case of swconfig switches, the basename of the interface should be based on the last dot.
|
||||
Earlier it was done based on the first dot, which would result in incorrect basename.
|
||||
For example if the interface name is eth0.4087 then the vlan->ifname would be eth0.4087. (A dot at the end) .
|
||||
Before this patch, the basename was returned as eth0. It should be eth0.4087
|
||||
|
||||
Also fixed the return code by adding a default value of 0 and removed an unncessary check
|
||||
for if_add before ubus add call.
|
||||
|
||||
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
|
||||
---
|
||||
src/ap/vlan_init.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/ap/vlan_init.c b/src/ap/vlan_init.c
|
||||
index 3e27671..cfeb1e5 100644
|
||||
--- a/src/ap/vlan_init.c
|
||||
+++ b/src/ap/vlan_init.c
|
||||
@@ -23,7 +23,8 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
int existsok)
|
||||
{
|
||||
bool vlan_exists = iface_exists(vlan->ifname);
|
||||
- int ret;
|
||||
+ int ret = 0;
|
||||
+
|
||||
#ifdef CONFIG_WEP
|
||||
int i;
|
||||
|
||||
@@ -38,7 +39,7 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (!hapd->driver || !hapd->driver->if_add) {
|
||||
- char *dot = strstr(vlan->ifname, ".");
|
||||
+ char *dot = strrchr(vlan->ifname, '.');
|
||||
if (dot)
|
||||
*dot = '\0';
|
||||
ret = 0;
|
||||
@@ -59,7 +60,7 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
if (hapd->wpa_auth)
|
||||
ret = wpa_auth_ensure_group(hapd->wpa_auth, vlan->vlan_id);
|
||||
|
||||
- if (!ret && !vlan_exists && hapd->driver->if_add)
|
||||
+ if (!ret && !vlan_exists)
|
||||
hostapd_ubus_add_vlan(hapd, vlan);
|
||||
|
||||
if (ret == 0)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/src/radius/radius.c
|
||||
+++ b/src/radius/radius.c
|
||||
@@ -755,7 +755,7 @@ struct radius_attr_hdr * radius_msg_add_
|
||||
ext->length = sizeof(*ext) + 1 + alen;
|
||||
ext->ext_type = ext_type;
|
||||
wpabuf_put_u8(msg->buf, data_len > alen ? 0x80 : 0);
|
||||
- wpabuf_put_data(msg->buf, data, data_len);
|
||||
+ wpabuf_put_data(msg->buf, data, alen);
|
||||
data += alen;
|
||||
data_len -= alen;
|
||||
if (radius_msg_add_attr_to_array(
|
||||
@@ -1,69 +0,0 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3154,6 +3154,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->ft_psk_generate_local = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ft_l2_refresh") == 0) {
|
||||
bss->ft_l2_refresh = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "ft_key") == 0) {
|
||||
+ strncpy(bss->ft_key, pos, sizeof(bss->ft_key));
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
#ifndef CONFIG_NO_CTRL_IFACE
|
||||
} else if (os_strcmp(buf, "ctrl_interface") == 0) {
|
||||
@@ -4996,8 +4998,22 @@ struct hostapd_config * hostapd_config_r
|
||||
|
||||
fclose(f);
|
||||
|
||||
- for (i = 0; i < conf->num_bss; i++)
|
||||
+ for (i = 0; i < conf->num_bss; i++) {
|
||||
+ if (*conf->bss[i]->ft_key) {
|
||||
+ u8 buffer[128];
|
||||
+ sprintf(buffer, "%02X:%02X:%02X:%02X:%02X:%02X %02X%02X%02X%02X%02X%02X %s", MAC2STR(conf->bss[i]->bssid), MAC2STR(conf->bss[i]->bssid), conf->bss[i]->ft_key);
|
||||
+ add_r0kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "%02X:%02X:%02X:%02X:%02X:%02X %02X:%02X:%02X:%02X:%02X:%02X %s", MAC2STR(conf->bss[i]->bssid), MAC2STR(conf->bss[i]->bssid), conf->bss[i]->ft_key);
|
||||
+ add_r1kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "ff:ff:ff:ff:ff:ff * %s", conf->bss[i]->ft_key);
|
||||
+ add_r0kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "00:00:00:00:00:00 00:00:00:00:00:00 %s", conf->bss[i]->ft_key);
|
||||
+ add_r1kh(conf->bss[i], buffer);
|
||||
+ hexstr2bin(conf->bss[i]->bssid, conf->bss[i]->r1_key_holder, FT_R1KH_ID_LEN);
|
||||
+ conf->bss[i]->r0_key_holder_bssid = 1;
|
||||
+ }
|
||||
hostapd_set_security_params(conf->bss[i], 1);
|
||||
+ }
|
||||
|
||||
if (hostapd_config_check(conf, 1))
|
||||
errors++;
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -403,6 +403,7 @@ struct hostapd_bss_config {
|
||||
int ft_psk_generate_local;
|
||||
int ft_l2_refresh;
|
||||
int r1_max_key_lifetime;
|
||||
+ u8 ft_key[65];
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
char *ctrl_interface; /* directory for UNIX domain sockets */
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -390,6 +390,7 @@ struct hostapd_bss_config {
|
||||
/* IEEE 802.11r - Fast BSS Transition */
|
||||
u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
|
||||
u8 r1_key_holder[FT_R1KH_ID_LEN];
|
||||
+ int r0_key_holder_bssid;
|
||||
u32 r0_key_lifetime; /* PMK-R0 lifetime seconds */
|
||||
int rkh_pos_timeout;
|
||||
int rkh_neg_timeout;
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -80,7 +80,10 @@ static void hostapd_wpa_auth_conf(struct
|
||||
os_memcpy(wconf->ssid, conf->ssid.ssid, wconf->ssid_len);
|
||||
os_memcpy(wconf->mobility_domain, conf->mobility_domain,
|
||||
MOBILITY_DOMAIN_ID_LEN);
|
||||
- if (conf->nas_identifier &&
|
||||
+ if (1 || conf->r0_key_holder_bssid) {
|
||||
+ sprintf(wconf->r0_key_holder, "%02X%02X%02X%02X%02X%02X", MAC2STR(conf->bssid));
|
||||
+ wconf->r0_key_holder_len = 12;
|
||||
+ } else if (conf->nas_identifier &&
|
||||
os_strlen(conf->nas_identifier) <= FT_R0KH_ID_MAX_LEN) {
|
||||
wconf->r0_key_holder_len = os_strlen(conf->nas_identifier);
|
||||
os_memcpy(wconf->r0_key_holder, conf->nas_identifier,
|
||||
@@ -431,10 +431,6 @@ radius_user_parse_methods(struct eap_user *eap, struct blob_attr *data)
|
||||
eap->ttls_auth |= EAP_TTLS_AUTH_MSCHAPV2;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(method, "MACACL")) {
|
||||
eap->macacl = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
@@ -276,10 +276,24 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
blobmsg_add_u8(&b, sta_flags[i].name,
|
||||
!!(sta->flags & sta_flags[i].flag));
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
blobmsg_add_u8(&b, "mbo", !!(sta->cell_capa));
|
||||
#endif
|
||||
|
||||
r = blobmsg_open_array(&b, "rrm");
|
||||
for (i = 0; i < ARRAY_SIZE(sta->rrm_enabled_capa); i++)
|
||||
blobmsg_add_u32(&b, "", sta->rrm_enabled_capa[i]);
|
||||
blobmsg_close_array(&b, r);
|
||||
|
||||
r = blobmsg_open_array(&b, "extended_capabilities");
|
||||
/* Check if client advertises extended capabilities */
|
||||
if (sta->ext_capability && sta->ext_capability[0] > 0) {
|
||||
for (i = 0; i < sta->ext_capability[0]; i++) {
|
||||
blobmsg_add_u32(&b, "", sta->ext_capability[1 + i]);
|
||||
}
|
||||
}
|
||||
blobmsg_close_array(&b, r);
|
||||
|
||||
blobmsg_add_u32(&b, "aid", sta->aid);
|
||||
#ifdef CONFIG_TAXONOMY
|
||||
r = blobmsg_alloc_string_buffer(&b, "signature", 1024);
|
||||
@@ -309,7 +323,7 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
blobmsg_add_u32(&b, "retries", sta_driver_data.tx_retry_count);
|
||||
blobmsg_add_u32(&b, "failed", sta_driver_data.tx_retry_failed);
|
||||
blobmsg_add_u32(&b, "signal", sta_driver_data.signal);
|
||||
|
||||
|
||||
r = blobmsg_open_table(&b, "mcs");
|
||||
if (sta_driver_data.rx_hemcs) {
|
||||
blobmsg_add_u32(&b, "he", 1);
|
||||
@@ -339,7 +353,7 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs);
|
||||
}
|
||||
blobmsg_close_table(&b, r);
|
||||
|
||||
|
||||
if (sta->signal_mgmt)
|
||||
blobmsg_add_u32(&b, "signal_mgmt", sta->signal_mgmt);
|
||||
}
|
||||
@@ -369,32 +383,6 @@ hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Imported from iw/util.c
|
||||
* https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/tree/util.c?id=4b25ae3537af48dbf9d0abf94132e5ba01b32c18#n200
|
||||
*/
|
||||
int ieee80211_frequency_to_channel(int freq)
|
||||
{
|
||||
/* see 802.11-2007 17.3.8.3.2 and Annex J */
|
||||
if (freq == 2484)
|
||||
return 14;
|
||||
/* see 802.11ax D6.1 27.3.23.2 and Annex E */
|
||||
else if (freq == 5935)
|
||||
return 2;
|
||||
else if (freq < 2484)
|
||||
return (freq - 2407) / 5;
|
||||
else if (freq >= 4910 && freq <= 4980)
|
||||
return (freq - 4000) / 5;
|
||||
else if (freq < 5950)
|
||||
return (freq - 5000) / 5;
|
||||
else if (freq <= 45000) /* DMG band lower limit */
|
||||
/* see 802.11ax D6.1 27.3.23.2 */
|
||||
return (freq - 5950) / 5;
|
||||
else if (freq >= 58320 && freq <= 70200)
|
||||
return (freq - 56160) / 2160;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
@@ -429,6 +417,12 @@ hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
blobmsg_add_u32(&b, "channel", channel);
|
||||
blobmsg_add_u32(&b, "op_class", op_class);
|
||||
blobmsg_add_u32(&b, "beacon_interval", hapd->iconf->beacon_int);
|
||||
#ifdef CONFIG_IEEE80211AX
|
||||
blobmsg_add_u32(&b, "bss_color", hapd->iface->conf->he_op.he_bss_color_disabled ? -1 :
|
||||
hapd->iface->conf->he_op.he_bss_color);
|
||||
#else
|
||||
blobmsg_add_u32(&b, "bss_color", -1);
|
||||
#endif
|
||||
|
||||
snprintf(phy_name, 17, "%s", hapd->iface->phy);
|
||||
blobmsg_add_string(&b, "phy", phy_name);
|
||||
@@ -529,7 +523,6 @@ hostapd_bss_del_client_cb(struct hostapd_iface *iface, void *ctx)
|
||||
|
||||
hwaddr_aton(blobmsg_data(tb[DEL_CLIENT_ADDR]), addr);
|
||||
|
||||
syslog(0, "blogic %s:%s[%d]\n", __FILE__, __func__, __LINE__);
|
||||
for (i = 0; i < iface->num_bss; i++) {
|
||||
struct hostapd_data *bss = iface->bss[i];
|
||||
|
||||
@@ -547,7 +540,7 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
|
||||
struct sta_info *sta;
|
||||
bool deauth = false, global = false;
|
||||
int reason, ban_time = 0;;
|
||||
int reason, ban_time = 0;
|
||||
u8 addr[ETH_ALEN];
|
||||
|
||||
blobmsg_parse(del_policy, __DEL_CLIENT_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
@@ -567,6 +560,9 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
if (tb[DEL_CLIENT_GLOBAL_BAN])
|
||||
global = blobmsg_get_bool(tb[DEL_CLIENT_GLOBAL_BAN]);
|
||||
|
||||
if (tb[DEL_CLIENT_GLOBAL_BAN])
|
||||
global = blobmsg_get_bool(tb[DEL_CLIENT_GLOBAL_BAN]);
|
||||
|
||||
sta = ap_get_sta(hapd, addr);
|
||||
if (sta) {
|
||||
if (deauth) {
|
||||
@@ -579,7 +575,7 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
}
|
||||
|
||||
if (tb[DEL_CLIENT_BAN_TIME]) {
|
||||
ban_time = blobmsg_get_u32(tb[DEL_CLIENT_BAN_TIME]);
|
||||
ban_time = blobmsg_get_u32(tb[DEL_CLIENT_BAN_TIME]);
|
||||
if (global)
|
||||
hapd->iface->interfaces->for_each_interface(hapd->iface->interfaces, hostapd_bss_del_client_cb, tb);
|
||||
else
|
||||
@@ -848,8 +844,11 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
css.freq_params.sec_channel_offset,
|
||||
chwidth, seg0, seg1,
|
||||
iconf->vht_capab,
|
||||
mode ? &mode->he_capab[IEEE80211_MODE_AP] : NULL,
|
||||
mode ? &mode->eht_capab[IEEE80211_MODE_AP] : NULL);
|
||||
mode ? &mode->he_capab[IEEE80211_MODE_AP] :
|
||||
NULL,
|
||||
mode ? &mode->eht_capab[IEEE80211_MODE_AP] :
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < hapd->iface->num_bss; i++) {
|
||||
struct hostapd_data *bss = hapd->iface->bss[i];
|
||||
|
||||
@@ -951,6 +950,7 @@ hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr)
|
||||
enum {
|
||||
BSS_MGMT_EN_NEIGHBOR,
|
||||
BSS_MGMT_EN_BEACON,
|
||||
BSS_MGMT_EN_LINK_MEASUREMENT,
|
||||
#ifdef CONFIG_WNM_AP
|
||||
BSS_MGMT_EN_BSS_TRANSITION,
|
||||
#endif
|
||||
@@ -978,6 +978,14 @@ __hostapd_bss_mgmt_enable_f(struct hostapd_data *hapd, int flag)
|
||||
WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE |
|
||||
WLAN_RRM_CAPS_BEACON_REPORT_TABLE;
|
||||
|
||||
if (bss->radio_measurements[0] & flags == flags)
|
||||
return false;
|
||||
|
||||
bss->radio_measurements[0] |= (u8) flags;
|
||||
return true;
|
||||
case BSS_MGMT_EN_LINK_MEASUREMENT:
|
||||
flags = WLAN_RRM_CAPS_LINK_MEASUREMENT;
|
||||
|
||||
if (bss->radio_measurements[0] & flags == flags)
|
||||
return false;
|
||||
|
||||
@@ -1015,6 +1023,7 @@ __hostapd_bss_mgmt_enable(struct hostapd_data *hapd, uint32_t flags)
|
||||
static const struct blobmsg_policy bss_mgmt_enable_policy[__BSS_MGMT_EN_MAX] = {
|
||||
[BSS_MGMT_EN_NEIGHBOR] = { "neighbor_report", BLOBMSG_TYPE_BOOL },
|
||||
[BSS_MGMT_EN_BEACON] = { "beacon_report", BLOBMSG_TYPE_BOOL },
|
||||
[BSS_MGMT_EN_LINK_MEASUREMENT] = { "link_measurement", BLOBMSG_TYPE_BOOL },
|
||||
#ifdef CONFIG_WNM_AP
|
||||
[BSS_MGMT_EN_BSS_TRANSITION] = { "bss_transition", BLOBMSG_TYPE_BOOL },
|
||||
#endif
|
||||
@@ -1043,6 +1052,8 @@ hostapd_bss_mgmt_enable(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
}
|
||||
|
||||
__hostapd_bss_mgmt_enable(hapd, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1293,13 +1304,105 @@ hostapd_rrm_beacon_req(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum {
|
||||
LM_REQ_ADDR,
|
||||
LM_REQ_TX_POWER_USED,
|
||||
LM_REQ_TX_POWER_MAX,
|
||||
__LM_REQ_MAX,
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy lm_req_policy[__LM_REQ_MAX] = {
|
||||
[LM_REQ_ADDR] = { "addr", BLOBMSG_TYPE_STRING },
|
||||
[LM_REQ_TX_POWER_USED] = { "tx-power-used", BLOBMSG_TYPE_INT32 },
|
||||
[LM_REQ_TX_POWER_MAX] = { "tx-power-max", BLOBMSG_TYPE_INT32 },
|
||||
};
|
||||
|
||||
static int
|
||||
hostapd_rrm_lm_req(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *ureq, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
|
||||
struct blob_attr *tb[__LM_REQ_MAX];
|
||||
struct wpabuf *buf;
|
||||
u8 addr[ETH_ALEN];
|
||||
int ret;
|
||||
int8_t txp_used, txp_max;
|
||||
|
||||
txp_used = 0;
|
||||
txp_max = 0;
|
||||
|
||||
blobmsg_parse(lm_req_policy, __LM_REQ_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (!tb[LM_REQ_ADDR])
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (tb[LM_REQ_TX_POWER_USED])
|
||||
txp_used = (int8_t) blobmsg_get_u32(tb[LM_REQ_TX_POWER_USED]);
|
||||
|
||||
if (tb[LM_REQ_TX_POWER_MAX])
|
||||
txp_max = (int8_t) blobmsg_get_u32(tb[LM_REQ_TX_POWER_MAX]);
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[LM_REQ_ADDR]), addr))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
buf = wpabuf_alloc(5);
|
||||
if (!buf)
|
||||
return UBUS_STATUS_UNKNOWN_ERROR;
|
||||
|
||||
wpabuf_put_u8(buf, WLAN_ACTION_RADIO_MEASUREMENT);
|
||||
wpabuf_put_u8(buf, WLAN_RRM_LINK_MEASUREMENT_REQUEST);
|
||||
wpabuf_put_u8(buf, 1);
|
||||
/* TX-Power used */
|
||||
wpabuf_put_u8(buf, txp_used);
|
||||
/* Max TX Power */
|
||||
wpabuf_put_u8(buf, txp_max);
|
||||
|
||||
ret = hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr,
|
||||
wpabuf_head(buf), wpabuf_len(buf));
|
||||
|
||||
wpabuf_free(buf);
|
||||
if (ret < 0)
|
||||
return -ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len)
|
||||
{
|
||||
const struct ieee80211_mgmt *mgmt = (const struct ieee80211_mgmt *) data;
|
||||
const u8 *pos, *end;
|
||||
u8 token;
|
||||
|
||||
end = data + len;
|
||||
token = mgmt->u.action.u.rrm.dialog_token;
|
||||
pos = mgmt->u.action.u.rrm.variable;
|
||||
|
||||
if (end - pos < 8)
|
||||
return;
|
||||
|
||||
if (!hapd->ubus.obj.has_subscribers)
|
||||
return;
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "address", mgmt->sa);
|
||||
blobmsg_add_u16(&b, "dialog-token", token);
|
||||
blobmsg_add_u16(&b, "rx-antenna-id", pos[4]);
|
||||
blobmsg_add_u16(&b, "tx-antenna-id", pos[5]);
|
||||
blobmsg_add_u16(&b, "rcpi", pos[6]);
|
||||
blobmsg_add_u16(&b, "rsni", pos[7]);
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "link-measurement-report", b.head, -1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WNM_AP
|
||||
|
||||
static int
|
||||
hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent, bool abridged,
|
||||
u16 disassoc_timer, u8 validity_period, u8 dialog_token,
|
||||
struct blob_attr *neighbors)
|
||||
struct blob_attr *neighbors, u8 mbo_reason, u8 cell_pref, u8 reassoc_delay)
|
||||
{
|
||||
struct blob_attr *cur;
|
||||
struct sta_info *sta;
|
||||
@@ -1307,6 +1410,8 @@ hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent,
|
||||
int rem;
|
||||
u8 *nr = NULL;
|
||||
u8 req_mode = 0;
|
||||
u8 mbo[10];
|
||||
size_t mbo_len = 0;
|
||||
|
||||
sta = ap_get_sta(hapd, addr);
|
||||
if (!sta)
|
||||
@@ -1358,8 +1463,37 @@ hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent,
|
||||
if (disassoc_imminent)
|
||||
req_mode |= WNM_BSS_TM_REQ_DISASSOC_IMMINENT;
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
u8 *mbo_pos = mbo;
|
||||
|
||||
if (mbo_reason > MBO_TRANSITION_REASON_PREMIUM_AP)
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (cell_pref != 0 && cell_pref != 1 && cell_pref != 255)
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (reassoc_delay > 65535 || (reassoc_delay && !disassoc_imminent))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
*mbo_pos++ = MBO_ATTR_ID_TRANSITION_REASON;
|
||||
*mbo_pos++ = 1;
|
||||
*mbo_pos++ = mbo_reason;
|
||||
*mbo_pos++ = MBO_ATTR_ID_CELL_DATA_PREF;
|
||||
*mbo_pos++ = 1;
|
||||
*mbo_pos++ = cell_pref;
|
||||
|
||||
if (reassoc_delay) {
|
||||
*mbo_pos++ = MBO_ATTR_ID_ASSOC_RETRY_DELAY;
|
||||
*mbo_pos++ = 2;
|
||||
WPA_PUT_LE16(mbo_pos, reassoc_delay);
|
||||
mbo_pos += 2;
|
||||
}
|
||||
|
||||
mbo_len = mbo_pos - mbo;
|
||||
#endif
|
||||
|
||||
if (wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, validity_period, NULL,
|
||||
dialog_token, NULL, nr, nr_len, NULL, 0))
|
||||
dialog_token, NULL, nr, nr_len, mbo_len ? mbo : NULL, mbo_len))
|
||||
return UBUS_STATUS_UNKNOWN_ERROR;
|
||||
|
||||
return 0;
|
||||
@@ -1373,6 +1507,11 @@ enum {
|
||||
BSS_TR_NEIGHBORS,
|
||||
BSS_TR_ABRIDGED,
|
||||
BSS_TR_DIALOG_TOKEN,
|
||||
#ifdef CONFIG_MBO
|
||||
BSS_TR_MBO_REASON,
|
||||
BSS_TR_CELL_PREF,
|
||||
BSS_TR_REASSOC_DELAY,
|
||||
#endif
|
||||
__BSS_TR_DISASSOC_MAX
|
||||
};
|
||||
|
||||
@@ -1384,6 +1523,11 @@ static const struct blobmsg_policy bss_tr_policy[__BSS_TR_DISASSOC_MAX] = {
|
||||
[BSS_TR_NEIGHBORS] = { "neighbors", BLOBMSG_TYPE_ARRAY },
|
||||
[BSS_TR_ABRIDGED] = { "abridged", BLOBMSG_TYPE_BOOL },
|
||||
[BSS_TR_DIALOG_TOKEN] = { "dialog_token", BLOBMSG_TYPE_INT32 },
|
||||
#ifdef CONFIG_MBO
|
||||
[BSS_TR_MBO_REASON] = { "mbo_reason", BLOBMSG_TYPE_INT32 },
|
||||
[BSS_TR_CELL_PREF] = { "cell_pref", BLOBMSG_TYPE_INT32 },
|
||||
[BSS_TR_REASSOC_DELAY] = { "reassoc_delay", BLOBMSG_TYPE_INT32 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static int
|
||||
@@ -1400,6 +1544,9 @@ hostapd_bss_transition_request(struct ubus_context *ctx, struct ubus_object *obj
|
||||
u32 dialog_token = 1;
|
||||
bool abridged;
|
||||
bool da_imminent;
|
||||
u8 mbo_reason;
|
||||
u8 cell_pref;
|
||||
u8 reassoc_delay;
|
||||
|
||||
blobmsg_parse(bss_tr_policy, __BSS_TR_DISASSOC_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
@@ -1421,52 +1568,19 @@ hostapd_bss_transition_request(struct ubus_context *ctx, struct ubus_object *obj
|
||||
da_imminent = !!(tb[BSS_TR_DA_IMMINENT] && blobmsg_get_bool(tb[BSS_TR_DA_IMMINENT]));
|
||||
abridged = !!(tb[BSS_TR_ABRIDGED] && blobmsg_get_bool(tb[BSS_TR_ABRIDGED]));
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
if (tb[BSS_TR_MBO_REASON])
|
||||
mbo_reason = blobmsg_get_u32(tb[BSS_TR_MBO_REASON]);
|
||||
|
||||
if (tb[BSS_TR_CELL_PREF])
|
||||
cell_pref = blobmsg_get_u32(tb[BSS_TR_CELL_PREF]);
|
||||
|
||||
if (tb[BSS_TR_REASSOC_DELAY])
|
||||
reassoc_delay = blobmsg_get_u32(tb[BSS_TR_REASSOC_DELAY]);
|
||||
#endif
|
||||
|
||||
return hostapd_bss_tr_send(hapd, addr, da_imminent, abridged, da_timer, valid_period,
|
||||
dialog_token, tb[BSS_TR_NEIGHBORS]);
|
||||
}
|
||||
|
||||
enum {
|
||||
WNM_DISASSOC_ADDR,
|
||||
WNM_DISASSOC_DURATION,
|
||||
WNM_DISASSOC_NEIGHBORS,
|
||||
WNM_DISASSOC_ABRIDGED,
|
||||
__WNM_DISASSOC_MAX,
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy wnm_disassoc_policy[__WNM_DISASSOC_MAX] = {
|
||||
[WNM_DISASSOC_ADDR] = { "addr", BLOBMSG_TYPE_STRING },
|
||||
[WNM_DISASSOC_DURATION] { "duration", BLOBMSG_TYPE_INT32 },
|
||||
[WNM_DISASSOC_NEIGHBORS] { "neighbors", BLOBMSG_TYPE_ARRAY },
|
||||
[WNM_DISASSOC_ABRIDGED] { "abridged", BLOBMSG_TYPE_BOOL },
|
||||
};
|
||||
|
||||
static int
|
||||
hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *ureq, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
|
||||
struct blob_attr *tb[__WNM_DISASSOC_MAX];
|
||||
struct sta_info *sta;
|
||||
int duration = 10;
|
||||
u8 addr[ETH_ALEN];
|
||||
bool abridged;
|
||||
|
||||
blobmsg_parse(wnm_disassoc_policy, __WNM_DISASSOC_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (!tb[WNM_DISASSOC_ADDR])
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[WNM_DISASSOC_ADDR]), addr))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (tb[WNM_DISASSOC_DURATION])
|
||||
duration = blobmsg_get_u32(tb[WNM_DISASSOC_DURATION]);
|
||||
|
||||
abridged = !!(tb[WNM_DISASSOC_ABRIDGED] && blobmsg_get_bool(tb[WNM_DISASSOC_ABRIDGED]));
|
||||
|
||||
return hostapd_bss_tr_send(hapd, addr, true, abridged, duration, duration,
|
||||
1, tb[WNM_DISASSOC_NEIGHBORS]);
|
||||
dialog_token, tb[BSS_TR_NEIGHBORS], mbo_reason, cell_pref, reassoc_delay);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1601,8 +1715,8 @@ static const struct ubus_method bss_methods[] = {
|
||||
UBUS_METHOD_NOARG("rrm_nr_list", hostapd_rrm_nr_list),
|
||||
UBUS_METHOD("rrm_nr_set", hostapd_rrm_nr_set, nr_set_policy),
|
||||
UBUS_METHOD("rrm_beacon_req", hostapd_rrm_beacon_req, beacon_req_policy),
|
||||
UBUS_METHOD("link_measurement_req", hostapd_rrm_lm_req, lm_req_policy),
|
||||
#ifdef CONFIG_WNM_AP
|
||||
UBUS_METHOD("wnm_disassoc_imminent", hostapd_wnm_disassoc_imminent, wnm_disassoc_policy),
|
||||
UBUS_METHOD("bss_transition_request", hostapd_bss_transition_request, bss_tr_policy),
|
||||
#endif
|
||||
};
|
||||
@@ -1644,7 +1758,7 @@ hostapd_wired_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
blobmsg_add_u8(&b, sta_flags[i].name,
|
||||
!!(sta->flags & sta_flags[i].flag));
|
||||
|
||||
blobmsg_close_table(&b, c);
|
||||
blobmsg_close_table(&b, c);
|
||||
}
|
||||
blobmsg_close_array(&b, list);
|
||||
ubus_send_reply(ctx, req, b.head);
|
||||
@@ -1700,21 +1814,21 @@ hostapd_wired_mac_auth(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
{
|
||||
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
|
||||
struct blob_attr *tb[__MAC_AUTH_MAX];
|
||||
struct radius_sta rad_info;
|
||||
struct radius_sta rad_info;
|
||||
struct sta_info *sta;
|
||||
u8 addr[ETH_ALEN];
|
||||
int acl_res;
|
||||
|
||||
|
||||
blobmsg_parse(mac_auth_policy, __MAC_AUTH_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[MAC_AUTH_ADDR]), addr))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
acl_res = hostapd_allowed_address(hapd, addr, NULL, 0, &rad_info, 0);
|
||||
if (acl_res == HOSTAPD_ACL_REJECT) {
|
||||
wpa_printf(MSG_ERROR, "Ignore new peer notification\n");
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
}
|
||||
acl_res = hostapd_allowed_address(hapd, addr, NULL, 0, &rad_info, 0);
|
||||
if (acl_res == HOSTAPD_ACL_REJECT) {
|
||||
wpa_printf(MSG_ERROR, "Ignore new peer notification\n");
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1830,8 +1944,7 @@ ubus_event_cb(struct ubus_notify_request *req, int idx, int ret)
|
||||
{
|
||||
struct ubus_event_req *ureq = container_of(req, struct ubus_event_req, nreq);
|
||||
|
||||
if (!ureq->resp)
|
||||
ureq->resp = ret;
|
||||
ureq->resp = ret;
|
||||
}
|
||||
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
|
||||
@@ -1864,7 +1977,6 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "address", addr);
|
||||
blobmsg_add_string(&b, "ifname", hapd->conf->iface);
|
||||
if (req->mgmt_frame)
|
||||
blobmsg_add_macaddr(&b, "target", req->mgmt_frame->da);
|
||||
if (req->ssi_signal)
|
||||
@@ -1957,8 +2069,8 @@ void hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq)
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "channel-switch", b.head, -1);
|
||||
}
|
||||
|
||||
|
||||
void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
const char *auth_alg)
|
||||
{
|
||||
if (!hapd->ubus.obj.has_subscribers)
|
||||
return;
|
||||
@@ -1966,8 +2078,10 @@ void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "address", sta->addr);
|
||||
if (sta->vlan_id)
|
||||
blobmsg_add_u32(&b, "vlan", sta->vlan_id);
|
||||
blobmsg_add_u32(&b, "vlan", sta->vlan_id);
|
||||
blobmsg_add_string(&b, "ifname", hapd->conf->iface);
|
||||
if (auth_alg)
|
||||
blobmsg_add_string(&b, "auth-alg", auth_alg);
|
||||
if (sta->bandwidth[0] || sta->bandwidth[1]) {
|
||||
void *r = blobmsg_open_array(&b, "rate-limit");
|
||||
|
||||
@@ -1975,7 +2089,6 @@ void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *
|
||||
blobmsg_add_u32(&b, "", sta->bandwidth[1]);
|
||||
blobmsg_close_array(&b, r);
|
||||
}
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "sta-authorized", b.head, -1);
|
||||
}
|
||||
|
||||
@@ -2001,6 +2114,7 @@ void hostapd_ubus_notify_beacon_report(
|
||||
blobmsg_add_macaddr(&b, "bssid", rep->bssid);
|
||||
blobmsg_add_u16(&b, "antenna-id", rep->antenna_id);
|
||||
blobmsg_add_u16(&b, "parent-tsf", rep->parent_tsf);
|
||||
blobmsg_add_u16(&b, "rep-mode", rep_mode);
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "beacon-report", b.head, -1);
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan)
|
||||
void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan);
|
||||
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req);
|
||||
void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len);
|
||||
void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac);
|
||||
void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
|
||||
const u8 *addr, u8 token, u8 rep_mode,
|
||||
struct rrm_measurement_beacon_report *rep,
|
||||
@@ -66,7 +66,8 @@ void hostapd_ubus_free(struct hapd_interfaces *interfaces);
|
||||
int hostapd_ubus_notify_bss_transition_query(
|
||||
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason,
|
||||
const u8 *candidate_list, u16 candidate_list_len);
|
||||
void hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq);
|
||||
void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
const char *auth_alg);
|
||||
|
||||
#else
|
||||
|
||||
@@ -101,6 +102,10 @@ static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct ho
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac)
|
||||
{
|
||||
}
|
||||
@@ -138,6 +143,13 @@ static inline int hostapd_ubus_notify_bss_transition_query(
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
const char *auth_alg)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "ap_drv_ops.h"
|
||||
#include "dfs.h"
|
||||
#include "acs.h"
|
||||
#include "ieee802_11_auth.h"
|
||||
#include <libubox/uloop.h>
|
||||
|
||||
static uc_resource_type_t *global_type, *bss_type, *iface_type;
|
||||
@@ -52,7 +51,7 @@ hostapd_ucode_update_bss_list(struct hostapd_iface *iface, uc_value_t *if_bss, u
|
||||
int i;
|
||||
|
||||
list = ucv_array_new(vm);
|
||||
for (i = 0; iface->bss && i < iface->num_bss; i++) {
|
||||
for (i = 0; i < iface->num_bss; i++) {
|
||||
struct hostapd_data *hapd = iface->bss[i];
|
||||
uc_value_t *val = hostapd_ucode_bss_get_uval(hapd);
|
||||
|
||||
@@ -256,7 +255,6 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
|
||||
|
||||
hostapd_setup_bss(hapd, hapd == iface->bss[0], true);
|
||||
hostapd_ucode_update_interfaces();
|
||||
hostapd_owe_update_trans(iface);
|
||||
|
||||
done:
|
||||
ret = 0;
|
||||
@@ -377,7 +375,6 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs)
|
||||
conf->bss[idx] = NULL;
|
||||
ret = hostapd_ucode_bss_get_uval(hapd);
|
||||
hostapd_ucode_update_interfaces();
|
||||
hostapd_owe_update_trans(iface);
|
||||
goto out;
|
||||
|
||||
deinit_ctrl:
|
||||
@@ -606,7 +603,6 @@ out:
|
||||
|
||||
ieee802_11_set_beacon(hapd);
|
||||
}
|
||||
hostapd_owe_update_trans(iface);
|
||||
|
||||
return ucv_boolean_new(true);
|
||||
}
|
||||
@@ -698,7 +694,6 @@ uc_hostapd_bss_rename(uc_vm_t *vm, size_t nargs)
|
||||
hostapd_ubus_add_bss(hapd);
|
||||
|
||||
hostapd_ucode_update_interfaces();
|
||||
hostapd_owe_update_trans(hapd->iface);
|
||||
out:
|
||||
if (interfaces->ctrl_iface_init)
|
||||
interfaces->ctrl_iface_init(hapd);
|
||||
@@ -706,113 +701,6 @@ out:
|
||||
return ret ? NULL : ucv_boolean_new(true);
|
||||
}
|
||||
|
||||
int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
char addr[sizeof(MACSTR)];
|
||||
uc_value_t *val, *cur;
|
||||
int ret = 0;
|
||||
|
||||
if (wpa_ucode_call_prepare("sta_auth"))
|
||||
return 0;
|
||||
|
||||
uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface)));
|
||||
|
||||
snprintf(addr, sizeof(addr), MACSTR, MAC2STR(sta->addr));
|
||||
val = ucv_string_new(addr);
|
||||
uc_value_push(ucv_get(val));
|
||||
|
||||
val = wpa_ucode_call(2);
|
||||
|
||||
cur = ucv_object_get(val, "psk", NULL);
|
||||
if (ucv_type(cur) == UC_ARRAY) {
|
||||
struct hostapd_sta_wpa_psk_short *p, **next;
|
||||
size_t len = ucv_array_length(cur);
|
||||
|
||||
next = &sta->psk;
|
||||
hostapd_free_psk_list(*next);
|
||||
*next = NULL;
|
||||
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
uc_value_t *cur_psk;
|
||||
const char *str;
|
||||
size_t str_len;
|
||||
|
||||
cur_psk = ucv_array_get(cur, i);
|
||||
str = ucv_string_get(cur_psk);
|
||||
str_len = strlen(str);
|
||||
if (!str || str_len < 8 || str_len > 64)
|
||||
continue;
|
||||
|
||||
p = os_zalloc(sizeof(*p));
|
||||
if (len == 64) {
|
||||
if (hexstr2bin(str, p->psk, PMK_LEN) < 0) {
|
||||
free(p);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
p->is_passphrase = 1;
|
||||
memcpy(p->passphrase, str, str_len + 1);
|
||||
}
|
||||
|
||||
*next = p;
|
||||
next = &p->next;
|
||||
}
|
||||
}
|
||||
|
||||
cur = ucv_object_get(val, "force_psk", NULL);
|
||||
sta->use_sta_psk = ucv_is_truish(cur);
|
||||
|
||||
cur = ucv_object_get(val, "status", NULL);
|
||||
if (ucv_type(cur) == UC_INTEGER)
|
||||
ret = ucv_int64_get(cur);
|
||||
|
||||
ucv_put(val);
|
||||
ucv_gc(vm);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
struct hostapd_sta_wpa_psk_short *psk = sta->psk;
|
||||
char addr[sizeof(MACSTR)];
|
||||
uc_value_t *val, *cur;
|
||||
int ret = 0;
|
||||
|
||||
if (wpa_ucode_call_prepare("sta_connected"))
|
||||
return;
|
||||
|
||||
uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface)));
|
||||
|
||||
snprintf(addr, sizeof(addr), MACSTR, MAC2STR(sta->addr));
|
||||
val = ucv_string_new(addr);
|
||||
uc_value_push(ucv_get(val));
|
||||
|
||||
val = ucv_object_new(vm);
|
||||
if (sta->psk_idx)
|
||||
ucv_object_add(val, "psk_idx", ucv_int64_new(sta->psk_idx - 1));
|
||||
if (sta->psk)
|
||||
ucv_object_add(val, "psk", ucv_string_new(sta->psk->passphrase));
|
||||
uc_value_push(ucv_get(val));
|
||||
|
||||
val = wpa_ucode_call(3);
|
||||
if (ucv_type(val) != UC_OBJECT)
|
||||
goto out;
|
||||
|
||||
cur = ucv_object_get(val, "vlan", NULL);
|
||||
if (ucv_type(cur) == UC_INTEGER) {
|
||||
struct vlan_description vdesc = {
|
||||
.notempty = 1,
|
||||
.untagged = ucv_int64_get(cur),
|
||||
};
|
||||
|
||||
ap_sta_set_vlan(hapd, sta, &vdesc);
|
||||
ap_sta_bind_vlan(hapd, sta);
|
||||
}
|
||||
|
||||
out:
|
||||
ucv_put(val);
|
||||
}
|
||||
|
||||
int hostapd_ucode_init(struct hapd_interfaces *ifaces)
|
||||
{
|
||||
@@ -877,34 +765,6 @@ void hostapd_ucode_free_iface(struct hostapd_iface *iface)
|
||||
wpa_ucode_registry_remove(iface_registry, iface->ucode.idx);
|
||||
}
|
||||
|
||||
int hostapd_ucode_afc_request(struct hostapd_iface *iface, const char *request,
|
||||
char *buf, size_t len)
|
||||
{
|
||||
uc_value_t *val;
|
||||
size_t ret_len;
|
||||
int ret = -1;
|
||||
|
||||
if (wpa_ucode_call_prepare("afc_request"))
|
||||
return -1;
|
||||
|
||||
uc_value_push(ucv_get(ucv_string_new(iface->phy)));
|
||||
uc_value_push(ucv_get(ucv_string_new(request)));
|
||||
val = wpa_ucode_call(2);
|
||||
if (ucv_type(val) != UC_STRING)
|
||||
goto out;
|
||||
|
||||
ret_len = ucv_string_length(val);
|
||||
if (ret_len >= len)
|
||||
goto out;
|
||||
|
||||
memcpy(buf, ucv_string_get(val), ret_len + 1);
|
||||
ret = (int)ret_len;
|
||||
|
||||
out:
|
||||
ucv_put(val);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void hostapd_ucode_add_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
uc_value_t *val;
|
||||
|
||||
@@ -23,13 +23,9 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces);
|
||||
|
||||
void hostapd_ucode_free(void);
|
||||
void hostapd_ucode_free_iface(struct hostapd_iface *iface);
|
||||
int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta);
|
||||
void hostapd_ucode_add_bss(struct hostapd_data *hapd);
|
||||
void hostapd_ucode_free_bss(struct hostapd_data *hapd);
|
||||
void hostapd_ucode_reload_bss(struct hostapd_data *hapd);
|
||||
int hostapd_ucode_afc_request(struct hostapd_iface *iface, const char *request,
|
||||
char *buf, size_t len);
|
||||
|
||||
#else
|
||||
|
||||
@@ -46,13 +42,6 @@ static inline void hostapd_ucode_free_iface(struct hostapd_iface *iface)
|
||||
static inline void hostapd_ucode_reload_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
}
|
||||
static inline int hostapd_ucode_sta_auth(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
{
|
||||
}
|
||||
static inline void hostapd_ucode_add_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
|
||||
uc_value_t *sec = uc_fn_arg(1);
|
||||
int width = ucv_uint64_get(uc_fn_arg(2));
|
||||
int freq_val, center_idx, center_ofs;
|
||||
enum oper_chan_width chanwidth;
|
||||
enum hostapd_hw_mode hw_mode;
|
||||
u8 op_class, channel, tmp_channel;
|
||||
const char *modestr;
|
||||
int sec_channel = 0;
|
||||
uc_value_t *ret;
|
||||
int chanwidth;
|
||||
|
||||
if (ucv_type(freq) != UC_INTEGER)
|
||||
return NULL;
|
||||
@@ -77,13 +77,13 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
|
||||
|
||||
switch (width) {
|
||||
case 0:
|
||||
chanwidth = CHANWIDTH_USE_HT;
|
||||
chanwidth = CONF_OPER_CHWIDTH_USE_HT;
|
||||
break;
|
||||
case 1:
|
||||
chanwidth = CHANWIDTH_80MHZ;
|
||||
chanwidth = CONF_OPER_CHWIDTH_80MHZ;
|
||||
break;
|
||||
case 2:
|
||||
chanwidth = CHANWIDTH_160MHZ;
|
||||
chanwidth = CONF_OPER_CHWIDTH_160MHZ;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
|
||||
@@ -136,6 +136,7 @@ static uc_value_t *
|
||||
uc_wpas_add_iface(uc_vm_t *vm, size_t nargs)
|
||||
{
|
||||
uc_value_t *info = uc_fn_arg(0);
|
||||
uc_value_t *driver = ucv_object_get(info, "driver", NULL);
|
||||
uc_value_t *ifname = ucv_object_get(info, "iface", NULL);
|
||||
uc_value_t *bridge = ucv_object_get(info, "bridge", NULL);
|
||||
uc_value_t *config = ucv_object_get(info, "config", NULL);
|
||||
@@ -154,6 +155,22 @@ uc_wpas_add_iface(uc_vm_t *vm, size_t nargs)
|
||||
.ctrl_interface = ucv_string_get(ctrl),
|
||||
};
|
||||
|
||||
if (driver) {
|
||||
const char *drvname;
|
||||
if (ucv_type(driver) != UC_STRING)
|
||||
goto out;
|
||||
|
||||
iface.driver = NULL;
|
||||
drvname = ucv_string_get(driver);
|
||||
for (int i = 0; wpa_drivers[i]; i++) {
|
||||
if (!strcmp(drvname, wpa_drivers[i]->name))
|
||||
iface.driver = wpa_drivers[i]->name;
|
||||
}
|
||||
|
||||
if (!iface.driver)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!iface.ifname || !iface.confname)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -1,26 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
mt76_generate_macs() {
|
||||
sysfs="/sys/class/ieee80211"
|
||||
board=$(board_name)
|
||||
|
||||
case ${board} in
|
||||
sonicfi,rap630w-211g)
|
||||
eth=$(fw_printenv | grep ethaddr | cut -d= -f2)
|
||||
mac1=$(macaddr_add ${eth} 2)
|
||||
mac2=$(macaddr_add ${eth} 3)
|
||||
[ -d ${sysfs}/phy0 ] && echo ${mac1} > ${sysfs}/phy0/macaddress
|
||||
[ -d ${sysfs}/phy1 ] && echo ${mac2} > ${sysfs}/phy1/macaddress
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
[ "${ACTION}" = "add" ] && {
|
||||
mt76_generate_macs
|
||||
/sbin/wifi config
|
||||
}
|
||||
|
||||
@@ -1,378 +0,0 @@
|
||||
/dts-v1/;
|
||||
#include "mt7981.dtsi"
|
||||
/ {
|
||||
model = "EdgeCore EAP112";
|
||||
compatible = "edgecore,eap112";
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200n1 loglevel=8 \
|
||||
earlycon=uart8250,mmio32,0x11002000";
|
||||
};
|
||||
|
||||
aliases {
|
||||
led-boot = &led_green;
|
||||
led-failsafe = &led_green;
|
||||
led-running = &led_green;
|
||||
led-upgrade = &led_green;
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
memory {
|
||||
// fpga ddr2: 128MB*2
|
||||
reg = <0 0x40000000 0 0x20000000>;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_green: led@0 {
|
||||
label = "green:power";
|
||||
gpios = <&pio 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_orange: led@1 {
|
||||
label = "orange:wan";
|
||||
gpios = <&pio 34 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_blue: led@2 {
|
||||
label = "blue:wlan5g";
|
||||
gpios = <&pio 35 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
nmbm_spim_nand {
|
||||
compatible = "generic,nmbm";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
lower-mtd-device = <&spi_nand>;
|
||||
forced-create;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "BL2";
|
||||
reg = <0x00000 0x0100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x0100000 0x0080000>;
|
||||
};
|
||||
|
||||
factory: partition@180000 {
|
||||
label = "Factory";
|
||||
reg = <0x180000 0x0200000>;
|
||||
};
|
||||
|
||||
partition@380000 {
|
||||
label = "FIP";
|
||||
reg = <0x380000 0x0200000>;
|
||||
};
|
||||
|
||||
partition@580000 {
|
||||
label = "rootfs1";
|
||||
reg = <0x580000 0x4000000>;
|
||||
compatible = "linux,ubi";
|
||||
};
|
||||
|
||||
partition@4580000 {
|
||||
label = "rootfs2";
|
||||
reg = <0x4580000 0x4000000>;
|
||||
compatible = "linux,ubi";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sound_wm8960 {
|
||||
compatible = "mediatek,mt7986-wm8960-sound";
|
||||
audio-routing = "Headphone", "HP_L",
|
||||
"Headphone", "HP_R",
|
||||
"LINPUT1", "AMIC",
|
||||
"RINPUT1", "AMIC";
|
||||
|
||||
status = "disabled";
|
||||
|
||||
platform {
|
||||
sound-dai = <&afe>;
|
||||
};
|
||||
|
||||
codec {
|
||||
sound-dai = <&wm8960>;
|
||||
};
|
||||
};
|
||||
|
||||
sound_si3218x {
|
||||
compatible = "mediatek,mt7986-si3218x-sound";
|
||||
status = "disabled";
|
||||
|
||||
platform {
|
||||
sound-dai = <&afe>;
|
||||
};
|
||||
|
||||
codec {
|
||||
sound-dai = <&proslic_spi>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&afe {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcm_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
status = "disabled";
|
||||
|
||||
wm8960: wm8960@1a {
|
||||
compatible = "wlf,wm8960";
|
||||
reg = <0x1a>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart2_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac0: mac@0 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-mode = "sgmii";
|
||||
phy-handle = <&phy1>; // add phy handler
|
||||
mtd-mac-address = <&factory 0x24>;
|
||||
};
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&phy0>;
|
||||
mtd-mac-address = <&factory 0x2a>;
|
||||
};
|
||||
|
||||
mdio: mdio-bus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-id03a2.9461";
|
||||
reg = <0>;
|
||||
phy-mode = "gmii";
|
||||
nvmem-cells = <&phy_calibration>;
|
||||
nvmem-cell-names = "phy-cal-data";
|
||||
};
|
||||
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-id03a2.9471";
|
||||
reg = <24>; // set phy address to 0x18
|
||||
reset-gpios = <&pio 39 1>;
|
||||
reset-assert-us = <600>;
|
||||
reset-deassert-us = <20000>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
&hnat {
|
||||
mtketh-wan = "eth1";
|
||||
mtketh-lan = "lan";
|
||||
mtketh-max-gmac = <2>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_flash_pins>;
|
||||
status = "okay";
|
||||
spi_nand: spi_nand@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <52000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spic_pins>;
|
||||
status = "okay";
|
||||
|
||||
proslic_spi: proslic_spi@0 {
|
||||
compatible = "silabs,proslic_spi";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <10000000>;
|
||||
spi-cpha = <1>;
|
||||
spi-cpol = <1>;
|
||||
channel_count = <1>;
|
||||
debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */
|
||||
reset_gpio = <&pio 15 0>;
|
||||
ig,enable-spi = <1>; /* 1: Enable, 0: Disable */
|
||||
};
|
||||
};
|
||||
|
||||
&wbsys {
|
||||
mediatek,mtd-eeprom = <&factory 0x0000>;
|
||||
status = "okay";
|
||||
pinctrl-names = "dbdc";
|
||||
pinctrl-0 = <&wf_dbdc_pins>;
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi2_pins>;
|
||||
status = "okay";
|
||||
|
||||
slb9670: slb9670@0 {
|
||||
compatible = "infineon,slb9670";
|
||||
reg = <0>; /* CE0 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-cal-enable;
|
||||
spi-cal-mode = "read-data";
|
||||
spi-cal-datalen = <2>;
|
||||
spi-cal-data = /bits/ 8 <0x00 0x1b>;
|
||||
spi-max-frequency = <40000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pio {
|
||||
|
||||
i2c_pins: i2c-pins-g0 {
|
||||
mux {
|
||||
function = "i2c";
|
||||
groups = "i2c0_0";
|
||||
};
|
||||
};
|
||||
|
||||
pcm_pins: pcm-pins-g0 {
|
||||
mux {
|
||||
function = "pcm";
|
||||
groups = "pcm";
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_pin: pwm0-pin-g0 {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm0_0";
|
||||
};
|
||||
};
|
||||
|
||||
pwm1_pin: pwm1-pin-g0 {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm1_0";
|
||||
};
|
||||
};
|
||||
|
||||
pwm2_pin: pwm2-pin {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm2";
|
||||
};
|
||||
};
|
||||
|
||||
spi0_flash_pins: spi0-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
|
||||
conf-pu {
|
||||
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
|
||||
conf-pd {
|
||||
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
|
||||
spic_pins: spi1-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi1_1";
|
||||
};
|
||||
};
|
||||
|
||||
spi2_pins: spi2-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi2";
|
||||
};
|
||||
};
|
||||
|
||||
uart1_pins: uart1-pins-g1 {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart1_1";
|
||||
};
|
||||
};
|
||||
|
||||
uart2_pins: uart2-pins-g1 {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart2_1";
|
||||
};
|
||||
};
|
||||
|
||||
wf_dbdc_pins: wf_dbdc-pins {
|
||||
mux {
|
||||
function = "eth";
|
||||
groups = "wf0_mode1";
|
||||
};
|
||||
conf {
|
||||
pins = "WF_HB1", "WF_HB2", "WF_HB3", "WF_HB4",
|
||||
"WF_HB0", "WF_HB0_B", "WF_HB5", "WF_HB6",
|
||||
"WF_HB7", "WF_HB8", "WF_HB9", "WF_HB10",
|
||||
"WF_TOP_CLK", "WF_TOP_DATA", "WF_XO_REQ",
|
||||
"WF_CBA_RESETB", "WF_DIG_RESETB";
|
||||
drive-strength = <MTK_DRIVE_4mA>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&xhci {
|
||||
mediatek,u3p-dis-msk = <0x0>;
|
||||
phys = <&u2port0 PHY_TYPE_USB2>,
|
||||
<&u3port0 PHY_TYPE_USB3>;
|
||||
status = "okay";
|
||||
};
|
||||
@@ -1,560 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
#include "mt7981.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0 0x40000000 0 0x10000000>;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
|
||||
mesh {
|
||||
label = "mesh";
|
||||
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <BTN_9>;
|
||||
linux,input-type = <EV_SW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_blue {
|
||||
label = "sys:blue";
|
||||
gpios = <&pio 23 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "timer";
|
||||
active-delay = <500>;
|
||||
inactive-delay = <500>;
|
||||
default-state="on";
|
||||
};
|
||||
|
||||
led_green {
|
||||
label = "sys:green";
|
||||
gpios = <&pio 24 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "timer";
|
||||
active-delay = <500>;
|
||||
inactive-delay = <500>;
|
||||
default-state="on";
|
||||
};
|
||||
|
||||
led_red {
|
||||
label = "sys:red";
|
||||
gpios = <&pio 25 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "timer";
|
||||
active-delay = <500>;
|
||||
inactive-delay = <500>;
|
||||
default-state="on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac0: mac@0 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
speed = <2500>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&phy0>;
|
||||
};
|
||||
|
||||
mdio: mdio-bus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-id03a2.9461";
|
||||
reg = <0>;
|
||||
phy-mode = "gmii";
|
||||
nvmem-cells = <&phy_calibration>;
|
||||
nvmem-cell-names = "phy-cal-data";
|
||||
};
|
||||
|
||||
switch@0 {
|
||||
compatible = "mediatek,mt7531";
|
||||
reg = <31>;
|
||||
reset-gpios = <&pio 39 0>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
port@2 {
|
||||
reg = <2>;
|
||||
label = "lan3";
|
||||
};
|
||||
|
||||
port@6 {
|
||||
reg = <6>;
|
||||
label = "cpu";
|
||||
ethernet = <&gmac0>;
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
speed = <2500>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
spi_nand: flash@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <52000000>;
|
||||
spi-tx-buswidth = <4>;
|
||||
spi-rx-buswidth = <4>;
|
||||
|
||||
partitions: partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "BL2";
|
||||
reg = <0x00 0x100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x0100000 0x0080000>;
|
||||
};
|
||||
|
||||
factory: partition@180000 {
|
||||
label = "Factory";
|
||||
reg = <0x180000 0x200000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
reg = <0x4 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
partition@380000 {
|
||||
label = "FIP";
|
||||
reg = <0x380000 0x200000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@580000 {
|
||||
label = "ubi";
|
||||
reg = <0x580000 0x6000000>;
|
||||
};
|
||||
|
||||
partition@7580000 {
|
||||
label = "devinfo";
|
||||
reg = <0x6580000 0x00080000>;
|
||||
};
|
||||
|
||||
partition@7600000 {
|
||||
label ="certificates";
|
||||
reg = <0x6600000 0x00080000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pio {
|
||||
i2c_pins: i2c-pins-g0 {
|
||||
mux {
|
||||
function = "i2c";
|
||||
groups = "i2c0_1";
|
||||
};
|
||||
};
|
||||
spi0_flash_pins: spi0-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
|
||||
conf-pu {
|
||||
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
|
||||
conf-pd {
|
||||
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
pse_out_en {
|
||||
gpios = <&pio 27 GPIO_ACTIVE_HIGH>;
|
||||
output-high;
|
||||
};
|
||||
pse_int_n {
|
||||
gpios = <&pio 29 GPIO_ACTIVE_LOW>;
|
||||
input;
|
||||
};
|
||||
};
|
||||
|
||||
&hnat {
|
||||
mtketh-wan = "eth1";
|
||||
mtketh-lan = "lan";
|
||||
mtketh-max-gmac = <2>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
status = "okay";
|
||||
|
||||
};
|
||||
|
||||
&pio {
|
||||
wf_dbdc_pins: wf_dbdc-pins {
|
||||
mux {
|
||||
function = "eth";
|
||||
groups = "wf0_mode1";
|
||||
};
|
||||
conf {
|
||||
pins = "WF_HB1", "WF_HB2", "WF_HB3", "WF_HB4",
|
||||
"WF_HB0", "WF_HB0_B", "WF_HB5", "WF_HB6",
|
||||
"WF_HB7", "WF_HB8", "WF_HB9", "WF_HB10",
|
||||
"WF_TOP_CLK", "WF_TOP_DATA", "WF_XO_REQ",
|
||||
"WF_CBA_RESETB", "WF_DIG_RESETB";
|
||||
drive-strength = <MTK_DRIVE_4mA>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&wbsys {
|
||||
status = "okay";
|
||||
|
||||
mediatek,mtd-eeprom = <&factory 0x0>;
|
||||
pinctrl-names = "dbdc";
|
||||
pinctrl-0 = <&wf_dbdc_pins>;
|
||||
power-limits {
|
||||
r0 {
|
||||
regdomain = "fcc";
|
||||
txpower-2g {
|
||||
r0 {
|
||||
channels = <1 1>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-cck = <38 38 38 38>;
|
||||
rates-ofdm = <37 37 37 37 37 37 37 37>;
|
||||
rates-mcs =
|
||||
<1 36 36 36 36 36 36 36 36 34 33>,
|
||||
<3 34 34 34 34 34 34 34 34 34 33>;
|
||||
rates-ru =
|
||||
<4 36 36 36 36 36 36 36 36 34 33 32 32>,
|
||||
<3 34 34 34 34 34 34 34 34 34 33 32 32>;
|
||||
};
|
||||
r1 {
|
||||
channels = <2 3>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-cck = <38 38 38 38>;
|
||||
rates-ofdm = <38 38 38 38 38 38 38 37>;
|
||||
rates-mcs =
|
||||
<1 38 38 38 38 38 38 37 36 34 33>,
|
||||
<3 34 34 34 34 34 34 34 34 34 33>;
|
||||
rates-ru =
|
||||
<4 38 38 38 38 38 38 37 36 34 33 32 32>,
|
||||
<3 34 34 34 34 34 34 34 34 34 33 32 32>;
|
||||
};
|
||||
r2 {
|
||||
channels = <4 8>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-cck = <38 38 38 38>;
|
||||
rates-ofdm = <38 38 38 38 38 38 38 37>;
|
||||
rates-mcs =
|
||||
<1 38 38 38 38 38 38 37 36 34 33>,
|
||||
<3 36 36 36 36 36 36 36 36 34 33>;
|
||||
rates-ru =
|
||||
<4 38 38 38 38 38 38 37 36 34 33 32 32>,
|
||||
<3 36 36 36 36 36 36 36 36 34 33 32 32>;
|
||||
};
|
||||
r3 {
|
||||
channels = <9 14>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-cck = <38 38 38 38>;
|
||||
rates-ofdm = <38 38 38 38 38 38 38 37>;
|
||||
rates-mcs =
|
||||
<1 38 38 38 38 38 38 37 36 34 33>,
|
||||
<3 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<4 38 38 38 38 38 38 37 36 34 33 32 32>,
|
||||
<3 32 32 32 32 32 32 32 32 32 32 32 32>;
|
||||
};
|
||||
};
|
||||
txpower-5g {
|
||||
r0 {
|
||||
channels = <184 196>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<2 40 40 40 40 40 39 38 36 35 34>,
|
||||
<2 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<5 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r1 {
|
||||
channels = <8 16>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<2 40 40 40 40 40 39 38 36 35 34>,
|
||||
<2 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<5 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r2 {
|
||||
channels = <36 40>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<1 40 40 40 40 40 39 38 36 35 34>,
|
||||
<1 38 38 38 38 38 38 38 36 35 34>,
|
||||
<2 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<4 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 38 38 38 38 38 38 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r3 {
|
||||
channels = <44 44>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<2 40 40 40 40 40 39 38 36 35 34>,
|
||||
<2 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<5 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r4 {
|
||||
channels = <48 48>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <39 39 39 39 39 39 39 38>;
|
||||
rates-mcs =
|
||||
<2 40 40 40 40 40 39 38 36 35 34>,
|
||||
<2 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<5 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r5 {
|
||||
channels = <52 96>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <36 36 36 36 36 36 36 36>;
|
||||
rates-mcs =
|
||||
<3 36 36 36 36 36 36 36 36 35 34>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<6 36 36 36 36 36 36 36 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r6 {
|
||||
channels = <100 112>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <36 36 36 36 36 36 36 36>;
|
||||
rates-mcs =
|
||||
<2 36 36 36 36 36 36 36 36 35 34>,
|
||||
<1 35 35 35 35 35 35 35 35 35 34>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<5 36 36 36 36 36 36 36 36 35 34 32 32>,
|
||||
<1 35 35 35 35 35 35 35 35 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r7 {
|
||||
channels = <116 144>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <36 36 36 36 36 36 36 36>;
|
||||
rates-mcs =
|
||||
<3 36 36 36 36 36 36 36 36 35 34>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<6 36 36 36 36 36 36 36 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r8 {
|
||||
channels = <149 181>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<3 40 40 40 40 40 39 38 36 35 34>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<6 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
};
|
||||
};
|
||||
r1 {
|
||||
regdomain = "etsi";
|
||||
txpower-2g {
|
||||
r0 {
|
||||
channels = <1 14>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-cck = <29 29 29 29>;
|
||||
rates-ofdm = <30 30 30 30 30 30 30 30>;
|
||||
rates-mcs =
|
||||
<4 28 28 28 28 28 28 28 28 28 28>;
|
||||
rates-ru =
|
||||
<7 28 28 28 28 28 28 28 28 28 28 28 28>;
|
||||
};
|
||||
};
|
||||
txpower-5g {
|
||||
r0 {
|
||||
channels = <184 196>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <33 33 33 33 33 33 33 33>;
|
||||
rates-mcs =
|
||||
<4 33 33 33 33 33 33 33 33 33 33>;
|
||||
rates-ru =
|
||||
<6 33 33 33 33 33 33 33 33 33 33 32 32>,
|
||||
<1 33 33 33 33 33 33 33 33 33 33 30 30>;
|
||||
};
|
||||
r1 {
|
||||
channels = <8 16>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <33 33 33 33 33 33 33 33>;
|
||||
rates-mcs =
|
||||
<4 33 33 33 33 33 33 33 33 33 33>;
|
||||
rates-ru =
|
||||
<6 33 33 33 33 33 33 33 33 33 33 32 32>,
|
||||
<1 33 33 33 33 33 33 33 33 33 33 30 30>;
|
||||
};
|
||||
r2 {
|
||||
channels = <36 48>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <33 33 33 33 33 33 33 33>;
|
||||
rates-mcs =
|
||||
<4 33 33 33 33 33 33 33 33 33 33>;
|
||||
rates-ru =
|
||||
<6 33 33 33 33 33 33 33 33 33 33 32 32>,
|
||||
<1 33 33 33 33 33 33 33 33 33 33 30 30>;
|
||||
};
|
||||
r3 {
|
||||
channels = <52 96>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <33 33 33 33 33 33 33 33>;
|
||||
rates-mcs =
|
||||
<1 32 32 32 32 32 32 32 32 32 32>,
|
||||
<3 33 33 33 33 33 33 33 33 33 33>;
|
||||
rates-ru =
|
||||
<4 32 32 32 32 32 32 32 32 32 32 32 32>,
|
||||
<2 33 33 33 33 33 33 33 33 33 33 32 32>,
|
||||
<1 33 33 33 33 33 33 33 33 33 33 30 30>;
|
||||
};
|
||||
r4 {
|
||||
channels = <100 128>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<3 40 40 40 40 40 39 38 36 35 34>,
|
||||
<1 40 40 40 39 39 38 36 35 34 33>;
|
||||
rates-ru =
|
||||
<6 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 40 40 40 39 39 38 36 35 34 33 30 30>;
|
||||
};
|
||||
r5 {
|
||||
channels = <132 144>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<3 40 40 40 40 40 39 38 36 35 34>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<6 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
r6 {
|
||||
channels = <149 181>;
|
||||
txs-delta = <0 0 0>;
|
||||
rates-ofdm = <40 40 40 40 40 40 39 38>;
|
||||
rates-mcs =
|
||||
<3 40 40 40 40 40 39 38 36 35 34>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32>;
|
||||
rates-ru =
|
||||
<6 40 40 40 40 40 39 38 36 35 34 32 32>,
|
||||
<1 32 32 32 32 32 32 32 32 32 32 30 30>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
/ {
|
||||
model = "SONICFI RAP630W-211G";
|
||||
compatible = "sonicfi,rap630w-211g", "mediatek,mt7981";
|
||||
};
|
||||
|
||||
|
||||
@@ -61,52 +61,6 @@ define Device/edgecore_eap111
|
||||
endef
|
||||
TARGET_DEVICES += edgecore_eap111
|
||||
|
||||
define Device/edgecore_eap112
|
||||
DEVICE_VENDOR := EdgeCore
|
||||
DEVICE_MODEL := EAP112
|
||||
DEVICE_DTS := mt7981-edgecore-eap112
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||
SUPPORTED_DEVICES := edgecore,eap112
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
IMAGE_SIZE := 65536k
|
||||
KERNEL_IN_UBI := 1
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7981-firmware kmod-mt7915e
|
||||
endef
|
||||
TARGET_DEVICES += edgecore_eap112
|
||||
|
||||
define Device/sonicfi_rap630w_211g
|
||||
DEVICE_VENDOR := SONICFI
|
||||
DEVICE_MODEL := RAP630W-211G
|
||||
DEVICE_DTS := mt7981b-sonicfi-rap630w-211g
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||
SUPPORTED_DEVICES := sonicfi,rap630w-211g
|
||||
DEVICE_PACKAGES := kmod-mt7981-firmware kmod-mt7915e kmod-hwmon-tps23861 \
|
||||
e2fsprogs f2fsck mkf2fs
|
||||
KERNEL := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL_IN_UBI := 1
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
IMAGE_SIZE := 65536k
|
||||
ROOTFSNAME_IN_UBI := rootfs
|
||||
UBOOTENV_IN_UBI := 1
|
||||
IMAGES := sysupgrade.tar
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
|
||||
pad-rootfs | append-metadata
|
||||
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += sonicfi_rap630w_211g
|
||||
|
||||
define Device/mt7981-spim-nand-gsw
|
||||
DEVICE_VENDOR := MediaTek
|
||||
DEVICE_MODEL := mt7981-spim-nand-gsw
|
||||
|
||||
@@ -1,378 +0,0 @@
|
||||
/dts-v1/;
|
||||
#include "mt7981.dtsi"
|
||||
/ {
|
||||
model = "EdgeCore EAP112";
|
||||
compatible = "edgecore,eap112";
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200n1 loglevel=8 \
|
||||
earlycon=uart8250,mmio32,0x11002000";
|
||||
};
|
||||
|
||||
aliases {
|
||||
led-boot = &led_green;
|
||||
led-failsafe = &led_green;
|
||||
led-running = &led_green;
|
||||
led-upgrade = &led_green;
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
memory {
|
||||
// fpga ddr2: 128MB*2
|
||||
reg = <0 0x40000000 0 0x20000000>;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_green: led@0 {
|
||||
label = "green:power";
|
||||
gpios = <&pio 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_orange: led@1 {
|
||||
label = "orange:wan";
|
||||
gpios = <&pio 34 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_blue: led@2 {
|
||||
label = "blue:wlan5g";
|
||||
gpios = <&pio 35 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
nmbm_spim_nand {
|
||||
compatible = "generic,nmbm";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
lower-mtd-device = <&spi_nand>;
|
||||
forced-create;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "BL2";
|
||||
reg = <0x00000 0x0100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x0100000 0x0080000>;
|
||||
};
|
||||
|
||||
factory: partition@180000 {
|
||||
label = "Factory";
|
||||
reg = <0x180000 0x0200000>;
|
||||
};
|
||||
|
||||
partition@380000 {
|
||||
label = "FIP";
|
||||
reg = <0x380000 0x0200000>;
|
||||
};
|
||||
|
||||
partition@580000 {
|
||||
label = "rootfs1";
|
||||
reg = <0x580000 0x4000000>;
|
||||
compatible = "linux,ubi";
|
||||
};
|
||||
|
||||
partition@4580000 {
|
||||
label = "rootfs2";
|
||||
reg = <0x4580000 0x4000000>;
|
||||
compatible = "linux,ubi";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sound_wm8960 {
|
||||
compatible = "mediatek,mt7986-wm8960-sound";
|
||||
audio-routing = "Headphone", "HP_L",
|
||||
"Headphone", "HP_R",
|
||||
"LINPUT1", "AMIC",
|
||||
"RINPUT1", "AMIC";
|
||||
|
||||
status = "disabled";
|
||||
|
||||
platform {
|
||||
sound-dai = <&afe>;
|
||||
};
|
||||
|
||||
codec {
|
||||
sound-dai = <&wm8960>;
|
||||
};
|
||||
};
|
||||
|
||||
sound_si3218x {
|
||||
compatible = "mediatek,mt7986-si3218x-sound";
|
||||
status = "disabled";
|
||||
|
||||
platform {
|
||||
sound-dai = <&afe>;
|
||||
};
|
||||
|
||||
codec {
|
||||
sound-dai = <&proslic_spi>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&afe {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcm_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
status = "disabled";
|
||||
|
||||
wm8960: wm8960@1a {
|
||||
compatible = "wlf,wm8960";
|
||||
reg = <0x1a>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart2_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac0: mac@0 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-mode = "sgmii";
|
||||
phy-handle = <&phy1>; // add phy handler
|
||||
mtd-mac-address = <&factory 0x24>;
|
||||
};
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&phy0>;
|
||||
mtd-mac-address = <&factory 0x2a>;
|
||||
};
|
||||
|
||||
mdio: mdio-bus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-id03a2.9461";
|
||||
reg = <0>;
|
||||
phy-mode = "gmii";
|
||||
nvmem-cells = <&phy_calibration>;
|
||||
nvmem-cell-names = "phy-cal-data";
|
||||
};
|
||||
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-id03a2.9471";
|
||||
reg = <24>; // set phy address to 0x18
|
||||
reset-gpios = <&pio 39 1>;
|
||||
reset-assert-us = <600>;
|
||||
reset-deassert-us = <20000>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
&hnat {
|
||||
mtketh-wan = "eth1";
|
||||
mtketh-lan = "lan";
|
||||
mtketh-max-gmac = <2>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_flash_pins>;
|
||||
status = "okay";
|
||||
spi_nand: spi_nand@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <52000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spic_pins>;
|
||||
status = "okay";
|
||||
|
||||
proslic_spi: proslic_spi@0 {
|
||||
compatible = "silabs,proslic_spi";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <10000000>;
|
||||
spi-cpha = <1>;
|
||||
spi-cpol = <1>;
|
||||
channel_count = <1>;
|
||||
debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */
|
||||
reset_gpio = <&pio 15 0>;
|
||||
ig,enable-spi = <1>; /* 1: Enable, 0: Disable */
|
||||
};
|
||||
};
|
||||
|
||||
&wbsys {
|
||||
mediatek,mtd-eeprom = <&factory 0x0000>;
|
||||
status = "okay";
|
||||
pinctrl-names = "dbdc";
|
||||
pinctrl-0 = <&wf_dbdc_pins>;
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi2_pins>;
|
||||
status = "okay";
|
||||
|
||||
slb9670: slb9670@0 {
|
||||
compatible = "infineon,slb9670";
|
||||
reg = <0>; /* CE0 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-cal-enable;
|
||||
spi-cal-mode = "read-data";
|
||||
spi-cal-datalen = <2>;
|
||||
spi-cal-data = /bits/ 8 <0x00 0x1b>;
|
||||
spi-max-frequency = <40000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pio {
|
||||
|
||||
i2c_pins: i2c-pins-g0 {
|
||||
mux {
|
||||
function = "i2c";
|
||||
groups = "i2c0_0";
|
||||
};
|
||||
};
|
||||
|
||||
pcm_pins: pcm-pins-g0 {
|
||||
mux {
|
||||
function = "pcm";
|
||||
groups = "pcm";
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_pin: pwm0-pin-g0 {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm0_0";
|
||||
};
|
||||
};
|
||||
|
||||
pwm1_pin: pwm1-pin-g0 {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm1_0";
|
||||
};
|
||||
};
|
||||
|
||||
pwm2_pin: pwm2-pin {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm2";
|
||||
};
|
||||
};
|
||||
|
||||
spi0_flash_pins: spi0-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
|
||||
conf-pu {
|
||||
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
|
||||
conf-pd {
|
||||
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
|
||||
spic_pins: spi1-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi1_1";
|
||||
};
|
||||
};
|
||||
|
||||
spi2_pins: spi2-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi2";
|
||||
};
|
||||
};
|
||||
|
||||
uart1_pins: uart1-pins-g1 {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart1_1";
|
||||
};
|
||||
};
|
||||
|
||||
uart2_pins: uart2-pins-g1 {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart2_1";
|
||||
};
|
||||
};
|
||||
|
||||
wf_dbdc_pins: wf_dbdc-pins {
|
||||
mux {
|
||||
function = "eth";
|
||||
groups = "wf0_mode1";
|
||||
};
|
||||
conf {
|
||||
pins = "WF_HB1", "WF_HB2", "WF_HB3", "WF_HB4",
|
||||
"WF_HB0", "WF_HB0_B", "WF_HB5", "WF_HB6",
|
||||
"WF_HB7", "WF_HB8", "WF_HB9", "WF_HB10",
|
||||
"WF_TOP_CLK", "WF_TOP_DATA", "WF_XO_REQ",
|
||||
"WF_CBA_RESETB", "WF_DIG_RESETB";
|
||||
drive-strength = <MTK_DRIVE_4mA>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&xhci {
|
||||
mediatek,u3p-dis-msk = <0x0>;
|
||||
phys = <&u2port0 PHY_TYPE_USB2>,
|
||||
<&u3port0 PHY_TYPE_USB3>;
|
||||
status = "okay";
|
||||
};
|
||||
@@ -6,8 +6,7 @@ board=$(board_name)
|
||||
board_config_update
|
||||
|
||||
case $board in
|
||||
edgecore,eap111|\
|
||||
edgecore,eap112)
|
||||
edgecore,eap111)
|
||||
ucidef_set_led_netdev "wan" "wan" "orange:wan" "eth1"
|
||||
ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0"
|
||||
;;
|
||||
|
||||
49
feeds/mediatek-sdk/mediatek/mt7981/base-files/etc/board.d/02_network
Normal file → Executable file
49
feeds/mediatek-sdk/mediatek/mt7981/base-files/etc/board.d/02_network
Normal file → Executable file
@@ -1,9 +1,8 @@
|
||||
#!/bin/sh
|
||||
. /lib/uboot-envtools.sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
. /lib/rap211g-envtools.sh
|
||||
|
||||
mediatek_setup_interfaces()
|
||||
{
|
||||
@@ -23,10 +22,7 @@ mediatek_setup_interfaces()
|
||||
*2500wan-p5*)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
|
||||
;;
|
||||
sonicfi,rap630w-211g)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
|
||||
;;
|
||||
*)
|
||||
*)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
esac
|
||||
@@ -42,49 +38,10 @@ mediatek_setup_macs()
|
||||
local wan_mac_offset=""
|
||||
|
||||
case $board in
|
||||
edgecore,eap111|\
|
||||
edgecore,eap112)
|
||||
edgecore,eap111)
|
||||
lan_mac_offset="0x24"
|
||||
wan_mac_offset="0x2a"
|
||||
;;
|
||||
sonicfi,rap630w-211g)
|
||||
sysfs="/sys/class/ieee80211"
|
||||
env_dev=$(get_boot_param "boot_param.env_part")
|
||||
if [ -n "$env_dev" ]; then
|
||||
mtdnum="$( find_mtd_index "$CI_UBIPART" )"
|
||||
if [ ! "$mtdnum" ]; then
|
||||
echo "cannot find ubi mtd partition $CI_UBIPART"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
if [ ! "$ubidev" ]; then
|
||||
ubiattach -m "$mtdnum"
|
||||
sync
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
fi
|
||||
|
||||
env_ubivol="$( nand_find_volume "${ubidev}" ${env_dev} )"
|
||||
if [ -n "${env_ubivol}" ]; then
|
||||
#ubootenv_add_uci_config "/dev/$env_ubivol" "0" "0x80000" "0x80000" 1
|
||||
echo "/dev/$env_ubivol 0 0x80000 0x80000 1" > /etc/fw_env.config
|
||||
fi
|
||||
fi
|
||||
#echo "/dev/ubi0_0 0 0x80000 0x80000 1" > /etc/fw_env.config
|
||||
mac=$(fw_printenv | grep ethaddr | cut -d= -f2)
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_interface_macaddr "lan" "$lan_mac"
|
||||
ucidef_set_interface_macaddr "wan" "$wan_mac"
|
||||
ucidef_set_label_macaddr "$wan_mac"
|
||||
mac1=$(macaddr_add ${mac} 2)
|
||||
mac2=$(macaddr_add ${mac} 3)
|
||||
[ -d ${sysfs}/phy0 ] && echo ${mac1} > ${sysfs}/phy0/macaddress
|
||||
[ -d ${sysfs}/phy1 ] && echo ${mac2} > ${sysfs}/phy1/macaddress
|
||||
return
|
||||
;;
|
||||
*)
|
||||
lan_mac_offset="0x2A"
|
||||
wan_mac_offset="0x24"
|
||||
|
||||
@@ -4,8 +4,7 @@ START=99
|
||||
|
||||
boot() {
|
||||
case $(board_name) in
|
||||
edgecore,eap111|\
|
||||
edgecore,eap112)
|
||||
edgecore,eap111)
|
||||
bootcount=$(fw_printenv -n bootcount)
|
||||
[ "$bootcount" != 0 ] && fw_setenv bootcount 0
|
||||
;;
|
||||
|
||||
@@ -8,42 +8,16 @@ touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
. /lib/rap211g-envtools.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
edgecore,eap111|\
|
||||
edgecore,eap112)
|
||||
edgecore,eap111)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
sonicfi,rap630w-211g)
|
||||
#env_dev=$(cat /sys/module/boot_param/parameters/env_part 2>/dev/null)
|
||||
env_dev=$(get_boot_param "boot_param.env_part")
|
||||
if [ -n "$env_dev" ]; then
|
||||
mtdnum="$( find_mtd_index "$CI_UBIPART" )"
|
||||
if [ ! "$mtdnum" ]; then
|
||||
echo "cannot find ubi mtd partition $CI_UBIPART"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
if [ ! "$ubidev" ]; then
|
||||
ubiattach -m "$mtdnum"
|
||||
sync
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
fi
|
||||
|
||||
env_ubivol="$( nand_find_volume "${ubidev}" ${env_dev} )"
|
||||
if [ -n "${env_ubivol}" ]; then
|
||||
ubootenv_add_uci_config "/dev/$env_ubivol" "0" "0x80000" "0x80000" 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
CI_UBIPART=ubi
|
||||
|
||||
ubi_mknod() {
|
||||
local dir="$1"
|
||||
local dev="/dev/$(basename $dir)"
|
||||
|
||||
[ -e "$dev" ] && return 0
|
||||
|
||||
local devid="$(cat $dir/dev)"
|
||||
local major="${devid%%:*}"
|
||||
local minor="${devid##*:}"
|
||||
mknod "$dev" c $major $minor
|
||||
}
|
||||
|
||||
get_boot_param()
|
||||
{
|
||||
local cmdline_param=$(cat /proc/cmdline)
|
||||
local name
|
||||
for var in $cmdline_param
|
||||
do
|
||||
#echo "aaa---$var"
|
||||
if [ $var == $1 ];
|
||||
then
|
||||
echo "Y"
|
||||
return
|
||||
else
|
||||
name=$(echo $var | awk -F '=' '{print $1}')
|
||||
#echo "$name"
|
||||
if [ $name == $1 ];
|
||||
then
|
||||
echo $(echo $var | awk -F '=' '{print $2}')
|
||||
return
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "N"
|
||||
}
|
||||
|
||||
block_dev_path() {
|
||||
local dev_path
|
||||
|
||||
case "$1" in
|
||||
/dev/mmcblk*)
|
||||
dev_path="$1"
|
||||
;;
|
||||
PARTLABEL=* | PARTUUID=*)
|
||||
dev_path=$(blkid -t "$1" -o device)
|
||||
[ -z "${dev_path}" -o $? -ne 0 ] && return 1
|
||||
;;
|
||||
*)
|
||||
return 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "${dev_path}"
|
||||
return 0
|
||||
}
|
||||
|
||||
nand_find_volume() {
|
||||
local ubidevdir ubivoldir
|
||||
ubidevdir="/sys/devices/virtual/ubi/$1"
|
||||
[ ! -d "$ubidevdir" ] && return 1
|
||||
for ubivoldir in $ubidevdir/${1}_*; do
|
||||
[ ! -d "$ubivoldir" ] && continue
|
||||
if [ "$( cat $ubivoldir/name )" = "$2" ]; then
|
||||
basename $ubivoldir
|
||||
ubi_mknod "$ubivoldir"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
nand_find_ubi() {
|
||||
local ubidevdir ubidev mtdnum
|
||||
mtdnum="$( find_mtd_index $1 )"
|
||||
[ ! "$mtdnum" ] && return 1
|
||||
for ubidevdir in /sys/devices/virtual/ubi/ubi*; do
|
||||
[ ! -d "$ubidevdir" ] && continue
|
||||
cmtdnum="$( cat $ubidevdir/mtd_num )"
|
||||
[ ! "$mtdnum" ] && continue
|
||||
if [ "$mtdnum" = "$cmtdnum" ]; then
|
||||
ubidev=$( basename $ubidevdir )
|
||||
ubi_mknod "$ubidevdir"
|
||||
echo $ubidev
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user