Update On Sat Sep 21 20:33:20 CEST 2024

This commit is contained in:
github-action[bot]
2024-09-21 20:33:20 +02:00
parent 94e24d57cc
commit cbc28fd552
240 changed files with 21857 additions and 2307 deletions

1
.github/update.log vendored
View File

@@ -770,3 +770,4 @@ Update On Tue Sep 17 20:34:06 CEST 2024
Update On Wed Sep 18 20:34:25 CEST 2024
Update On Thu Sep 19 20:35:43 CEST 2024
Update On Fri Sep 20 20:34:37 CEST 2024
Update On Sat Sep 21 20:33:09 CEST 2024

View File

@@ -23,12 +23,20 @@ brook server -l :9999 -p hello
## Client
| iOS | Android | Mac |Windows |Linux |OpenWrt |
| --- | --- | --- | --- | --- | --- |
| [![](https://brook.app/images/appstore.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![](https://brook.app/images/android.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.apk) | [![](https://brook.app/images/mac.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![Windows](https://brook.app/images/windows.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.msix) | [![](https://brook.app/images/linux.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.bin) | [![OpenWrt](https://brook.app/images/openwrt.png)](https://github.com/txthinking/brook/releases) |
| / | / | [App Mode](https://www.txthinking.com/talks/articles/macos-app-mode-en.article) | [How](https://www.txthinking.com/talks/articles/msix-brook-en.article) | [How](https://www.txthinking.com/talks/articles/linux-app-brook-en.article) | [How](https://www.txthinking.com/talks/articles/brook-openwrt-en.article) |
- [iOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Android](https://github.com/txthinking/brook/releases/latest/download/Brook.apk)
- [macOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Windows](https://github.com/txthinking/brook/releases/latest/download/Brook.msix)
- [Linux](https://github.com/txthinking/brook/releases/latest/download/Brook.bin)
- [OpenWrt](https://github.com/txthinking/brook/releases)
> You may want to use `brook link` to customize some parameters
- [About App Mode on macOS](https://www.txthinking.com/talks/articles/macos-app-mode-en.article)
- [How to install Brook on Windows?](https://www.txthinking.com/talks/articles/msix-brook-en.article)
- [How to install Brook on Linux](https://www.txthinking.com/talks/articles/linux-app-brook-en.article)
- [How to install Brook on OpenWrt](https://www.txthinking.com/talks/articles/brook-openwrt-en.article)
# Client
Brook GUI will pass different _global variables_ to the script at different times, and the script only needs to assign the processing result to the global variable `out`
@@ -449,7 +457,7 @@ Brook [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
- **--dialWithSocks5Username**="": If there is
- **--help, -h**: show help
- **--ipLimitInterval**="": Interval (s) for ipLimitMax (default: 0)
@@ -1028,11 +1036,11 @@ Generate markdown page
- **--file, -f**="": Write to file, default print to stdout
- **--help, -h**: show help
### help, h
Shows a list of commands or help for one command
## manpage
@@ -1045,6 +1053,7 @@ Generate man.1 page
## help, h
Shows a list of commands or help for one command
# Examples
List some examples of common scene commands, pay attention to replace the parameters such as IP, port, password, domain name, certificate path, etc. in the example by yourself

30
brook/docs/build.js Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bun
import * as fs from 'node:fs/promises'
import { $ } from 'bun'
var f = await fs.open("../readme.md", 'w+');
await fs.write(f.fd, '# Brook\n')
await fs.write(f.fd, '<!--SIDEBAR-->\n')
await fs.write(f.fd, '<!--G-R3M673HK5V-->\n')
await fs.write(f.fd, 'A cross-platform programmable network tool.\n')
await fs.write(f.fd, '\n')
await fs.write(f.fd, '# Sponsor\n')
await fs.write(f.fd, '**❤️ [Shiliew - A network app designed for those who value their time](https://www.txthinking.com/shiliew.html)**\n')
var s = await fs.readFile('getting-started.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
var s = await fs.readFile('gui.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
await fs.write(f.fd, '# CLI Documentation\n')
await fs.write(f.fd, 'Each subcommand has a `--example` parameter that can print the minimal example of usage\n')
var s = await $`brook mdpage`.text()
s = s.split("\n").filter(v => !v.startsWith("[")).join("\n").replace("```\n```", "```\nbrook --help\n```").split("\n").map(v => v.startsWith("**") && !v.startsWith("**Usage") ? "- " + v : v).join('\n')
s = s.replace("### help, h", "").replace("Shows a list of commands or help for one command", "").replaceAll("- **--help, -h**: show help", "")
await fs.write(f.fd, s)
var s = await fs.readFile('example.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
var s = await fs.readFile('resources.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
await fs.close(f.fd)
await $`markdown ../readme.md ./index.html`

View File

@@ -1,22 +0,0 @@
#!/bin/bash
echo '# Brook' > ../readme.md
echo '<!--SIDEBAR-->' >> ../readme.md
echo '<!--G-R3M673HK5V-->' >> ../readme.md
echo 'A cross-platform programmable network tool.' >> ../readme.md
echo '' >> ../readme.md
echo '# Sponsor' >> ../readme.md
echo '**❤️ [Shiliew - A network app designed for those who value their time](https://www.txthinking.com/shiliew.html)**' >> ../readme.md
cat getting-started.md >> ../readme.md
cat gui.md >> ../readme.md
echo '# CLI Documentation' >> ../readme.md
echo 'Each subcommand has a `--example` parameter that can print the minimal example of usage' >> ../readme.md
jb '$1`brook mdpage`.split("\n").filter(v=>!v.startsWith("[")).join("\n").replace("```\n```", "```\nbrook --help\n```").split("\n").forEach(v=> echo(v.startsWith("**") && !v.startsWith("**Usage") ? "- "+v : v))' >> ../readme.md
cat example.md >> ../readme.md
cat resources.md >> ../readme.md
markdown ../readme.md ./index.html

View File

@@ -16,9 +16,17 @@ brook server -l :9999 -p hello
## Client
| iOS | Android | Mac |Windows |Linux |OpenWrt |
| --- | --- | --- | --- | --- | --- |
| [![](https://brook.app/images/appstore.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![](https://brook.app/images/android.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.apk) | [![](https://brook.app/images/mac.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![Windows](https://brook.app/images/windows.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.msix) | [![](https://brook.app/images/linux.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.bin) | [![OpenWrt](https://brook.app/images/openwrt.png)](https://github.com/txthinking/brook/releases) |
| / | / | [App Mode](https://www.txthinking.com/talks/articles/macos-app-mode-en.article) | [How](https://www.txthinking.com/talks/articles/msix-brook-en.article) | [How](https://www.txthinking.com/talks/articles/linux-app-brook-en.article) | [How](https://www.txthinking.com/talks/articles/brook-openwrt-en.article) |
- [iOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Android](https://github.com/txthinking/brook/releases/latest/download/Brook.apk)
- [macOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Windows](https://github.com/txthinking/brook/releases/latest/download/Brook.msix)
- [Linux](https://github.com/txthinking/brook/releases/latest/download/Brook.bin)
- [OpenWrt](https://github.com/txthinking/brook/releases)
> You may want to use `brook link` to customize some parameters
- [About App Mode on macOS](https://www.txthinking.com/talks/articles/macos-app-mode-en.article)
- [How to install Brook on Windows?](https://www.txthinking.com/talks/articles/msix-brook-en.article)
- [How to install Brook on Linux](https://www.txthinking.com/talks/articles/linux-app-brook-en.article)
- [How to install Brook on OpenWrt](https://www.txthinking.com/talks/articles/brook-openwrt-en.article)

View File

@@ -1216,12 +1216,9 @@
<li><a href="#echoclient">echoclient</a></li>
<li><a href="#ipcountry">ipcountry</a></li>
<li><a href="#completion">completion</a></li>
<li><a href="#mdpage">mdpage</a><ul>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#mdpage">mdpage</a></li>
<li><a href="#manpage">manpage</a></li>
<li><a href="#help-h-1">help, h</a></li>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#examples">Examples</a><ul>
@@ -1319,12 +1316,9 @@
<li><a href="#echoclient">echoclient</a></li>
<li><a href="#ipcountry">ipcountry</a></li>
<li><a href="#completion">completion</a></li>
<li><a href="#mdpage">mdpage</a><ul>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#mdpage">mdpage</a></li>
<li><a href="#manpage">manpage</a></li>
<li><a href="#help-h-1">help, h</a></li>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#examples">Examples</a><ul>
@@ -1368,37 +1362,23 @@
<pre><code>brook server -l :9999 -p hello
</code></pre>
<h2 id="client">Client</h2>
<table>
<thead>
<tr>
<th>iOS</th>
<th>Android</th>
<th>Mac</th>
<th>Windows</th>
<th>Linux</th>
<th>OpenWrt</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642"><img src="https://brook.app/images/appstore.png" alt=""></a></td>
<td><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.apk"><img src="https://brook.app/images/android.png" alt=""></a></td>
<td><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642"><img src="https://brook.app/images/mac.png" alt=""></a></td>
<td><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.msix"><img src="https://brook.app/images/windows.png" alt="Windows"></a></td>
<td><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.bin"><img src="https://brook.app/images/linux.png" alt=""></a></td>
<td><a href="https://github.com/txthinking/brook/releases"><img src="https://brook.app/images/openwrt.png" alt="OpenWrt"></a></td>
</tr>
<tr>
<td>/</td>
<td>/</td>
<td><a href="https://www.txthinking.com/talks/articles/macos-app-mode-en.article">App Mode</a></td>
<td><a href="https://www.txthinking.com/talks/articles/msix-brook-en.article">How</a></td>
<td><a href="https://www.txthinking.com/talks/articles/linux-app-brook-en.article">How</a></td>
<td><a href="https://www.txthinking.com/talks/articles/brook-openwrt-en.article">How</a></td>
</tr>
</tbody></table>
<ul>
<li><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642">iOS</a></li>
<li><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.apk">Android</a></li>
<li><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642">macOS</a></li>
<li><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.msix">Windows</a></li>
<li><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.bin">Linux</a></li>
<li><a href="https://github.com/txthinking/brook/releases">OpenWrt</a></li>
</ul>
<blockquote>
<p>You may want to use <code>brook link</code> to customize some parameters</p>
</blockquote>
<ul>
<li><a href="https://www.txthinking.com/talks/articles/macos-app-mode-en.article">About App Mode on macOS</a></li>
<li><a href="https://www.txthinking.com/talks/articles/msix-brook-en.article">How to install Brook on Windows?</a></li>
<li><a href="https://www.txthinking.com/talks/articles/linux-app-brook-en.article">How to install Brook on Linux</a></li>
<li><a href="https://www.txthinking.com/talks/articles/brook-openwrt-en.article">How to install Brook on OpenWrt</a></li>
</ul>
<h1 id="client-1">Client</h1>
<p>Brook GUI will pass different <em>global variables</em> to the script at different times, and the script only needs to assign the processing result to the global variable <code>out</code></p>
<h2 id="cli">CLI</h2>
@@ -2119,8 +2099,6 @@ Functions
</li>
<li><p><strong>--dialWithSocks5Username</strong>=&quot;&quot;: If there is</p>
</li>
<li><p><strong>--help, -h</strong>: show help</p>
</li>
<li><p><strong>--ipLimitInterval</strong>=&quot;&quot;: Interval (s) for ipLimitMax (default: 0)</p>
</li>
<li><p><strong>--ipLimitMax</strong>=&quot;&quot;: Limit the number of client IP addresses, be careful when using this parameter, as the client may have dynamic IP. Works with server/wsserver/wssserver/quicserver (default: 0)</p>
@@ -2696,11 +2674,7 @@ Functions
</li>
<li><p><strong>--file, -f</strong>=&quot;&quot;: Write to file, default print to stdout</p>
</li>
<li><p><strong>--help, -h</strong>: show help</p>
</li>
</ul>
<h3 id="help-h">help, h</h3>
<p>Shows a list of commands or help for one command</p>
<h2 id="manpage">manpage</h2>
<p>Generate man.1 page</p>
<ul>
@@ -2709,7 +2683,7 @@ Functions
<li><p><strong>--file, -f</strong>=&quot;&quot;: Write to file, default print to stdout. You should put to /path/to/man/man1/brook.1 on linux or /usr/local/share/man/man1/brook.1 on macos</p>
</li>
</ul>
<h2 id="help-h-1">help, h</h2>
<h2 id="help-h">help, h</h2>
<p>Shows a list of commands or help for one command</p>
<h1 id="examples">Examples</h1>
<p>List some examples of common scene commands, pay attention to replace the parameters such as IP, port, password, domain name, certificate path, etc. in the example by yourself</p>

View File

@@ -128,7 +128,7 @@ func (pp *proxySetProvider) getSubscriptionInfo() {
go func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*90)
defer cancel()
resp, err := mihomoHttp.HttpRequestWithProxy(ctx, pp.Vehicle().(*resource.HTTPVehicle).Url(),
resp, err := mihomoHttp.HttpRequestWithProxy(ctx, pp.Vehicle().Url(),
http.MethodGet, nil, nil, pp.Vehicle().Proxy())
if err != nil {
return
@@ -137,7 +137,7 @@ func (pp *proxySetProvider) getSubscriptionInfo() {
userInfoStr := strings.TrimSpace(resp.Header.Get("subscription-userinfo"))
if userInfoStr == "" {
resp2, err := mihomoHttp.HttpRequestWithProxy(ctx, pp.Vehicle().(*resource.HTTPVehicle).Url(),
resp2, err := mihomoHttp.HttpRequestWithProxy(ctx, pp.Vehicle().Url(),
http.MethodGet, http.Header{"User-Agent": {"Quantumultx"}}, nil, pp.Vehicle().Proxy())
if err != nil {
return

View File

@@ -65,8 +65,7 @@ func (f *Fetcher[V]) Initial() (V, error) {
modTime := stat.ModTime()
f.updatedAt = modTime
isLocal = true
if f.interval != 0 && modTime.Add(f.interval).Before(time.Now()) {
log.Warnln("[Provider] %s not updated for a long time, force refresh", f.Name())
if time.Since(modTime) > f.interval {
forceUpdate = true
}
} else {
@@ -78,21 +77,7 @@ func (f *Fetcher[V]) Initial() (V, error) {
return lo.Empty[V](), err
}
var contents V
if forceUpdate {
var forceBuf []byte
if forceBuf, err = f.vehicle.Read(f.ctx); err == nil {
if contents, err = f.parser(forceBuf); err == nil {
isLocal = false
buf = forceBuf
}
}
}
if err != nil || !forceUpdate {
contents, err = f.parser(buf)
}
contents, err := f.parser(buf)
if err != nil {
if !isLocal {
return lo.Empty[V](), err
@@ -135,7 +120,7 @@ func (f *Fetcher[V]) Initial() (V, error) {
return lo.Empty[V](), err
}
} else if f.interval > 0 {
go f.pullLoop()
go f.pullLoop(forceUpdate)
}
return contents, nil
@@ -164,7 +149,7 @@ func (f *Fetcher[V]) SideUpdate(buf []byte) (V, bool, error) {
}
if f.vehicle.Type() != types.File {
if err := safeWrite(f.vehicle.Path(), buf); err != nil {
if err = safeWrite(f.vehicle.Path(), buf); err != nil {
return lo.Empty[V](), false, err
}
}
@@ -183,12 +168,17 @@ func (f *Fetcher[V]) Close() error {
return nil
}
func (f *Fetcher[V]) pullLoop() {
func (f *Fetcher[V]) pullLoop(forceUpdate bool) {
initialInterval := f.interval - time.Since(f.updatedAt)
if initialInterval > f.interval {
initialInterval = f.interval
}
if forceUpdate {
log.Warnln("[Provider] %s not updated for a long time, force refresh", f.Name())
f.update(f.vehicle.Path())
}
timer := time.NewTimer(initialInterval)
defer timer.Stop()
for {

View File

@@ -24,6 +24,10 @@ func (f *FileVehicle) Path() string {
return f.path
}
func (f *FileVehicle) Url() string {
return "file://" + f.path
}
func (f *FileVehicle) Read(ctx context.Context) ([]byte, error) {
return os.ReadFile(f.path)
}

View File

@@ -3,6 +3,8 @@ package trie
import (
"errors"
"strings"
"unicode"
"unicode/utf8"
)
const (
@@ -25,6 +27,14 @@ func ValidAndSplitDomain(domain string) ([]string, bool) {
if domain != "" && domain[len(domain)-1] == '.' {
return nil, false
}
if domain != "" {
if r, _ := utf8.DecodeRuneInString(domain); unicode.IsSpace(r) {
return nil, false
}
if r, _ := utf8.DecodeLastRuneInString(domain); unicode.IsSpace(r) {
return nil, false
}
}
domain = strings.ToLower(domain)
parts := strings.Split(domain, domainStep)
if len(parts) == 1 {

View File

@@ -127,3 +127,14 @@ func TestTrie_Foreach(t *testing.T) {
})
assert.Equal(t, 7, count)
}
func TestTrie_Space(t *testing.T) {
validDomain := func(domain string) bool {
_, ok := trie.ValidAndSplitDomain(domain)
return ok
}
assert.True(t, validDomain("google.com"))
assert.False(t, validDomain(" google.com"))
assert.False(t, validDomain(" google.com "))
assert.True(t, validDomain("Mijia Cloud"))
}

View File

@@ -8,7 +8,6 @@ import (
"net/netip"
"net/url"
"path"
"regexp"
"strings"
"time"
@@ -1287,7 +1286,6 @@ func parsePureDNSServer(server string) string {
func parseNameServerPolicy(nsPolicy *orderedmap.OrderedMap[string, any], ruleProviders map[string]providerTypes.RuleProvider, respectRules bool, preferH3 bool) ([]dns.Policy, error) {
var policy []dns.Policy
re := regexp.MustCompile(`[a-zA-Z0-9\-]+\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?`)
for pair := nsPolicy.Oldest(); pair != nil; pair = pair.Next() {
k, v := pair.Key, pair.Value
@@ -1299,8 +1297,9 @@ func parseNameServerPolicy(nsPolicy *orderedmap.OrderedMap[string, any], rulePro
if err != nil {
return nil, err
}
if strings.Contains(strings.ToLower(k), ",") {
if strings.Contains(k, "geosite:") {
kLower := strings.ToLower(k)
if strings.Contains(kLower, ",") {
if strings.Contains(kLower, "geosite:") {
subkeys := strings.Split(k, ":")
subkeys = subkeys[1:]
subkeys = strings.Split(subkeys[0], ",")
@@ -1308,7 +1307,7 @@ func parseNameServerPolicy(nsPolicy *orderedmap.OrderedMap[string, any], rulePro
newKey := "geosite:" + subkey
policy = append(policy, dns.Policy{Domain: newKey, NameServers: nameservers})
}
} else if strings.Contains(strings.ToLower(k), "rule-set:") {
} else if strings.Contains(kLower, "rule-set:") {
subkeys := strings.Split(k, ":")
subkeys = subkeys[1:]
subkeys = strings.Split(subkeys[0], ",")
@@ -1316,16 +1315,16 @@ func parseNameServerPolicy(nsPolicy *orderedmap.OrderedMap[string, any], rulePro
newKey := "rule-set:" + subkey
policy = append(policy, dns.Policy{Domain: newKey, NameServers: nameservers})
}
} else if re.MatchString(k) {
} else {
subkeys := strings.Split(k, ",")
for _, subkey := range subkeys {
policy = append(policy, dns.Policy{Domain: subkey, NameServers: nameservers})
}
}
} else {
if strings.Contains(strings.ToLower(k), "geosite:") {
if strings.Contains(kLower, "geosite:") {
policy = append(policy, dns.Policy{Domain: "geosite:" + k[8:], NameServers: nameservers})
} else if strings.Contains(strings.ToLower(k), "rule-set:") {
} else if strings.Contains(kLower, "rule-set:") {
policy = append(policy, dns.Policy{Domain: "rule-set:" + k[9:], NameServers: nameservers})
} else {
policy = append(policy, dns.Policy{Domain: k, NameServers: nameservers})

View File

@@ -34,6 +34,7 @@ func (v VehicleType) String() string {
type Vehicle interface {
Read(ctx context.Context) ([]byte, error)
Path() string
Url() string
Proxy() string
Type() VehicleType
}

View File

@@ -138,6 +138,7 @@ func New(options LC.Tun, tunnel C.Tunnel, additions ...inbound.Addition) (l *Lis
tunName := options.Device
if options.FileDescriptor == 0 && (tunName == "" || !checkTunName(tunName)) {
tunName = CalculateInterfaceName(InterfaceName)
options.Device = tunName
}
routeAddress := options.RouteAddress
if len(options.Inet4RouteAddress) > 0 {

View File

@@ -570,9 +570,9 @@ dependencies = [
[[package]]
name = "axum"
version = "0.7.5"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf"
checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec"
dependencies = [
"async-trait",
"axum-core",
@@ -599,7 +599,7 @@ dependencies = [
"sync_wrapper 1.0.1",
"tokio",
"tokio-tungstenite",
"tower",
"tower 0.5.1",
"tower-layer",
"tower-service",
"tracing",
@@ -607,9 +607,9 @@ dependencies = [
[[package]]
name = "axum-core"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3"
checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00"
dependencies = [
"async-trait",
"bytes",
@@ -620,7 +620,7 @@ dependencies = [
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper 0.1.2",
"sync_wrapper 1.0.1",
"tower-layer",
"tower-service",
"tracing",
@@ -1228,9 +1228,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.17"
version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac"
checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3"
dependencies = [
"clap_builder",
"clap_derive",
@@ -1238,9 +1238,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.17"
version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73"
checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b"
dependencies = [
"anstream",
"anstyle",
@@ -1250,9 +1250,9 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.13"
version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0"
checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -1756,9 +1756,9 @@ dependencies = [
[[package]]
name = "curl-sys"
version = "0.4.75+curl-8.10.0"
version = "0.4.76+curl-8.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a4fd752d337342e4314717c0d9b6586b059a120c80029ebe4d49b11fec7875e"
checksum = "00462dbe9cbb9344e1b2be34d9094d74e3b8aac59a883495b335eafd02e25120"
dependencies = [
"cc",
"libc",
@@ -3322,7 +3322,7 @@ dependencies = [
"pin-project-lite",
"socket2 0.5.7",
"tokio",
"tower",
"tower 0.4.13",
"tower-service",
"tracing",
]
@@ -4709,7 +4709,7 @@ dependencies = [
[[package]]
name = "nyanpasu-ipc"
version = "1.0.6"
source = "git+https://github.com/LibNyanpasu/nyanpasu-service.git#a9d91584893489ffb96741bfee3f5b20a4f2eba7"
source = "git+https://github.com/LibNyanpasu/nyanpasu-service.git#eafde94f159754296b7bf896b08f8c50da6bfe05"
dependencies = [
"anyhow",
"axum",
@@ -5583,9 +5583,9 @@ checksum = "325a6d2ac5dee293c3b2612d4993b98aec1dff096b0a2dae70ed7d95784a05da"
[[package]]
name = "portable-atomic"
version = "1.7.0"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce"
[[package]]
name = "powerfmt"
@@ -5750,9 +5750,9 @@ dependencies = [
[[package]]
name = "quick-xml"
version = "0.36.1"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc"
checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe"
dependencies = [
"memchr",
]
@@ -6446,9 +6446,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
version = "2.11.1"
version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf"
checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6"
dependencies = [
"core-foundation-sys",
"libc",
@@ -7439,7 +7439,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-clipboard-manager"
version = "2.0.0-rc.4"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"arboard",
"image",
@@ -7469,7 +7469,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.0.0-rc.7"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"log",
"raw-window-handle",
@@ -7486,7 +7486,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.0.0-rc.5"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"anyhow",
"dunce",
@@ -7506,7 +7506,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-global-shortcut"
version = "2.0.0-rc.2"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"global-hotkey",
"log",
@@ -7520,7 +7520,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-notification"
version = "2.0.0-rc.5"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"log",
"notify-rust",
@@ -7538,7 +7538,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-os"
version = "2.0.0-rc.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"gethostname 0.5.0",
"log",
@@ -7555,7 +7555,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-process"
version = "2.0.0-rc.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"tauri",
"tauri-plugin",
@@ -7564,7 +7564,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-shell"
version = "2.0.0-rc.3"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"encoding_rs",
"log",
@@ -7584,7 +7584,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-updater"
version = "2.0.0-rc.3"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#221f50f53bd7a87dbd404e4cb1aaf502a5047785"
dependencies = [
"base64 0.22.1",
"dirs 5.0.1",
@@ -7593,6 +7593,7 @@ dependencies = [
"http 1.1.0",
"infer 0.16.0",
"minisign-verify",
"percent-encoding",
"reqwest",
"semver 1.0.23",
"serde",
@@ -8031,9 +8032,9 @@ dependencies = [
[[package]]
name = "tokio-tungstenite"
version = "0.21.0"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38"
checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd"
dependencies = [
"futures-util",
"log",
@@ -8126,6 +8127,21 @@ dependencies = [
"tokio",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f"
dependencies = [
"futures-core",
"futures-util",
"pin-project-lite",
"sync_wrapper 0.1.2",
"tokio",
"tower-layer",
"tower-service",
"tracing",
]
@@ -8290,9 +8306,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "tungstenite"
version = "0.21.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1"
checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8"
dependencies = [
"byteorder",
"bytes",
@@ -8303,7 +8319,6 @@ dependencies = [
"rand 0.8.5",
"sha1",
"thiserror",
"url",
"utf-8",
]
@@ -8803,7 +8818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3"
dependencies = [
"proc-macro2",
"quick-xml 0.36.1",
"quick-xml 0.36.2",
"quote",
]

View File

@@ -5,7 +5,7 @@ use parking_lot::Mutex;
use std::{collections::HashMap, sync::Arc};
use tauri::AppHandle;
use tauri_plugin_global_shortcut::{GlobalShortcutExt, Shortcut};
use tauri_plugin_global_shortcut::{GlobalShortcutExt, Shortcut, ShortcutState};
pub struct Hotkey {
current: Arc<Mutex<Vec<String>>>, // 保存当前的热键设置
@@ -15,6 +15,7 @@ pub struct Hotkey {
// (hotkey, func)
type HotKeyOp<'a> = (&'a str, HotKeyOpType<'a>);
#[derive(Debug)]
enum HotKeyOpType<'a> {
#[allow(unused)]
Unbind(&'a str),
@@ -97,8 +98,10 @@ impl Hotkey {
_ => bail!("invalid function \"{func}\""),
};
manager.on_shortcut(hotkey, move |_app_handle, _hotkey, _ev| {
f();
manager.on_shortcut(hotkey, move |_app_handle, _hotkey, ev| {
if let ShortcutState::Pressed = ev.state {
f();
}
})?;
log::info!(target: "app", "register hotkey {hotkey} {func}");
@@ -117,6 +120,7 @@ impl Hotkey {
Ok(())
}
#[tracing::instrument(skip(self))]
pub fn update(&self, new_hotkeys: Vec<String>) -> Result<()> {
let mut current = self.current.lock();
let old_map = Self::get_map_from_vec(&current);
@@ -126,11 +130,13 @@ impl Hotkey {
// 先检查一遍所有新的热键是不是可以用的
for (hotkey, op) in ops.iter() {
if let HotKeyOpType::Bind(_) = op {
if matches!(op, HotKeyOpType::Bind(_) | HotKeyOpType::Change(_, _)) {
Self::check_key(hotkey)?
}
}
tracing::info!("hotkey update: {:?}", ops);
for (hotkey, op) in ops.iter() {
match op {
HotKeyOpType::Unbind(_) => self.unregister(hotkey)?,

View File

@@ -1,4 +1,4 @@
#![feature(auto_traits, negative_impls)]
#![feature(auto_traits, negative_impls, let_chains)]
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
@@ -136,6 +136,14 @@ pub fn run() -> std::io::Result<()> {
panic.note = note,
"A panic occurred",
);
// This is a workaround for the upstream issue: https://github.com/tauri-apps/tauri/issues/10546
if let Some(s) = payload.as_ref()
&& s.contains("PostMessage failed ; is the messages queue full?")
{
return;
}
utils::dialog::panic_dialog(&format!(
"payload: {:#?}\nlocation: {:?}\nbacktrace: {:#?}\n\nnote: {:?}",
payload, location, backtrace, note
@@ -149,6 +157,7 @@ pub fn run() -> std::io::Result<()> {
});
let _ = task.join();
default_panic(panic_info);
std::process::exit(1); // exit if default panic handler doesn't exit
}));
let verge = { Config::verge().latest().language.clone().unwrap() };
@@ -324,10 +333,13 @@ pub fn run() -> std::io::Result<()> {
tauri::WindowEvent::ScaleFactorChanged { scale_factor, .. } => {
core::tray::on_scale_factor_changed(scale_factor);
}
tauri::WindowEvent::CloseRequested { .. } | tauri::WindowEvent::Destroyed => {
tauri::WindowEvent::CloseRequested { .. } => {
log::debug!(target: "app", "window close requested");
reset_window_open_counter();
let _ = resolve::save_window_state(app_handle, true);
}
tauri::WindowEvent::Destroyed => {
log::debug!(target: "app", "window destroyed");
reset_window_open_counter();
#[cfg(target_os = "macos")]
log_err!(app_handle.run_on_main_thread(|| {
crate::utils::dock::macos::hide_dock_icon();

View File

@@ -104,27 +104,27 @@ pub fn run_pending_migrations() -> Result<()> {
/// before tauri setup
pub fn init_config() -> Result<()> {
// Check if old config dir exist and new config dir is not exist
let mut old_app_dir: Option<PathBuf> = None;
let mut app_dir: Option<PathBuf> = None;
crate::dialog_err!(dirs::old_app_home_dir().map(|_old_app_dir| {
old_app_dir = Some(_old_app_dir);
}));
// let mut old_app_dir: Option<PathBuf> = None;
// let mut app_dir: Option<PathBuf> = None;
// crate::dialog_err!(dirs::old_app_home_dir().map(|_old_app_dir| {
// old_app_dir = Some(_old_app_dir);
// }));
crate::dialog_err!(dirs::app_home_dir().map(|_app_dir| {
app_dir = Some(_app_dir);
}));
// crate::dialog_err!(dirs::app_home_dir().map(|_app_dir| {
// app_dir = Some(_app_dir);
// }));
if let (Some(app_dir), Some(old_app_dir)) = (app_dir, old_app_dir) {
let msg = t!("dialog.migrate");
if !app_dir.exists() && old_app_dir.exists() && migrate_dialog(msg.to_string().as_str()) {
if let Err(e) = do_config_migration(&old_app_dir, &app_dir) {
super::dialog::error_dialog(format!("failed to do migration: {:?}", e))
}
}
if !app_dir.exists() {
let _ = fs::create_dir_all(app_dir);
}
}
// if let (Some(app_dir), Some(old_app_dir)) = (app_dir, old_app_dir) {
// let msg = t!("dialog.migrate");
// if !app_dir.exists() && old_app_dir.exists() && migrate_dialog(msg.to_string().as_str()) {
// if let Err(e) = do_config_migration(&old_app_dir, &app_dir) {
// super::dialog::error_dialog(format!("failed to do migration: {:?}", e))
// }
// }
// if !app_dir.exists() {
// let _ = fs::create_dir_all(app_dir);
// }
// }
// init log
logging::init().unwrap();

View File

@@ -37,6 +37,7 @@
"sidecar/mihomo",
"sidecar/mihomo-alpha",
"sidecar/clash-rs",
"sidecar/clash-rs-alpha",
"sidecar/nyanpasu-service"
],
"copyright": "© 2024 Clash Nyanpasu All Rights Reserved",

View File

@@ -13,7 +13,7 @@
"dependencies": {
"@tauri-apps/api": "2.0.0-rc.5",
"ahooks": "3.8.1",
"ofetch": "1.3.4",
"ofetch": "1.4.0",
"react": "rc",
"swr": "2.2.5"
},

View File

@@ -38,6 +38,8 @@ export const useNyanpasu = (options?: {
} catch (error) {
if (options?.onError) {
options?.onError(error);
} else {
throw error;
}
}
};

View File

@@ -34,7 +34,7 @@
"json-schema": "0.4.0",
"material-react-table": "3.0.1",
"monaco-editor": "0.52.0",
"mui-color-input": "4.0.0",
"mui-color-input": "4.0.1",
"react": "rc",
"react-dom": "rc",
"react-error-boundary": "4.0.13",
@@ -53,7 +53,7 @@
"@csstools/normalize.css": "12.1.1",
"@emotion/babel-plugin": "11.12.0",
"@emotion/react": "11.13.3",
"@iconify/json": "2.2.250",
"@iconify/json": "2.2.251",
"@monaco-editor/react": "4.6.0",
"@tanstack/react-router": "1.58.3",
"@tanstack/router-devtools": "1.58.3",
@@ -75,13 +75,13 @@
"meta-json-schema": "1.18.8",
"monaco-yaml": "5.2.2",
"nanoid": "5.0.7",
"sass": "1.79.2",
"sass": "1.79.3",
"shiki": "1.18.0",
"tailwindcss-textshadow": "2.1.3",
"unplugin-auto-import": "0.18.3",
"unplugin-icons": "0.19.3",
"validator": "13.12.0",
"vite": "5.4.6",
"vite": "5.4.7",
"vite-plugin-sass-dts": "1.3.29",
"vite-plugin-svgr": "4.2.0",
"vite-tsconfig-paths": "5.0.1",

View File

@@ -1,9 +1,9 @@
import { use, useEffect, useState } from "react";
import { Add } from "@mui/icons-material";
import { FloatingButton } from "@nyanpasu/ui";
import { cn, FloatingButton } from "@nyanpasu/ui";
import { AddProfileContext, ProfileDialog } from "./profile-dialog";
export const NewProfileButton = () => {
export const NewProfileButton = ({ className }: { className?: string }) => {
const addProfileCtx = use(AddProfileContext);
const [open, setOpen] = useState(!!addProfileCtx);
useEffect(() => {
@@ -11,7 +11,7 @@ export const NewProfileButton = () => {
}, [addProfileCtx]);
return (
<>
<FloatingButton onClick={() => setOpen(true)}>
<FloatingButton className={cn(className)} onClick={() => setOpen(true)}>
<Add className="absolute !size-8" />
</FloatingButton>

View File

@@ -1,7 +1,7 @@
import { useLockFn, useMemoizedFn, useSetState } from "ahooks";
import dayjs from "dayjs";
import { AnimatePresence, motion } from "framer-motion";
import { memo, useEffect, useMemo, useState } from "react";
import { memo, use, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { message } from "@/utils/notification";
import parseTraffic from "@/utils/parse-traffic";
@@ -29,6 +29,7 @@ import {
import { Profile, useClash } from "@nyanpasu/interface";
import { cleanDeepClickEvent, cn } from "@nyanpasu/ui";
import { ProfileDialog } from "./profile-dialog";
import { GlobalUpdatePendingContext } from "./provider";
export interface ProfileItemProps {
item: Profile.Item;
@@ -60,6 +61,8 @@ export const ProfileItem = memo(function ProfileItem({
viewProfile,
} = useClash();
const globalUpdatePending = use(GlobalUpdatePendingContext);
const [loading, setLoading] = useSetState({
update: false,
card: false,
@@ -91,16 +94,6 @@ export const ProfileItem = memo(function ProfileItem({
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
const menuMapping = {
Select: () => handleSelect(),
"Edit Info": () => setOpen(true),
"Proxy Chains": () => onClickChains(item),
"Open File": () => viewProfile(item.uid),
Update: () => handleUpdate(),
"Update(Proxy)": () => handleUpdate(true),
Delete: () => handleDelete(),
};
const handleSelect = useLockFn(async () => {
if (selected) {
return;
@@ -166,7 +159,27 @@ export const ProfileItem = memo(function ProfileItem({
}
});
const MenuComp = () => {
const menuMapping = useMemo(
() => ({
Select: () => handleSelect(),
"Edit Info": () => setOpen(true),
"Proxy Chains": () => onClickChains(item),
"Open File": () => viewProfile(item.uid),
Update: () => handleUpdate(),
"Update(Proxy)": () => handleUpdate(true),
Delete: () => handleDelete(),
}),
[
handleDelete,
handleSelect,
handleUpdate,
item,
onClickChains,
viewProfile,
],
);
const MenuComp = useMemo(() => {
const handleClick = (func: () => void) => {
setAnchorEl(null);
func();
@@ -193,7 +206,7 @@ export const ProfileItem = memo(function ProfileItem({
})}
</Menu>
);
};
}, [anchorEl, menuMapping, t]);
const [open, setOpen] = useState(false);
@@ -310,7 +323,7 @@ export const ProfileItem = memo(function ProfileItem({
cleanDeepClickEvent(e);
menuMapping.Update();
}}
loading={loading.update}
loading={globalUpdatePending || loading.update}
>
<Update />
</LoadingButton>
@@ -351,7 +364,7 @@ export const ProfileItem = memo(function ProfileItem({
<div>Applying Profile...</div>
</motion.div>
</Paper>
<MenuComp />
{MenuComp}
<ProfileDialog
open={open}
onClose={() => setOpen(false)}

View File

@@ -0,0 +1,3 @@
import { createContext } from "react";
export const GlobalUpdatePendingContext = createContext<boolean>(false);

View File

@@ -1,7 +1,8 @@
import { useLockFn, useMemoizedFn } from "ahooks";
import { useEffect, useMemo, useRef, useState } from "react";
import { useLockFn } from "ahooks";
import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { notification, NotificationType } from "@/utils/notification";
import { formatError } from "@/utils";
import { message } from "@/utils/notification";
import { Typography } from "@mui/material";
import { useNyanpasu } from "@nyanpasu/interface";
import { BaseDialog, BaseDialogProps } from "@nyanpasu/ui";
@@ -21,7 +22,21 @@ const HOTKEY_FUNC = [
"toggle_tun_mode",
// "enable_tun_mode",
// "disable_tun_mode",
];
] as const;
type AllowedHotkeyFunc = (typeof HOTKEY_FUNC)[number];
type Key = string;
type HotKeyErrorMessages = {
[K in AllowedHotkeyFunc]: string | null;
};
type HotKeyLoading = {
[K in AllowedHotkeyFunc]: boolean;
};
type HotkeyMap = { [K in AllowedHotkeyFunc]: Key[] };
export default function HotkeyDialog({
open,
@@ -31,19 +46,19 @@ export default function HotkeyDialog({
}: HotkeyDialogProps) {
const { t } = useTranslation();
const { nyanpasuConfig, setNyanpasuConfig } = useNyanpasu();
const [hotkeyMap, setHotkeyMap] = useState<Record<string, string[]>>({});
const hotkeyMapRef = useRef<Record<string, string[]>>({});
// 检查是否有快捷键重复
const [duplicateItems, setDuplicateItems] = useState<string[]>([]);
const { nyanpasuConfig, setNyanpasuConfig } = useNyanpasu();
const [hotkeyMap, setHotkeyMap] = useState<HotkeyMap>({} as HotkeyMap);
useEffect(() => {
if (open) {
if (open && Object.keys(hotkeyMap).length === 0) {
const map = {} as typeof hotkeyMap;
nyanpasuConfig?.hotkeys?.forEach((text) => {
const [func, key] = text.split(",").map((i) => i.trim());
if (!func || !key) return;
map[func] = key
map[func as AllowedHotkeyFunc] = key
.split("+")
.map((e) => e.trim())
.map((k) => (k === "PLUS" ? "+" : k));
@@ -51,61 +66,76 @@ export default function HotkeyDialog({
setHotkeyMap(map);
setDuplicateItems([]);
}
}, [nyanpasuConfig?.hotkeys, open]);
const isDuplicated = useMemo(() => !!duplicateItems.length, [duplicateItems]);
}, [hotkeyMap, nyanpasuConfig?.hotkeys, open]);
const onBlurCb = useMemoizedFn(
(e: React.FocusEvent<HTMLInputElement>, func: string) => {
console.log(func);
const keys = Object.values(hotkeyMapRef.current).flat().filter(Boolean);
const set = new Set(keys);
if (keys.length !== set.size) {
setDuplicateItems([...duplicateItems, func]);
} else {
setDuplicateItems(duplicateItems.filter((e) => e !== func));
const [errorMessages, setErrorMessages] = useState<HotKeyErrorMessages>(
HOTKEY_FUNC.reduce(
(acc, cur) => ({ ...acc, [cur]: null }),
{} as HotKeyErrorMessages,
),
);
const [loading, setLoading] = useState<HotKeyLoading>(
HOTKEY_FUNC.reduce(
(acc, cur) => ({ ...acc, [cur]: false }),
{} as HotKeyLoading,
),
);
const saveState = useLockFn(
async (func: AllowedHotkeyFunc, hotkeyMap: HotkeyMap) => {
const hotkeys = Object.entries(hotkeyMap)
.map(([func, keys]) => {
if (!func || !keys?.length) return "";
const key = keys
.map((k) => k.trim())
.filter(Boolean)
.map((k) => (k === "+" ? "PLUS" : k))
.join("+");
if (!key) return "";
return `${func},${key}`;
})
.filter(Boolean);
try {
await setNyanpasuConfig({ hotkeys });
} catch (err: unknown) {
setErrorMessages((prev) => ({
...prev,
[func]: formatError(err),
}));
await message(formatError(err), {
kind: "error",
});
}
},
);
const saveState = useLockFn(async () => {
const hotkeys = Object.entries(hotkeyMap)
.map(([func, keys]) => {
if (!func || !keys?.length) return "";
const onBlurCb = useCallback(
(e: React.FocusEvent<HTMLInputElement>, func: string) => {
const keys = Object.values(hotkeyMap).flat().filter(Boolean);
const set = new Set(keys);
if (keys.length !== set.size) {
setDuplicateItems([...duplicateItems, func]);
return;
} else {
setDuplicateItems(duplicateItems.filter((e) => e !== func));
}
const key = keys
.map((k) => k.trim())
.filter(Boolean)
.map((k) => (k === "+" ? "PLUS" : k))
.join("+");
setLoading((prev) => ({ ...prev, [func]: true }));
if (!key) return "";
return `${func},${key}`;
})
.filter(Boolean);
try {
await setNyanpasuConfig({ hotkeys });
} catch (err: any) {
notification({
title: t("Error"),
body: err.message || err.toString(),
type: NotificationType.Error,
});
}
});
// 自动保存
useEffect(() => {
if (!isDuplicated && open) {
saveState();
}
}, [hotkeyMap, isDuplicated, open, saveState]);
const onSave = () => {
saveState().then(() => {
onClose?.();
});
};
saveState(func as AllowedHotkeyFunc, hotkeyMap)
.catch(() => {
setDuplicateItems([...duplicateItems, func]);
})
.finally(() => {
setLoading((prev) => ({ ...prev, [func]: false }));
});
},
[duplicateItems, hotkeyMap, saveState],
);
return (
<BaseDialog
@@ -121,14 +151,15 @@ export default function HotkeyDialog({
<Typography>{t(func)}</Typography>
<HotkeyInput
func={func}
isDuplicate={duplicateItems.includes(func)}
isDuplicate={
duplicateItems.includes(func) || !!errorMessages[func]
}
onBlurCb={onBlurCb}
loading={loading[func]}
value={hotkeyMap[func] ?? []}
onValueChange={(v) => {
const map = { ...hotkeyMapRef.current, [func]: v };
hotkeyMapRef.current = map;
setHotkeyMap(map);
}}
onValueChange={(v) =>
setHotkeyMap((prev) => ({ ...prev, [func]: v }))
}
/>
</div>
))}

View File

@@ -1,9 +1,8 @@
import { parseHotkey } from "@/utils/parse-hotkey";
import { DeleteRounded } from "@mui/icons-material";
import { alpha, IconButton, useTheme } from "@mui/material";
import { Dangerous, DeleteRounded } from "@mui/icons-material";
import { alpha, CircularProgress, IconButton, useTheme } from "@mui/material";
import type {} from "@mui/material/themeCssVarsAugmentation";
import clsx from "clsx";
import { CSSProperties, useRef, useState } from "react";
import { CSSProperties, useEffect, useRef, useState } from "react";
import { cn, Kbd } from "@nyanpasu/ui";
import styles from "./hotkey-input.module.scss";
@@ -13,23 +12,33 @@ export interface Props extends React.HTMLAttributes<HTMLInputElement> {
onValueChange?: (value: string[]) => void;
func: string;
onBlurCb?: (e: React.FocusEvent<HTMLInputElement>, func: string) => void;
loading?: boolean;
}
export default function HotkeyInput({
isDuplicate = false,
value,
children,
func,
onValueChange,
onBlurCb,
// native
className,
loading,
...rest
}: Props) {
const theme = useTheme();
const changeRef = useRef<string[]>([]);
const [keys, setKeys] = useState(value || []);
const [isClearing, setIsClearing] = useState(false);
useEffect(() => {
if (isClearing) {
onBlurCb?.({} as React.FocusEvent<HTMLInputElement>, func);
setIsClearing(false);
}
}, [func, isClearing, onBlurCb]);
return (
<div className="flex items-center gap-2">
<div className={cn("relative min-h-[36px] w-[165px]", styles.wrapper)}>
@@ -84,6 +93,19 @@ export default function HotkeyInput({
{key}
</Kbd>
))}
{loading && (
<CircularProgress className="absolute right-2" size={13} />
)}
{isDuplicate && (
<Dangerous
className="absolute right-2 text-base"
sx={[
(theme) => ({
color: theme.palette.error.main,
}),
]}
/>
)}
</div>
</div>
@@ -94,7 +116,7 @@ export default function HotkeyInput({
onClick={() => {
onValueChange?.([]);
setKeys([]);
onBlurCb?.({} as any, func);
setIsClearing(true);
}}
>
<DeleteRounded fontSize="inherit" />

View File

@@ -1,7 +1,8 @@
import MdiTextBoxCheckOutline from "~icons/mdi/text-box-check-outline";
import { useLockFn } from "ahooks";
import { AnimatePresence, motion } from "framer-motion";
import { useAtom } from "jotai";
import { useMemo, useState } from "react";
import { useMemo, useState, useTransition } from "react";
import { useTranslation } from "react-i18next";
import { useWindowSize } from "react-use";
import { z } from "zod";
@@ -16,14 +17,17 @@ import {
} from "@/components/profiles/profile-dialog";
import ProfileItem from "@/components/profiles/profile-item";
import ProfileSide from "@/components/profiles/profile-side";
import { GlobalUpdatePendingContext } from "@/components/profiles/provider";
import { QuickImport } from "@/components/profiles/quick-import";
import RuntimeConfigDiffDialog from "@/components/profiles/runtime-config-diff-dialog";
import { filterProfiles } from "@/components/profiles/utils";
import { Public } from "@mui/icons-material";
import { Badge, Button, IconButton } from "@mui/material";
import { formatError } from "@/utils";
import { message } from "@/utils/notification";
import { Public, Update } from "@mui/icons-material";
import { Badge, Button, CircularProgress, IconButton } from "@mui/material";
import Grid from "@mui/material/Grid2";
import { Profile, useClash } from "@nyanpasu/interface";
import { SidePage } from "@nyanpasu/ui";
import { Profile, updateProfile, useClash } from "@nyanpasu/interface";
import { FloatingButton, SidePage } from "@nyanpasu/ui";
import { createFileRoute, useLocation } from "@tanstack/react-router";
import { zodSearchValidator } from "@tanstack/router-zod-adapter";
@@ -119,6 +123,30 @@ function ProfilePage() {
const { width } = useWindowSize();
const [globalUpdatePending, startGlobalUpdate] = useTransition();
const handleGlobalProfileUpdate = useLockFn(async () => {
await startGlobalUpdate(async () => {
const remoteProfiles =
profiles?.filter((item) => item.type == "remote") || [];
const updates: Array<Promise<void>> = [];
for (const profile of remoteProfiles) {
const options: Profile.Option = profile.option || {
with_proxy: false,
self_proxy: false,
};
updates.push(updateProfile(profile.uid, options));
}
try {
await Promise.all(updates);
} catch (e) {
message(`failed to update profiles: \n${formatError(e)}`, {
kind: "error",
});
}
});
});
return (
<SidePage
title={t("Profiles")}
@@ -168,45 +196,64 @@ function ProfilePage() {
side={hasSide && <ProfileSide onClose={handleSideClose} />}
>
<AnimatePresence initial={false} mode="sync">
<div className="flex flex-col gap-4 p-6">
<QuickImport />
<GlobalUpdatePendingContext.Provider value={globalUpdatePending}>
<div className="flex flex-col gap-4 p-6">
<QuickImport />
{profiles && (
<Grid container spacing={2}>
{profiles.map((item) => (
<Grid
key={item.uid}
size={{
xs: 12,
sm: 12,
md: hasSide && width <= 1000 ? 12 : 6,
lg: 4,
xl: 3,
}}
>
<motion.div
{profiles && (
<Grid container spacing={2}>
{profiles.map((item) => (
<Grid
key={item.uid}
layoutId={`profile-${item.uid}`}
layout="position"
initial={false}
size={{
xs: 12,
sm: 12,
md: hasSide && width <= 1000 ? 12 : 6,
lg: 4,
xl: 3,
}}
>
<ProfileItem
item={item}
onClickChains={onClickChains}
selected={getProfiles.data?.current == item.uid}
maxLogLevelTriggered={maxLogLevelTriggered}
chainsSelected={chainsSelected == item.uid}
/>
</motion.div>
</Grid>
))}
</Grid>
)}
</div>
<motion.div
key={item.uid}
layoutId={`profile-${item.uid}`}
layout="position"
initial={false}
>
<ProfileItem
item={item}
onClickChains={onClickChains}
selected={getProfiles.data?.current == item.uid}
maxLogLevelTriggered={maxLogLevelTriggered}
chainsSelected={chainsSelected == item.uid}
/>
</motion.div>
</Grid>
))}
</Grid>
)}
</div>
</GlobalUpdatePendingContext.Provider>
</AnimatePresence>
<AddProfileContext.Provider value={addProfileCtxValue}>
<NewProfileButton />
<div className="fixed bottom-8 right-8">
<FloatingButton
className="relative -right-2.5 -top-3 flex size-11 min-w-fit"
sx={[
(theme) => ({
backgroundColor: theme.palette.grey[200],
boxShadow: 4,
"&:hover": {
backgroundColor: theme.palette.grey[300],
},
}),
]}
onClick={handleGlobalProfileUpdate}
>
{globalUpdatePending ? <CircularProgress size={22} /> : <Update />}
</FloatingButton>
<NewProfileButton className="static" />
</div>
</AddProfileContext.Provider>
</SidePage>
);

View File

@@ -34,7 +34,7 @@
"react-error-boundary": "4.0.13",
"react-i18next": "15.0.2",
"react-use": "17.5.1",
"vite": "5.4.6",
"vite": "5.4.7",
"vite-tsconfig-paths": "5.0.1"
},
"devDependencies": {
@@ -42,7 +42,7 @@
"@types/d3-interpolate-path": "2.0.3",
"clsx": "2.1.1",
"d3-interpolate-path": "2.3.0",
"sass": "1.79.2",
"sass": "1.79.3",
"tailwind-merge": "2.5.2",
"typescript-plugin-css-modules": "5.1.0",
"vite-plugin-dts": "4.2.1"

View File

@@ -60,6 +60,7 @@ export const BaseDialog = ({
});
const [okLoading, setOkLoading] = useState(false);
const [closeLoading, setCloseLoading] = useState(false);
const { run: runMounted, cancel: cancelMounted } = useDebounceFn(
() => setMounted(false),
@@ -79,12 +80,22 @@ export const BaseDialog = ({
}
}, [open]);
const handleClose = useCallback(() => {
const handleClose = useLockFn(async () => {
if (onClose) {
onClose();
runMounted();
if (onClose.constructor.name === "AsyncFunction") {
try {
setCloseLoading(true);
await onClose();
} finally {
setCloseLoading(false);
}
} else {
onClose();
}
}
}, [onClose, runMounted]);
runMounted();
});
const handleOk = useLockFn(async () => {
if (!onOk) return;
@@ -208,9 +219,14 @@ export const BaseDialog = ({
<div className={cn("m-2 flex justify-end gap-2", full && "mx-6")}>
{onClose && (
<Button variant="outlined" onClick={handleClose}>
<LoadingButton
disabled={loading || closeLoading}
loading={closeLoading || loading}
variant="outlined"
onClick={handleClose}
>
{close || t("Close")}
</Button>
</LoadingButton>
)}
{onOk && (

View File

@@ -1,4 +1,5 @@
import { ReactNode } from "react";
import { cn } from "@/utils";
import { alpha, Button, ButtonProps, useTheme } from "@mui/material";
export interface FloatingButtonProps extends ButtonProps {
@@ -15,7 +16,10 @@ export const FloatingButton = ({
return (
<Button
className={`bottom-8 right-8 z-10 size-16 !rounded-2xl backdrop-blur ${className}`}
className={cn(
`bottom-8 right-8 z-10 size-16 !rounded-2xl backdrop-blur`,
className,
)}
sx={{
position: "fixed",
boxShadow: 8,

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
"octokit": "4.0.2",
"picocolors": "1.1.0",
"tar": "7.4.3",
"telegram": "2.25.4",
"telegram": "2.25.9",
"undici": "6.19.8"
}
}

View File

@@ -133,7 +133,9 @@ const repoInfo = {
() =>
client.sendFile(TELEGRAM_TO_NIGHTLY, {
file: resourceMapping.filter(
(item) => item.endsWith(".exe") || item.endsWith("portable.zip"),
(item) =>
!item.includes("fixed-webview") &&
(item.endsWith(".exe") || item.endsWith("portable.zip")),
),
forceDocument: true,
caption: `Clash Nyanpasu Nightly Build ${GIT_SHORT_HASH} for Windows`,

View File

@@ -294,7 +294,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
VM_WARN_ON_ONCE(!list_empty(list));
@@ -5249,7 +5249,7 @@ done:
@@ -5248,7 +5248,7 @@ done:
static bool __maybe_unused state_is_valid(struct lruvec *lruvec)
{
@@ -303,7 +303,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
if (lrugen->enabled) {
enum lru_list lru;
@@ -5531,7 +5531,7 @@ static void lru_gen_seq_show_full(struct
@@ -5530,7 +5530,7 @@ static void lru_gen_seq_show_full(struct
int i;
int type, tier;
int hist = lru_hist_from_seq(seq);
@@ -312,7 +312,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
for (tier = 0; tier < MAX_NR_TIERS; tier++) {
seq_printf(m, " %10d", tier);
@@ -5581,7 +5581,7 @@ static int lru_gen_seq_show(struct seq_f
@@ -5580,7 +5580,7 @@ static int lru_gen_seq_show(struct seq_f
unsigned long seq;
bool full = !debugfs_real_fops(m->file)->write;
struct lruvec *lruvec = v;
@@ -321,7 +321,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
int nid = lruvec_pgdat(lruvec)->node_id;
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
DEFINE_MAX_SEQ(lruvec);
@@ -5835,7 +5835,7 @@ void lru_gen_init_lruvec(struct lruvec *
@@ -5834,7 +5834,7 @@ void lru_gen_init_lruvec(struct lruvec *
{
int i;
int gen, type, zone;

View File

@@ -76,7 +76,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
{
int type;
int scanned;
@@ -5095,9 +5104,6 @@ retry:
@@ -5094,9 +5103,6 @@ retry:
goto retry;
}
@@ -86,7 +86,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
return scanned;
}
@@ -5136,67 +5142,26 @@ done:
@@ -5135,67 +5141,26 @@ done:
return min_seq[!can_swap] + MIN_NR_GENS <= max_seq ? nr_to_scan : 0;
}
@@ -163,7 +163,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
lru_add_drain();
@@ -5220,7 +5185,7 @@ static void lru_gen_shrink_lruvec(struct
@@ -5219,7 +5184,7 @@ static void lru_gen_shrink_lruvec(struct
if (!nr_to_scan)
goto done;
@@ -172,7 +172,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
if (!delta)
goto done;
@@ -5228,7 +5193,7 @@ static void lru_gen_shrink_lruvec(struct
@@ -5227,7 +5192,7 @@ static void lru_gen_shrink_lruvec(struct
if (scanned >= nr_to_scan)
break;
@@ -181,7 +181,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
break;
cond_resched();
@@ -5678,7 +5643,7 @@ static int run_eviction(struct lruvec *l
@@ -5677,7 +5642,7 @@ static int run_eviction(struct lruvec *l
if (sc->nr_reclaimed >= nr_to_reclaim)
return 0;

View File

@@ -214,7 +214,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
*/
if (mutex_trylock(&oom_lock)) {
struct oom_control oc = {
@@ -5113,33 +5117,27 @@ retry:
@@ -5112,33 +5116,27 @@ retry:
* reclaim.
*/
static unsigned long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc,
@@ -254,7 +254,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
}
static unsigned long get_nr_to_reclaim(struct scan_control *sc)
@@ -5158,9 +5156,7 @@ static unsigned long get_nr_to_reclaim(s
@@ -5157,9 +5155,7 @@ static unsigned long get_nr_to_reclaim(s
static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
{
struct blk_plug plug;
@@ -264,7 +264,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
unsigned long nr_to_reclaim = get_nr_to_reclaim(sc);
lru_add_drain();
@@ -5181,13 +5177,13 @@ static void lru_gen_shrink_lruvec(struct
@@ -5180,13 +5176,13 @@ static void lru_gen_shrink_lruvec(struct
else
swappiness = 0;
@@ -281,7 +281,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
scanned += delta;
if (scanned >= nr_to_scan)
@@ -5199,10 +5195,6 @@ static void lru_gen_shrink_lruvec(struct
@@ -5198,10 +5194,6 @@ static void lru_gen_shrink_lruvec(struct
cond_resched();
}

View File

@@ -95,7 +95,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
static bool lruvec_is_sizable(struct lruvec *lruvec, struct scan_control *sc)
{
int gen, type, zone;
@@ -5111,6 +5049,68 @@ retry:
@@ -5110,6 +5048,68 @@ retry:
return scanned;
}

View File

@@ -335,7 +335,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
if (order > 0)
return 0;
@@ -5387,6 +5400,7 @@ static int mem_cgroup_css_online(struct
@@ -5408,6 +5421,7 @@ static int mem_cgroup_css_online(struct
if (unlikely(mem_cgroup_is_root(memcg)))
queue_delayed_work(system_unbound_wq, &stats_flush_dwork,
2UL*HZ);
@@ -343,7 +343,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
return 0;
offline_kmem:
memcg_offline_kmem(memcg);
@@ -5418,6 +5432,7 @@ static void mem_cgroup_css_offline(struc
@@ -5439,6 +5453,7 @@ static void mem_cgroup_css_offline(struc
memcg_offline_kmem(memcg);
reparent_shrinker_deferred(memcg);
wb_memcg_offline(memcg);
@@ -351,7 +351,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
drain_all_stock(memcg);
@@ -5429,6 +5444,7 @@ static void mem_cgroup_css_released(stru
@@ -5450,6 +5465,7 @@ static void mem_cgroup_css_released(stru
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
invalidate_reclaim_iterators(memcg);
@@ -361,7 +361,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
static void mem_cgroup_css_free(struct cgroup_subsys_state *css)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7949,6 +7949,7 @@ static void __init free_area_init_node(i
@@ -7956,6 +7956,7 @@ static void __init free_area_init_node(i
pgdat_set_deferred_range(pgdat);
free_area_init_core(pgdat);
@@ -421,7 +421,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
/* check the order to exclude compaction-induced reclaim */
if (!min_ttl || sc->order || sc->priority == DEF_PRIORITY)
return;
@@ -5116,8 +5113,7 @@ static bool should_run_aging(struct lruv
@@ -5115,8 +5112,7 @@ static bool should_run_aging(struct lruv
* 1. Defer try_to_inc_max_seq() to workqueues to reduce latency for memcg
* reclaim.
*/
@@ -431,7 +431,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
{
unsigned long nr_to_scan;
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
@@ -5134,10 +5130,8 @@ static unsigned long get_nr_to_scan(stru
@@ -5133,10 +5129,8 @@ static unsigned long get_nr_to_scan(stru
if (sc->priority == DEF_PRIORITY)
return nr_to_scan;
@@ -443,7 +443,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
}
static unsigned long get_nr_to_reclaim(struct scan_control *sc)
@@ -5146,29 +5140,18 @@ static unsigned long get_nr_to_reclaim(s
@@ -5145,29 +5139,18 @@ static unsigned long get_nr_to_reclaim(s
if (!global_reclaim(sc))
return -1;
@@ -475,7 +475,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
if (sc->may_swap)
swappiness = get_swappiness(lruvec, sc);
@@ -5178,7 +5161,7 @@ static void lru_gen_shrink_lruvec(struct
@@ -5177,7 +5160,7 @@ static void lru_gen_shrink_lruvec(struct
swappiness = 0;
nr_to_scan = get_nr_to_scan(lruvec, sc, swappiness);
@@ -484,7 +484,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
break;
delta = evict_folios(lruvec, sc, swappiness);
@@ -5195,10 +5178,251 @@ static void lru_gen_shrink_lruvec(struct
@@ -5194,10 +5177,251 @@ static void lru_gen_shrink_lruvec(struct
cond_resched();
}
@@ -736,7 +736,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
/******************************************************************************
* state change
@@ -5656,11 +5880,11 @@ static int run_cmd(char cmd, int memcg_i
@@ -5655,11 +5879,11 @@ static int run_cmd(char cmd, int memcg_i
if (!mem_cgroup_disabled()) {
rcu_read_lock();
@@ -751,7 +751,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
rcu_read_unlock();
if (!memcg)
@@ -5808,6 +6032,19 @@ void lru_gen_init_lruvec(struct lruvec *
@@ -5807,6 +6031,19 @@ void lru_gen_init_lruvec(struct lruvec *
}
#ifdef CONFIG_MEMCG
@@ -771,7 +771,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
void lru_gen_init_memcg(struct mem_cgroup *memcg)
{
INIT_LIST_HEAD(&memcg->mm_list.fifo);
@@ -5831,7 +6068,69 @@ void lru_gen_exit_memcg(struct mem_cgrou
@@ -5830,7 +6067,69 @@ void lru_gen_exit_memcg(struct mem_cgrou
}
}
}
@@ -842,7 +842,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
static int __init init_lru_gen(void)
{
@@ -5858,6 +6157,10 @@ static void lru_gen_shrink_lruvec(struct
@@ -5857,6 +6156,10 @@ static void lru_gen_shrink_lruvec(struct
{
}
@@ -853,7 +853,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
#endif /* CONFIG_LRU_GEN */
static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
@@ -5871,7 +6174,7 @@ static void shrink_lruvec(struct lruvec
@@ -5870,7 +6173,7 @@ static void shrink_lruvec(struct lruvec
bool proportional_reclaim;
struct blk_plug plug;
@@ -862,7 +862,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
lru_gen_shrink_lruvec(lruvec, sc);
return;
}
@@ -6114,6 +6417,11 @@ static void shrink_node(pg_data_t *pgdat
@@ -6113,6 +6416,11 @@ static void shrink_node(pg_data_t *pgdat
struct lruvec *target_lruvec;
bool reclaimable = false;

View File

@@ -113,7 +113,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
*/
return isolated || !remaining ? scanned : 0;
}
@@ -5119,8 +5115,7 @@ static long get_nr_to_scan(struct lruvec
@@ -5118,8 +5114,7 @@ static long get_nr_to_scan(struct lruvec
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
DEFINE_MAX_SEQ(lruvec);
@@ -123,7 +123,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
return 0;
if (!should_run_aging(lruvec, max_seq, sc, can_swap, &nr_to_scan))
@@ -5148,17 +5143,14 @@ static bool try_to_shrink_lruvec(struct
@@ -5147,17 +5142,14 @@ static bool try_to_shrink_lruvec(struct
long nr_to_scan;
unsigned long scanned = 0;
unsigned long nr_to_reclaim = get_nr_to_reclaim(sc);
@@ -146,7 +146,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
nr_to_scan = get_nr_to_scan(lruvec, sc, swappiness);
if (nr_to_scan <= 0)
@@ -5289,12 +5281,13 @@ static void lru_gen_shrink_lruvec(struct
@@ -5288,12 +5280,13 @@ static void lru_gen_shrink_lruvec(struct
struct blk_plug plug;
VM_WARN_ON_ONCE(global_reclaim(sc));
@@ -161,7 +161,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
if (try_to_shrink_lruvec(lruvec, sc))
lru_gen_rotate_memcg(lruvec, MEMCG_LRU_YOUNG);
@@ -5350,11 +5343,19 @@ static void lru_gen_shrink_node(struct p
@@ -5349,11 +5342,19 @@ static void lru_gen_shrink_node(struct p
VM_WARN_ON_ONCE(!global_reclaim(sc));
@@ -182,7 +182,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
set_initial_priority(pgdat, sc);
@@ -5372,7 +5373,7 @@ static void lru_gen_shrink_node(struct p
@@ -5371,7 +5372,7 @@ static void lru_gen_shrink_node(struct p
clear_mm_walk();
blk_finish_plug(&plug);
@@ -191,7 +191,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
/* kswapd should never fail */
pgdat->kswapd_failures = 0;
}
@@ -5944,7 +5945,7 @@ static ssize_t lru_gen_seq_write(struct
@@ -5943,7 +5944,7 @@ static ssize_t lru_gen_seq_write(struct
set_task_reclaim_state(current, &sc.reclaim_state);
flags = memalloc_noreclaim_save();
blk_start_plug(&plug);

View File

@@ -29,7 +29,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -5218,18 +5218,20 @@ static int shrink_one(struct lruvec *lru
@@ -5217,18 +5217,20 @@ static int shrink_one(struct lruvec *lru
static void shrink_many(struct pglist_data *pgdat, struct scan_control *sc)
{
@@ -52,7 +52,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
gen = get_memcg_gen(READ_ONCE(pgdat->memcg_lru.seq));
rcu_read_lock();
@@ -5253,14 +5255,22 @@ restart:
@@ -5252,14 +5254,22 @@ restart:
op = shrink_one(lruvec, sc);
@@ -78,7 +78,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
/* restart if raced with lru_gen_rotate_memcg() */
if (gen != get_nulls_value(pos))
goto restart;
@@ -5269,11 +5279,6 @@ restart:
@@ -5268,11 +5278,6 @@ restart:
bin = get_memcg_bin(bin + 1);
if (bin != first_bin)
goto restart;

View File

@@ -87,7 +87,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
mark_page_accessed(page);
}
rss[mm_counter(page)]--;
@@ -5219,8 +5218,8 @@ static inline void mm_account_fault(stru
@@ -5235,8 +5234,8 @@ static inline void mm_account_fault(stru
#ifdef CONFIG_LRU_GEN
static void lru_gen_enter_fault(struct vm_area_struct *vma)
{

View File

@@ -303,7 +303,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
* the eviction
******************************************************************************/
@@ -5398,53 +5540,6 @@ done:
@@ -5397,53 +5539,6 @@ done:
pgdat->kswapd_failures = 0;
}
@@ -357,7 +357,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
/******************************************************************************
* state change
******************************************************************************/
@@ -6090,67 +6185,6 @@ void lru_gen_exit_memcg(struct mem_cgrou
@@ -6089,67 +6184,6 @@ void lru_gen_exit_memcg(struct mem_cgrou
}
}

View File

@@ -20,7 +20,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -6172,12 +6172,17 @@ void lru_gen_exit_memcg(struct mem_cgrou
@@ -6171,12 +6171,17 @@ void lru_gen_exit_memcg(struct mem_cgrou
int i;
int nid;

View File

@@ -255,7 +255,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
}
/******************************************************************************
@@ -6117,7 +6087,6 @@ void lru_gen_init_lruvec(struct lruvec *
@@ -6116,7 +6086,6 @@ void lru_gen_init_lruvec(struct lruvec *
INIT_LIST_HEAD(&lrugen->folios[gen][type][zone]);
lruvec->mm_state.seq = MIN_NR_GENS;
@@ -263,7 +263,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
}
#ifdef CONFIG_MEMCG
@@ -6150,7 +6119,6 @@ void lru_gen_exit_memcg(struct mem_cgrou
@@ -6149,7 +6118,6 @@ void lru_gen_exit_memcg(struct mem_cgrou
for_each_node(nid) {
struct lruvec *lruvec = get_lruvec(memcg, nid);

View File

@@ -14,7 +14,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -701,6 +701,7 @@ static const struct spi_device_id spidev
@@ -702,6 +702,7 @@ static const struct spi_device_id spidev
{ .name = "spi-petra" },
{ .name = "spi-authenta" },
{ .name = "em3581" },
@@ -22,9 +22,9 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
{},
};
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
@@ -728,6 +729,7 @@ static const struct of_device_id spidev_
{ .compatible = "cisco,spi-petra", .data = &spidev_of_check },
{ .compatible = "micron,spi-authenta", .data = &spidev_of_check },
@@ -730,6 +731,7 @@ static const struct of_device_id spidev_
{ .compatible = "rohm,dh2228fv", .data = &spidev_of_check },
{ .compatible = "semtech,sx1301", .data = &spidev_of_check },
{ .compatible = "silabs,em3581", .data = &spidev_of_check },
+ { .compatible = "silabs,si3210", .data = &spidev_of_check },
{},

View File

@@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct dpaa_priv *priv = netdev_priv(net_dev);
struct qm_mcc_initcgr opts = { };
u32 cs_th;
@@ -2905,58 +2915,6 @@ static void dpaa_eth_napi_disable(struct
@@ -2920,58 +2930,6 @@ static void dpaa_eth_napi_disable(struct
}
}
@@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int dpaa_open(struct net_device *net_dev)
{
struct mac_device *mac_dev;
@@ -2967,7 +2925,8 @@ static int dpaa_open(struct net_device *
@@ -2982,7 +2940,8 @@ static int dpaa_open(struct net_device *
mac_dev = priv->mac_dev;
dpaa_eth_napi_enable(priv);
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (err)
goto phy_init_failed;
@@ -2982,7 +2941,7 @@ static int dpaa_open(struct net_device *
@@ -2997,7 +2956,7 @@ static int dpaa_open(struct net_device *
netif_err(priv, ifup, net_dev, "mac_dev->enable() = %d\n", err);
goto mac_start_failed;
}
@@ -208,7 +208,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
netif_tx_start_all_queues(net_dev);
@@ -2991,6 +2950,7 @@ static int dpaa_open(struct net_device *
@@ -3006,6 +2965,7 @@ static int dpaa_open(struct net_device *
mac_start_failed:
for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++)
fman_port_disable(mac_dev->port[i]);
@@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phy_init_failed:
dpaa_eth_napi_disable(priv);
@@ -3146,10 +3106,12 @@ static int dpaa_ts_ioctl(struct net_devi
@@ -3161,10 +3121,12 @@ static int dpaa_ts_ioctl(struct net_devi
static int dpaa_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
{
int ret = -EINVAL;
@@ -230,7 +230,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
if (cmd == SIOCSHWTSTAMP)
@@ -3552,6 +3514,7 @@ static int dpaa_remove(struct platform_d
@@ -3569,6 +3531,7 @@ static int dpaa_remove(struct platform_d
dev_set_drvdata(dev, NULL);
unregister_netdev(net_dev);

View File

@@ -202,7 +202,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.mac_link_up = am65_cpsw_nuss_mac_link_up,
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1736,7 +1736,6 @@ static void axienet_mac_link_up(struct p
@@ -1741,7 +1741,6 @@ static void axienet_mac_link_up(struct p
}
static const struct phylink_mac_ops axienet_phylink_ops = {

View File

@@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
supported = mac_dev->phylink_config.supported_interfaces;
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1631,7 +1631,7 @@ static void axienet_pcs_an_restart(struc
@@ -1636,7 +1636,7 @@ static void axienet_pcs_an_restart(struc
phylink_mii_c22_pcs_an_restart(pcs_phy);
}
@@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
phy_interface_t interface,
const unsigned long *advertising,
bool permit_pause_to_mac)
@@ -1653,7 +1653,8 @@ static int axienet_pcs_config(struct phy
@@ -1658,7 +1658,8 @@ static int axienet_pcs_config(struct phy
}
}
@@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret < 0)
netdev_warn(ndev, "Failed to configure PCS: %d\n", ret);
@@ -2129,6 +2130,7 @@ static int axienet_probe(struct platform
@@ -2138,6 +2139,7 @@ static int axienet_probe(struct platform
}
of_node_put(np);
lp->pcs.ops = &axienet_pcs_ops;

View File

@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -510,8 +510,8 @@ err_register_netdev:
@@ -511,8 +511,8 @@ err_register_netdev:
ipheth_free_urbs(dev);
err_alloc_urbs:
err_get_macaddr:

View File

@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -373,12 +373,10 @@ static netdev_tx_t ipheth_tx(struct sk_b
@@ -374,12 +374,10 @@ static netdev_tx_t ipheth_tx(struct sk_b
}
memcpy(dev->tx_buf, skb->data, skb->len);

View File

@@ -256,7 +256,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ipheth_rx_submit(dev, GFP_ATOMIC);
}
@@ -310,6 +411,27 @@ static int ipheth_get_macaddr(struct iph
@@ -311,6 +412,27 @@ static int ipheth_get_macaddr(struct iph
return retval;
}
@@ -284,7 +284,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
{
struct usb_device *udev = dev->udev;
@@ -317,7 +439,7 @@ static int ipheth_rx_submit(struct iphet
@@ -318,7 +440,7 @@ static int ipheth_rx_submit(struct iphet
usb_fill_bulk_urb(dev->rx_urb, udev,
usb_rcvbulkpipe(udev, dev->bulk_in),
@@ -293,7 +293,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ipheth_rcvbulk_callback,
dev);
dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
@@ -365,7 +487,7 @@ static netdev_tx_t ipheth_tx(struct sk_b
@@ -366,7 +488,7 @@ static netdev_tx_t ipheth_tx(struct sk_b
int retval;
/* Paranoid */
@@ -302,7 +302,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
WARN(1, "%s: skb too large: %d bytes\n", __func__, skb->len);
dev->net->stats.tx_dropped++;
dev_kfree_skb_any(skb);
@@ -448,6 +570,8 @@ static int ipheth_probe(struct usb_inter
@@ -449,6 +571,8 @@ static int ipheth_probe(struct usb_inter
dev->net = netdev;
dev->intf = intf;
dev->confirmed_pairing = false;
@@ -311,7 +311,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Set up endpoints */
hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM);
if (hintf == NULL) {
@@ -479,6 +603,12 @@ static int ipheth_probe(struct usb_inter
@@ -480,6 +604,12 @@ static int ipheth_probe(struct usb_inter
if (retval)
goto err_get_macaddr;

View File

@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mv88e6352_get_port4_serdes_cmode(struct mv88e6xxx_chip *chip)
{
u16 reg, val;
@@ -4501,7 +4513,7 @@ static const struct mv88e6xxx_ops mv88e6
@@ -4502,7 +4514,7 @@ static const struct mv88e6xxx_ops mv88e6
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
.stu_getnext = mv88e6352_g1_stu_getnext,
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
@@ -60,7 +60,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mv88e6xxx_ops mv88e6172_ops = {
@@ -4604,7 +4616,7 @@ static const struct mv88e6xxx_ops mv88e6
@@ -4605,7 +4617,7 @@ static const struct mv88e6xxx_ops mv88e6
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
.stu_getnext = mv88e6352_g1_stu_getnext,
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mv88e6xxx_ops mv88e6176_ops = {
@@ -5281,7 +5293,7 @@ static const struct mv88e6xxx_ops mv88e6
@@ -5282,7 +5294,7 @@ static const struct mv88e6xxx_ops mv88e6
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
.stu_getnext = mv88e6352_g1_stu_getnext,
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mv88e6xxx_ops mv88e6351_ops = {
@@ -5327,7 +5339,7 @@ static const struct mv88e6xxx_ops mv88e6
@@ -5328,7 +5340,7 @@ static const struct mv88e6xxx_ops mv88e6
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
.avb_ops = &mv88e6352_avb_ops,
.ptp_ops = &mv88e6352_ptp_ops,

View File

@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int current_brightness;
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -527,6 +527,16 @@ static inline void *led_get_trigger_data
@@ -525,6 +525,16 @@ led_trigger_get_brightness(const struct
#endif /* CONFIG_LEDS_TRIGGERS */

View File

@@ -230,7 +230,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* base state is ON (link present) */
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -530,6 +530,9 @@ static inline void *led_get_trigger_data
@@ -528,6 +528,9 @@ led_trigger_get_brightness(const struct
/* Trigger specific enum */
enum led_trigger_netdev_modes {
TRIGGER_NETDEV_LINK = 0,

View File

@@ -127,7 +127,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* base state is ON (link present) */
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -533,6 +533,8 @@ enum led_trigger_netdev_modes {
@@ -531,6 +531,8 @@ enum led_trigger_netdev_modes {
TRIGGER_NETDEV_LINK_10,
TRIGGER_NETDEV_LINK_100,
TRIGGER_NETDEV_LINK_1000,

View File

@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -5998,7 +5998,8 @@ static const struct mv88e6xxx_info mv88e
@@ -5999,7 +5999,8 @@ static const struct mv88e6xxx_info mv88e
.name = "Marvell 88E6191X",
.num_databases = 4096,
.num_ports = 11, /* 10 + Z80 */
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.max_vid = 8191,
.max_sid = 63,
.port_base_addr = 0x0,
@@ -6021,7 +6022,8 @@ static const struct mv88e6xxx_info mv88e
@@ -6022,7 +6023,8 @@ static const struct mv88e6xxx_info mv88e
.name = "Marvell 88E6193X",
.num_databases = 4096,
.num_ports = 11, /* 10 + Z80 */
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.max_vid = 8191,
.max_sid = 63,
.port_base_addr = 0x0,
@@ -6340,7 +6342,8 @@ static const struct mv88e6xxx_info mv88e
@@ -6341,7 +6343,8 @@ static const struct mv88e6xxx_info mv88e
.name = "Marvell 88E6393X",
.num_databases = 4096,
.num_ports = 11, /* 10 + Z80 */

View File

@@ -58,7 +58,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
}
@@ -6285,6 +6291,32 @@ static const struct mv88e6xxx_info mv88e
@@ -6286,6 +6292,32 @@ static const struct mv88e6xxx_info mv88e
.ptp_support = true,
.ops = &mv88e6352_ops,
},

View File

@@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -4157,17 +4157,6 @@ void intel_execlists_show_requests(struc
@@ -4153,17 +4153,6 @@ void intel_execlists_show_requests(struc
spin_unlock_irqrestore(&sched_engine->lock, flags);
}
@@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
void intel_execlists_dump_active_requests(struct intel_engine_cs *engine,
struct i915_request *hung_rq,
struct drm_printer *m)
@@ -4178,8 +4167,8 @@ void intel_execlists_dump_active_request
@@ -4174,8 +4163,8 @@ void intel_execlists_dump_active_request
intel_engine_dump_active_requests(&engine->sched_engine->requests, hung_rq, m);

View File

@@ -24,7 +24,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -1009,6 +1009,31 @@ static inline int of_parse_phandle_with_
@@ -1011,6 +1011,31 @@ static inline int of_parse_phandle_with_
}
/**

View File

@@ -161,7 +161,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
goto err_out;
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -362,7 +362,8 @@ extern int of_n_addr_cells(struct device
@@ -364,7 +364,8 @@ extern int of_n_addr_cells(struct device
extern int of_n_size_cells(struct device_node *np);
extern const struct of_device_id *of_match_node(
const struct of_device_id *matches, const struct device_node *node);

View File

@@ -135,7 +135,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+}
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -374,6 +374,9 @@ extern int of_parse_phandle_with_args_ma
@@ -376,6 +376,9 @@ extern int of_parse_phandle_with_args_ma
extern int of_count_phandle_with_args(const struct device_node *np,
const char *list_name, const char *cells_name);
@@ -145,7 +145,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* phandle iterator functions */
extern int of_phandle_iterator_init(struct of_phandle_iterator *it,
const struct device_node *np,
@@ -731,6 +734,12 @@ static inline int of_count_phandle_with_
@@ -733,6 +736,12 @@ static inline int of_count_phandle_with_
return -ENOSYS;
}

View File

@@ -109,7 +109,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+EXPORT_SYMBOL_GPL(of_request_module);
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -376,6 +376,7 @@ extern int of_count_phandle_with_args(co
@@ -378,6 +378,7 @@ extern int of_count_phandle_with_args(co
/* module functions */
extern ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len);
@@ -117,7 +117,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* phandle iterator functions */
extern int of_phandle_iterator_init(struct of_phandle_iterator *it,
@@ -739,6 +740,11 @@ static inline ssize_t of_modalias(const
@@ -741,6 +742,11 @@ static inline ssize_t of_modalias(const
{
return -ENODEV;
}

View File

@@ -32,7 +32,7 @@ Link: https://lore.kernel.org/r/20230526204802.3081168-4-robimarko@gmail.com
enum _msm8996_version {
MSM8996_V3,
@@ -153,12 +148,12 @@ static enum _msm8996_version qcom_cpufre
@@ -157,12 +152,12 @@ static enum _msm8996_version qcom_cpufre
msm_id++;
switch ((enum _msm_id)*msm_id) {

View File

@@ -36,7 +36,7 @@ Link: https://lore.kernel.org/r/20230526204802.3081168-5-robimarko@gmail.com
struct qcom_cpufreq_drv;
struct qcom_cpufreq_match_data {
@@ -134,60 +126,32 @@ static void get_krait_bin_format_b(struc
@@ -138,60 +130,32 @@ static void get_krait_bin_format_b(struc
dev_dbg(cpu_dev, "PVS version: %d\n", *pvs_ver);
}

View File

@@ -99,7 +99,7 @@ Signed-off-by: Lee Jones <lee@kernel.org>
interval = jiffies_to_msecs(
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -533,6 +533,9 @@ enum led_trigger_netdev_modes {
@@ -531,6 +531,9 @@ enum led_trigger_netdev_modes {
TRIGGER_NETDEV_LINK_10,
TRIGGER_NETDEV_LINK_100,
TRIGGER_NETDEV_LINK_1000,

View File

@@ -22,7 +22,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -596,6 +596,9 @@ static const struct pci_device_id mhi_pc
@@ -599,6 +599,9 @@ static const struct pci_device_id mhi_pc
/* MV32-WB (Cinterion) */
{ PCI_DEVICE(0x1269, 0x00bb),
.driver_data = (kernel_ulong_t) &mhi_mv32_info },

View File

@@ -28,7 +28,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
/**
* struct mhi_pci_dev_info - MHI PCI device specific information
* @config: MHI controller configuration
@@ -557,11 +561,11 @@ static const struct pci_device_id mhi_pc
@@ -560,11 +564,11 @@ static const struct pci_device_id mhi_pc
.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308),
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },
@@ -43,7 +43,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
/* T99W175 (sdx55), Both for eSIM and Non-eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0ab),
@@ -585,16 +589,16 @@ static const struct pci_device_id mhi_pc
@@ -588,16 +592,16 @@ static const struct pci_device_id mhi_pc
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info },
/* MV31-W (Cinterion) */

View File

@@ -36,7 +36,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/mhi.h>
@@ -901,11 +900,9 @@ static int mhi_pci_probe(struct pci_dev
@@ -904,11 +903,9 @@ static int mhi_pci_probe(struct pci_dev
mhi_pdev->pci_state = pci_store_saved_state(pdev);
pci_load_saved_state(pdev, NULL);
@@ -49,7 +49,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
/* MHI bus does not power up the controller by default */
err = mhi_prepare_for_power_up(mhi_cntrl);
@@ -939,8 +936,6 @@ err_unprepare:
@@ -942,8 +939,6 @@ err_unprepare:
mhi_unprepare_after_power_down(mhi_cntrl);
err_unregister:
mhi_unregister_controller(mhi_cntrl);
@@ -58,7 +58,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
return err;
}
@@ -963,7 +958,6 @@ static void mhi_pci_remove(struct pci_de
@@ -966,7 +961,6 @@ static void mhi_pci_remove(struct pci_de
pm_runtime_get_noresume(&pdev->dev);
mhi_unregister_controller(mhi_cntrl);

View File

@@ -31,7 +31,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
.name = "foxconn-sdx55",
.fw = "qcom/sdx55m/sbl1.mbn",
@@ -587,6 +596,15 @@ static const struct pci_device_id mhi_pc
@@ -590,6 +599,15 @@ static const struct pci_device_id mhi_pc
/* T99W373 (sdx62) */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info },

View File

@@ -23,7 +23,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -591,6 +591,8 @@ static const struct pci_device_id mhi_pc
@@ -594,6 +594,8 @@ static const struct pci_device_id mhi_pc
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1002), /* EM160R-GL (sdx24) */
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },

View File

@@ -37,7 +37,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 32, 0),
MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 32, 0),
@@ -591,6 +601,9 @@ static const struct pci_device_id mhi_pc
@@ -594,6 +604,9 @@ static const struct pci_device_id mhi_pc
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1002), /* EM160R-GL (sdx24) */
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },

View File

@@ -19,7 +19,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -638,6 +638,12 @@ static const struct pci_device_id mhi_pc
@@ -641,6 +641,12 @@ static const struct pci_device_id mhi_pc
/* T99W510 (sdx24), variant 3 */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f2),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info },

View File

@@ -24,7 +24,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -604,6 +604,9 @@ static const struct pci_device_id mhi_pc
@@ -607,6 +607,9 @@ static const struct pci_device_id mhi_pc
/* RM520N-GL (sdx6x), eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1004),
.driver_data = (kernel_ulong_t) &mhi_quectel_rm5xx_info },

View File

@@ -123,7 +123,7 @@ Signed-off-by: Justin Stitt <justinstitt@google.com>
#endif /* _LINUX_ETHTOOL_H */
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1974,6 +1974,13 @@ __printf(2, 3) void ethtool_sprintf(u8 *
@@ -1977,6 +1977,13 @@ __printf(2, 3) void ethtool_sprintf(u8 *
}
EXPORT_SYMBOL(ethtool_sprintf);

View File

@@ -23,7 +23,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
{ {0x02, 0x21}, "lz4", unlz4 },
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -443,10 +443,10 @@ quiet_cmd_bzip2_with_size = BZIP2 $@
@@ -447,10 +447,10 @@ quiet_cmd_bzip2_with_size = BZIP2 $@
# ---------------------------------------------------------------------------
quiet_cmd_lzma = LZMA $@

View File

@@ -10,7 +10,7 @@ Subject: [PATCH] Kconfig: add tristate for OID and ASNI string
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2013,7 +2013,7 @@ config PADATA
@@ -2017,7 +2017,7 @@ config PADATA
bool
config ASN1

View File

@@ -10,7 +10,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1082,12 +1082,18 @@ static const struct usb_device_id produc
@@ -1083,12 +1083,18 @@ static const struct usb_device_id produc
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
.driver_info = (unsigned long)&qmi_wwan_info,
},
@@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
@@ -1156,6 +1161,11 @@ static const struct usb_device_id option
@@ -1158,6 +1163,11 @@ static const struct usb_device_id option
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
.driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
@@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
/* Quectel products using Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
@@ -1197,6 +1207,11 @@ static const struct usb_device_id option
@@ -1199,6 +1209,11 @@ static const struct usb_device_id option
.driver_info = ZLP },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
.driver_info = RSVD(4) },

View File

@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2909,6 +2909,8 @@ static const struct seq_operations locks
@@ -2907,6 +2907,8 @@ static const struct seq_operations locks
static int __init proc_locks_init(void)
{
@@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!pe)
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -4222,6 +4222,8 @@ static const struct seq_operations vmall
@@ -4215,6 +4215,8 @@ static const struct seq_operations vmall
static int __init proc_vmalloc_init(void)
{
@@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -3036,11 +3036,13 @@ static const struct seq_operations fib_r
@@ -3037,11 +3037,13 @@ static const struct seq_operations fib_r
int __net_init fib_proc_init(struct net *net)
{
@@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
fib_triestat_seq_show, NULL))
goto out2;
@@ -3051,17 +3053,21 @@ int __net_init fib_proc_init(struct net
@@ -3052,17 +3054,21 @@ int __net_init fib_proc_init(struct net
return 0;
out3:

View File

@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4366,6 +4366,7 @@ int wake_up_state(struct task_struct *p,
@@ -4363,6 +4363,7 @@ int wake_up_state(struct task_struct *p,
{
return try_to_wake_up(p, state, 0);
}

View File

@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif /* _KOBJECT_H_ */
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -691,6 +691,43 @@ int add_uevent_var(struct kobj_uevent_en
@@ -706,6 +706,43 @@ int add_uevent_var(struct kobj_uevent_en
EXPORT_SYMBOL_GPL(add_uevent_var);
#if defined(CONFIG_NET)

View File

@@ -19,7 +19,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1717,7 +1717,7 @@ static void device_links_purge(struct de
@@ -1718,7 +1718,7 @@ static void device_links_purge(struct de
#define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \
DL_FLAG_PM_RUNTIME)

View File

@@ -319,7 +319,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
struct nf_conn *ct = item->ct;
struct sk_buff *skb;
unsigned int type;
@@ -3754,11 +3761,17 @@ static int ctnetlink_stat_exp_cpu(struct
@@ -3755,11 +3762,17 @@ static int ctnetlink_stat_exp_cpu(struct
}
#ifdef CONFIG_NF_CONNTRACK_EVENTS
@@ -337,7 +337,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
static const struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX] = {
[IPCTNL_MSG_CT_NEW] = {
@@ -3857,8 +3870,12 @@ static int __net_init ctnetlink_net_init
@@ -3858,8 +3871,12 @@ static int __net_init ctnetlink_net_init
static void ctnetlink_net_pre_exit(struct net *net)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS

View File

@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7903,7 +7903,7 @@ static void __init alloc_node_mem_map(st
@@ -7910,7 +7910,7 @@ static void __init alloc_node_mem_map(st
if (pgdat == NODE_DATA(0)) {
mem_map = NODE_DATA(0)->node_mem_map;
if (page_to_pfn(mem_map) != pgdat->node_start_pfn)

View File

@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1866,6 +1866,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1927,6 +1927,7 @@ static int packet_rcv_spkt(struct sk_buf
{
struct sock *sk;
struct sockaddr_pkt *spkt;
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* When we registered the protocol we saved the socket in the data
@@ -1873,6 +1874,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1934,6 +1935,7 @@ static int packet_rcv_spkt(struct sk_buf
*/
sk = pt->af_packet_priv;
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Yank back the headers [hope the device set this
@@ -1885,7 +1887,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1946,7 +1948,7 @@ static int packet_rcv_spkt(struct sk_buf
* so that this procedure is noop.
*/
@@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
@@ -2131,12 +2133,12 @@ static int packet_rcv(struct sk_buff *sk
@@ -2192,12 +2194,12 @@ static int packet_rcv(struct sk_buff *sk
unsigned int snaplen, res;
bool is_drop_n_account = false;
@@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
@@ -2263,12 +2265,12 @@ static int tpacket_rcv(struct sk_buff *s
@@ -2324,12 +2326,12 @@ static int tpacket_rcv(struct sk_buff *s
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
@@ -3377,6 +3379,7 @@ static int packet_create(struct net *net
@@ -3443,6 +3445,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
@@ -4014,6 +4017,16 @@ packet_setsockopt(struct socket *sock, i
@@ -4096,6 +4099,16 @@ packet_setsockopt(struct socket *sock, i
WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit);
return 0;
}
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
default:
return -ENOPROTOOPT;
}
@@ -4070,6 +4083,13 @@ static int packet_getsockopt(struct sock
@@ -4152,6 +4165,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR:
val = po->has_vnet_hdr;
break;

View File

@@ -338,7 +338,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
return -1;
@@ -1545,6 +1706,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
@@ -1546,6 +1707,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
t->parms.link = p->link;
t->parms.proto = p->proto;
t->parms.fwmark = p->fwmark;
@@ -353,7 +353,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
dst_cache_reset(&t->dst_cache);
ip6_tnl_link_config(t);
}
@@ -1579,6 +1748,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
@@ -1580,6 +1749,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
p->flowinfo = u->flowinfo;
p->link = u->link;
p->proto = u->proto;
@@ -361,7 +361,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
memcpy(p->name, u->name, sizeof(u->name));
}
@@ -1965,6 +2135,15 @@ static int ip6_tnl_validate(struct nlatt
@@ -1967,6 +2137,15 @@ static int ip6_tnl_validate(struct nlatt
return 0;
}
@@ -377,7 +377,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{
@@ -2002,6 +2181,46 @@ static void ip6_tnl_netlink_parms(struct
@@ -2004,6 +2183,46 @@ static void ip6_tnl_netlink_parms(struct
if (data[IFLA_IPTUN_FWMARK])
parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]);
@@ -424,7 +424,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
}
static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev,
@@ -2085,6 +2304,12 @@ static void ip6_tnl_dellink(struct net_d
@@ -2087,6 +2306,12 @@ static void ip6_tnl_dellink(struct net_d
static size_t ip6_tnl_get_size(const struct net_device *dev)
{
@@ -437,7 +437,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
return
/* IFLA_IPTUN_LINK */
nla_total_size(4) +
@@ -2114,6 +2339,24 @@ static size_t ip6_tnl_get_size(const str
@@ -2116,6 +2341,24 @@ static size_t ip6_tnl_get_size(const str
nla_total_size(0) +
/* IFLA_IPTUN_FWMARK */
nla_total_size(4) +
@@ -462,7 +462,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
0;
}
@@ -2121,6 +2364,9 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -2123,6 +2366,9 @@ static int ip6_tnl_fill_info(struct sk_b
{
struct ip6_tnl *tunnel = netdev_priv(dev);
struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -472,7 +472,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
@@ -2130,9 +2376,27 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -2132,9 +2378,27 @@ static int ip6_tnl_fill_info(struct sk_b
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) ||
@@ -501,7 +501,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
@@ -2172,6 +2436,7 @@ static const struct nla_policy ip6_tnl_p
@@ -2174,6 +2438,7 @@ static const struct nla_policy ip6_tnl_p
[IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG },
[IFLA_IPTUN_FWMARK] = { .type = NLA_U32 },

View File

@@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static void rt_fibinfo_free(struct rtable __rcu **rtp)
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2783,6 +2783,7 @@ static const char *const rtn_type_names[
@@ -2784,6 +2784,7 @@ static const char *const rtn_type_names[
[RTN_THROW] = "THROW",
[RTN_NAT] = "NAT",
[RTN_XRESOLVE] = "XRESOLVE",

View File

@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -7958,7 +7958,7 @@ static int nft_register_flowtable_net_ho
@@ -8012,7 +8012,7 @@ static int nft_register_flowtable_net_ho
err = flowtable->data.type->setup(&flowtable->data,
hook->ops.dev,
FLOW_BLOCK_BIND);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -7079,6 +7079,7 @@ static int mv88e6xxx_register_switch(str
@@ -7080,6 +7080,7 @@ static int mv88e6xxx_register_switch(str
ds->ops = &mv88e6xxx_switch_ops;
ds->ageing_time_min = chip->info->age_time_coeff;
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;

View File

@@ -100,7 +100,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2466,6 +2466,19 @@ static const struct b53_chip_data b53_sw
@@ -2469,6 +2469,19 @@ static const struct b53_chip_data b53_sw
.jumbo_size_reg = B53_JUMBO_MAX_SIZE_63XX,
},
{

View File

@@ -100,7 +100,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2613,6 +2613,20 @@ static const struct b53_chip_data b53_sw
@@ -2616,6 +2616,20 @@ static const struct b53_chip_data b53_sw
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
@@ -121,7 +121,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
};
static int b53_switch_init(struct b53_device *dev)
@@ -2790,6 +2804,7 @@ int b53_switch_detect(struct b53_device
@@ -2793,6 +2807,7 @@ int b53_switch_detect(struct b53_device
case BCM53012_DEVICE_ID:
case BCM53018_DEVICE_ID:
case BCM53019_DEVICE_ID:

View File

@@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ata_sff_port_init(ap);
return ap;
@@ -5473,6 +5492,12 @@ static void ata_host_release(struct kref
@@ -5476,6 +5495,12 @@ static void ata_host_release(struct kref
kfree(ap->pmp_link);
kfree(ap->slave_link);
@@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
kfree(ap);
host->ports[i] = NULL;
}
@@ -5875,7 +5900,23 @@ int ata_host_register(struct ata_host *h
@@ -5880,7 +5905,23 @@ int ata_host_register(struct ata_host *h
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}

View File

@@ -0,0 +1,28 @@
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1437,6 +1437,9 @@ static const struct usb_device_id produc
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
{QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
{QMI_FIXED_INTF(0x2dee, 0x4d22, 5)}, /* MeiG Smart SRM825L */
+ {QMI_FIXED_INTF(0x2077, 0x2002, 4)}, /* T&W TW04C */
+ {QMI_FIXED_INTF(0x2077, 0x2003, 4)}, /* T&W TW12G */
+ {QMI_FIXED_INTF(0x2077, 0x2004, 4)}, /* T&W TW510M */
/* 4. Gobi 1000 devices */
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2324,9 +2324,13 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a06, 0xff) }, /* Fibocom FM650-CN (RNDIS mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a07, 0xff) }, /* Fibocom FM650-CN (MBIM mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1402, 0xff) }, /* GosunCn GM800 (Download mode) */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1403, 0xff) }, /* GosunCn GM800 (rmnet, old) */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1421, 0xff) }, /* GosunCn GM800 (rmnet) */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1422, 0xff) }, /* GosunCn GM800 (EAP) */
{ USB_DEVICE(0x33f8, 0x0104), /* Rolling RW101-GL (laptop RMNET) */
.driver_info = RSVD(4) | RSVD(5) },
{ USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a2, 0xff) }, /* Rolling RW101-GL (laptop MBIM) */

View File

@@ -32,7 +32,7 @@ Signed-off-by: Rob Herring <robh@kernel.org>
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -408,6 +408,9 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_T
@@ -412,6 +412,9 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_T
$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
$(call if_changed_dep,dtc)

View File

@@ -39,7 +39,7 @@ Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
ret = clk_bulk_prepare_enable(MSDC_NR_CLOCKS, host->bulk_clks);
if (ret) {
dev_err(host->dev, "Cannot enable pclk/axi/ahb clock gates\n");
@@ -2670,6 +2673,15 @@ static int msdc_drv_probe(struct platfor
@@ -2666,6 +2669,15 @@ static int msdc_drv_probe(struct platfor
goto host_free;
}

View File

@@ -25,8 +25,8 @@ Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
bd[j].bd_info &= ~BDMA_DESC_CHECKSUM;
bd[j].bd_info |= msdc_dma_calcs((u8 *)(&bd[j]), 16) << 8;
}
@@ -1229,7 +1229,7 @@ static bool msdc_cmd_done(struct msdc_ho
!host->hs400_tuning))
@@ -1227,7 +1227,7 @@ static bool msdc_cmd_done(struct msdc_ho
(!mmc_op_tuning(cmd->opcode) && !host->hs400_tuning))
/*
* should not clear fifo/interrupt as the tune data
- * may have alreay come when cmd19/cmd21 gets response

View File

@@ -1,39 +0,0 @@
From b98e7e8daf0ebab9dcc36812378a71e1be0b5089 Mon Sep 17 00:00:00 2001
From: ChanWoo Lee <cw9316.lee@samsung.com>
Date: Thu, 24 Nov 2022 17:00:31 +0900
Subject: [PATCH 4/6] mmc: Avoid open coding by using mmc_op_tuning()
Replace code with the already defined function. No functional changes.
Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20221124080031.14690-1-cw9316.lee@samsung.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/host/mtk-sd.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1224,9 +1224,7 @@ static bool msdc_cmd_done(struct msdc_ho
if (!sbc_error && !(events & MSDC_INT_CMDRDY)) {
if (events & MSDC_INT_CMDTMO ||
- (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
- cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200 &&
- !host->hs400_tuning))
+ (!mmc_op_tuning(cmd->opcode) && !host->hs400_tuning))
/*
* should not clear fifo/interrupt as the tune data
* may have already come when cmd19/cmd21 gets response
@@ -1320,9 +1318,7 @@ static void msdc_cmd_next(struct msdc_ho
{
if ((cmd->error &&
!(cmd->error == -EILSEQ &&
- (cmd->opcode == MMC_SEND_TUNING_BLOCK ||
- cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200 ||
- host->hs400_tuning))) ||
+ (mmc_op_tuning(cmd->opcode) || host->hs400_tuning))) ||
(mrq->sbc && mrq->sbc->error))
msdc_request_done(host, mrq);
else if (cmd == mrq->sbc)

View File

@@ -31,8 +31,8 @@
static int mtk_pinconf_bias_set_pullsel_pullen(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc,
u32 pullup, u32 arg)
@@ -755,6 +779,12 @@ int mtk_pinconf_bias_set_combo(struct mt
return err;
@@ -758,6 +782,12 @@ int mtk_pinconf_bias_set_combo(struct mt
return 0;
}
+ if (try_all_type & MTK_PULL_PD_TYPE) {
@@ -44,7 +44,7 @@
if (try_all_type & MTK_PULL_PU_PD_TYPE) {
err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg);
if (!err)
@@ -875,6 +905,29 @@ out:
@@ -878,6 +908,29 @@ out:
return err;
}
@@ -74,19 +74,19 @@
static int mtk_pinconf_bias_get_pullsel_pullen(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc,
u32 *pullup, u32 *enable)
@@ -943,6 +996,12 @@ int mtk_pinconf_bias_get_combo(struct mt
if (!err)
return err;
@@ -947,6 +1000,12 @@ int mtk_pinconf_bias_get_combo(struct mt
return 0;
}
+
+ if (try_all_type & MTK_PULL_PD_TYPE) {
+ err = mtk_pinconf_bias_get_pd(hw, desc, pullup, enable);
+ if (!err)
+ return err;
+ }
+
if (try_all_type & MTK_PULL_PU_PD_TYPE) {
err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
if (!err)
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
@@ -24,6 +24,7 @@

View File

@@ -37,7 +37,7 @@
* CONFIG_CMDLINE is meant to be a default in case nothing else
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2239,6 +2239,14 @@ config CMDLINE_FORCE
@@ -2277,6 +2277,14 @@ config CMDLINE_FORCE
endchoice

View File

@@ -25,7 +25,21 @@ CONFIG_ARM64=y
CONFIG_ARM64_4K_PAGES=y
CONFIG_ARM64_CNP=y
CONFIG_ARM64_EPAN=y
CONFIG_ARM64_ERRATUM_1024718=y
CONFIG_ARM64_ERRATUM_1165522=y
CONFIG_ARM64_ERRATUM_1286807=y
CONFIG_ARM64_ERRATUM_1319367=y
CONFIG_ARM64_ERRATUM_1463225=y
CONFIG_ARM64_ERRATUM_1530923=y
CONFIG_ARM64_ERRATUM_1742098=y
CONFIG_ARM64_ERRATUM_2051678=y
CONFIG_ARM64_ERRATUM_2054223=y
CONFIG_ARM64_ERRATUM_2067961=y
CONFIG_ARM64_ERRATUM_2077057=y
CONFIG_ARM64_ERRATUM_2441007=y
CONFIG_ARM64_ERRATUM_2441009=y
CONFIG_ARM64_ERRATUM_2658417=y
CONFIG_ARM64_ERRATUM_3117295=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_826319=y
@@ -50,6 +64,9 @@ CONFIG_ARM64_VA_BITS=48
# CONFIG_ARM64_VA_BITS_39 is not set
CONFIG_ARM64_VA_BITS_48=y
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y
CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD=y
# CONFIG_ARMV8_DEPRECATED is not set
CONFIG_ARM_AMBA=y
CONFIG_ARM_ARCH_TIMER=y

Some files were not shown because too many files have changed in this diff Show More