mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-06 20:14:10 +08:00
⛅ Sync 2026-09-06 02:17:46
This commit is contained in:
1 parent
f99d5bef45
commit
5b40eafd9b
2 files changed
+36
-9
No files matched your search
@@ -82,6 +82,24 @@ function buildIwinfoDeviceLookup(devices) {
|
|||||||
return lookup;
|
return lookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQcaIwinfoDevicesFromConfig() {
|
||||||
|
const radios = uci.sections('wireless', 'wifi-device');
|
||||||
|
const devices = [];
|
||||||
|
|
||||||
|
if (!radios.length || !radios.every((radio) => isQcaWifiHwtype(radio.type)))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
for (const iface of uci.sections('wireless', 'wifi-iface')) {
|
||||||
|
if (isConfigWifiIfaceDisabled(iface) ||
|
||||||
|
!isQcaWifiHwtype(uci.get('wireless', iface.device, 'type')))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pushUnique(devices, iface.ifname || getQcaFallbackIfname(iface.device, iface['.name']));
|
||||||
|
}
|
||||||
|
|
||||||
|
return devices;
|
||||||
|
}
|
||||||
|
|
||||||
function getWifiNetIdBySection(section) {
|
function getWifiNetIdBySection(section) {
|
||||||
let index = 0;
|
let index = 0;
|
||||||
|
|
||||||
@@ -130,7 +148,7 @@ function parseIwDevInfoTxPower(stdout) {
|
|||||||
return (!isNaN(value) && value > 0) ? value : null;
|
return (!isNaN(value) && value > 0) ? value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildIwinfoResolver(devices) {
|
function buildIwinfoResolver(devices, configOnly) {
|
||||||
const deviceLookup = buildIwinfoDeviceLookup(devices);
|
const deviceLookup = buildIwinfoDeviceLookup(devices);
|
||||||
const aliasMap = Object.create(null);
|
const aliasMap = Object.create(null);
|
||||||
const queryTargets = [];
|
const queryTargets = [];
|
||||||
@@ -190,7 +208,8 @@ function buildIwinfoResolver(devices) {
|
|||||||
return {
|
return {
|
||||||
deviceLookup,
|
deviceLookup,
|
||||||
aliasMap,
|
aliasMap,
|
||||||
queryTargets
|
queryTargets,
|
||||||
|
configOnly
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,8 +220,13 @@ function loadIwinfoResolver(force) {
|
|||||||
if (!force && cachedIwinfoResolver != null)
|
if (!force && cachedIwinfoResolver != null)
|
||||||
return Promise.resolve(cachedIwinfoResolver);
|
return Promise.resolve(cachedIwinfoResolver);
|
||||||
|
|
||||||
cachedIwinfoResolverPromise = L.resolveDefault(callIwinfoDevices(), {}).then((res) => {
|
const qcaDevices = getQcaIwinfoDevicesFromConfig();
|
||||||
cachedIwinfoResolver = buildIwinfoResolver(res?.devices);
|
const deviceRequest = qcaDevices != null
|
||||||
|
? Promise.resolve({ devices: qcaDevices })
|
||||||
|
: L.resolveDefault(callIwinfoDevices(), {});
|
||||||
|
|
||||||
|
cachedIwinfoResolverPromise = deviceRequest.then((res) => {
|
||||||
|
cachedIwinfoResolver = buildIwinfoResolver(res?.devices, qcaDevices != null);
|
||||||
cachedIwinfoResolverPromise = null;
|
cachedIwinfoResolverPromise = null;
|
||||||
return cachedIwinfoResolver;
|
return cachedIwinfoResolver;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -214,7 +238,8 @@ function loadIwinfoResolver(force) {
|
|||||||
cachedIwinfoResolver = {
|
cachedIwinfoResolver = {
|
||||||
deviceLookup: Object.create(null),
|
deviceLookup: Object.create(null),
|
||||||
aliasMap: Object.create(null),
|
aliasMap: Object.create(null),
|
||||||
queryTargets: []
|
queryTargets: [],
|
||||||
|
configOnly: false
|
||||||
};
|
};
|
||||||
|
|
||||||
return cachedIwinfoResolver;
|
return cachedIwinfoResolver;
|
||||||
@@ -231,7 +256,9 @@ function loadIwinfoInfoMap(force) {
|
|||||||
return Promise.resolve(cachedIwinfoInfoMap);
|
return Promise.resolve(cachedIwinfoInfoMap);
|
||||||
|
|
||||||
cachedIwinfoInfoPromise = loadIwinfoResolver(force).then((resolver) => {
|
cachedIwinfoInfoPromise = loadIwinfoResolver(force).then((resolver) => {
|
||||||
const queryTargets = resolver.queryTargets.length ? resolver.queryTargets : getLegacyIwinfoProbeTargets();
|
const queryTargets = (resolver.configOnly || resolver.queryTargets.length)
|
||||||
|
? resolver.queryTargets
|
||||||
|
: getLegacyIwinfoProbeTargets();
|
||||||
|
|
||||||
return Promise.all(queryTargets.map((name) =>
|
return Promise.all(queryTargets.map((name) =>
|
||||||
L.resolveDefault(callIwinfoInfoCompat(name), null).then((info) => [ name, info ])
|
L.resolveDefault(callIwinfoInfoCompat(name), null).then((info) => [ name, info ])
|
||||||
|
|||||||
@@ -1767,6 +1767,9 @@ static int __init fast_classifier_init(void)
|
|||||||
printk(KERN_ALERT "fast-classifier: starting up\n");
|
printk(KERN_ALERT "fast-classifier: starting up\n");
|
||||||
DEBUG_INFO("SFE CM init\n");
|
DEBUG_INFO("SFE CM init\n");
|
||||||
|
|
||||||
|
/* Initialize state before registering callbacks that can use it. */
|
||||||
|
spin_lock_init(&sc->lock);
|
||||||
|
|
||||||
hash_init(fc_conn_ht);
|
hash_init(fc_conn_ht);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1882,8 +1885,6 @@ static int __init fast_classifier_init(void)
|
|||||||
|
|
||||||
printk(KERN_ALERT "fast-classifier: registered\n");
|
printk(KERN_ALERT "fast-classifier: registered\n");
|
||||||
|
|
||||||
spin_lock_init(&sc->lock);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hook the receive path in the network stack.
|
* Hook the receive path in the network stack.
|
||||||
*/
|
*/
|
||||||
@@ -2005,4 +2006,3 @@ module_exit(fast_classifier_exit)
|
|||||||
|
|
||||||
MODULE_DESCRIPTION("Shortcut Forwarding Engine - Connection Manager");
|
MODULE_DESCRIPTION("Shortcut Forwarding Engine - Connection Manager");
|
||||||
MODULE_LICENSE("Dual BSD/GPL");
|
MODULE_LICENSE("Dual BSD/GPL");
|
||||||
|
|
||||||
Reference in new issue
Block a user