Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
+43
-6
@@ -196,6 +196,10 @@
|
||||
"description": "Specifies the path the CA certificate used for authentication",
|
||||
"type": "string"
|
||||
},
|
||||
"ca_cert2": {
|
||||
"description": "Path to the inner-tunnel (phase 2) CA certificate for EAP-TLS",
|
||||
"type": "string"
|
||||
},
|
||||
"ca_cert2_usesystem": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -215,6 +219,10 @@
|
||||
"description": "File path to client certificate file (PEM/DER)",
|
||||
"type": "string"
|
||||
},
|
||||
"client_cert2": {
|
||||
"description": "File path to the inner-tunnel (phase 2) client certificate for EAP-TLS",
|
||||
"type": "string"
|
||||
},
|
||||
"dae_client": {
|
||||
"type": "alias",
|
||||
"default": "radius_das_client"
|
||||
@@ -371,6 +379,10 @@
|
||||
"gas_address3": {
|
||||
"type": "string"
|
||||
},
|
||||
"gcmp256": {
|
||||
"description": "Advertise the GCMP-256 pairwise cipher on HE/EHT BSSes (alongside CCMP for sae/sae-mixed, in the RSNE Override 2 element for sae-compat). Mandatory for EHT, recommended otherwise. Defaults off for sae and sae-mixed because some clients and chipsets misbehave when GCMP-256 is offered, and on for sae-compat BSSes using an EHT htmode (where GCMP-256 is mandatory), carried in a separate RSN Override element that legacy clients ignore. Only advertised when the driver supports the GCMP-256 cipher.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"hidden": {
|
||||
"type": "alias",
|
||||
"default": "ignore_broadcast_ssid"
|
||||
@@ -841,19 +853,37 @@
|
||||
"default": true
|
||||
},
|
||||
"priv_key": {
|
||||
"type": "string"
|
||||
"type": "alias",
|
||||
"default": "private_key"
|
||||
},
|
||||
"priv_key_pwd": {
|
||||
"type": "string"
|
||||
"type": "alias",
|
||||
"default": "private_key_passwd"
|
||||
},
|
||||
"priv_key2": {
|
||||
"type": "alias",
|
||||
"default": "private_key2"
|
||||
},
|
||||
"priv_key2_pwd": {
|
||||
"type": "alias",
|
||||
"default": "private_key2_passwd"
|
||||
},
|
||||
"private_key": {
|
||||
"description": "Private key matching with the server certificate for EAP-TLS/PEAP/TTLS",
|
||||
"type": "string"
|
||||
},
|
||||
"private_key2": {
|
||||
"description": "Inner-tunnel (phase 2) private key for EAP-TLS",
|
||||
"type": "string"
|
||||
},
|
||||
"private_key_passwd": {
|
||||
"description": "Passphrase for private key",
|
||||
"type": "string"
|
||||
},
|
||||
"private_key2_passwd": {
|
||||
"description": "Passphrase for the inner-tunnel (phase 2) private key",
|
||||
"type": "string"
|
||||
},
|
||||
"proxy_arp": {
|
||||
"description": "Proxy ARP",
|
||||
"type": "boolean"
|
||||
@@ -962,10 +992,9 @@
|
||||
"rsn_preauth": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"rsn_override": {
|
||||
"type": "number",
|
||||
"description": "Use RSNE override IE WPA3 compatibility (0: disabled, 1: enabled, 2:force WPA2 for older devices)",
|
||||
"default": 1
|
||||
"sae_ext_key": {
|
||||
"description": "Advertise the SAE-EXT-KEY AKM (SAE using a group-dependent hash) alongside plain SAE. Mandatory for EHT, recommended otherwise. Defaults off for sae and sae-mixed because some clients misbehave when SAE-EXT-KEY is offered, and on for sae-compat BSSes using an EHT htmode (where SAE-EXT-KEY is mandatory), carried in a separate RSN Override element that legacy clients ignore.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"sae_password_file": {
|
||||
"description": "External file containing VLAN SAE MAC address triplets",
|
||||
@@ -1040,6 +1069,14 @@
|
||||
"description": "Local time zone as specified in 8.3 of IEEE Std 1003.1-2004",
|
||||
"type": "string"
|
||||
},
|
||||
"transition_disable": {
|
||||
"description": "Transition modes the AP signals as disabled per WPA3 v3.5 §13. Entries 'sae', 'sae-pk', 'wpa3', 'owe' are OR'd into the bitmap; 'on' (or '1') derives it from auth_type; 'off' (or '0') suppresses the element. Unset by default.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [ "on", "off", "0", "1", "sae", "sae-pk", "wpa3", "owe" ]
|
||||
}
|
||||
},
|
||||
"uapsd": {
|
||||
"type": "alias",
|
||||
"default": "uapsd_advertisement_enabled"
|
||||
|
||||
@@ -57,7 +57,7 @@ function iface_setup(config) {
|
||||
'disassoc_low_ack', 'skip_inactivity_poll', 'ignore_broadcast_ssid', 'uapsd_advertisement_enabled',
|
||||
'utf8_ssid', 'multi_ap', 'multi_ap_vlanid', 'multi_ap_profile', 'tdls_prohibit', 'bridge',
|
||||
'wds_sta', 'wds_bridge', 'snoop_iface', 'vendor_elements', 'nas_identifier', 'radius_acct_interim_interval',
|
||||
'ocv', 'beacon_prot', 'spp_amsdu', 'multicast_to_unicast', 'preamble', 'proxy_arp', 'per_sta_vif', 'mbo',
|
||||
'ocv', 'spp_amsdu', 'multicast_to_unicast', 'preamble', 'proxy_arp', 'per_sta_vif', 'mbo',
|
||||
'bss_transition', 'wnm_sleep_mode', 'wnm_sleep_mode_no_keys', 'qos_map_set', 'max_listen_int',
|
||||
'dtim_period', 'wmm_enabled', 'start_disabled', 'na_mcast_to_ucast', 'no_probe_resp_if_max_sta',
|
||||
]);
|
||||
@@ -81,21 +81,39 @@ function iface_accounting_server(config) {
|
||||
append_vars(config, [ 'radius_acct_req_attr' ]);
|
||||
}
|
||||
|
||||
function iface_auth_type(config) {
|
||||
if (config.auth_type in [ 'sae', 'owe', 'eap2', 'eap192' ]) {
|
||||
function iface_auth_type(config, band) {
|
||||
if (config.auth_type in [ 'sae', 'owe', 'eap2', 'eap192' ])
|
||||
config.ieee80211w = 2;
|
||||
config.sae_require_mfp = 1;
|
||||
if (!config.ppsk)
|
||||
set_default(config, 'sae_pwe', 2);
|
||||
|
||||
if (config.auth_type in [ 'psk-sae', 'eap-eap2' ])
|
||||
set_default(config, 'ieee80211w', 1);
|
||||
|
||||
if (config.auth_type == 'psk-sae-compat') {
|
||||
if (band == '6g') {
|
||||
set_default(config, 'ieee80211w', 2);
|
||||
} else {
|
||||
set_default(config, 'ieee80211w', 0);
|
||||
config.rsn_override_mfp = 2;
|
||||
config.rsn_override_omit_rsnxe = 1;
|
||||
}
|
||||
if (config.rsn_override_pairwise_2)
|
||||
config.rsn_override_mfp_2 = 2;
|
||||
}
|
||||
|
||||
if (config.auth_type in [ 'psk-sae', 'eap-eap2' ]) {
|
||||
set_default(config, 'ieee80211w', 1);
|
||||
if (config.rsn_override)
|
||||
config.rsn_override_mfp = 2;
|
||||
if (config.auth_type == 'owe') {
|
||||
set_default(config, 'owe_groups', '19 20 21');
|
||||
set_default(config, 'owe_ptk_workaround', 1);
|
||||
}
|
||||
|
||||
if (config.auth_type in [ 'sae', 'psk-sae', 'psk-sae-compat' ]) {
|
||||
config.sae_require_mfp = 1;
|
||||
if (!config.ppsk)
|
||||
set_default(config, 'sae_pwe', 2);
|
||||
set_default(config, 'sae_groups', '19 20 21');
|
||||
if (!config.ppsk) {
|
||||
if (band == '6g')
|
||||
set_default(config, 'sae_pwe', 1);
|
||||
else
|
||||
set_default(config, 'sae_pwe', 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.own_ip_addr)
|
||||
@@ -120,6 +138,7 @@ function iface_auth_type(config) {
|
||||
case 'psk2':
|
||||
case 'sae':
|
||||
case 'psk-sae':
|
||||
case 'psk-sae-compat':
|
||||
config.vlan_possible = 1;
|
||||
config.wps_possible = 1;
|
||||
|
||||
@@ -135,12 +154,12 @@ function iface_auth_type(config) {
|
||||
netifd.setup_failed('INVALID_WPA_PSK');
|
||||
}
|
||||
|
||||
if (config.auth_type in [ 'psk', 'psk-sae' ]) {
|
||||
if (config.auth_type in [ 'psk', 'psk-sae', 'psk-sae-compat' ] && band != '6g') {
|
||||
set_default(config, 'wpa_psk_file', `/var/run/hostapd-${config.ifname}.psk`);
|
||||
touch_file(config.wpa_psk_file);
|
||||
}
|
||||
|
||||
if (config.auth_type in [ 'sae', 'psk-sae' ]) {
|
||||
if (config.auth_type in [ 'sae', 'psk-sae', 'psk-sae-compat' ]) {
|
||||
set_default(config, 'sae_password_file', `/var/run/hostapd-${config.ifname}.sae`);
|
||||
touch_file(config.sae_password_file);
|
||||
}
|
||||
@@ -180,18 +199,18 @@ function iface_auth_type(config) {
|
||||
}
|
||||
|
||||
append_vars(config, [
|
||||
'sae_require_mfp', 'sae_password_file', 'sae_pwe', 'sae_track_password', 'time_advertisement', 'time_zone',
|
||||
'sae_require_mfp', 'sae_password_file', 'sae_pwe', 'sae_groups', 'sae_track_password', 'time_advertisement', 'time_zone',
|
||||
'wpa_group_rekey', 'wpa_ptk_rekey', 'wpa_gmk_rekey', 'wpa_strict_rekey',
|
||||
'macaddr_acl', 'wpa_psk_radius', 'wpa_psk', 'wpa_passphrase', 'wpa_psk_file',
|
||||
'eapol_version', 'dynamic_vlan', 'radius_request_cui', 'eap_reauth_period',
|
||||
'radius_das_client', 'radius_das_port', 'own_ip_addr', 'dynamic_own_ip_addr',
|
||||
'radius_das_client', 'radius_das_port', 'owe_groups', 'owe_ptk_workaround', 'own_ip_addr', 'dynamic_own_ip_addr',
|
||||
'wpa_disable_eapol_key_retries', 'auth_algs', 'wpa', 'wpa_pairwise',
|
||||
'erp_domain', 'fils_realm', 'erp_send_reauth_start', 'fils_cache_id'
|
||||
]);
|
||||
}
|
||||
|
||||
function iface_ppsk(config) {
|
||||
if (!(config.auth_type in [ 'none', 'owe', 'psk', 'sae', 'psk-sae', 'wep' ]) || !config.auth_server_addr)
|
||||
if (!(config.auth_type in [ 'none', 'owe', 'psk', 'sae', 'psk-sae', 'psk-sae-compat', 'wep' ]) || !config.auth_server_addr)
|
||||
return;
|
||||
|
||||
iface_authentication_server(config);
|
||||
@@ -394,22 +413,74 @@ function iface_roaming(config) {
|
||||
]);
|
||||
}
|
||||
|
||||
function default_group_mgmt_cipher(config) {
|
||||
let p = ' ' + (config.wpa_pairwise ?? '') + ' ';
|
||||
|
||||
if (wildcard(p, '* CCMP *') || wildcard(p, '* TKIP *'))
|
||||
return 'AES-128-CMAC';
|
||||
if (wildcard(p, '* CCMP-256 *'))
|
||||
return 'BIP-CMAC-256';
|
||||
if (wildcard(p, '* GCMP *'))
|
||||
return 'BIP-GMAC-128';
|
||||
if (wildcard(p, '* GCMP-256 *'))
|
||||
return 'BIP-GMAC-256';
|
||||
return 'AES-128-CMAC';
|
||||
}
|
||||
|
||||
function iface_mfp(config) {
|
||||
if (!config.ieee80211w || config.wpa < 2) {
|
||||
let override_mfp = config.rsn_override_mfp || config.rsn_override_mfp_2;
|
||||
|
||||
if ((!config.ieee80211w && !override_mfp) || config.wpa < 2) {
|
||||
append('ieee80211w', 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.auth_type == 'eap192')
|
||||
config.group_mgmt_cipher = 'BIP-GMAC-256';
|
||||
else
|
||||
config.group_mgmt_cipher = config.ieee80211w_mgmt_cipher ?? 'AES-128-CMAC';
|
||||
config.group_mgmt_cipher = config.ieee80211w_mgmt_cipher ?? default_group_mgmt_cipher(config);
|
||||
|
||||
set_default(config, 'beacon_prot', 1);
|
||||
|
||||
append_vars(config, [
|
||||
'ieee80211w', 'group_mgmt_cipher', 'assoc_sa_query_max_timeout', 'assoc_sa_query_retry_timeout'
|
||||
'ieee80211w', 'group_mgmt_cipher', 'beacon_prot',
|
||||
'assoc_sa_query_max_timeout', 'assoc_sa_query_retry_timeout'
|
||||
]);
|
||||
}
|
||||
|
||||
function iface_transition_disable(config) {
|
||||
if (config.wpa < 2)
|
||||
return;
|
||||
|
||||
let list = config.transition_disable;
|
||||
if (!list || !length(list))
|
||||
return;
|
||||
|
||||
for (let s in list)
|
||||
if (s == 'off' || s == '0')
|
||||
return;
|
||||
|
||||
let bits = 0;
|
||||
for (let s in list) {
|
||||
if (s == 'on' || s == '1') {
|
||||
bits = 0;
|
||||
switch (config.auth_type) {
|
||||
case 'sae': bits = 0x01; break;
|
||||
case 'eap2':
|
||||
case 'eap192': bits = 0x04; break;
|
||||
case 'owe': if (!config.owe_transition) bits = 0x08; break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (s) {
|
||||
case 'sae': bits |= 0x01; break;
|
||||
case 'sae-pk': bits |= 0x02; break;
|
||||
case 'wpa3': bits |= 0x04; break;
|
||||
case 'owe': bits |= 0x08; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bits)
|
||||
append('transition_disable', sprintf('0x%02x', bits));
|
||||
}
|
||||
|
||||
function iface_key_caching(config) {
|
||||
if (config.wpa < 2)
|
||||
return;
|
||||
@@ -422,7 +493,7 @@ function iface_key_caching(config) {
|
||||
'rsn_preauth', 'rsn_preauth_interfaces'
|
||||
]);
|
||||
} else {
|
||||
set_default(config, 'okc', (config.auth_type in [ 'sae', 'psk-sae', 'owe' ]));
|
||||
set_default(config, 'okc', (config.auth_type in [ 'sae', 'psk-sae', 'psk-sae-compat', 'owe' ]));
|
||||
}
|
||||
|
||||
if (!config.okc && !config.fils)
|
||||
@@ -469,7 +540,7 @@ export function generate(interface, data, config, vlans, stas, phy_features) {
|
||||
config.start_disabled = data.ap_start_disabled;
|
||||
iface_setup(config);
|
||||
|
||||
iface.parse_encryption(config, data.config);
|
||||
iface.parse_encryption(config, data.config, phy_features);
|
||||
if (data.config.band == '6g') {
|
||||
if (config.auth_type == 'psk-sae')
|
||||
config.auth_type = 'sae';
|
||||
@@ -477,12 +548,12 @@ export function generate(interface, data, config, vlans, stas, phy_features) {
|
||||
config.auth_type = 'eap2';
|
||||
}
|
||||
|
||||
if (config.auth_type in [ 'psk', 'psk-sae' ])
|
||||
if (config.auth_type in [ 'psk', 'psk-sae', 'psk-sae-compat' ] && data.config.band != '6g')
|
||||
iface_wpa_stations(config, stas);
|
||||
if (config.auth_type in [ 'sae', 'psk-sae' ])
|
||||
if (config.auth_type in [ 'sae', 'psk-sae', 'psk-sae-compat' ])
|
||||
iface_sae_stations(config, stas);
|
||||
|
||||
iface_auth_type(config);
|
||||
iface_auth_type(config, data.config.band);
|
||||
|
||||
iface_accounting_server(config);
|
||||
|
||||
@@ -504,38 +575,37 @@ export function generate(interface, data, config, vlans, stas, phy_features) {
|
||||
|
||||
iface_mfp(config);
|
||||
|
||||
iface_transition_disable(config);
|
||||
|
||||
iface_key_caching(config);
|
||||
|
||||
iface_hs20(config);
|
||||
|
||||
iface_interworking(config);
|
||||
|
||||
iface.wpa_key_mgmt(config);
|
||||
iface.wpa_key_mgmt(config, data.config.band);
|
||||
append_vars(config, [
|
||||
'wpa_key_mgmt',
|
||||
]);
|
||||
|
||||
if (config.rsn_override_key_mgmt || config.rsn_override_pairwise) {
|
||||
config.rsn_override_mfp ??= config.ieee80211w;
|
||||
config.rsn_override_key_mgmt ??= config.wpa_key_mgmt;
|
||||
config.rsn_override_pairwise ??= config.wpa_pairwise;
|
||||
if (config.rsn_override_key_mgmt && config.rsn_override_pairwise && config.rsn_override_mfp) {
|
||||
append_vars(config, [
|
||||
'rsn_override_key_mgmt',
|
||||
'rsn_override_pairwise',
|
||||
'rsn_override_mfp'
|
||||
]);
|
||||
}
|
||||
|
||||
if (config.mlo) {
|
||||
config.rsn_override_mfp_2 ??= config.rsn_override_mfp;
|
||||
config.rsn_override_key_mgmt_2 ??= config.rsn_override_key_mgmt;
|
||||
config.rsn_override_pairwise_2 ??= config.rsn_override_pairwise;
|
||||
if (config.rsn_override_key_mgmt_2 && config.rsn_override_pairwise_2 && config.rsn_override_mfp_2) {
|
||||
append_vars(config, [
|
||||
'rsn_override_key_mgmt_2',
|
||||
'rsn_override_pairwise_2',
|
||||
'rsn_override_mfp_2'
|
||||
]);
|
||||
}
|
||||
|
||||
append_vars(config, [
|
||||
'rsn_override_key_mgmt_2',
|
||||
'rsn_override_pairwise_2',
|
||||
'rsn_override_mfp_2'
|
||||
]);
|
||||
}
|
||||
if (config.rsn_override_omit_rsnxe) {
|
||||
append_vars(config, ['rsn_override_omit_rsnxe']);
|
||||
}
|
||||
|
||||
/* raw options */
|
||||
|
||||
@@ -14,6 +14,8 @@ import * as fs from 'fs';
|
||||
const NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 33;
|
||||
const NL80211_EXT_FEATURE_RADAR_BACKGROUND = 61;
|
||||
|
||||
const WLAN_CIPHER_SUITE_GCMP_256 = 0x000fac09;
|
||||
|
||||
let phy_features = {};
|
||||
let phy_capabilities = {};
|
||||
|
||||
@@ -478,6 +480,7 @@ function device_capabilities(config) {
|
||||
|
||||
phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
|
||||
phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND);
|
||||
phy_features.cipher_gcmp256 = WLAN_CIPHER_SUITE_GCMP_256 in (phy.cipher_suites ?? []);
|
||||
}
|
||||
|
||||
function generate(config) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { append_value, log } from 'wifi.common';
|
||||
import * as fs from 'fs';
|
||||
|
||||
export function parse_encryption(config, dev_config) {
|
||||
export function parse_encryption(config, dev_config, phy_features) {
|
||||
if (!config.encryption)
|
||||
return;
|
||||
|
||||
@@ -17,15 +17,20 @@ export function parse_encryption(config, dev_config) {
|
||||
break;
|
||||
}
|
||||
|
||||
config.wpa_pairwise = null;
|
||||
if (config.wpa)
|
||||
config.wpa_pairwise = (config.hw_mode == 'ad') ? 'GCMP' : 'CCMP';
|
||||
|
||||
config.auth_type = encryption[0] ?? 'none';
|
||||
|
||||
let wpa3_pairwise = config.wpa_pairwise;
|
||||
if (wildcard(dev_config?.htmode, 'EHT*') || wildcard(dev_config?.htmode, 'HE*'))
|
||||
wpa3_pairwise = 'GCMP-256 ' + wpa3_pairwise;
|
||||
/*
|
||||
* GCMP-256 and the SAE-EXT-KEY (SAE-GDH) AKM are only mandatory for
|
||||
* EHT/MLO and break interoperability with many clients, so only default
|
||||
* them on where they are both required and safe to offer: on Compatibility
|
||||
* mode (sae-compat) BSSes that run an EHT htmode, which carry them in a
|
||||
* separate RSN Override element that legacy clients ignore. They stay off
|
||||
* for WPA3-Personal (sae) and Transition (sae-mixed) mode and on non-EHT
|
||||
* BSSes. Explicit gcmp256 and sae_ext_key options override this per BSS.
|
||||
*/
|
||||
let compat = (config.auth_type == 'sae-compat');
|
||||
config.gcmp256 ??= compat && wildcard(dev_config?.htmode ?? '', 'EHT*');
|
||||
config.sae_ext_key ??= compat && wildcard(dev_config?.htmode ?? '', 'EHT*');
|
||||
|
||||
switch(config.auth_type) {
|
||||
case 'owe':
|
||||
@@ -34,6 +39,7 @@ export function parse_encryption(config, dev_config) {
|
||||
|
||||
case 'wpa3-192':
|
||||
config.auth_type = 'eap192';
|
||||
config.wpa_pairwise = 'GCMP-256';
|
||||
break;
|
||||
|
||||
case 'wpa3-mixed':
|
||||
@@ -48,7 +54,6 @@ export function parse_encryption(config, dev_config) {
|
||||
case 'psk2':
|
||||
case 'psk-mixed':
|
||||
config.auth_type = 'psk';
|
||||
wpa3_pairwise = null;
|
||||
break;
|
||||
|
||||
case 'sae':
|
||||
@@ -61,16 +66,19 @@ export function parse_encryption(config, dev_config) {
|
||||
config.auth_type = 'psk-sae';
|
||||
break;
|
||||
|
||||
case 'sae-compat':
|
||||
config.auth_type = 'psk-sae-compat';
|
||||
config.wpa_pairwise = 'CCMP';
|
||||
if (dev_config.band != '6g')
|
||||
config.rsn_override_pairwise = 'CCMP';
|
||||
if (config.gcmp256 && phy_features?.cipher_gcmp256)
|
||||
config.rsn_override_pairwise_2 = 'GCMP-256';
|
||||
break;
|
||||
|
||||
case 'wpa':
|
||||
case 'wpa2':
|
||||
case 'wpa-mixed':
|
||||
config.auth_type = 'eap';
|
||||
wpa3_pairwise = null;
|
||||
break;
|
||||
|
||||
default:
|
||||
config.wpa_pairwise = null;
|
||||
wpa3_pairwise = null;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -102,26 +110,19 @@ export function parse_encryption(config, dev_config) {
|
||||
case 'gcmp':
|
||||
config.wpa_pairwise = 'GCMP';
|
||||
break;
|
||||
|
||||
default:
|
||||
if (config.encryption == 'wpa3-192') {
|
||||
config.wpa_pairwise = 'GCMP-256';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!wpa3_pairwise)
|
||||
break;
|
||||
|
||||
if (config.rsn_override && wpa3_pairwise != config.wpa_pairwise)
|
||||
config.rsn_override_pairwise = wpa3_pairwise;
|
||||
else
|
||||
config.wpa_pairwise = wpa3_pairwise;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!config.wpa)
|
||||
config.wpa_pairwise ??= null;
|
||||
else if (config.hw_mode == 'ad')
|
||||
config.wpa_pairwise ??= 'GCMP';
|
||||
else if (config.gcmp256 && phy_features?.cipher_gcmp256)
|
||||
config.wpa_pairwise ??= 'GCMP-256 CCMP';
|
||||
else
|
||||
config.wpa_pairwise ??= 'CCMP';
|
||||
};
|
||||
|
||||
export function wpa_key_mgmt(config) {
|
||||
export function wpa_key_mgmt(config, band) {
|
||||
if (!config.wpa)
|
||||
return;
|
||||
|
||||
@@ -154,9 +155,6 @@ export function wpa_key_mgmt(config) {
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-EAP');
|
||||
|
||||
if (config.rsn_override)
|
||||
config.rsn_override_key_mgmt = config.wpa_key_mgmt;
|
||||
|
||||
append_value(config, 'wpa_key_mgmt', 'WPA-EAP');
|
||||
break;
|
||||
|
||||
@@ -168,26 +166,25 @@ export function wpa_key_mgmt(config) {
|
||||
|
||||
case 'sae':
|
||||
append_value(config, 'wpa_key_mgmt', 'SAE');
|
||||
if (config.ieee80211r)
|
||||
if (config.sae_ext_key)
|
||||
append_value(config, 'wpa_key_mgmt', 'SAE-EXT-KEY');
|
||||
if (config.ieee80211r) {
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-SAE');
|
||||
if (config.sae_ext_key)
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-SAE-EXT-KEY');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'psk-sae':
|
||||
append_value(config, 'wpa_key_mgmt', 'SAE');
|
||||
if (config.ieee80211r)
|
||||
if (config.sae_ext_key)
|
||||
append_value(config, 'wpa_key_mgmt', 'SAE-EXT-KEY');
|
||||
if (config.ieee80211r) {
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-SAE');
|
||||
|
||||
if (config.rsn_override) {
|
||||
config.rsn_override_key_mgmt = config.wpa_key_mgmt;
|
||||
|
||||
append_value(config, 'rsn_override_key_mgmt_2', 'SAE-EXT-KEY');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'rsn_override_key_mgmt_2', 'FT-SAE-EXT-KEY');
|
||||
if (config.sae_ext_key)
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-SAE-EXT-KEY');
|
||||
}
|
||||
|
||||
if (config.rsn_override > 1)
|
||||
delete config.wpa_key_mgmt;
|
||||
|
||||
append_value(config, 'wpa_key_mgmt', 'WPA-PSK');
|
||||
if (config.ieee80211w)
|
||||
append_value(config, 'wpa_key_mgmt', 'WPA-PSK-SHA256');
|
||||
@@ -195,6 +192,36 @@ export function wpa_key_mgmt(config) {
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-PSK');
|
||||
break;
|
||||
|
||||
case 'psk-sae-compat':
|
||||
if (band == '6g') {
|
||||
append_value(config, 'wpa_key_mgmt', 'SAE');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-SAE');
|
||||
|
||||
if (config.sae_ext_key) {
|
||||
append_value(config, 'rsn_override_key_mgmt_2', 'SAE-EXT-KEY');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'rsn_override_key_mgmt_2', 'FT-SAE-EXT-KEY');
|
||||
}
|
||||
} else {
|
||||
append_value(config, 'wpa_key_mgmt', 'WPA-PSK');
|
||||
if (config.ieee80211w)
|
||||
append_value(config, 'wpa_key_mgmt', 'WPA-PSK-SHA256');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-PSK');
|
||||
|
||||
append_value(config, 'rsn_override_key_mgmt', 'SAE');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'rsn_override_key_mgmt', 'FT-SAE');
|
||||
|
||||
if (config.sae_ext_key) {
|
||||
append_value(config, 'rsn_override_key_mgmt_2', 'SAE-EXT-KEY');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'rsn_override_key_mgmt_2', 'FT-SAE-EXT-KEY');
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'owe':
|
||||
append_value(config, 'wpa_key_mgmt', 'OWE');
|
||||
break;
|
||||
@@ -214,13 +241,6 @@ export function wpa_key_mgmt(config) {
|
||||
append_value(config, 'wpa_key_mgmt', 'FILS-SHA256');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'wpa_key_mgmt', 'FT-FILS-SHA256');
|
||||
|
||||
if (!config.rsn_override_key_mgmt)
|
||||
break;
|
||||
|
||||
append_value(config, 'rsn_override_key_mgmt', 'FILS-SHA256');
|
||||
if (config.ieee80211r)
|
||||
append_value(config, 'rsn_override_key_mgmt', 'FT-FILS-SHA256');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,20 @@ function setup_sta(data, config) {
|
||||
case 'peap':
|
||||
case 'ttls':
|
||||
set_default(config, 'auth', 'MSCHAPV2');
|
||||
config.phase2 = `"auth=${config.auth}"`;
|
||||
|
||||
let auth = config.auth;
|
||||
let phase2proto = 'auth=';
|
||||
if (index(auth, 'auth') == 0) {
|
||||
/* user already provided a full "auth=..." spec */
|
||||
phase2proto = '';
|
||||
} else if (index(auth, 'EAP-') == 0) {
|
||||
/* inner EAP method, e.g. EAP-MSCHAPV2 -> MSCHAPV2 */
|
||||
auth = substr(auth, 4);
|
||||
if (config.eap_type == 'ttls')
|
||||
phase2proto = 'autheap=';
|
||||
}
|
||||
config.phase2 = `"${phase2proto}${auth}"`;
|
||||
|
||||
if (config.auth == 'EAP-TLS') {
|
||||
if (config.ca_cert2_usesystem && fs.stat('/etc/ssl/certs/ca-certificates.crt'))
|
||||
config.ca_cert2 = '/etc/ssl/certs/ca-certificates.crt';
|
||||
@@ -194,9 +207,24 @@ function setup_sta(data, config) {
|
||||
|
||||
config.mcast_rate = ratestr(config.mcast_rate);
|
||||
|
||||
/*
|
||||
* Certificate constraint lists are semicolon-separated strings in the
|
||||
* wpa_supplicant config, while UCI stores them as arrays. Join them here
|
||||
* so they are emitted as a single quoted value below.
|
||||
*/
|
||||
for (let key in [ 'altsubject_match', 'altsubject_match2',
|
||||
'domain_match', 'domain_match2',
|
||||
'domain_suffix_match', 'domain_suffix_match2' ])
|
||||
if (type(config[key]) == 'array')
|
||||
config[key] = length(config[key]) ? join(';', config[key]) : null;
|
||||
|
||||
network_append_string_vars(config, [ 'ssid',
|
||||
'identity', 'anonymous_identity', 'password',
|
||||
'ca_cert', 'ca_cert2', 'client_cert', 'client_cert2', 'subject_match',
|
||||
'ca_cert', 'ca_cert2', 'client_cert', 'client_cert2',
|
||||
'subject_match', 'subject_match2',
|
||||
'altsubject_match', 'altsubject_match2',
|
||||
'domain_match', 'domain_match2',
|
||||
'domain_suffix_match', 'domain_suffix_match2',
|
||||
'private_key', 'private_key_passwd', 'private_key2', 'private_key2_passwd',
|
||||
]);
|
||||
network_append_vars(config, [
|
||||
@@ -205,7 +233,6 @@ function setup_sta(data, config) {
|
||||
'proto', 'mesh_fwding', 'mesh_rssi_threshold', 'frequency', 'fixed_freq',
|
||||
'disable_ht', 'disable_ht40', 'disable_vht', 'vht', 'max_oper_chwidth',
|
||||
'ht40', 'beacon_int', 'ieee80211w', 'rates', 'mesh_basic_rates', 'mcast_rate',
|
||||
'altsubject_match', 'domain_match', 'domain_suffix_match',
|
||||
'bssid_blacklist', 'bssid_whitelist', 'erp', 'eap', 'phase2',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From d90618809e06e123241f57efdb7039a7a8a43d58 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Gavin <a_gavin@icloud.com>
|
||||
Date: Sun, 15 Mar 2026 22:16:46 -0700
|
||||
Subject: iw: scan: print RSN Element Override IEs
|
||||
|
||||
Parse body of RSN Element Override IEs as RSN IEs
|
||||
using existing code.
|
||||
|
||||
RSN IEs are a minimum size of 4 octets, as detailed
|
||||
in IEEE802.11-2024, 9.4.2.23.1
|
||||
|
||||
Example output:
|
||||
RSN Element Override:
|
||||
* Version: 1
|
||||
* Group cipher: CCMP
|
||||
* Pairwise ciphers: CCMP
|
||||
* Authentication suites: SAE
|
||||
* Capabilities: 16-PTKSA-RC 1-GTKSA-RC MFP-required MFP-capable (0x00cc)
|
||||
RSN Element Override 2:
|
||||
* Version: 1
|
||||
* Group cipher: CCMP
|
||||
* Pairwise ciphers: GCMP-256
|
||||
* Authentication suites: SAE-EXT-KEY
|
||||
* Capabilities: 16-PTKSA-RC 1-GTKSA-RC MFP-required MFP-capable (0x00cc)
|
||||
|
||||
Signed-off-by: Alex Gavin <a_gavin@icloud.com>
|
||||
Link: https://patch.msgid.link/20260316051646.18303-2-a_gavin@icloud.com
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
scan.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/scan.c
|
||||
+++ b/scan.c
|
||||
@@ -1893,6 +1893,14 @@ static void print_wifi_osen(const uint8_
|
||||
print_osen_ie("OSEN", "OSEN", len, data);
|
||||
}
|
||||
|
||||
+static void print_wifi_rsn_override(const uint8_t type, uint8_t len,
|
||||
+ const uint8_t *data,
|
||||
+ const struct ie_context *ctx)
|
||||
+{
|
||||
+ printf("\n\t");
|
||||
+ print_rsn_ie("CCMP", "IEEE802.1X", len, data);
|
||||
+}
|
||||
+
|
||||
static bool print_wifi_wmm_param(const uint8_t *data, uint8_t len)
|
||||
{
|
||||
int i;
|
||||
@@ -2344,6 +2352,8 @@ static const struct ie_print wfa_printer
|
||||
[16] = { "HotSpot 2.0 Indication", print_hs20_ind, 1, 255, BIT(PRINT_SCAN), },
|
||||
[18] = { "HotSpot 2.0 OSEN", print_wifi_osen, 1, 255, BIT(PRINT_SCAN), },
|
||||
[28] = { "OWE Transition Mode", print_wifi_owe_tarns, 7, 255, BIT(PRINT_SCAN), },
|
||||
+ [41] = { "RSN Element Override", print_wifi_rsn_override, 4, 255, BIT(PRINT_SCAN), },
|
||||
+ [42] = { "RSN Element Override 2", print_wifi_rsn_override, 4, 255, BIT(PRINT_SCAN), },
|
||||
};
|
||||
|
||||
static void print_vendor(unsigned char len, unsigned char *data,
|
||||
@@ -24,15 +24,18 @@
|
||||
case NL80211_CMD_JOIN_IBSS:
|
||||
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
||||
printf("IBSS %s joined\n", macbuf);
|
||||
@@ -1297,9 +1300,9 @@ static int print_event(struct nl_msg *ms
|
||||
@@ -1297,9 +1300,14 @@ static int print_event(struct nl_msg *ms
|
||||
case NL80211_CMD_ASSOC_COMEBACK: /* 147 */
|
||||
parse_assoc_comeback(tb, gnlh->cmd);
|
||||
break;
|
||||
+#endif
|
||||
default:
|
||||
- printf("unknown event %d (%s)\n",
|
||||
- gnlh->cmd, command_name(gnlh->cmd));
|
||||
+#ifndef IW_FULL
|
||||
+ printf("unknown event %d\n", gnlh->cmd);
|
||||
+#else
|
||||
printf("unknown event %d (%s)\n",
|
||||
gnlh->cmd, command_name(gnlh->cmd));
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -197,7 +200,7 @@
|
||||
};
|
||||
|
||||
static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data,
|
||||
@@ -2213,8 +2218,10 @@ static void print_wifi_wps(const uint8_t
|
||||
@@ -2221,8 +2226,10 @@ static void print_wifi_wps(const uint8_t
|
||||
|
||||
static const struct ie_print wifiprinters[] = {
|
||||
[1] = { "WPA", print_wifi_wpa, 2, 255, BIT(PRINT_SCAN), },
|
||||
@@ -208,18 +211,18 @@
|
||||
};
|
||||
|
||||
static inline void print_p2p(const uint8_t type, uint8_t len,
|
||||
@@ -2377,6 +2384,10 @@ static void print_vendor(unsigned char l
|
||||
@@ -2387,6 +2394,10 @@ static void print_vendor(unsigned char l
|
||||
return;
|
||||
}
|
||||
|
||||
+#ifdef IW_FULL
|
||||
+#ifndef IW_FULL
|
||||
+ return;
|
||||
+#endif
|
||||
+
|
||||
if (len >= 4 && memcmp(data, wfa_oui, 3) == 0) {
|
||||
if (data[3] < ARRAY_SIZE(wfa_printers) &&
|
||||
wfa_printers[data[3]].name &&
|
||||
@@ -2576,6 +2587,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
@@ -2586,6 +2597,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
printf(" ESS");
|
||||
if (capa & WLAN_CAPABILITY_IBSS)
|
||||
printf(" IBSS");
|
||||
@@ -227,7 +230,7 @@
|
||||
if (capa & WLAN_CAPABILITY_CF_POLLABLE)
|
||||
printf(" CfPollable");
|
||||
if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST)
|
||||
@@ -2604,6 +2616,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
@@ -2614,6 +2626,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
printf(" DelayedBACK");
|
||||
if (capa & WLAN_CAPABILITY_IMM_BACK)
|
||||
printf(" ImmediateBACK");
|
||||
@@ -235,7 +238,7 @@
|
||||
}
|
||||
|
||||
static int print_bss_handler(struct nl_msg *msg, void *arg)
|
||||
@@ -2694,8 +2707,10 @@ static int print_bss_handler(struct nl_m
|
||||
@@ -2704,8 +2717,10 @@ static int print_bss_handler(struct nl_m
|
||||
else
|
||||
printf("\tfreq: %d\n", freq);
|
||||
|
||||
@@ -246,7 +249,7 @@
|
||||
}
|
||||
if (bss[NL80211_BSS_BEACON_INTERVAL])
|
||||
printf("\tbeacon interval: %d TUs\n",
|
||||
@@ -2889,6 +2904,7 @@ static int handle_stop_sched_scan(struct
|
||||
@@ -2899,6 +2914,7 @@ static int handle_stop_sched_scan(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -254,7 +257,7 @@
|
||||
COMMAND(scan, sched_start,
|
||||
SCHED_SCAN_OPTIONS,
|
||||
NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan,
|
||||
@@ -2899,3 +2915,4 @@ COMMAND(scan, sched_start,
|
||||
@@ -2909,3 +2925,4 @@ COMMAND(scan, sched_start,
|
||||
COMMAND(scan, sched_stop, "",
|
||||
NL80211_CMD_STOP_SCHED_SCAN, 0, CIB_NETDEV, handle_stop_sched_scan,
|
||||
"Stop an ongoing scheduled scan.");
|
||||
|
||||
@@ -575,14 +575,14 @@
|
||||
#phy-cells = <1>;
|
||||
};
|
||||
|
||||
crypto@1e004000 {
|
||||
crypto@1fb70000 {
|
||||
compatible = "inside-secure,safexcel-eip93ies";
|
||||
reg = <0x0 0x1fb70000 0x0 0x1000>;
|
||||
|
||||
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
|
||||
};
|
||||
|
||||
thermal: thermal-sensor@1efbd800 {
|
||||
thermal: thermal-sensor@1efbd000 {
|
||||
compatible = "airoha,en7581-thermal";
|
||||
reg = <0x0 0x1efbd000 0x0 0xd5c>;
|
||||
interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
crypto@1e004000 {
|
||||
crypto@1fb70000 {
|
||||
compatible = "inside-secure,safexcel-eip93ies";
|
||||
reg = <0x0 0x1fb70000 0x0 0x1000>;
|
||||
|
||||
@@ -747,7 +747,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_phy1: ethernet-phy@1 {
|
||||
gsw_phy1: ethernet-phy@9 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <9>;
|
||||
phy-mode = "internal";
|
||||
@@ -770,7 +770,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
gsw_phy2: ethernet-phy@2 {
|
||||
gsw_phy2: ethernet-phy@a {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <10>;
|
||||
phy-mode = "internal";
|
||||
@@ -793,7 +793,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
gsw_phy3: ethernet-phy@3 {
|
||||
gsw_phy3: ethernet-phy@b {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <11>;
|
||||
phy-mode = "internal";
|
||||
@@ -816,7 +816,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
gsw_phy4: ethernet-phy@4 {
|
||||
gsw_phy4: ethernet-phy@c {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <12>;
|
||||
phy-mode = "internal";
|
||||
|
||||
@@ -11,7 +11,6 @@ define Device/airoha_an7583-evb
|
||||
DEVICE_PACKAGES := kmod-phy-aeonsemi-as21xxx kmod-leds-pwm kmod-pwm-airoha kmod-input-gpio-keys-polled
|
||||
DEVICE_DTS := an7583-evb
|
||||
DEVICE_DTS_CONFIG := config@1
|
||||
KERNEL_LOADADDR := 0x80088000
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += airoha_an7583-evb
|
||||
|
||||
@@ -1070,9 +1070,9 @@ static int net_activate(struct led_classdev *led_cdev)
|
||||
*/
|
||||
parsed = parse_family_token(fn, &online);
|
||||
if (parsed < 0) {
|
||||
pr_info("network: unknown function '%s' for LED %s\n",
|
||||
pr_warn("network: cannot infer family from '%s' for LED %s, defaulting to 'wlan'\n",
|
||||
fn ?: "<NULL>", name);
|
||||
return -EINVAL;
|
||||
parsed = NET_TRIG_WLAN;
|
||||
}
|
||||
|
||||
if (online) {
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
#include "mt7987a.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
model = "Hiveton H5000M";
|
||||
compatible = "hiveton,h5000m", "mediatek,mt7987a", "mediatek,mt7987";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_status_blue;
|
||||
led-failsafe = &led_status_amber;
|
||||
led-upgrade = &led_status_amber;
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "earlycon=uart8250,mmio32,0x11000000 \
|
||||
root=PARTLABEL=rootfs rootwait pci=pcie_bus_perf";
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
button-reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <10>;
|
||||
};
|
||||
|
||||
button-wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <10>;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* LED Indicator Layout
|
||||
* -------------------
|
||||
* Total of 5 LED indicators, viewed from front with antenna facing up (left to right):
|
||||
*
|
||||
* LED 1: 5G Module indicator
|
||||
* LED 2: Built-in 2.5G Ethernet port indicator (configurable in system)
|
||||
* LED 3: User-definable (configurable in system)
|
||||
* LED 4: User-definable (configurable in system)
|
||||
* LED 5: Power indicator
|
||||
*
|
||||
* Note:
|
||||
* - LEDs 1 and 5 are hardware-controlled and cannot be modified via software
|
||||
* - In vendor firmware, LEDs 3 and 4 are used as WiFi link activity indicators
|
||||
* for dual-band (2.4GHz/5GHz) respectively
|
||||
*/
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_status_amber: led-3 {
|
||||
function = LED_FUNCTION_WLAN_2GHZ;
|
||||
color = <LED_COLOR_ID_AMBER>;
|
||||
gpios = <&pio 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_status_blue: led-4 {
|
||||
function = LED_FUNCTION_WLAN_5GHZ;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&pio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
reg_3p3v: regulator-3p3v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-3.3V";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
reg_usb_5v: regulator-usb-5v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "usb-5v";
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&fan {
|
||||
pwms = <&pwm 1 50000 0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
phy-mode = "2500base-x";
|
||||
phy-handle = <&phy0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gmac1 {
|
||||
phy-mode = "internal";
|
||||
phy-handle = <&phy1>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio {
|
||||
/* RTL8221B-VB-CG 2.5Gbps PHY (away from power) eth0 */
|
||||
phy0: phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <1>;
|
||||
reset-gpios = <&pio 42 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <100000>;
|
||||
reset-deassert-us = <100000>;
|
||||
interrupt-parent = <&pio>;
|
||||
interrupts = <41 IRQ_TYPE_LEVEL_LOW>;
|
||||
realtek,aldps-enable;
|
||||
};
|
||||
|
||||
/* built-in 2.5G Ethernet PHY (near power) eth1 */
|
||||
phy1: phy@15 {
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <15>;
|
||||
pinctrl-names = "i2p5gbe-led";
|
||||
pinctrl-0 = <&i2p5gbe_led0_pins>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
pinctrl-names = "default", "state_uhs";
|
||||
pinctrl-0 = <&mmc_pins_default>;
|
||||
pinctrl-1 = <&mmc_pins_uhs>;
|
||||
bus-width = <8>;
|
||||
max-frequency = <48000000>;
|
||||
cap-mmc-highspeed;
|
||||
vmmc-supply = <®_3p3v>;
|
||||
non-removable;
|
||||
status = "okay";
|
||||
|
||||
card@0 {
|
||||
compatible = "mmc-card";
|
||||
reg = <0>;
|
||||
|
||||
block {
|
||||
compatible = "block-device";
|
||||
|
||||
partitions {
|
||||
block-partition-factory {
|
||||
partname = "factory";
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1e00>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie0_pins>;
|
||||
reset-gpios = <&pio 36 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
|
||||
pcie@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
device_type = "pci";
|
||||
|
||||
mt7992@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ieee80211-freq-limit = <2400000 2500000>,
|
||||
<5170000 5835000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pcie1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pio {
|
||||
pwm_fan_pins: pwm-fan-pins {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm1_0";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pwm {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pwm_fan_pins>;
|
||||
};
|
||||
|
||||
&ssusb {
|
||||
status = "okay";
|
||||
vusb33-supply = <®_3p3v>;
|
||||
vbus-supply = <®_usb_5v>;
|
||||
};
|
||||
|
||||
&tphyu3port0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
@@ -111,6 +111,10 @@ glinet,gl-xe3000)
|
||||
ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wifi2g" "phy0-ap0"
|
||||
ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wifi5g" "phy1-ap0"
|
||||
;;
|
||||
hiveton,h5000m)
|
||||
ucidef_set_led_netdev "wlan2g" "wlan-2ghz" "amber:wlan-2ghz" "phy0.0-ap0" "link tx rx"
|
||||
ucidef_set_led_netdev "wlan5g" "wlan-5ghz" "blue:wlan-5ghz" "phy0.1-ap0" "link tx rx"
|
||||
;;
|
||||
huasifei,wh3000-emmc)
|
||||
ucidef_set_led_netdev "wan" "WAN" "red:wan" "eth1"
|
||||
ucidef_set_led_netdev "wlan" "WLAN" "white:wlan" "phy1-ap0"
|
||||
|
||||
@@ -139,6 +139,7 @@ mediatek_setup_interfaces()
|
||||
airpi,ap3000m|\
|
||||
bananapi,bpi-r3-mini|\
|
||||
edgecore,eap111|\
|
||||
hiveton,h5000m|\
|
||||
huasifei,wh3000-emmc|\
|
||||
huasifei,wh3000-pro-emmc|\
|
||||
huasifei,wh3000-pro-nand)
|
||||
@@ -276,6 +277,11 @@ mediatek_setup_macs()
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
hiveton,h5000m)
|
||||
lan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
|
||||
wan_mac=$(macaddr_add "$lan_mac" 1)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
jiorouter,ax6000-jidu6101)
|
||||
label_mac=$(mtd_get_mac_ascii u-boot-env mac)
|
||||
wan_mac=$label_mac
|
||||
|
||||
@@ -124,6 +124,11 @@ case "$board" in
|
||||
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
|
||||
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
hiveton,h5000m)
|
||||
base_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
|
||||
[ "$PHYNBR" = "0" ] && macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress
|
||||
[ "$PHYNBR" = "1" ] && macaddr_add $base_mac 3 > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
iptime,ax3000q)
|
||||
addr=$(mtd_get_mac_binary "Factory" 0x4)
|
||||
[ "$PHYNBR" = "1" ] && macaddr_setbit_la $addr > /sys${DEVPATH}/macaddress
|
||||
|
||||
@@ -170,6 +170,7 @@ platform_do_upgrade() {
|
||||
glinet,gl-mt6000|\
|
||||
glinet,gl-x3000|\
|
||||
glinet,gl-xe3000|\
|
||||
hiveton,h5000m|\
|
||||
huasifei,wh3000-emmc|\
|
||||
huasifei,wh3000-pro-emmc|\
|
||||
smartrg,sdg-8612|\
|
||||
@@ -372,6 +373,7 @@ platform_check_image() {
|
||||
;;
|
||||
creatlentem,clt-r30b1|\
|
||||
creatlentem,clt-r30b1-112m|\
|
||||
hiveton,h5000m|\
|
||||
nradio,c8-668gl)
|
||||
# tar magic `ustar`
|
||||
magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)"
|
||||
@@ -404,6 +406,7 @@ platform_copy_config() {
|
||||
glinet,gl-mt6000|\
|
||||
glinet,gl-x3000|\
|
||||
glinet,gl-xe3000|\
|
||||
hiveton,h5000m|\
|
||||
huasifei,wh3000-emmc|\
|
||||
huasifei,wh3000-pro-emmc|\
|
||||
jdcloud,re-cp-03|\
|
||||
|
||||
@@ -1851,6 +1851,20 @@ define Device/h3c_magic-nx30-pro
|
||||
endef
|
||||
TARGET_DEVICES += h3c_magic-nx30-pro
|
||||
|
||||
define Device/hiveton_h5000m
|
||||
DEVICE_VENDOR := Hiveton
|
||||
DEVICE_MODEL := H5000M
|
||||
DEVICE_ALT0_VENDOR := Airpi
|
||||
DEVICE_ALT0_MODEL := H5000M
|
||||
DEVICE_DTS := mt7987a-hiveton-h5000m
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-usb3 mt7987-2p5g-phy-firmware \
|
||||
kmod-mt7996e kmod-mt7992-23-firmware f2fsck mkf2fs automount
|
||||
KERNEL_LOADADDR := 0x40000000
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += hiveton_h5000m
|
||||
|
||||
define Device/huasifei_wh3000-emmc
|
||||
DEVICE_VENDOR := Huasifei
|
||||
DEVICE_MODEL := WH3000 eMMC
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "mt7628an.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
compatible = "cudy,lt500-outdoor-v1", "mediatek,mt7628an-soc";
|
||||
model = "Cudy LT500 Outdoor v1";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_status;
|
||||
led-running = &led_status;
|
||||
led-failsafe = &led_status;
|
||||
led-upgrade = &led_status;
|
||||
label-mac-device = ðernet;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200";
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_status: status {
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
};
|
||||
|
||||
internet {
|
||||
gpios = <&gpio 40 GPIO_ACTIVE_HIGH>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN_ONLINE;
|
||||
};
|
||||
|
||||
lan {
|
||||
gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
};
|
||||
|
||||
wifi2g {
|
||||
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN_2GHZ;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
wifi5g {
|
||||
gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN_5GHZ;
|
||||
linux,default-trigger = "phy1tpt";
|
||||
};
|
||||
|
||||
signal1 {
|
||||
gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
|
||||
label = "green:signal1";
|
||||
};
|
||||
|
||||
signal2 {
|
||||
gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
|
||||
label = "green:signal2";
|
||||
};
|
||||
|
||||
signal3 {
|
||||
gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
|
||||
label = "green:signal3";
|
||||
};
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
pwr {
|
||||
gpio-export,name = "pwr";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&gpio 38 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
usb4g {
|
||||
gpio-export,name = "4g";
|
||||
gpio-export,output = <0>;
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <40000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x30000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@30000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x30000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
factory: partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x400>;
|
||||
};
|
||||
|
||||
eeprom_factory_8000: eeprom@8000 {
|
||||
reg = <0x8000 0x4da8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@fd0000 {
|
||||
label = "debug";
|
||||
reg = <0xfd0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@fe0000 {
|
||||
label = "backup";
|
||||
reg = <0xfe0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
bdinfo: partition@ff0000 {
|
||||
label = "bdinfo";
|
||||
reg = <0xff0000 0x10000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_bdinfo_de00: macaddr@de00 {
|
||||
compatible = "mac-base";
|
||||
reg = <0xde00 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
compatible = "denx,uimage";
|
||||
label = "firmware";
|
||||
reg = <0x50000 0xf80000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&state_default {
|
||||
gpio {
|
||||
groups = "refclk", "wled_an", "gpio", "spi cs1";
|
||||
function = "gpio";
|
||||
};
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
wifi@0,0 {
|
||||
compatible = "mediatek,mt76";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>;
|
||||
nvmem-cell-names = "eeprom", "mac-address";
|
||||
ieee80211-freq-limit = <5000000 6000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>;
|
||||
nvmem-cell-names = "eeprom", "mac-address";
|
||||
};
|
||||
|
||||
ðernet {
|
||||
nvmem-cells = <&macaddr_bdinfo_de00 0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&ehci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&ohci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&esw {
|
||||
mediatek,portmap = <0x3d>;
|
||||
mediatek,portdisable = <0x3e>;
|
||||
};
|
||||
@@ -210,6 +210,18 @@ define Device/cudy_lt300-v3
|
||||
endef
|
||||
TARGET_DEVICES += cudy_lt300-v3
|
||||
|
||||
define Device/cudy_lt500-outdoor-v1
|
||||
IMAGE_SIZE := 15872k
|
||||
DEVICE_VENDOR := Cudy
|
||||
DEVICE_MODEL := LT500 Outdoor
|
||||
DEVICE_VARIANT := v1
|
||||
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb2 \
|
||||
kmod-usb-ohci kmod-usb-net-cdc-ether kmod-usb-serial-option
|
||||
UIMAGE_NAME := R35
|
||||
SUPPORTED_DEVICES += R35
|
||||
endef
|
||||
TARGET_DEVICES += cudy_lt500-outdoor-v1
|
||||
|
||||
define Device/cudy_m1200-v1
|
||||
IMAGE_SIZE := 15872k
|
||||
DEVICE_VENDOR := Cudy
|
||||
|
||||
@@ -118,6 +118,10 @@ tplink,archer-mr200-v6)
|
||||
ucidef_set_led_netdev "lan" "lan" "white:lan" "eth0"
|
||||
ucidef_set_led_netdev "wan" "wan" "white:wan" "wwan0"
|
||||
;;
|
||||
cudy,lt500-outdoor-v1)
|
||||
ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x01"
|
||||
ucidef_set_led_netdev "internet" "internet" "green:wan-online" "usb0"
|
||||
;;
|
||||
cudy,re1200-outdoor-v1|\
|
||||
mercusys,mb130-4g-v1|\
|
||||
tplink,re200-v2|\
|
||||
|
||||
@@ -208,6 +208,13 @@ ramips_setup_interfaces()
|
||||
"0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
|
||||
ucidef_set_interface "wan" device "/dev/cdc-wdm0" protocol "qmi"
|
||||
;;
|
||||
cudy,lt500-outdoor-v1)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0:lan" "6@eth0"
|
||||
ucidef_set_interface "wwan" device "usb0" protocol "dhcp"
|
||||
uci add_list firewall.@zone[1].network='wwan'
|
||||
uci add_list firewall.@zone[1].network='wwan6'
|
||||
;;
|
||||
cudy,re1200-outdoor-v1|\
|
||||
tplink,tl-mr3020-v3)
|
||||
ucidef_add_switch "switch0" \
|
||||
|
||||
Reference in New Issue
Block a user