Compare commits

..

94 Commits

Author SHA1 Message Date
Hauke Mehrtens
28cf53e6bd OpenWrt v23.05.5: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-24 00:53:33 +02:00
Paul Spooren
10cc5fcd00 build: align SOURCE path for build system and SDK
Building a package in the build system or the SDK results in different
values for the `SOURCE` property, it's either `packages/<package name>`
or `feeds/base/<package name>`. The reason is that the SDK handles
`openwrt.git` as an external feed called while the build system contains
the *base* packages directly.

Since packages created with either method are (ideally) the same (bit
for bit), align the content of SOURCE. To do so this commit creates a
symlink from `feeds/base` to `$(TOPDIR)/package` and adopts the SOURCE
when building from inside the build system.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-09-23 14:34:46 +02:00
Fabian Bläse
87fbb5085d ipq40xx: re-add label MAC address for FritzBox 4040
The MAC address of the GMAC is contained inside the CWMP-Account
number on the label.

The label MAC address alias was defined previously, but it has been
removed with the switch to IPQESS / DSA.

Restore the label MAC address alias.

Fixes: 27b441cbaf ("ipq40xx: drop ESSEDMA + AR40xx DTS nodes")
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit b22d382ae4)
Signed-off-by: Tom Herbers <mail@tomherbers.de>
Link: https://github.com/openwrt/openwrt/pull/16459
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-23 10:25:05 +02:00
Sander Vanheule
a2a67804fc firmware-utils: bump to latest openwrt-23.05
This version bump contains one patch improving compatibility with recent
vendor firmware versions:
  - commit f3b636d0ee47 ("tplink-safeloader: bump EAP610-V3 compat_level")

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2024-09-22 16:47:19 +02:00
Markus Stockhausen
ace013101c realtek: 5.15: backport VLAN fix
With commit a22d359fa5 VLAN handling was fixed for kernel 6.6.
This restored network connectivity of the devices. For easy testing
backport the fix for 5.15 too.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16391
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 35e13244aa)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
2024-09-22 16:26:25 +02:00
Ryan Salsbury
8e75eed617 ath79: fix I2C pins on GL-AR750
Change I2C pin flags to GPIO_ACTIVE_HIGH and change SDA to GPIO1.

On my late production GL-AR750 (purchased 2024):
SCL = GPIO16
SDA = GPIO1

Bug report:
I2C bus doesn't work in GL-AR750
https://github.com/openwrt/openwrt/issues/16319

Signed-off-by: Ryan Salsbury <ryanrs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16406
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 2e626ae2d2)
Signed-off-by: Ryan Salsbury <ryanrs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16446
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 16:07:46 +02:00
Hauke Mehrtens
4d4d260f5b ramips: tp-link er605-v2: Remove sysupgrade-tar image
The sysupgrade-tar image build is not defined for this target, do not
add a build instruction for it. The build system will use the definition
from the dna_valokuitu-plus-ex400 board and the build will fail.

This fixes the build of the ramips target.

Fixes: 665c2154ef ("ramips: add basic support for tp-link er605-v2")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 746e894877)
2024-09-22 15:33:11 +02:00
Felix Fietkau
66055df3e0 ucode: another fix for host installation
The previous host installation fix accidentally moved the rpath settings
out of CMAKE_HOST_OPTIONS and into CMAKE_OPTIONS.

Fixes: ae42ecaad4 ("ucode: fix host installation")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 2ee1392e09)
2024-09-20 22:21:03 +02:00
David Bauer
dd4b05ee8a ipq40xx: add PoE passthrough GPIO
Add the GPIO pin of the PoE passthrough switch on the Aruba AP-303H.
Power is activated when the pin is low. It enables a PSE chip, so power
is only supplied to downstream devices when they are 802.3af/at
compliant devices.

Ensure you use a sufficient power supply when chaining a consuming
device after the AP.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit b40cc46cc8)
2024-09-20 19:52:46 +02:00
Andreas Böhler
4d7ad37891 ramips: mt7621: use lzma-loader for Sercomm NA502s
This fixes a well-known "LZMA ERROR 1" error on Sercomm NA502s, reported
on the OpneWrt forum [0].

[0] https://forum.openwrt.org/t/206640

Signed-off-by: Andreas Böhler <dev@aboehler.at>
(cherry picked from commit 6d89aa2987)
Link: https://github.com/openwrt/openwrt/pull/16412
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-18 23:04:37 +02:00
Paul Donald
e3bb35811e lldpd: fix reload bug: advertisements shall default to on
Because these capability advertisements default to on in lldpd, they
became absent at reload, and not restart, due to how the reload logic
works ( keep daemon running, send unconfigured and then the new config
via socket ), and it was not evident unless you happened to be looking
for it (e.g. via pcap or tcpdump). It was also not evident from the
manpage ( have now sent patches upstream ).

At reload time, the unconfigure logic disabled them unless they were
explicitly enabled (compare with other settings where 'unconfigure' just
resets them). Now they default to on/enabled at init time, and are
explicitly 'unconfigure'd at startup if the user disables them via:

lldp_mgmt_addr_advertisements=0
lldp_capability_advertisements=0

In other words: explicit is necessary to disable the advertisements.

The same applies to 'configure system capabilities enabled'. Technically
'unconfigure'd is the default but now it is explicit at reload.

Tested on: 23.05.3

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 708101c141)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
0b48b832a9 lldpd: extended interface(s) parsing to handle patterns
For interface type parameters, the man page documents patterns:
```
*,!eth*,!!eth1

uses all interfaces, except interfaces starting with "eth",
but including "eth1".
```

* Renamed `_ifname` to `_l2dev`.
* get the l2dev via network_get_physdev (and not l3dev)
* Glob pattern `*` is also valid - use noglob for this

The net result is that now interface 'names' including globs '*' and '!'
inversions are included in the generated lldpd configs.

Temporarily `set -o noglob` and then `set +o noglob` to disable & enable
globbing respectively, because when we pass `*` as an interface choice,
other file and pathnames get sucked in from where the init script runs,
and the `*` never makes it to lldpd.

Tested extensively on: 22.03.6, 23.05.3

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
[ squash with commit bumping release version ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 4a81d868db)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
7ee813b3ef lldpd: make management address advertisement controllable
Defaults to off.

Available from >= 0.7.15

These are sent in TLV

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 50021d3222)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
af6a852ced lldpd: make capabilities advertisement controllable
Defaults to off.

Only available from >= 1.0.15

These capabilities are sent in TLV.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 4d8f56bd59)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
cec02193d5 lldpd: note about capabilities
only available from >= 1.0.15

Comments are useful. Apparently this config parameter was committed when
openwrt used an older version of lldpd which did not yet support it.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit b476917502)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
ca0c2363c2 lldpd: fix restart
Redirection broke in 5364fe0f01 ("lldpd: shellcheck fixes")

redirects to /dev/null shall be handled correctly (i.e. last).

This fixes these errors on `/etc/init.d/lldpd reload`:

2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`

Tested-on: 22.03.6
Fixes: 5364fe0f01 ("lldpd: shellcheck fixes")
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
[ improve commit description, add fixes tag ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8cf1dce428)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
3d3dad61b2 lldpd: update URL
update Makefile URL

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit f753d3152f)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
d7765c488c lldpd: shellcheck fixes
No functionality/behaviour changes; code is synonymous

Tested on: 22.03.6

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 5364fe0f01)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
601bbdda6a lldpd: implement lldp_policy parameter
For certain lldp_class scenarios (2 & 3) a policy must be set also.
Class 4 is default, although it's good to handle the policy eventuality.

Here, set a default lldp_policy for all lldp_class scenarios. Any
lldp_policy can now be set.

Depends on PR #14584 (which introduced an `if` block)

Tested on 22.03.5, 22.03.6

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 497fafb8ae)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
56675166e8 lldpd: Implement location parameter
Previously only partially implemented. After commit
5007f488bb lldp_location was never removed

Now, add the value of lldp_location to the generated config.

The location param has a few syntaxes, so the config acquires the first
usage from the man page: 'address country EU'

Supplementary fix for PR #14193 (this param was included in the original
PR #13018 but the lldp_location fixes were absent from PR #14193).

Tested on 22.03.5, 22.03.6

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 53252eeb3b)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
7542e7927b lldpd: fix error "sh: XXXms: bad number"
from commit 3ce909914a

The lldpd man page says that "configure lldp tx-interval" can
specify an interval value in milliseconds by appending a "ms" suffix to
the figure. Thus mandating string handling, and not integer comparison.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 79ee4cb039)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
b886948692 lldpd: refactor out ifaces derivation; reuse function
from commit 909f063066

Now pass two params to get_config_cid_ifaces() for:

cid_interface
interface

Each of which is a CSV of interfaces.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 228d4e7f1b)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
74581b02b2 lldpd: remove unneeded quotes
from commit a5f715da71

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 4dcece46a7)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
8766fed5cd lldpd: remove unneeded quotes and variable quoting
from commit ac771313eb

portidsubtype takes 1 of 2 possible keywords which do not need quoting:

         configure lldp portidsubtype ifname | macaddress

The third keyword 'local' is used in the syntax when individual ports
are being defined:

         configure [ports ethX [,…]] lldp portidsubtype local value

When this syntax is used, quoting is useful (see test cases for lldpd).
In the init file, the 'local' syntax is unused.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit bd1b17d589)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
64b38f3bd5 lldpd: remove unneeded quotes and variable quoting
from commit c98ee4dbb3

agent-type takes 1 of 3 possible keywords which do not require quoting:

         configure lldp agent-type nearest-bridge | nearest-non-tpmr-bridge
         | nearest-customer-bridge

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 24a4da527f)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
89759ee4bb lldpd: remove unneeded quotes and variable quoting
from commit 3ce909914a

'capabilities enabled x' where x is a string of CSV

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit b039641071)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
50135a03a6 lldpd: remove unneeded quotes
from commit 3ce909914a

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 82ec853284)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
4446346fdd lldpd: remove unneeded quotes and variable quoting
from commit 24176a6bdd

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 20a4dddeb0)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
b1ddf0a859 lldpd: fix a paste error
from commit 1be2088a52

The original PR #13018 did not exhibit this.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 4fb8fea6de)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
c0217ef8f8 lldpd: spell fixes
Supplementary fix for PR #14193

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 1909b6f883)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
1d14e0abfc lldpd: fix -k 'lldp_no_version' row
Supplementary fix for PR #14193 and commit
b67182008f

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 97eb3bf76c)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Stephen Howell
4ebd60b083 lldpd: add option to force EDP
allow EDP support if compiled and add force EDP option

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit d274867c21)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Stephen Howell
13193cb070 lldpd: only use snmp options when compiled in
prevent SNMP options being passed unless lldpd supports them

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 8b2d02e48c)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Stephen Howell
02e3845890 lldpd: Update Makefile package release
increment Makefile package release to reflect changes to init script

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 1b36d44323)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
a7f749ded4 lldpd: add option for tx delay and tx hold
add option to set LLDP transmit delay, hold timers to set update frequency

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit a5f715da71)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
b2008404ab lldpd: add option to set system platform
add option to override system platform instead of using kernel name

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 4159acceeb)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
18fc86a0f5 lldpd: add option to force SONMP enabled
add option to force SONMP to be enabled even when no peer detected

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 4ac134aa78)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
1201a69664 lldpd: add option to force FDP on
add option to force FDP when no peers detected

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 1be2088a52)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
d6da0952ab lldpd: set CDP version and allow forcing CDP on
add option to specify CDPv1 or CDPv2 and separately enable or force each

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit b67182008f)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
7f58fc14d8 lldpd: allow disabling LLDP protcol
add option to allow LLDP disabling while using other supported protocols

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 61dbe756d8)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
ed3f182d63 lldpd: add portidsubtype option
add option portidsubtype to correct port identifiers and descriptions

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit ac771313eb)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
6cbc100762 lldpd: add agent-type option
add option to set agent-type to control propogation

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit c98ee4dbb3)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
be4824977b lldpd: add LLDP MED options
add option to enable LLDP MED fast-start and set fast-start timer

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 24176a6bdd)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
15e6259231 lldpd: option to disable LLDP-MED inventory TLV
add option to disable LLDP-MED inventory TLV transmission

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 1753498b01)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
59ad77faba lldpd: Init adds no-version option
add option to disable advertising kernel version

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 058f284b1a)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
1d83e4c5ed lldpd: Allow neighbour filtering
add filter option to init script.

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit ac3ed75309)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
f79ab96312 lldpd: LLDPD binds to only specified interfaces
Bind to the configured system interfaces only. Switchport interfaces
are no longer ignored and uci interface values for LLDPD are honored.

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 064b4999ad)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
b0f991d03c lldpd: Init config read on reload
Init script reload with trigger to detect config file update.
Reload command added to attempt non-impactful lldpd reload where
lldpcli can be used to update config without process restart.
Config hash function used to track whether process restart is needed.

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit e483c247dc)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Sebastian Pflieger
8f714af40b lldpd: add lldp_syscapabilities config option
allow to overwrite the detected system capabilities e.g. if devices
does not operate as bridge.

Signed-off-by: Sebastian Pflieger <sebastian@pflieger.email>
(cherry picked from commit 3ce909914a)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
David Bauer
3b85719b62 ucode: fix missing backslash
Fixes: ae42ecaad4 ("ucode: fix host installation")

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 9d663c7435)
2024-09-15 03:32:18 +02:00
Hauke Mehrtens
461102d99c ncurses: Fix path in ncursesw.pc
The file contains the the /usr/lib path from the toolchain directory and
not from the target directory. The /usr/lib directory for the toolchain
is empty and the shared library is not in the specified paths. On RISCV
the linker of util-linux was finding the libncursesw.so in my host
system, tried to link against it and failed. Fix the .pc file.

Fixes: #15942
Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
Link: https://github.com/openwrt/openwrt/pull/16018
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 91573ac145)
Link: https://github.com/openwrt/openwrt/pull/16390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 02:03:25 +02:00
Philip Prindeville
b1858ffbf3 build: autoconf: set ac_cv_func_setresuid=true
MUSL and eglibc provide these symbols.

Bind needs setresuid() to build properly in recent versions.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Link: https://github.com/openwrt/openwrt/pull/15952
(cherry picked from commit 0bd129a5d3)
Link: https://github.com/openwrt/openwrt/pull/16390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 02:03:25 +02:00
Yan Cangang
912acb6c09 filogic: add missing 2.5G PHY LEDs configuration for Zyxel EX5700
configure 2.5G PHY LEDs to:

2500/1000: green with blink on TX/RX
100/10: green+yellow with blink on TX/RX

which is similar to other 1G PHY LEDs, which are:

1000: green with blink on TX/RX
100/10: green+yellow with blink on TX/RX

Fixes: 6cc14bf66a ("filogic: support Telenor branded ZyXEL EX5700")

Signed-off-by: Yan Cangang <nalanzeyu@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16082
(cherry picked from commit 3de653a0af)
Link: https://github.com/openwrt/openwrt/pull/16390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 02:03:25 +02:00
Hauke Mehrtens
7e42fdcafe mac80211: Update to version 6.1.110-1
This updates mac80211 to version 6.1.110-1. This code is based on Linux
6.1.110 and contains all fixes included in the upstream wireless
subsystem from that kernel version. This includes many bugfixes and also
some security fixes.

The removed patches are already integrated in upstream Linux 6.1.110.

The following patches were integrated in upstream Linux:
   subsys/311-v6.2-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch
   subsys/312-v6.3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch
   subsys/313-v6.3-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch
   subsys/314-v6.3-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch
   subsys/315-v6.3-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch
   subsys/316-v6.3-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch
   subsys/321-mac80211-fix-mesh-forwarding.patch
   subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch
   subsys/329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch
   subsys/339-wifi-cfg80211-fix-receving-mesh-packets-without-RFC1.patch
   subsys/350-v6.3-wifi-mac80211-Allow-NSS-change-only-up-to-capability.patch
   subsys/351-v6.9-wifi-mac80211-track-capability-opmode-NSS-separately.patch

Link: https://github.com/openwrt/openwrt/pull/16368
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 01:59:41 +02:00
Ivan Pavlov
4fa16c1e24 openssl: update to 3.0.15
OpenSSL 3.0.15 is a security patch release. The most severe CVE fixed in this release is Moderate.

This release incorporates the following bug fixes and mitigations:

  * Fixed possible denial of service in X.509 name checks (CVE-2024-6119)

  * Fixed possible buffer overread in SSL_select_next_proto() (CVE-2024-5535)

Added github releases url as source mirror

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16332
(cherry picked from commit 62d3773bf1)
Link: https://github.com/openwrt/openwrt/pull/16346
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 17:04:20 +02:00
Hauke Mehrtens
a0ebff651d mbedtls: Update to 2.28.9
This contains a fix for:
CVE-2024-45157:
Unlike previously documented, enabling MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does
not cause the PSA subsystem to use HMAC_DRBG: it uses HMAC_DRBG only when
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and MBEDTLS_CTR_DRBG_C are disabled.

Link: https://github.com/openwrt/openwrt/pull/16367
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 17:02:22 +02:00
Hauke Mehrtens
8e5e62416f kernel: bump 5.15 to 5.15.167
Manually adapted:
   generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch
   ramips/patches-5.15/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch

Link: https://github.com/openwrt/openwrt/pull/16366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 16:51:13 +02:00
Hauke Mehrtens
fd6e077ddf kernel: bump 5.15 to 5.15.166
Manually adapted:
   bcm27xx/patches-5.15/950-0030-Revert-Bluetooth-Always-request-for-user-confirmatio.patch

Link: https://github.com/openwrt/openwrt/pull/16366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 16:51:13 +02:00
Hauke Mehrtens
bad01d4806 kernel: bump 5.15 to 5.15.165
Removed because they are upstream:
   generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=bff165a3993683daddf3f00563960e7675966f91

   ipq807x/patches-5.15/0004-v5.16-arm64-dts-qcom-msm8996-Move-clock-cells-to-QMP-PHY-c.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=32f0e52f16d45d743b473659329f93d4a27c68bf

Manually adapted:
   bcm27xx/patches-5.15/950-0040-spi-spidev-Completely-disable-the-spidev-warning.patch
   bcm27xx/patches-5.15/950-0578-spi-spidev-Restore-loading-from-Device-Tree.patch
   generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch

Adapt kernel configuration for newly added option
CONFIG_ARM64_ERRATUM_3194386.

The leddev_list_lock attribute changed from rwlock_t to spinlock_t in:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=590304b798a3b89e716b6b564f8ad14bc9373d93

Link: https://github.com/openwrt/openwrt/pull/16366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 16:51:13 +02:00
David Bauer
cc938b18a8 ucode: fix host installation
The path for linking libucode.so was not specified for the ucode binary.
This breaks execution of ucode in the host context.

Signed-off-by: David Bauer <david.bauer@uniberg.com>
(cherry picked from commit ae42ecaad4)
2024-09-13 03:16:31 +02:00
Rafał Miłecki
ee3efefc5e treewide: fixup models names for UniFi U6 series
Ubiquiti has a set of UniFi 802.11ax (Wi-Fi 6) AP devices. All models
include "U6" in their names and also have code names with no special
characters (including spaces).

Examples:
1. U6 Lite (codename U6-Lite)
2. U6 Long-Range (codename U6-LR)
3. U6+ (codename U6-PLUS)
4. U6 Pro (codename U6-Pro)
5. U6 Mesh (codename U6-Mesh)
6. U6 Mesh Pro (codename U6-Mesh-Pro)
7. U6 Enterprise (codename U6-Enterprise)

Use proper full names for those devices. Names in OpenWrt/DTS code may
need updating too but it can be handled later.

Cc: Elbert Mai <code@elbertmai.com>
Cc: Daniel Golle <daniel@makrotopia.org>
Cc: Henrik Riomar <henrik.riomar@gmail.com>
Cc: David Bauer <mail@david-bauer.net>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 74879140a1)
2024-09-12 14:37:59 +02:00
David Bauer
7447eeac91 ipq40xx: define config-names for Aruba boards
Aruba boards now ship with multiple DTS and image-configurations per
image. Newer apboot revs expect a configuration for their hardware to be
present.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c7ba5574f5)
2024-09-11 17:47:11 +02:00
Matthias Schiffer
5773538c90 base-files: fix merge of passwd/shadow/group lines with trailing colons
Empty trailing fields get lost when the lines are split and merged again
at colons, resulting in unparsable entries. Only use the split fields for
matching against the other file, but emit the original line unchanged
to fix the issue.

Fixes: de7ca7dafa ("base-files: merge /etc/passwd et al at sysupgrade config restore")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 9bbaa6f2c0)
2024-08-29 21:07:48 +02:00
Matthias Schiffer
c4c43c64aa tools: libtool: do not symlink files in bootstrap
Another instance of files in build_dir symlinking to staging_dir. While
the symlinks do not currently cause any bugs in the libtool package,
such symlinks were found to make the build more fragile, as writing to
the symlink may accidentally modify the shared file in staging_dir. Pass
--copy to bootstrap to disable the symlinking.

Link: https://github.com/openwrt/openwrt/pull/15825
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit d6e5459319)
2024-08-29 20:06:03 +02:00
Matthias Schiffer
d811a09524 include: autotools: do not symlink files in autoreconf
In Gluon's Github Actions CI, we were occasionally seeing bizarre build
errors that looked like a config.sub file had been corrupted, or changed
while it was being executed.

The cause turned out to be an interaction of the symlinks created by
autoreconf (pointing from individual tools' build dirs into
`staging_dir/host/share/automake-1.16`) and OpenWrt's host-build.mk,
which replaced config.guess and config.sub *after* autoreconf. The
result was that the replacement of these files ended up following the
symlinks and writing the files in `staging_dir/host/share/automake-1.16`
instead of a package's build dir. This could cause other packages' builds
to fail if they were currently executing the scripts while they were
being written.

To fix this, disable autoreconf's symlinking feature, so that modifying
these files in a package's build directory can't accidentally affect the
staged versions.

Link: https://github.com/openwrt/openwrt/pull/15825
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit c364cb8e46)
2024-08-29 20:06:02 +02:00
Sarah Maedel
5a8588e360 hostapd: fix anqp_3gpp_cell_net list delimiter
This patch fixes the list delimiter between 3GPP networks
passed to hostapd.

> list iw_anqp_3gpp_cell_net '262,001'
> list iw_anqp_3gpp_cell_net '262,002'

When passing a list of "iw_anqp_3gpp_cell_net" parameters via UCI,
hostapd would crash at startup:
> daemon.err hostapd: Line 73: Invalid anqp_3gpp_cell_net: 262,001:262,002

Using a semicolon as a delimiter, hostapd will start as expected.

Signed-off-by: Sarah Maedel <git@tbspace.de>
(cherry picked from commit 8de185a176)
2024-08-28 12:00:23 +02:00
Jakob Haufe
a07a531329 octeon: ubnt-edgerouter: Disable PCIe
Some devices lock up on PCIe initialization:

[   64.309697] PCIe: Port 0 in endpoint mode, skipping.
[   64.320496] PCIe: Initializing port 1
[   64.325257] PCIe: BIST FAILED for port 1 (0xffffffffffffffff)
(system hangs here)

Given the ER contains no PCIe peripherals, has no way to attach any
and the stock kernel doesn't have PCIe support either, just disable it.

(cherry picked from commit 308630aea6)
Signed-off-by: Jakob Haufe <sur5r@sur5r.net>
Link: https://github.com/openwrt/openwrt/pull/16223
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-08-22 11:41:22 +02:00
Álvaro Fernández Rojas
bd79a16674 kernel: r8126: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 5d2a008670)
2024-08-19 12:46:30 +02:00
Álvaro Fernández Rojas
4d33716f96 kernel: r8125: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from a57a3e5cc5)
2024-08-19 12:46:14 +02:00
Álvaro Fernández Rojas
561d534adb kernel: r8168: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 2f846a3315)
2024-08-19 12:45:59 +02:00
Álvaro Fernández Rojas
fe8c1fdd24 kernel: r8101: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from fe0240f27e)
2024-08-19 12:45:41 +02:00
Álvaro Fernández Rojas
403af43fd4 kernel: r8126: ignore the rss rxnfc log
This log is noisy and useless, just ignore it.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 8d9893ff34)
2024-08-18 12:21:15 +02:00
Chukun Pan
6a877053dd kernel: r8125: ignore the rss rxnfc log
This log is noisy and useless, just ignore it.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 2fd0102cc3)
2024-08-18 12:20:55 +02:00
Álvaro Fernández Rojas
c615bcf438 kernel: r8126: add RSS variant
Instead of enabling RSS support, let's introduce a variant and let users
choose between both variants since it can cause network issues.

Signed-off-by: Milinda Brantini <C_A_T_T_E_R_Y@outlook.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from bfeef9b3d7)
2024-08-17 12:40:26 +02:00
Álvaro Fernández Rojas
a79157f257 package: add kmod-r8126 ethernet driver
r8126 is an out of tree driver provided by Realtek for RTL8126 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from 54623c6a1d)
2024-08-17 12:40:22 +02:00
Álvaro Fernández Rojas
4d0dc5e15e kernel: r8125: add RSS variant
Instead of enabling RSS support, let's introduce a variant and let users
choose between both variants since it can cause network issues.

Signed-off-by: Milinda Brantini <C_A_T_T_E_R_Y@outlook.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from f063f4620c)
2024-08-17 12:35:09 +02:00
Álvaro Fernández Rojas
68d5ed7526 package: add kmod-r8125 ethernet driver
r8125 is an out of tree driver provided by Realtek for RTL8125 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from ddb4070c96)
2024-08-17 12:34:50 +02:00
Álvaro Fernández Rojas
7d6366dcd7 package: add kmod-r8168 ethernet driver
r8168 is an out of tree driver provided by Realtek for RTL8168 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
((cherry picked from commit 1565eeda4e)
2024-08-17 08:06:25 +02:00
Álvaro Fernández Rojas
d1de7d3c92 package: add kmod-r8101 ethernet driver
r8101 is an out of tree driver provided by Realtek for RTL8101 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit b72c4b5386)
2024-08-17 08:03:48 +02:00
Tianling Shen
cce5b49de4 mediatek: fix lan/wan macaddr for cmcc rax3000m
The MAC address assigned to lan/wan was reversed on eMMC boards.

Fixes: d3c193525e ("mediatek: add CMCC RAX3000M support")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/15077
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-11 19:18:39 +02:00
Tianling Shen
a591f9cd14 mediatek: enable rootwait for cmcc rax3000m emmc version
Sometimes the mmc deivce may come up later than kernel attempts to
mount rootfs, resulting kernel panic. Enable rootwait to fix it.

Reported-by: Yangyu Chen <cyy@cyyself.name>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/15077
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-11 19:18:39 +02:00
Tianling Shen
6fadcee50b mediatek: increase phy assert time for jdcloud re-cp-03
According to RTL8221B's datasheet, the PHY requires at least 10ms
for assert and 68ms (recommended) for de-assert. So increase the
assert/de-assert time to 15ms and 68ms respectively.

Fixes: c0c3234e17 ("mediatek: add support for JDCloud RE-CP-03")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/16106
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d1954aa535)
2024-08-08 22:07:08 +02:00
Bjørn Mork
c241885687 kernel: ubootenv-nvram: driver for RAM backed environments
The vendor U-Boot implementaion on Telenor branded ZyXEL EX5700
devices does not store its environment on flash. It is instead
kept in a memory region.  This is persistent over reboots, but
not over power cycling.

The dual partition failsafe system used by the vendor U-Boot
requires the OS to modify a variable in this memory environment.
This driver allows the ordinary uboot-envtools to access a
memory region like it was a partition on NOR flash.

The specific vendor U-Boot adds a "no-map" /reserved-memory
section and a top level /ubootenv node pointing to the memory
environment.  The driver uses this device specific fact to
locate the region.  The matching and probing code will likely
have to be adjusted for any other devices to be supported.

Example partial device tree:

 / {
    ..
    ubootenv {
        memory-region = <&uenv>;
        compatible = "ubootenv";
    };
    ..
    reserved-memory {
        ..
        uenv: ubootenv@7ffe8000 {
            no-map;
            reg = <0 0x7ffe8000 0 0x4000>;
        };

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit b2e810f495)
2024-08-07 12:12:30 +02:00
Rany Hany
e4625c37c4 hostapd: fix SAE H2E security vulnerability
This patch backports fixes for a security vulnerability impacting the
hostapd implementation of SAE H2E.

As upgrading hostapd would require more testing, the second mitigation
step which involves backporting several patches was adopted as outlined
in the official advisory[1].

An explanation of the impact of the vulnerability is provided from the
advisory[1]:

This vulnerability allows the attacker to downgrade the negotiated group
to another enabled group if both the AP and STA have enabled SAE H2E and
multiple groups. It should be noted that the H2E option is not enabled
by default and the attack is not applicable to the default option, i.e.,
hunting-and-pecking, since it does not have any downgrade protection for
group negotiation. In addition, the default configuration for enabled
SAE groups in hostapd is to enable only a single group, so the
vulnerability is not applicable unless hostapd has been explicitly
configured to enable more groups for SAE.

[1]: https://w1.fi/security/2024-2/sae-h2h-and-incomplete-downgrade-protection-for-group-negotiation.txt

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/16043
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit db7f70fe61)
2024-08-02 23:18:03 +02:00
Hauke Mehrtens
07cb7cb885 kernel: bump 5.15 to 5.15.164
No manual changes needed.

Link: https://github.com/openwrt/openwrt/pull/16027
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-29 23:11:33 +02:00
Hauke Mehrtens
f99dffcaca mac80211: Update to version 6.1.102-1
Upstream removed SSB and BCMA, the drivers are now compiled against the
in kernel versions. No need to patch this for OpenWrt.

Link: https://github.com/openwrt/openwrt/pull/15983
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-29 23:09:51 +02:00
Hauke Mehrtens
6edde2b502 ath25: eth: Fix PHY access over ar2313 driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
2e064182bf ipq40xx: eth: Fix PHY access over ipqess driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit f0bb25aba2)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
c4dc5dbd33 ramips: eth: Fix PHY access over mtk_eth_soc driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit dbccc9cf91)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
e5233fa70e ath79: Fix PHY access over ag71xx driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

The SIOCSIFHWADDR and SIOCGIFHWADDR operation are handled in the generic
code in the same way just with more input validation.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Reported-by: Cthulhu88 in https://forum.openwrt.org/t/ethernet-leds-control-for-tp-link-tl-wr1043nd-v2-v3/202378
Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit f86273e742)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
1478f641bd ltq-ptm: Fix netdev ioctls with kernel > 5.15
.ndo_do_ioctl is not called for SIOCDEVPRIVATE any more, the kernel
calls .ndo_siocdevprivate now.

The function gets the data pointer from the callback directly, make use
of it.

See upstream Linux kernel commit:
https://git.kernel.org/linus/b9067f5dc4a07c8e24e01a1b277c6722d91be39e

Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit e33ebdd00e)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:35 +02:00
Hauke Mehrtens
f791ec1f6d kernel: bump 5.15 to 5.15.163
Manually adapted:
   lantiq/patches-5.15/0028-NET-lantiq-various-etop-fixes.patch

Link: https://github.com/openwrt/openwrt/pull/15982
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-27 00:40:25 +02:00
Hauke Mehrtens
56a84b3c47 mac80211: Fix wifi throughput
Backport 2 patches from upstream Linux to fix a Wifi throughput
problem.

Fixes: 323e249ce8 ("mac80211: Update to version 6.1.97-1")
Link: https://github.com/openwrt/openwrt/pull/16007
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-27 00:38:46 +02:00
Hauke Mehrtens
76a0c2932c OpenWrt v23.05.4: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-16 23:51:26 +02:00
237 changed files with 2108 additions and 2526 deletions

View File

@@ -1,4 +1,4 @@
src-git packages https://git.openwrt.org/feed/packages.git^89955ee711d92e6fb6db7dde9d9d7eb06841acdb
src-git luci https://git.openwrt.org/project/luci.git^85dec609ab12eee92601d492e4d472b01d71f7ae
src-git routing https://git.openwrt.org/feed/routing.git^a82e34d5e402ec77fd5facc1349352cacda2d0f8
src-git packages https://git.openwrt.org/feed/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201
src-git luci https://git.openwrt.org/project/luci.git^63ba3cba5b7bfb803a875d4d8f01248634687fd5
src-git routing https://git.openwrt.org/feed/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d
src-git telephony https://git.openwrt.org/feed/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d

View File

@@ -44,7 +44,7 @@ define autoreconf
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
$(AM_TOOL_PATHS) \
LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i \
$(if $(word 2,$(3)),--no-recursive) \
-B $(STAGING_DIR_HOST)/share/aclocal \
$(patsubst %,-I %,$(5)) \

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .162
LINUX_KERNEL_HASH-5.15.162 = 91bfc0ea152ce7b102a0b79d35a7c92843874ebf085c99d2ba8b4d85e62b1a7c
LINUX_VERSION-5.15 = .167
LINUX_KERNEL_HASH-5.15.167 = b1751f18ece3df08d502dd87a9ab1a317dc0f9486355bf8ee62ba6af0b35da30

View File

@@ -20,7 +20,7 @@ define Package/Default
PROVIDES:=
EXTRA_DEPENDS:=
MAINTAINER:=$(PKG_MAINTAINER)
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(patsubst $(TOPDIR)/package/%,feeds/base/%,$(CURDIR)))
ifneq ($(PKG_VERSION),)
ifneq ($(PKG_RELEASE),)
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)

View File

@@ -37,7 +37,7 @@ ac_cv_func_rindex=yes
ac_cv_func_setlocale=yes
ac_cv_func_setgrent_void=yes
ac_cv_func_setpgrp_void=yes
ac_cv_func_setresuid=no
ac_cv_func_setresuid=yes
ac_cv_func_setvbuf_reversed=no
ac_cv_func_stat_empty_string_bug=no
ac_cv_func_stat_ignores_trailing_slash=no

View File

@@ -77,7 +77,8 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
prepare-tmpinfo: FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
for type in package target; do \

View File

@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.4)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.5)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r24012-d8dd03c46f)
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r24106-10cc5fcd00)
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.4)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.5)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)

View File

@@ -9,7 +9,7 @@ missing_lines() {
IFS=":"
while read line; do
set -- $line
grep -q "^$1:" "$file2" || echo "$*"
grep -q "^$1:" "$file2" || echo "$line"
done < "$file1"
IFS="$oIFS"
}

View File

@@ -190,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "https://downloads.openwrt.org/releases/23.05.4"
default "https://downloads.openwrt.org/releases/23.05.5"
help
This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders:

View File

@@ -585,7 +585,7 @@
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=root=/dev/mmcblk0p65
+bootargs=root=/dev/mmcblk0p65 rootwait
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
+bootconf=config-1#mt7981b-cmcc-rax3000m-emmc
+bootdelay=0

View File

@@ -126,7 +126,7 @@ static int ptm_stop(struct net_device *);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static int ptm_ioctl(struct net_device *, struct ifreq *, void __user *, int);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
static void ptm_tx_timeout(struct net_device *);
#else
@@ -247,7 +247,7 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_do_ioctl = ptm_ioctl,
.ndo_siocdevprivate = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
@@ -452,7 +452,7 @@ PTM_HARD_START_XMIT_FAIL:
return NETDEV_TX_OK;
}
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *data, int cmd)
{
int ndev;
@@ -462,45 +462,45 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
switch ( cmd )
{
case IFX_PTM_MIB_CW_GET:
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxNoIdleCodewords = 0;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxIdleCodewords = 0;
((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw;
((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw;
((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw;
((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = 0;
((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = 0;
break;
case IFX_PTM_MIB_FRAME_GET:
((PTM_FRAME_MIB_T *)ifr->ifr_data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu;
((PTM_FRAME_MIB_T *)ifr->ifr_data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu;
((PTM_FRAME_MIB_T *)ifr->ifr_data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu;
((PTM_FRAME_MIB_T *)ifr->ifr_data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu;
((PTM_FRAME_MIB_T *)data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu;
((PTM_FRAME_MIB_T *)data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu;
((PTM_FRAME_MIB_T *)data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu;
((PTM_FRAME_MIB_T *)data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu;
break;
case IFX_PTM_CFG_GET:
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len;
((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present;
((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check;
((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check;
((IFX_PTM_CFG_T *)data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len;
((IFX_PTM_CFG_T *)data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen;
((IFX_PTM_CFG_T *)data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen;
((IFX_PTM_CFG_T *)data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len;
break;
case IFX_PTM_CFG_SET:
CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent ? 1 : 0;
CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen == 32) )
CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent ? 1 : 0;
CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 32) )
{
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1;
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen;
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->RxTcCrcLen;
}
else
{
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0;
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0;
}
CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen == 32) )
CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 32) )
{
CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1;
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen;
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->TxTcCrcLen;
}
else
{

View File

@@ -76,7 +76,7 @@ static int ptm_stop(struct net_device *);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static int ptm_ioctl(struct net_device *, struct ifreq *, void __user *, int);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
static void ptm_tx_timeout(struct net_device *);
#else
@@ -120,7 +120,7 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_do_ioctl = ptm_ioctl,
.ndo_siocdevprivate = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
@@ -370,62 +370,62 @@ PTM_HARD_START_XMIT_FAIL:
return 0;
}
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *data, int cmd)
{
ASSERT(dev == g_net_dev[0], "incorrect device");
switch ( cmd )
{
case IFX_PTM_MIB_CW_GET:
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1);
((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1);
((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1);
((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1);
((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1);
((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1);
break;
case IFX_PTM_MIB_FRAME_GET:
{
PTM_FRAME_MIB_T data = {0};
PTM_FRAME_MIB_T tmp = {0};
int i;
data.RxCorrect = IFX_REG_R32(DREG_AR_HEC_CNT0) + IFX_REG_R32(DREG_AR_HEC_CNT1) + IFX_REG_R32(DREG_AR_AIIDLE_CNT0) + IFX_REG_R32(DREG_AR_AIIDLE_CNT1);
tmp.RxCorrect = IFX_REG_R32(DREG_AR_HEC_CNT0) + IFX_REG_R32(DREG_AR_HEC_CNT1) + IFX_REG_R32(DREG_AR_AIIDLE_CNT0) + IFX_REG_R32(DREG_AR_AIIDLE_CNT1);
for ( i = 0; i < 4; i++ )
data.RxDropped += WAN_RX_MIB_TABLE(i)->wrx_dropdes_pdu;
tmp.RxDropped += WAN_RX_MIB_TABLE(i)->wrx_dropdes_pdu;
for ( i = 0; i < 8; i++ )
data.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu;
tmp.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu;
*((PTM_FRAME_MIB_T *)ifr->ifr_data) = data;
*((PTM_FRAME_MIB_T *)data) = tmp;
}
break;
case IFX_PTM_CFG_GET:
// use bear channel 0 preemption gamma interface settings
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent = 1;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16);
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16);
((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = 1;
((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;;
((IFX_PTM_CFG_T *)data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16);
((IFX_PTM_CFG_T *)data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1;
((IFX_PTM_CFG_T *)data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16);
break;
case IFX_PTM_CFG_SET:
{
int i;
for ( i = 0; i < 4; i++ ) {
RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck ? 0 : 1;
RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 0 : 1;
RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck ? 0 : 1;
RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck ? 0 : 1;
switch ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen ) {
switch ( ((IFX_PTM_CFG_T *)data)->RxTcCrcLen ) {
case 16: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 1; break;
case 32: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 2; break;
default: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 0;
}
TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen ? 0 : 1;
TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 0 : 1;
if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen ) {
switch ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen ) {
if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen ) {
switch ( ((IFX_PTM_CFG_T *)data)->TxTcCrcLen ) {
case 16: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 1; break;
case 32: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 2; break;
default: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 0;
@@ -440,7 +440,7 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ppe_prio_q_map cmd;
if ( copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd)) )
if ( copy_from_user(&cmd, data, sizeof(cmd)) )
return -EFAULT;
if ( cmd.pkt_prio < 0 || cmd.pkt_prio >= ARRAY_SIZE(g_ptm_prio_queue_map) )

View File

@@ -804,6 +804,7 @@ define KernelPackage/mtdtests
$(LINUX_DIR)/drivers/mtd/tests/mtd_speedtest.ko \
$(LINUX_DIR)/drivers/mtd/tests/mtd_stresstest.ko \
$(LINUX_DIR)/drivers/mtd/tests/mtd_subpagetest.ko \
$(LINUX_DIR)/drivers/mtd/tests/mtd_test.ko \
$(LINUX_DIR)/drivers/mtd/tests/mtd_torturetest.ko
endef

View File

@@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=6.1.97-1
PKG_VERSION:=6.1.110-1
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v6.1.97/
PKG_HASH:=8e9ae2d02f373252dd61f5c6a81c88eec67ca773464d9ef3d844752dc6775540
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v6.1.110/
PKG_HASH:=2415bc529ca25be0aa597f9638d8b6fc4138080bbaea96881a38101896df6703
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
@@ -299,9 +299,6 @@ define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(PKG_UNPACK)
$(Build/Patch)
rm -rf \
$(PKG_BUILD_DIR)/include/linux/ssb \
$(PKG_BUILD_DIR)/include/linux/bcma
rm -f \
$(PKG_BUILD_DIR)/include/linux/mhi.h \

View File

@@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20221006005842.8599-1-quic_periyasa@quicinc.com
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6418,18 +6418,16 @@ static int ath11k_mac_op_add_interface(s
@@ -6425,18 +6425,16 @@ static int ath11k_mac_op_add_interface(s
ath11k_dp_vdev_tx_attach(ar, arvif);
@@ -42,7 +42,7 @@ Link: https://lore.kernel.org/r/20221006005842.8599-1-quic_periyasa@quicinc.com
mutex_unlock(&ar->conf_mutex);
return 0;
@@ -6454,7 +6452,6 @@ err_vdev_del:
@@ -6461,7 +6459,6 @@ err_vdev_del:
spin_unlock_bh(&ar->data_lock);
err:

View File

@@ -90,7 +90,7 @@ Link: https://lore.kernel.org/r/20221007051130.6067-1-quic_mpubbise@quicinc.com
exit:
kfree(arg.chan_list);
@@ -9065,6 +9087,9 @@ static int __ath11k_mac_register(struct
@@ -9072,6 +9094,9 @@ static int __ath11k_mac_register(struct
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP);
}

View File

@@ -21,7 +21,7 @@ Link: https://lore.kernel.org/r/20221011095346.3901-1-quic_ssreeela@quicinc.com
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6230,6 +6230,40 @@ void ath11k_mac_11d_scan_stop_all(struct
@@ -6237,6 +6237,40 @@ void ath11k_mac_11d_scan_stop_all(struct
}
}
@@ -62,7 +62,7 @@ Link: https://lore.kernel.org/r/20221011095346.3901-1-quic_ssreeela@quicinc.com
static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
@@ -6465,10 +6499,7 @@ err_peer_del:
@@ -6472,10 +6506,7 @@ err_peer_del:
}
err_vdev_del:
@@ -74,7 +74,7 @@ Link: https://lore.kernel.org/r/20221011095346.3901-1-quic_ssreeela@quicinc.com
spin_lock_bh(&ar->data_lock);
list_del(&arvif->list);
spin_unlock_bh(&ar->data_lock);
@@ -6496,7 +6527,6 @@ static void ath11k_mac_op_remove_interfa
@@ -6503,7 +6534,6 @@ static void ath11k_mac_op_remove_interfa
struct ath11k *ar = hw->priv;
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
struct ath11k_base *ab = ar->ab;
@@ -82,7 +82,7 @@ Link: https://lore.kernel.org/r/20221011095346.3901-1-quic_ssreeela@quicinc.com
int ret;
int i;
@@ -6517,29 +6547,13 @@ static void ath11k_mac_op_remove_interfa
@@ -6524,29 +6554,13 @@ static void ath11k_mac_op_remove_interfa
arvif->vdev_id, ret);
}

View File

@@ -96,7 +96,7 @@ Link: https://lore.kernel.org/r/20221104085403.11025-1-quic_youghand@quicinc.com
struct ath11k_hw_ops {
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -8007,6 +8007,7 @@ ath11k_mac_op_reconfig_complete(struct i
@@ -8014,6 +8014,7 @@ ath11k_mac_op_reconfig_complete(struct i
struct ath11k *ar = hw->priv;
struct ath11k_base *ab = ar->ab;
int recovery_count;
@@ -104,7 +104,7 @@ Link: https://lore.kernel.org/r/20221104085403.11025-1-quic_youghand@quicinc.com
if (reconfig_type != IEEE80211_RECONFIG_TYPE_RESTART)
return;
@@ -8042,6 +8043,12 @@ ath11k_mac_op_reconfig_complete(struct i
@@ -8049,6 +8050,12 @@ ath11k_mac_op_reconfig_complete(struct i
ath11k_dbg(ab, ATH11K_DBG_BOOT, "reset success\n");
}
}

View File

@@ -146,7 +146,7 @@ Link: https://lore.kernel.org/r/20221220044435.10506-1-quic_rajkbhag@quicinc.com
if (changed & BSS_CHANGED_FILS_DISCOVERY ||
changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP)
ath11k_mac_fils_discovery(arvif, info);
@@ -9118,6 +9132,10 @@ static int __ath11k_mac_register(struct
@@ -9125,6 +9139,10 @@ static int __ath11k_mac_register(struct
wiphy_ext_feature_set(ar->hw->wiphy,
NL80211_EXT_FEATURE_SET_SCAN_DWELL);

View File

@@ -179,7 +179,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-3-git-send-email-quic_msinada@q
ath11k_control_beaconing(arvif, info);
if (arvif->is_up && vif->bss_conf.he_support &&
@@ -5389,6 +5512,10 @@ static int ath11k_mac_copy_he_cap(struct
@@ -5388,6 +5511,10 @@ static int ath11k_mac_copy_he_cap(struct
he_cap_elem->mac_cap_info[1] &=
IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK;
@@ -190,7 +190,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-3-git-send-email-quic_msinada@q
he_cap_elem->phy_cap_info[5] &=
~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK;
@@ -6023,69 +6150,6 @@ ath11k_mac_setup_vdev_create_params(stru
@@ -6030,69 +6157,6 @@ ath11k_mac_setup_vdev_create_params(stru
}
}
@@ -260,7 +260,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-3-git-send-email-quic_msinada@q
static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
@@ -6754,7 +6818,6 @@ ath11k_mac_vdev_start_restart(struct ath
@@ -6761,7 +6825,6 @@ ath11k_mac_vdev_start_restart(struct ath
struct ath11k_base *ab = ar->ab;
struct wmi_vdev_start_req_arg arg = {};
const struct cfg80211_chan_def *chandef = &ctx->def;
@@ -268,7 +268,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-3-git-send-email-quic_msinada@q
int ret = 0;
lockdep_assert_held(&ar->conf_mutex);
@@ -6795,15 +6858,6 @@ ath11k_mac_vdev_start_restart(struct ath
@@ -6802,15 +6865,6 @@ ath11k_mac_vdev_start_restart(struct ath
spin_lock_bh(&ab->base_lock);
arg.regdomain = ar->ab->dfs_region;
spin_unlock_bh(&ab->base_lock);

View File

@@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-4-git-send-email-quic_msinada@q
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5480,6 +5480,27 @@ static __le16 ath11k_mac_setup_he_6ghz_c
@@ -5479,6 +5479,27 @@ static __le16 ath11k_mac_setup_he_6ghz_c
return cpu_to_le16(bcap->he_6ghz_capa);
}
@@ -45,7 +45,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-4-git-send-email-quic_msinada@q
static int ath11k_mac_copy_he_cap(struct ath11k *ar,
struct ath11k_pdev_cap *cap,
struct ieee80211_sband_iftype_data *data,
@@ -5541,18 +5562,7 @@ static int ath11k_mac_copy_he_cap(struct
@@ -5540,18 +5561,7 @@ static int ath11k_mac_copy_he_cap(struct
break;
}

View File

@@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/1666128501-12364-5-git-send-email-quic_msinada@q
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5485,20 +5485,36 @@ static void ath11k_mac_set_hemcsmap(stru
@@ -5484,20 +5484,36 @@ static void ath11k_mac_set_hemcsmap(stru
struct ieee80211_sta_he_cap *he_cap,
int band)
{

View File

@@ -36,7 +36,7 @@ Link: https://lore.kernel.org/r/20221219053844.4084486-1-quic_mkenna@quicinc.com
static int ath11k_hw_mac_id_to_pdev_id_ipq8074(struct ath11k_hw_params *hw,
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -9179,6 +9179,11 @@ static int __ath11k_mac_register(struct
@@ -9186,6 +9186,11 @@ static int __ath11k_mac_register(struct
goto err_free_if_combs;
}

View File

@@ -65,7 +65,7 @@ Link: https://lore.kernel.org/r/20230309164434.32660-1-quic_hprem@quicinc.com
return 0;
}
@@ -3038,39 +3015,51 @@ static int ath11k_dp_rx_reap_mon_status_
@@ -3037,39 +3014,51 @@ static int ath11k_dp_rx_reap_mon_status_
spin_lock_bh(&rx_ring->idr_lock);
skb = idr_find(&rx_ring->bufs_idr, buf_id);

View File

@@ -106,7 +106,7 @@ Link: https://lore.kernel.org/r/20230317072034.8217-1-quic_gjothira@quicinc.com
(vif->type == NL80211_IFTYPE_AP ||
vif->type == NL80211_IFTYPE_MESH_POINT)) {
arvif->ftm_responder = info->ftm_responder;
@@ -9239,7 +9239,7 @@ static int __ath11k_mac_register(struct
@@ -9246,7 +9246,7 @@ static int __ath11k_mac_register(struct
wiphy_ext_feature_set(ar->hw->wiphy,
NL80211_EXT_FEATURE_SET_SCAN_DWELL);

View File

@@ -22,7 +22,7 @@ Link: https://lore.kernel.org/r/20230328071150.29645-1-quic_tamizhr@quicinc.com
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6682,6 +6682,11 @@ static void ath11k_mac_op_remove_interfa
@@ -6689,6 +6689,11 @@ static void ath11k_mac_op_remove_interfa
ath11k_dbg(ab, ATH11K_DBG_MAC, "mac remove interface (vdev %d)\n",
arvif->vdev_id);

View File

@@ -19,7 +19,7 @@ Link: https://lore.kernel.org/r/20230405090425.1351-1-kvalo@kernel.org
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -3115,8 +3115,11 @@ int ath11k_peer_rx_frag_setup(struct ath
@@ -3114,8 +3114,11 @@ int ath11k_peer_rx_frag_setup(struct ath
int i;
tfm = crypto_alloc_shash("michael_mic", 0, 0);

View File

@@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/20230403184155.8670-3-quic_nmaran@quicinc.com
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -3607,7 +3607,7 @@ static int ath11k_dp_rx_frag_h_mpdu(stru
@@ -3606,7 +3606,7 @@ static int ath11k_dp_rx_frag_h_mpdu(stru
goto out_unlock;
}

View File

@@ -24,7 +24,7 @@ Link: https://lore.kernel.org/r/1681762947-13882-1-git-send-email-quic_msinada@q
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5582,10 +5582,6 @@ static int ath11k_mac_copy_he_cap(struct
@@ -5581,10 +5581,6 @@ static int ath11k_mac_copy_he_cap(struct
he_cap_elem->mac_cap_info[1] &=
IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK;

View File

@@ -56,7 +56,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-2-quic_alokad@quicinc.com
#define ATH11K_QUEUE_LEN 4096
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -9006,19 +9006,23 @@ static int ath11k_mac_setup_iface_combin
@@ -9013,19 +9013,23 @@ static int ath11k_mac_setup_iface_combin
static const u8 ath11k_if_types_ext_capa[] = {
[0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
@@ -80,7 +80,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-2-quic_alokad@quicinc.com
};
static const struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = {
@@ -9256,6 +9260,9 @@ static int __ath11k_mac_register(struct
@@ -9263,6 +9267,9 @@ static int __ath11k_mac_register(struct
wiphy_ext_feature_set(ar->hw->wiphy,
NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);

View File

@@ -23,7 +23,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6178,17 +6178,62 @@ static void ath11k_mac_op_stop(struct ie
@@ -6185,17 +6185,62 @@ static void ath11k_mac_op_stop(struct ie
atomic_set(&ar->num_pending_mgmt_tx, 0);
}
@@ -89,7 +89,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com
if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) {
params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains;
@@ -6203,6 +6248,7 @@ ath11k_mac_setup_vdev_create_params(stru
@@ -6210,6 +6255,7 @@ ath11k_mac_setup_vdev_create_params(stru
params->chains[NL80211_BAND_6GHZ].tx = ar->num_tx_chains;
params->chains[NL80211_BAND_6GHZ].rx = ar->num_rx_chains;
}
@@ -97,7 +97,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com
}
static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
@@ -6497,7 +6543,12 @@ static int ath11k_mac_op_add_interface(s
@@ -6504,7 +6550,12 @@ static int ath11k_mac_op_add_interface(s
for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++)
vif->hw_queue[i] = i % (ATH11K_HW_MAX_QUEUES - 1);
@@ -111,7 +111,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com
ret = ath11k_wmi_vdev_create(ar, vif->addr, &vdev_param);
if (ret) {
@@ -6902,6 +6953,17 @@ ath11k_mac_vdev_start_restart(struct ath
@@ -6909,6 +6960,17 @@ ath11k_mac_vdev_start_restart(struct ath
arg.pref_tx_streams = ar->num_tx_chains;
arg.pref_rx_streams = ar->num_rx_chains;

View File

@@ -63,7 +63,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com
if (ret) {
ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n",
arvif->vdev_id, ret);
@@ -7130,7 +7138,8 @@ ath11k_mac_update_vif_chan(struct ath11k
@@ -7137,7 +7145,8 @@ ath11k_mac_update_vif_chan(struct ath11k
int n_vifs)
{
struct ath11k_base *ab = ar->ab;
@@ -73,7 +73,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com
int ret;
int i;
bool monitor_vif = false;
@@ -7184,8 +7193,15 @@ ath11k_mac_update_vif_chan(struct ath11k
@@ -7191,8 +7200,15 @@ ath11k_mac_update_vif_chan(struct ath11k
ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
ret);
@@ -90,7 +90,7 @@ Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com
if (ret) {
ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
arvif->vdev_id, ret);
@@ -7303,7 +7319,8 @@ static int ath11k_start_vdev_delay(struc
@@ -7310,7 +7326,8 @@ static int ath11k_start_vdev_delay(struc
}
if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {

View File

@@ -31,7 +31,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com
*/
#include <net/mac80211.h>
@@ -4335,6 +4335,20 @@ exit:
@@ -4334,6 +4334,20 @@ exit:
}
static int
@@ -52,7 +52,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com
ath11k_mac_bitrate_mask_num_vht_rates(struct ath11k *ar,
enum nl80211_band band,
const struct cfg80211_bitrate_mask *mask)
@@ -7788,20 +7802,6 @@ static void ath11k_mac_op_flush(struct i
@@ -7795,20 +7809,6 @@ static void ath11k_mac_op_flush(struct i
ath11k_mac_flush_tx_complete(ar);
}

View File

@@ -27,7 +27,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -4477,6 +4477,54 @@ ath11k_mac_set_peer_he_fixed_rate(struct
@@ -4476,6 +4476,54 @@ ath11k_mac_set_peer_he_fixed_rate(struct
return ret;
}
@@ -82,7 +82,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
static int ath11k_station_assoc(struct ath11k *ar,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
@@ -4488,7 +4536,7 @@ static int ath11k_station_assoc(struct a
@@ -4487,7 +4535,7 @@ static int ath11k_station_assoc(struct a
struct cfg80211_chan_def def;
enum nl80211_band band;
struct cfg80211_bitrate_mask *mask;
@@ -91,7 +91,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
lockdep_assert_held(&ar->conf_mutex);
@@ -4516,6 +4564,7 @@ static int ath11k_station_assoc(struct a
@@ -4515,6 +4563,7 @@ static int ath11k_station_assoc(struct a
num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band, mask);
num_he_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band, mask);
@@ -99,7 +99,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
/* If single VHT/HE rate is configured (by set_bitrate_mask()),
* peer_assoc will disable VHT/HE. This is now enabled by a peer specific
@@ -4532,6 +4581,11 @@ static int ath11k_station_assoc(struct a
@@ -4531,6 +4580,11 @@ static int ath11k_station_assoc(struct a
band);
if (ret)
return ret;
@@ -111,7 +111,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
}
/* Re-assoc is run only to update supported rates for given station. It
@@ -4605,7 +4659,7 @@ static void ath11k_sta_rc_update_wk(stru
@@ -4604,7 +4658,7 @@ static void ath11k_sta_rc_update_wk(stru
const u16 *vht_mcs_mask;
const u16 *he_mcs_mask;
u32 changed, bw, nss, smps, bw_prev;
@@ -120,7 +120,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
const struct cfg80211_bitrate_mask *mask;
struct peer_assoc_params peer_arg;
enum wmi_phy_mode peer_phymode;
@@ -4721,6 +4775,8 @@ static void ath11k_sta_rc_update_wk(stru
@@ -4720,6 +4774,8 @@ static void ath11k_sta_rc_update_wk(stru
if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) {
mask = &arvif->bitrate_mask;
@@ -129,7 +129,7 @@ Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com
num_vht_rates = ath11k_mac_bitrate_mask_num_vht_rates(ar, band,
mask);
num_he_rates = ath11k_mac_bitrate_mask_num_he_rates(ar, band,
@@ -4743,6 +4799,9 @@ static void ath11k_sta_rc_update_wk(stru
@@ -4742,6 +4798,9 @@ static void ath11k_sta_rc_update_wk(stru
} else if (sta->deflink.he_cap.has_he && num_he_rates == 1) {
ath11k_mac_set_peer_he_fixed_rate(arvif, sta, mask,
band);

View File

@@ -226,7 +226,7 @@ Link: https://lore.kernel.org/r/20230517135934.16408-4-quic_rajkbhag@quicinc.com
if (pdev && pdev->pdev_id == pdev_id)
return (pdev->ar ? pdev->ar : NULL);
@@ -6268,6 +6271,11 @@ static int ath11k_mac_op_start(struct ie
@@ -6275,6 +6278,11 @@ static int ath11k_mac_op_start(struct ie
struct ath11k_pdev *pdev = ar->pdev;
int ret;
@@ -238,7 +238,7 @@ Link: https://lore.kernel.org/r/20230517135934.16408-4-quic_rajkbhag@quicinc.com
ath11k_mac_drain_tx(ar);
mutex_lock(&ar->conf_mutex);
@@ -6282,6 +6290,7 @@ static int ath11k_mac_op_start(struct ie
@@ -6289,6 +6297,7 @@ static int ath11k_mac_op_start(struct ie
case ATH11K_STATE_RESTARTED:
case ATH11K_STATE_WEDGED:
case ATH11K_STATE_ON:

View File

@@ -1,314 +0,0 @@
--- a/local-symbols
+++ b/local-symbols
@@ -462,43 +462,6 @@ USB_VL600=
USB_NET_CH9200=
USB_NET_AQC111=
USB_RTL8153_ECM=
-SSB_POSSIBLE=
-SSB=
-SSB_SPROM=
-SSB_BLOCKIO=
-SSB_PCIHOST_POSSIBLE=
-SSB_PCIHOST=
-SSB_B43_PCI_BRIDGE=
-SSB_PCMCIAHOST_POSSIBLE=
-SSB_PCMCIAHOST=
-SSB_SDIOHOST_POSSIBLE=
-SSB_SDIOHOST=
-SSB_HOST_SOC=
-SSB_SERIAL=
-SSB_DRIVER_PCICORE_POSSIBLE=
-SSB_DRIVER_PCICORE=
-SSB_PCICORE_HOSTMODE=
-SSB_DRIVER_MIPS=
-SSB_SFLASH=
-SSB_EMBEDDED=
-SSB_DRIVER_EXTIF=
-SSB_DRIVER_GIGE=
-SSB_DRIVER_GPIO=
-BCMA_POSSIBLE=
-BCMA=
-BCMA_BLOCKIO=
-BCMA_HOST_PCI_POSSIBLE=
-BCMA_HOST_PCI=
-BCMA_HOST_SOC=
-BCMA_DRIVER_PCI=
-BCMA_DRIVER_PCI_HOSTMODE=
-BCMA_DRIVER_MIPS=
-BCMA_PFLASH=
-BCMA_SFLASH=
-BCMA_NFLASH=
-BCMA_DRIVER_GMAC_CMN=
-BCMA_DRIVER_GPIO=
-BCMA_DEBUG=
USB_ACM=
USB_PRINTER=
USB_WDM=
--- a/drivers/net/wireless/broadcom/b43/Kconfig
+++ b/drivers/net/wireless/broadcom/b43/Kconfig
@@ -63,21 +63,21 @@ endchoice
config B43_PCI_AUTOSELECT
bool
depends on B43 && SSB_PCIHOST_POSSIBLE
- select SSB_PCIHOST
- select SSB_B43_PCI_BRIDGE
+ depends on SSB_PCIHOST
+ depends on SSB_B43_PCI_BRIDGE
default y
# Auto-select SSB PCICORE driver, if possible
config B43_PCICORE_AUTOSELECT
bool
depends on B43 && SSB_DRIVER_PCICORE_POSSIBLE
- select SSB_DRIVER_PCICORE
+ depends on SSB_DRIVER_PCICORE
default y
config B43_SDIO
bool "Broadcom 43xx SDIO device support"
depends on B43 && B43_SSB && SSB_SDIOHOST_POSSIBLE
- select SSB_SDIOHOST
+ depends on SSB_SDIOHOST
help
Broadcom 43xx device support for Soft-MAC SDIO devices.
@@ -96,13 +96,13 @@ config B43_SDIO
config B43_BCMA_PIO
bool
depends on B43 && B43_BCMA
- select BCMA_BLOCKIO
+ depends on BCMA_BLOCKIO
default y
config B43_PIO
bool
depends on B43 && B43_SSB
- select SSB_BLOCKIO
+ depends on SSB_BLOCKIO
default y
config B43_PHY_G
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -2854,7 +2854,7 @@ static struct ssb_device *b43_ssb_gpio_d
{
struct ssb_bus *bus = dev->dev->sdev->bus;
-#ifdef CPTCFG_SSB_DRIVER_PCICORE
+#ifdef CONFIG_SSB_DRIVER_PCICORE
return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev);
#else
return bus->chipco.dev;
@@ -4873,7 +4873,7 @@ static int b43_wireless_core_init(struct
}
if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW)
hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */
-#if defined(CPTCFG_B43_SSB) && defined(CPTCFG_SSB_DRIVER_PCICORE)
+#if defined(CPTCFG_B43_SSB) && defined(CONFIG_SSB_DRIVER_PCICORE)
if (dev->dev->bus_type == B43_BUS_SSB &&
dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI &&
dev->dev->sdev->bus->pcicore.dev->id.revision <= 10)
--- a/drivers/net/wireless/broadcom/b43legacy/Kconfig
+++ b/drivers/net/wireless/broadcom/b43legacy/Kconfig
@@ -3,7 +3,7 @@ config B43LEGACY
tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)"
depends on m
depends on SSB_POSSIBLE && MAC80211 && HAS_DMA
- select SSB
+ depends on SSB
depends on FW_LOADER
help
b43legacy is a driver for 802.11b devices from Broadcom (BCM4301 and
@@ -25,15 +25,15 @@ config B43LEGACY
config B43LEGACY_PCI_AUTOSELECT
bool
depends on B43LEGACY && SSB_PCIHOST_POSSIBLE
- select SSB_PCIHOST
- select SSB_B43_PCI_BRIDGE
+ depends on SSB_PCIHOST
+ depends on SSB_B43_PCI_BRIDGE
default y
# Auto-select SSB PCICORE driver, if possible
config B43LEGACY_PCICORE_AUTOSELECT
bool
depends on B43LEGACY && SSB_DRIVER_PCICORE_POSSIBLE
- select SSB_DRIVER_PCICORE
+ depends on SSB_DRIVER_PCICORE
default y
# LED support
--- a/drivers/net/wireless/broadcom/b43legacy/main.c
+++ b/drivers/net/wireless/broadcom/b43legacy/main.c
@@ -1907,7 +1907,7 @@ static int b43legacy_gpio_init(struct b4
if (dev->dev->id.revision >= 2)
mask |= 0x0010; /* FIXME: This is redundant. */
-#ifdef CPTCFG_SSB_DRIVER_PCICORE
+#ifdef CONFIG_SSB_DRIVER_PCICORE
pcidev = bus->pcicore.dev;
#endif
gpiodev = bus->chipco.dev ? : pcidev;
@@ -1926,7 +1926,7 @@ static void b43legacy_gpio_cleanup(struc
struct ssb_bus *bus = dev->dev->bus;
struct ssb_device *gpiodev, *pcidev = NULL;
-#ifdef CPTCFG_SSB_DRIVER_PCICORE
+#ifdef CONFIG_SSB_DRIVER_PCICORE
pcidev = bus->pcicore.dev;
#endif
gpiodev = bus->chipco.dev ? : pcidev;
--- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
+++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
@@ -8,7 +8,7 @@ config BRCMSMAC
depends on m
depends on MAC80211
depends on BCMA_POSSIBLE
- select BCMA
+ depends on BCMA
select BRCMUTIL
depends on FW_LOADER
depends on CORDIC
--- a/Kconfig.local
+++ b/Kconfig.local
@@ -1390,117 +1390,6 @@ config BACKPORTED_USB_NET_AQC111
config BACKPORTED_USB_RTL8153_ECM
tristate
default USB_RTL8153_ECM
-config BACKPORTED_SSB_POSSIBLE
- tristate
- default SSB_POSSIBLE
-config BACKPORTED_SSB
- tristate
- default SSB
-config BACKPORTED_SSB_SPROM
- tristate
- default SSB_SPROM
-config BACKPORTED_SSB_BLOCKIO
- tristate
- default SSB_BLOCKIO
-config BACKPORTED_SSB_PCIHOST_POSSIBLE
- tristate
- default SSB_PCIHOST_POSSIBLE
-config BACKPORTED_SSB_PCIHOST
- tristate
- default SSB_PCIHOST
-config BACKPORTED_SSB_B43_PCI_BRIDGE
- tristate
- default SSB_B43_PCI_BRIDGE
-config BACKPORTED_SSB_PCMCIAHOST_POSSIBLE
- tristate
- default SSB_PCMCIAHOST_POSSIBLE
-config BACKPORTED_SSB_PCMCIAHOST
- tristate
- default SSB_PCMCIAHOST
-config BACKPORTED_SSB_SDIOHOST_POSSIBLE
- tristate
- default SSB_SDIOHOST_POSSIBLE
-config BACKPORTED_SSB_SDIOHOST
- tristate
- default SSB_SDIOHOST
-config BACKPORTED_SSB_HOST_SOC
- tristate
- default SSB_HOST_SOC
-config BACKPORTED_SSB_SERIAL
- tristate
- default SSB_SERIAL
-config BACKPORTED_SSB_DRIVER_PCICORE_POSSIBLE
- tristate
- default SSB_DRIVER_PCICORE_POSSIBLE
-config BACKPORTED_SSB_DRIVER_PCICORE
- tristate
- default SSB_DRIVER_PCICORE
-config BACKPORTED_SSB_PCICORE_HOSTMODE
- tristate
- default SSB_PCICORE_HOSTMODE
-config BACKPORTED_SSB_DRIVER_MIPS
- tristate
- default SSB_DRIVER_MIPS
-config BACKPORTED_SSB_SFLASH
- tristate
- default SSB_SFLASH
-config BACKPORTED_SSB_EMBEDDED
- tristate
- default SSB_EMBEDDED
-config BACKPORTED_SSB_DRIVER_EXTIF
- tristate
- default SSB_DRIVER_EXTIF
-config BACKPORTED_SSB_DRIVER_GIGE
- tristate
- default SSB_DRIVER_GIGE
-config BACKPORTED_SSB_DRIVER_GPIO
- tristate
- default SSB_DRIVER_GPIO
-config BACKPORTED_BCMA_POSSIBLE
- tristate
- default BCMA_POSSIBLE
-config BACKPORTED_BCMA
- tristate
- default BCMA
-config BACKPORTED_BCMA_BLOCKIO
- tristate
- default BCMA_BLOCKIO
-config BACKPORTED_BCMA_HOST_PCI_POSSIBLE
- tristate
- default BCMA_HOST_PCI_POSSIBLE
-config BACKPORTED_BCMA_HOST_PCI
- tristate
- default BCMA_HOST_PCI
-config BACKPORTED_BCMA_HOST_SOC
- tristate
- default BCMA_HOST_SOC
-config BACKPORTED_BCMA_DRIVER_PCI
- tristate
- default BCMA_DRIVER_PCI
-config BACKPORTED_BCMA_DRIVER_PCI_HOSTMODE
- tristate
- default BCMA_DRIVER_PCI_HOSTMODE
-config BACKPORTED_BCMA_DRIVER_MIPS
- tristate
- default BCMA_DRIVER_MIPS
-config BACKPORTED_BCMA_PFLASH
- tristate
- default BCMA_PFLASH
-config BACKPORTED_BCMA_SFLASH
- tristate
- default BCMA_SFLASH
-config BACKPORTED_BCMA_NFLASH
- tristate
- default BCMA_NFLASH
-config BACKPORTED_BCMA_DRIVER_GMAC_CMN
- tristate
- default BCMA_DRIVER_GMAC_CMN
-config BACKPORTED_BCMA_DRIVER_GPIO
- tristate
- default BCMA_DRIVER_GPIO
-config BACKPORTED_BCMA_DEBUG
- tristate
- default BCMA_DEBUG
config BACKPORTED_USB_ACM
tristate
default USB_ACM
--- a/Kconfig.sources
+++ b/Kconfig.sources
@@ -10,9 +10,6 @@ source "$BACKPORT_DIR/drivers/soc/qcom/K
source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
-source "$BACKPORT_DIR/drivers/ssb/Kconfig"
-source "$BACKPORT_DIR/drivers/bcma/Kconfig"
-
source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
source "$BACKPORT_DIR/drivers/staging/Kconfig"
--- a/Makefile.kernel
+++ b/Makefile.kernel
@@ -42,8 +42,6 @@ obj-$(CPTCFG_QRTR) += net/qrtr/
obj-$(CPTCFG_QCOM_QMI_HELPERS) += drivers/soc/qcom/
obj-$(CPTCFG_MHI_BUS) += drivers/bus/mhi/
obj-$(CPTCFG_WLAN) += drivers/net/wireless/
-obj-$(CPTCFG_SSB) += drivers/ssb/
-obj-$(CPTCFG_BCMA) += drivers/bcma/
obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/
obj-$(CPTCFG_USB_WDM) += drivers/usb/class/

View File

@@ -1,13 +0,0 @@
--- /dev/null
+++ b/backport-include/linux/bcma/bcma_driver_chipcommon.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_BCMA_DRIVER_CHIPCOMMON_H
+#define __BACKPORT_BCMA_DRIVER_CHIPCOMMON_H
+
+#include_next <linux/bcma/bcma_driver_chipcommon.h>
+
+#ifndef BCMA_CC_SROM_CONTROL_OTP_PRESENT
+#define BCMA_CC_SROM_CONTROL_OTP_PRESENT 0x00000020
+#endif
+
+#endif

View File

@@ -1,6 +1,6 @@
--- a/local-symbols
+++ b/local-symbols
@@ -339,6 +339,7 @@ RT2X00_LIB_FIRMWARE=
@@ -341,6 +341,7 @@ RT2X00_LIB_FIRMWARE=
RT2X00_LIB_CRYPTO=
RT2X00_LIB_LEDS=
RT2X00_LIB_DEBUGFS=

View File

@@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey)
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2733,6 +2733,8 @@ static int ieee80211_scan(struct wiphy *
@@ -2734,6 +2734,8 @@ static int ieee80211_scan(struct wiphy *
*/
fallthrough;
case NL80211_IFTYPE_AP:

View File

@@ -36,7 +36,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
.remove_interface = ar5523_remove_interface,
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -8592,6 +8592,7 @@ err_fallback:
@@ -8599,6 +8599,7 @@ err_fallback:
static const struct ieee80211_ops ath11k_ops = {
.tx = ath11k_mac_op_tx,

View File

@@ -11,7 +11,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4357,9 +4357,6 @@ static int ieee80211_get_txq_stats(struc
@@ -4359,9 +4359,6 @@ static int ieee80211_get_txq_stats(struc
struct ieee80211_sub_if_data *sdata;
int ret = 0;
@@ -36,7 +36,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -677,8 +677,7 @@ static void add_common_files(struct ieee
@@ -675,8 +675,7 @@ static void add_common_files(struct ieee
DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_5ghz);
DEBUGFS_ADD(hw_queues);
@@ -63,7 +63,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
NL80211_EXT_FEATURE_AQL))
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2300,7 +2300,6 @@ void ieee80211_wake_queue_by_reason(stru
@@ -2301,7 +2301,6 @@ void ieee80211_wake_queue_by_reason(stru
void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason,
bool refcounted);
@@ -73,7 +73,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
void ieee80211_add_pending_skbs(struct ieee80211_local *local,
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -460,12 +460,6 @@ static void ieee80211_do_stop(struct iee
@@ -481,12 +481,6 @@ static void ieee80211_do_stop(struct iee
if (cancel_scan)
ieee80211_scan_cancel(local);
@@ -86,7 +86,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ieee80211_roc_purge(local, sdata);
switch (sdata->vif.type) {
@@ -813,25 +807,6 @@ static void ieee80211_uninit(struct net_
@@ -834,25 +828,6 @@ static void ieee80211_uninit(struct net_
ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev));
}
@@ -112,7 +112,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
static void
ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{
@@ -845,7 +820,6 @@ static const struct net_device_ops ieee8
@@ -866,7 +841,6 @@ static const struct net_device_ops ieee8
.ndo_start_xmit = ieee80211_subif_start_xmit,
.ndo_set_rx_mode = ieee80211_set_multicast_list,
.ndo_set_mac_address = ieee80211_change_mac,
@@ -120,7 +120,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
.ndo_get_stats64 = ieee80211_get_stats64,
};
@@ -967,7 +941,6 @@ static const struct net_device_ops ieee8
@@ -988,7 +962,6 @@ static const struct net_device_ops ieee8
.ndo_start_xmit = ieee80211_subif_start_xmit_8023,
.ndo_set_rx_mode = ieee80211_set_multicast_list,
.ndo_set_mac_address = ieee80211_change_mac,
@@ -128,7 +128,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
.ndo_get_stats64 = ieee80211_get_stats64,
#if LINUX_VERSION_IS_GEQ(5,13,0)
.ndo_fill_forward_path = ieee80211_netdev_fill_forward_path,
@@ -1471,35 +1444,6 @@ int ieee80211_do_open(struct wireless_de
@@ -1492,35 +1465,6 @@ int ieee80211_do_open(struct wireless_de
ieee80211_recalc_ps(local);
@@ -164,7 +164,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
set_bit(SDATA_STATE_RUNNING, &sdata->state);
return 0;
@@ -1529,17 +1473,12 @@ static void ieee80211_if_setup(struct ne
@@ -1550,17 +1494,12 @@ static void ieee80211_if_setup(struct ne
{
ether_setup(dev);
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
@@ -183,7 +183,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
static void ieee80211_iface_process_skb(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb)
@@ -2124,9 +2063,7 @@ int ieee80211_if_add(struct ieee80211_lo
@@ -2145,9 +2084,7 @@ int ieee80211_if_add(struct ieee80211_lo
struct net_device *ndev = NULL;
struct ieee80211_sub_if_data *sdata = NULL;
struct txq_info *txqi;
@@ -193,7 +193,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ASSERT_RTNL();
@@ -2149,30 +2086,18 @@ int ieee80211_if_add(struct ieee80211_lo
@@ -2170,30 +2107,18 @@ int ieee80211_if_add(struct ieee80211_lo
sizeof(void *));
int txq_size = 0;
@@ -228,7 +228,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ndev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -627,7 +627,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
@@ -634,7 +634,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
if (WARN_ON(!ops->tx || !ops->start || !ops->stop || !ops->config ||
!ops->add_interface || !ops->remove_interface ||
@@ -237,7 +237,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
return NULL;
if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
@@ -716,9 +716,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
@@ -723,9 +723,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
if (!ops->set_key)
wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
@@ -248,7 +248,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM);
wiphy->bss_priv_size = sizeof(struct ieee80211_bss);
@@ -831,10 +829,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
@@ -838,10 +836,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
atomic_set(&local->agg_queue_stop[i], 0);
}
tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending);
@@ -317,7 +317,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
int i;
sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
@@ -600,21 +599,18 @@ __sta_info_alloc(struct ieee80211_sub_if
@@ -603,21 +602,18 @@ __sta_info_alloc(struct ieee80211_sub_if
sta->last_connected = ktime_get_seconds();
@@ -348,7 +348,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
}
if (sta_prepare_rate_control(local, sta, gfp))
@@ -688,8 +684,7 @@ __sta_info_alloc(struct ieee80211_sub_if
@@ -691,8 +687,7 @@ __sta_info_alloc(struct ieee80211_sub_if
return sta;
free_txq:
@@ -358,7 +358,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
free:
sta_info_free_link(&sta->deflink);
#ifdef CPTCFG_MAC80211_MESH
@@ -1965,9 +1960,6 @@ ieee80211_sta_ps_deliver_response(struct
@@ -1982,9 +1977,6 @@ ieee80211_sta_ps_deliver_response(struct
* TIM recalculation.
*/
@@ -368,7 +368,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
if (!sta->sta.txq[tid] ||
!(driver_release_tids & BIT(tid)) ||
@@ -2452,7 +2444,7 @@ static void sta_set_tidstats(struct sta_
@@ -2469,7 +2461,7 @@ static void sta_set_tidstats(struct sta_
tidstats->tx_msdu_failed = sta->deflink.status_stats.msdu_failed[tid];
}
@@ -377,7 +377,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
spin_lock_bh(&local->fq.lock);
rcu_read_lock();
@@ -2780,9 +2772,6 @@ unsigned long ieee80211_sta_last_active(
@@ -2797,9 +2789,6 @@ unsigned long ieee80211_sta_last_active(
static void sta_update_codel_params(struct sta_info *sta, u32 thr)
{

View File

@@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -2197,6 +2197,7 @@ int ieee80211_if_add(struct ieee80211_lo
@@ -2218,6 +2218,7 @@ int ieee80211_if_add(struct ieee80211_lo
ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
ndev->hw_features |= ndev->features &
MAC80211_SUPPORTED_FEATURES_TX;

View File

@@ -1,87 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 1 Dec 2022 14:57:30 +0100
Subject: [PATCH] wifi: mac80211: fix and simplify unencrypted drop check for
mesh
ieee80211_drop_unencrypted is called from ieee80211_rx_h_mesh_fwding and
ieee80211_frame_allowed.
Since ieee80211_rx_h_mesh_fwding can forward packets for other mesh nodes
and is called earlier, it needs to check the decryptions status and if the
packet is using the control protocol on its own, instead of deferring to
the later call from ieee80211_frame_allowed.
Because of that, ieee80211_drop_unencrypted has a mesh specific check
that skips over the mesh header in order to check the payload protocol.
This code is invalid when called from ieee80211_frame_allowed, since that
happens after the 802.11->802.3 conversion.
Fix this by moving the mesh specific check directly into
ieee80211_rx_h_mesh_fwding.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20221201135730.19723-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2405,7 +2405,6 @@ static int ieee80211_802_1x_port_control
static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
{
- struct ieee80211_hdr *hdr = (void *)rx->skb->data;
struct sk_buff *skb = rx->skb;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
@@ -2416,31 +2415,6 @@ static int ieee80211_drop_unencrypted(st
if (status->flag & RX_FLAG_DECRYPTED)
return 0;
- /* check mesh EAPOL frames first */
- if (unlikely(rx->sta && ieee80211_vif_is_mesh(&rx->sdata->vif) &&
- ieee80211_is_data(fc))) {
- struct ieee80211s_hdr *mesh_hdr;
- u16 hdr_len = ieee80211_hdrlen(fc);
- u16 ethertype_offset;
- __be16 ethertype;
-
- if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr))
- goto drop_check;
-
- /* make sure fixed part of mesh header is there, also checks skb len */
- if (!pskb_may_pull(rx->skb, hdr_len + 6))
- goto drop_check;
-
- mesh_hdr = (struct ieee80211s_hdr *)(skb->data + hdr_len);
- ethertype_offset = hdr_len + ieee80211_get_mesh_hdrlen(mesh_hdr) +
- sizeof(rfc1042_header);
-
- if (skb_copy_bits(rx->skb, ethertype_offset, &ethertype, 2) == 0 &&
- ethertype == rx->sdata->control_port_protocol)
- return 0;
- }
-
-drop_check:
/* Drop unencrypted frames if key is set. */
if (unlikely(!ieee80211_has_protected(fc) &&
!ieee80211_is_any_nullfunc(fc) &&
@@ -2898,8 +2872,16 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
hdr = (struct ieee80211_hdr *) skb->data;
mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
- if (ieee80211_drop_unencrypted(rx, hdr->frame_control))
- return RX_DROP_MONITOR;
+ if (ieee80211_drop_unencrypted(rx, hdr->frame_control)) {
+ int offset = hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr) +
+ sizeof(rfc1042_header);
+ __be16 ethertype;
+
+ if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr) ||
+ skb_copy_bits(rx->skb, offset, &ethertype, 2) != 0 ||
+ ethertype != rx->sdata->control_port_protocol)
+ return RX_DROP_MONITOR;
+ }
/* frame is in RMC, don't forward */
if (ieee80211_is_data(hdr->frame_control) &&

View File

@@ -1,25 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 2 Dec 2022 13:53:11 +0100
Subject: [PATCH] wifi: cfg80211: move A-MSDU check in
ieee80211_data_to_8023_exthdr
When parsing the outer A-MSDU header, don't check for inner bridge tunnel
or RFC1042 headers. This is handled by ieee80211_amsdu_to_8023s already.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -631,8 +631,9 @@ int ieee80211_data_to_8023_exthdr(struct
break;
}
- if (likely(skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
- ((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) &&
+ if (likely(!is_amsdu &&
+ skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
+ ((ether_addr_equal(payload.hdr, rfc1042_header) &&
payload.proto != htons(ETH_P_AARP) &&
payload.proto != htons(ETH_P_IPX)) ||
ether_addr_equal(payload.hdr, bridge_tunnel_header)))) {

View File

@@ -1,76 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 2 Dec 2022 13:54:15 +0100
Subject: [PATCH] wifi: cfg80211: factor out bridge tunnel / RFC1042 header
check
The same check is done in multiple places, unify it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -542,6 +542,21 @@ unsigned int ieee80211_get_mesh_hdrlen(s
}
EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
+static bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto)
+{
+ const __be16 *hdr_proto = hdr + ETH_ALEN;
+
+ if (!(ether_addr_equal(hdr, rfc1042_header) &&
+ *hdr_proto != htons(ETH_P_AARP) &&
+ *hdr_proto != htons(ETH_P_IPX)) &&
+ !ether_addr_equal(hdr, bridge_tunnel_header))
+ return false;
+
+ *proto = *hdr_proto;
+
+ return true;
+}
+
int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
const u8 *addr, enum nl80211_iftype iftype,
u8 data_offset, bool is_amsdu)
@@ -633,14 +648,9 @@ int ieee80211_data_to_8023_exthdr(struct
if (likely(!is_amsdu &&
skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
- ((ether_addr_equal(payload.hdr, rfc1042_header) &&
- payload.proto != htons(ETH_P_AARP) &&
- payload.proto != htons(ETH_P_IPX)) ||
- ether_addr_equal(payload.hdr, bridge_tunnel_header)))) {
- /* remove RFC1042 or Bridge-Tunnel encapsulation and
- * replace EtherType */
+ ieee80211_get_8023_tunnel_proto(&payload, &tmp.h_proto))) {
+ /* remove RFC1042 or Bridge-Tunnel encapsulation */
hdrlen += ETH_ALEN + 2;
- tmp.h_proto = payload.proto;
skb_postpull_rcsum(skb, &payload, ETH_ALEN + 2);
} else {
tmp.h_proto = htons(skb->len - hdrlen);
@@ -756,8 +766,6 @@ void ieee80211_amsdu_to_8023s(struct sk_
{
unsigned int hlen = ALIGN(extra_headroom, 4);
struct sk_buff *frame = NULL;
- u16 ethertype;
- u8 *payload;
int offset = 0, remaining;
struct ethhdr eth;
bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb);
@@ -811,14 +819,8 @@ void ieee80211_amsdu_to_8023s(struct sk_
frame->dev = skb->dev;
frame->priority = skb->priority;
- payload = frame->data;
- ethertype = (payload[6] << 8) | payload[7];
- if (likely((ether_addr_equal(payload, rfc1042_header) &&
- ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
- ether_addr_equal(payload, bridge_tunnel_header))) {
- eth.h_proto = htons(ethertype);
+ if (likely(ieee80211_get_8023_tunnel_proto(frame->data, &eth.h_proto)))
skb_pull(frame, ETH_ALEN + 2);
- }
memcpy(skb_push(frame, sizeof(eth)), &eth, sizeof(eth));
__skb_queue_tail(list, frame);

View File

@@ -1,54 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 2 Dec 2022 17:01:46 +0100
Subject: [PATCH] wifi: mac80211: remove mesh forwarding congestion check
Now that all drivers use iTXQ, it does not make sense to check to drop
tx forwarding packets when the driver has stopped the queues.
fq_codel will take care of dropping packets when the queues fill up
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -603,8 +603,6 @@ IEEE80211_IF_FILE(fwded_mcast, u.mesh.ms
IEEE80211_IF_FILE(fwded_unicast, u.mesh.mshstats.fwded_unicast, DEC);
IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC);
IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
-IEEE80211_IF_FILE(dropped_frames_congestion,
- u.mesh.mshstats.dropped_frames_congestion, DEC);
IEEE80211_IF_FILE(dropped_frames_no_route,
u.mesh.mshstats.dropped_frames_no_route, DEC);
@@ -740,7 +738,6 @@ static void add_mesh_stats(struct ieee80
MESHSTATS_ADD(fwded_frames);
MESHSTATS_ADD(dropped_frames_ttl);
MESHSTATS_ADD(dropped_frames_no_route);
- MESHSTATS_ADD(dropped_frames_congestion);
#undef MESHSTATS_ADD
}
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -333,7 +333,6 @@ struct mesh_stats {
__u32 fwded_frames; /* Mesh total forwarded frames */
__u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/
__u32 dropped_frames_no_route; /* Not transmitted, no route found */
- __u32 dropped_frames_congestion;/* Not forwarded due to congestion */
};
#define PREQ_Q_F_START 0x1
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2932,11 +2932,6 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
return RX_CONTINUE;
ac = ieee802_1d_to_ac[skb->priority];
- q = sdata->vif.hw_queue[ac];
- if (ieee80211_queue_stopped(&local->hw, q)) {
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
- return RX_DROP_MONITOR;
- }
skb_set_queue_mapping(skb, ac);
if (!--mesh_hdr->ttl) {

View File

@@ -1,753 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Tue, 6 Dec 2022 11:15:02 +0100
Subject: [PATCH] wifi: mac80211: fix receiving A-MSDU frames on mesh
interfaces
The current mac80211 mesh A-MSDU receive path fails to parse A-MSDU packets
on mesh interfaces, because it assumes that the Mesh Control field is always
directly after the 802.11 header.
802.11-2020 9.3.2.2.2 Figure 9-70 shows that the Mesh Control field is
actually part of the A-MSDU subframe header.
This makes more sense, since it allows packets for multiple different
destinations to be included in the same A-MSDU, as long as RA and TID are
still the same.
Another issue is the fact that the A-MSDU subframe length field was apparently
accidentally defined as little-endian in the standard.
In order to fix this, the mesh forwarding path needs happen at a different
point in the receive path.
ieee80211_data_to_8023_exthdr is changed to ignore the mesh control field
and leave it in after the ethernet header. This also affects the source/dest
MAC address fields, which now in the case of mesh point to the mesh SA/DA.
ieee80211_amsdu_to_8023s is changed to deal with the endian difference and
to add the Mesh Control length to the subframe length, since it's not covered
by the MSDU length field.
With these changes, the mac80211 will get the same packet structure for
converted regular data packets and unpacked A-MSDU subframes.
The mesh forwarding checks are now only performed after the A-MSDU decap.
For locally received packets, the Mesh Control header is stripped away.
For forwarded packets, a new 802.11 header gets added.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
@@ -33,7 +33,7 @@ static int mwifiex_11n_dispatch_amsdu_pk
skb_trim(skb, le16_to_cpu(local_rx_pd->rx_pkt_length));
ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr,
- priv->wdev.iftype, 0, NULL, NULL);
+ priv->wdev.iftype, 0, NULL, NULL, false);
while (!skb_queue_empty(&list)) {
struct rx_packet_hdr *rx_hdr;
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -6324,11 +6324,36 @@ static inline int ieee80211_data_to_8023
* @extra_headroom: The hardware extra headroom for SKBs in the @list.
* @check_da: DA to check in the inner ethernet header, or NULL
* @check_sa: SA to check in the inner ethernet header, or NULL
+ * @mesh_control: A-MSDU subframe header includes the mesh control field
*/
void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
const u8 *addr, enum nl80211_iftype iftype,
const unsigned int extra_headroom,
- const u8 *check_da, const u8 *check_sa);
+ const u8 *check_da, const u8 *check_sa,
+ bool mesh_control);
+
+/**
+ * ieee80211_get_8023_tunnel_proto - get RFC1042 or bridge tunnel encap protocol
+ *
+ * Check for RFC1042 or bridge tunnel header and fetch the encapsulated
+ * protocol.
+ *
+ * @hdr: pointer to the MSDU payload
+ * @proto: destination pointer to store the protocol
+ * Return: true if encapsulation was found
+ */
+bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto);
+
+/**
+ * ieee80211_strip_8023_mesh_hdr - strip mesh header from converted 802.3 frames
+ *
+ * Strip the mesh header, which was left in by ieee80211_data_to_8023 as part
+ * of the MSDU data. Also move any source/destination addresses from the mesh
+ * header to the ethernet header (if present).
+ *
+ * @skb: The 802.3 frame with embedded mesh header
+ */
+int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb);
/**
* cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2726,6 +2726,174 @@ ieee80211_deliver_skb(struct ieee80211_r
}
}
+static ieee80211_rx_result
+ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta,
+ struct sk_buff *skb)
+{
+#ifdef CPTCFG_MAC80211_MESH
+ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ struct ieee80211_local *local = sdata->local;
+ uint16_t fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA;
+ struct ieee80211_hdr hdr = {
+ .frame_control = cpu_to_le16(fc)
+ };
+ struct ieee80211_hdr *fwd_hdr;
+ struct ieee80211s_hdr *mesh_hdr;
+ struct ieee80211_tx_info *info;
+ struct sk_buff *fwd_skb;
+ struct ethhdr *eth;
+ bool multicast;
+ int tailroom = 0;
+ int hdrlen, mesh_hdrlen;
+ u8 *qos;
+
+ if (!ieee80211_vif_is_mesh(&sdata->vif))
+ return RX_CONTINUE;
+
+ if (!pskb_may_pull(skb, sizeof(*eth) + 6))
+ return RX_DROP_MONITOR;
+
+ mesh_hdr = (struct ieee80211s_hdr *)(skb->data + sizeof(*eth));
+ mesh_hdrlen = ieee80211_get_mesh_hdrlen(mesh_hdr);
+
+ if (!pskb_may_pull(skb, sizeof(*eth) + mesh_hdrlen))
+ return RX_DROP_MONITOR;
+
+ eth = (struct ethhdr *)skb->data;
+ multicast = is_multicast_ether_addr(eth->h_dest);
+
+ mesh_hdr = (struct ieee80211s_hdr *)(eth + 1);
+ if (!mesh_hdr->ttl)
+ return RX_DROP_MONITOR;
+
+ /* frame is in RMC, don't forward */
+ if (is_multicast_ether_addr(eth->h_dest) &&
+ mesh_rmc_check(sdata, eth->h_source, mesh_hdr))
+ return RX_DROP_MONITOR;
+
+ /* Frame has reached destination. Don't forward */
+ if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
+ goto rx_accept;
+
+ if (!ifmsh->mshcfg.dot11MeshForwarding) {
+ if (is_multicast_ether_addr(eth->h_dest))
+ goto rx_accept;
+
+ return RX_DROP_MONITOR;
+ }
+
+ /* forward packet */
+ if (sdata->crypto_tx_tailroom_needed_cnt)
+ tailroom = IEEE80211_ENCRYPT_TAILROOM;
+
+ if (!--mesh_hdr->ttl) {
+ if (multicast)
+ goto rx_accept;
+
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
+ return RX_DROP_MONITOR;
+ }
+
+ if (mesh_hdr->flags & MESH_FLAGS_AE) {
+ struct mesh_path *mppath;
+ char *proxied_addr;
+
+ if (multicast)
+ proxied_addr = mesh_hdr->eaddr1;
+ else if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
+ /* has_a4 already checked in ieee80211_rx_mesh_check */
+ proxied_addr = mesh_hdr->eaddr2;
+ else
+ return RX_DROP_MONITOR;
+
+ rcu_read_lock();
+ mppath = mpp_path_lookup(sdata, proxied_addr);
+ if (!mppath) {
+ mpp_path_add(sdata, proxied_addr, eth->h_source);
+ } else {
+ spin_lock_bh(&mppath->state_lock);
+ if (!ether_addr_equal(mppath->mpp, eth->h_source))
+ memcpy(mppath->mpp, eth->h_source, ETH_ALEN);
+ mppath->exp_time = jiffies;
+ spin_unlock_bh(&mppath->state_lock);
+ }
+ rcu_read_unlock();
+ }
+
+ skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
+
+ ieee80211_fill_mesh_addresses(&hdr, &hdr.frame_control,
+ eth->h_dest, eth->h_source);
+ hdrlen = ieee80211_hdrlen(hdr.frame_control);
+ if (multicast) {
+ int extra_head = sizeof(struct ieee80211_hdr) - sizeof(*eth);
+
+ fwd_skb = skb_copy_expand(skb, local->tx_headroom + extra_head +
+ IEEE80211_ENCRYPT_HEADROOM,
+ tailroom, GFP_ATOMIC);
+ if (!fwd_skb)
+ goto rx_accept;
+ } else {
+ fwd_skb = skb;
+ skb = NULL;
+
+ if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr)))
+ return RX_DROP_UNUSABLE;
+ }
+
+ fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr));
+ memcpy(fwd_hdr, &hdr, hdrlen - 2);
+ qos = ieee80211_get_qos_ctl(fwd_hdr);
+ qos[0] = qos[1] = 0;
+
+ skb_reset_mac_header(fwd_skb);
+ hdrlen += mesh_hdrlen;
+ if (ieee80211_get_8023_tunnel_proto(fwd_skb->data + hdrlen,
+ &fwd_skb->protocol))
+ hdrlen += ETH_ALEN;
+ else
+ fwd_skb->protocol = htons(fwd_skb->len - hdrlen);
+ skb_set_network_header(fwd_skb, hdrlen);
+
+ info = IEEE80211_SKB_CB(fwd_skb);
+ memset(info, 0, sizeof(*info));
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
+ info->control.vif = &sdata->vif;
+ info->control.jiffies = jiffies;
+ if (multicast) {
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
+ memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
+ /* update power mode indication when forwarding */
+ ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
+ } else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
+ /* mesh power mode flags updated in mesh_nexthop_lookup */
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
+ } else {
+ /* unable to resolve next hop */
+ if (sta)
+ mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl,
+ hdr.addr3, 0,
+ WLAN_REASON_MESH_PATH_NOFORWARD,
+ sta->sta.addr);
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
+ kfree_skb(fwd_skb);
+ goto rx_accept;
+ }
+
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
+ fwd_skb->dev = sdata->dev;
+ ieee80211_add_pending_skb(local, fwd_skb);
+
+rx_accept:
+ if (!skb)
+ return RX_QUEUED;
+
+ ieee80211_strip_8023_mesh_hdr(skb);
+#endif
+
+ return RX_CONTINUE;
+}
+
static ieee80211_rx_result debug_noinline
__ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)
{
@@ -2734,8 +2902,10 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
__le16 fc = hdr->frame_control;
struct sk_buff_head frame_list;
+ static ieee80211_rx_result res;
struct ethhdr ethhdr;
const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source;
+ bool mesh = false;
if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
check_da = NULL;
@@ -2752,6 +2922,8 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
break;
case NL80211_IFTYPE_MESH_POINT:
check_sa = NULL;
+ check_da = NULL;
+ mesh = true;
break;
default:
break;
@@ -2769,17 +2941,29 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
rx->sdata->vif.type,
rx->local->hw.extra_tx_headroom,
- check_da, check_sa);
+ check_da, check_sa, mesh);
while (!skb_queue_empty(&frame_list)) {
rx->skb = __skb_dequeue(&frame_list);
- if (!ieee80211_frame_allowed(rx, fc)) {
- dev_kfree_skb(rx->skb);
+ res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb);
+ switch (res) {
+ case RX_QUEUED:
continue;
+ case RX_CONTINUE:
+ break;
+ default:
+ goto free;
}
+ if (!ieee80211_frame_allowed(rx, fc))
+ goto free;
+
ieee80211_deliver_skb(rx);
+ continue;
+
+free:
+ dev_kfree_skb(rx->skb);
}
return RX_QUEUED;
@@ -2812,6 +2996,8 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
if (!rx->sdata->u.mgd.use_4addr)
return RX_DROP_UNUSABLE;
break;
+ case NL80211_IFTYPE_MESH_POINT:
+ break;
default:
return RX_DROP_UNUSABLE;
}
@@ -2840,155 +3026,6 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
return __ieee80211_rx_h_amsdu(rx, 0);
}
-#ifdef CPTCFG_MAC80211_MESH
-static ieee80211_rx_result
-ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
-{
- struct ieee80211_hdr *fwd_hdr, *hdr;
- struct ieee80211_tx_info *info;
- struct ieee80211s_hdr *mesh_hdr;
- struct sk_buff *skb = rx->skb, *fwd_skb;
- struct ieee80211_local *local = rx->local;
- struct ieee80211_sub_if_data *sdata = rx->sdata;
- struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
- u16 ac, q, hdrlen;
- int tailroom = 0;
-
- hdr = (struct ieee80211_hdr *) skb->data;
- hdrlen = ieee80211_hdrlen(hdr->frame_control);
-
- /* make sure fixed part of mesh header is there, also checks skb len */
- if (!pskb_may_pull(rx->skb, hdrlen + 6))
- return RX_DROP_MONITOR;
-
- mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
-
- /* make sure full mesh header is there, also checks skb len */
- if (!pskb_may_pull(rx->skb,
- hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr)))
- return RX_DROP_MONITOR;
-
- /* reload pointers */
- hdr = (struct ieee80211_hdr *) skb->data;
- mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
-
- if (ieee80211_drop_unencrypted(rx, hdr->frame_control)) {
- int offset = hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr) +
- sizeof(rfc1042_header);
- __be16 ethertype;
-
- if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr) ||
- skb_copy_bits(rx->skb, offset, &ethertype, 2) != 0 ||
- ethertype != rx->sdata->control_port_protocol)
- return RX_DROP_MONITOR;
- }
-
- /* frame is in RMC, don't forward */
- if (ieee80211_is_data(hdr->frame_control) &&
- is_multicast_ether_addr(hdr->addr1) &&
- mesh_rmc_check(rx->sdata, hdr->addr3, mesh_hdr))
- return RX_DROP_MONITOR;
-
- if (!ieee80211_is_data(hdr->frame_control))
- return RX_CONTINUE;
-
- if (!mesh_hdr->ttl)
- return RX_DROP_MONITOR;
-
- if (mesh_hdr->flags & MESH_FLAGS_AE) {
- struct mesh_path *mppath;
- char *proxied_addr;
- char *mpp_addr;
-
- if (is_multicast_ether_addr(hdr->addr1)) {
- mpp_addr = hdr->addr3;
- proxied_addr = mesh_hdr->eaddr1;
- } else if ((mesh_hdr->flags & MESH_FLAGS_AE) ==
- MESH_FLAGS_AE_A5_A6) {
- /* has_a4 already checked in ieee80211_rx_mesh_check */
- mpp_addr = hdr->addr4;
- proxied_addr = mesh_hdr->eaddr2;
- } else {
- return RX_DROP_MONITOR;
- }
-
- rcu_read_lock();
- mppath = mpp_path_lookup(sdata, proxied_addr);
- if (!mppath) {
- mpp_path_add(sdata, proxied_addr, mpp_addr);
- } else {
- spin_lock_bh(&mppath->state_lock);
- if (!ether_addr_equal(mppath->mpp, mpp_addr))
- memcpy(mppath->mpp, mpp_addr, ETH_ALEN);
- mppath->exp_time = jiffies;
- spin_unlock_bh(&mppath->state_lock);
- }
- rcu_read_unlock();
- }
-
- /* Frame has reached destination. Don't forward */
- if (!is_multicast_ether_addr(hdr->addr1) &&
- ether_addr_equal(sdata->vif.addr, hdr->addr3))
- return RX_CONTINUE;
-
- ac = ieee802_1d_to_ac[skb->priority];
- skb_set_queue_mapping(skb, ac);
-
- if (!--mesh_hdr->ttl) {
- if (!is_multicast_ether_addr(hdr->addr1))
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh,
- dropped_frames_ttl);
- goto out;
- }
-
- if (!ifmsh->mshcfg.dot11MeshForwarding)
- goto out;
-
- if (sdata->crypto_tx_tailroom_needed_cnt)
- tailroom = IEEE80211_ENCRYPT_TAILROOM;
-
- fwd_skb = skb_copy_expand(skb, local->tx_headroom +
- IEEE80211_ENCRYPT_HEADROOM,
- tailroom, GFP_ATOMIC);
- if (!fwd_skb)
- goto out;
-
- fwd_skb->dev = sdata->dev;
- fwd_hdr = (struct ieee80211_hdr *) fwd_skb->data;
- fwd_hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_RETRY);
- info = IEEE80211_SKB_CB(fwd_skb);
- memset(info, 0, sizeof(*info));
- info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
- info->control.vif = &rx->sdata->vif;
- info->control.jiffies = jiffies;
- if (is_multicast_ether_addr(fwd_hdr->addr1)) {
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
- memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
- /* update power mode indication when forwarding */
- ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
- } else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
- /* mesh power mode flags updated in mesh_nexthop_lookup */
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
- } else {
- /* unable to resolve next hop */
- mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl,
- fwd_hdr->addr3, 0,
- WLAN_REASON_MESH_PATH_NOFORWARD,
- fwd_hdr->addr2);
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
- kfree_skb(fwd_skb);
- return RX_DROP_MONITOR;
- }
-
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
- ieee80211_add_pending_skb(local, fwd_skb);
- out:
- if (is_multicast_ether_addr(hdr->addr1))
- return RX_CONTINUE;
- return RX_DROP_MONITOR;
-}
-#endif
-
static ieee80211_rx_result debug_noinline
ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
{
@@ -2997,6 +3034,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_
struct net_device *dev = sdata->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
__le16 fc = hdr->frame_control;
+ static ieee80211_rx_result res;
bool port_control;
int err;
@@ -3023,6 +3061,10 @@ ieee80211_rx_h_data(struct ieee80211_rx_
if (unlikely(err))
return RX_DROP_UNUSABLE;
+ res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb);
+ if (res != RX_CONTINUE)
+ return res;
+
if (!ieee80211_frame_allowed(rx, fc))
return RX_DROP_MONITOR;
@@ -3997,10 +4039,6 @@ static void ieee80211_rx_handlers(struct
CALL_RXH(ieee80211_rx_h_defragment);
CALL_RXH(ieee80211_rx_h_michael_mic_verify);
/* must be after MMIC verify so header is counted in MPDU mic */
-#ifdef CPTCFG_MAC80211_MESH
- if (ieee80211_vif_is_mesh(&rx->sdata->vif))
- CALL_RXH(ieee80211_rx_h_mesh_fwding);
-#endif
CALL_RXH(ieee80211_rx_h_amsdu);
CALL_RXH(ieee80211_rx_h_data);
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -542,7 +542,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s
}
EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
-static bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto)
+bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto)
{
const __be16 *hdr_proto = hdr + ETH_ALEN;
@@ -556,6 +556,49 @@ static bool ieee80211_get_8023_tunnel_pr
return true;
}
+EXPORT_SYMBOL(ieee80211_get_8023_tunnel_proto);
+
+int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb)
+{
+ const void *mesh_addr;
+ struct {
+ struct ethhdr eth;
+ u8 flags;
+ } payload;
+ int hdrlen;
+ int ret;
+
+ ret = skb_copy_bits(skb, 0, &payload, sizeof(payload));
+ if (ret)
+ return ret;
+
+ hdrlen = sizeof(payload.eth) + __ieee80211_get_mesh_hdrlen(payload.flags);
+
+ if (likely(pskb_may_pull(skb, hdrlen + 8) &&
+ ieee80211_get_8023_tunnel_proto(skb->data + hdrlen,
+ &payload.eth.h_proto)))
+ hdrlen += ETH_ALEN + 2;
+ else if (!pskb_may_pull(skb, hdrlen))
+ return -EINVAL;
+
+ mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
+ switch (payload.flags & MESH_FLAGS_AE) {
+ case MESH_FLAGS_AE_A4:
+ memcpy(&payload.eth.h_source, mesh_addr, ETH_ALEN);
+ break;
+ case MESH_FLAGS_AE_A5_A6:
+ memcpy(&payload.eth.h_dest, mesh_addr, 2 * ETH_ALEN);
+ break;
+ default:
+ break;
+ }
+
+ pskb_pull(skb, hdrlen - sizeof(payload.eth));
+ memcpy(skb->data, &payload.eth, sizeof(payload.eth));
+
+ return 0;
+}
+EXPORT_SYMBOL(ieee80211_strip_8023_mesh_hdr);
int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
const u8 *addr, enum nl80211_iftype iftype,
@@ -568,7 +611,6 @@ int ieee80211_data_to_8023_exthdr(struct
} payload;
struct ethhdr tmp;
u16 hdrlen;
- u8 mesh_flags = 0;
if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
return -1;
@@ -589,12 +631,6 @@ int ieee80211_data_to_8023_exthdr(struct
memcpy(tmp.h_dest, ieee80211_get_DA(hdr), ETH_ALEN);
memcpy(tmp.h_source, ieee80211_get_SA(hdr), ETH_ALEN);
- if (iftype == NL80211_IFTYPE_MESH_POINT &&
- skb_copy_bits(skb, hdrlen, &mesh_flags, 1) < 0)
- return -1;
-
- mesh_flags &= MESH_FLAGS_AE;
-
switch (hdr->frame_control &
cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
case cpu_to_le16(IEEE80211_FCTL_TODS):
@@ -608,17 +644,6 @@ int ieee80211_data_to_8023_exthdr(struct
iftype != NL80211_IFTYPE_AP_VLAN &&
iftype != NL80211_IFTYPE_STATION))
return -1;
- if (iftype == NL80211_IFTYPE_MESH_POINT) {
- if (mesh_flags == MESH_FLAGS_AE_A4)
- return -1;
- if (mesh_flags == MESH_FLAGS_AE_A5_A6 &&
- skb_copy_bits(skb, hdrlen +
- offsetof(struct ieee80211s_hdr, eaddr1),
- tmp.h_dest, 2 * ETH_ALEN) < 0)
- return -1;
-
- hdrlen += __ieee80211_get_mesh_hdrlen(mesh_flags);
- }
break;
case cpu_to_le16(IEEE80211_FCTL_FROMDS):
if ((iftype != NL80211_IFTYPE_STATION &&
@@ -627,16 +652,6 @@ int ieee80211_data_to_8023_exthdr(struct
(is_multicast_ether_addr(tmp.h_dest) &&
ether_addr_equal(tmp.h_source, addr)))
return -1;
- if (iftype == NL80211_IFTYPE_MESH_POINT) {
- if (mesh_flags == MESH_FLAGS_AE_A5_A6)
- return -1;
- if (mesh_flags == MESH_FLAGS_AE_A4 &&
- skb_copy_bits(skb, hdrlen +
- offsetof(struct ieee80211s_hdr, eaddr1),
- tmp.h_source, ETH_ALEN) < 0)
- return -1;
- hdrlen += __ieee80211_get_mesh_hdrlen(mesh_flags);
- }
break;
case cpu_to_le16(0):
if (iftype != NL80211_IFTYPE_ADHOC &&
@@ -646,7 +661,7 @@ int ieee80211_data_to_8023_exthdr(struct
break;
}
- if (likely(!is_amsdu &&
+ if (likely(!is_amsdu && iftype != NL80211_IFTYPE_MESH_POINT &&
skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
ieee80211_get_8023_tunnel_proto(&payload, &tmp.h_proto))) {
/* remove RFC1042 or Bridge-Tunnel encapsulation */
@@ -722,7 +737,8 @@ __ieee80211_amsdu_copy_frag(struct sk_bu
static struct sk_buff *
__ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen,
- int offset, int len, bool reuse_frag)
+ int offset, int len, bool reuse_frag,
+ int min_len)
{
struct sk_buff *frame;
int cur_len = len;
@@ -736,7 +752,7 @@ __ieee80211_amsdu_copy(struct sk_buff *s
* in the stack later.
*/
if (reuse_frag)
- cur_len = min_t(int, len, 32);
+ cur_len = min_t(int, len, min_len);
/*
* Allocate and reserve two bytes more for payload
@@ -746,6 +762,7 @@ __ieee80211_amsdu_copy(struct sk_buff *s
if (!frame)
return NULL;
+ frame->priority = skb->priority;
skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2);
skb_copy_bits(skb, offset, skb_put(frame, cur_len), cur_len);
@@ -762,23 +779,37 @@ __ieee80211_amsdu_copy(struct sk_buff *s
void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
const u8 *addr, enum nl80211_iftype iftype,
const unsigned int extra_headroom,
- const u8 *check_da, const u8 *check_sa)
+ const u8 *check_da, const u8 *check_sa,
+ bool mesh_control)
{
unsigned int hlen = ALIGN(extra_headroom, 4);
struct sk_buff *frame = NULL;
int offset = 0, remaining;
- struct ethhdr eth;
+ struct {
+ struct ethhdr eth;
+ uint8_t flags;
+ } hdr;
bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb);
bool reuse_skb = false;
bool last = false;
+ int copy_len = sizeof(hdr.eth);
+
+ if (iftype == NL80211_IFTYPE_MESH_POINT)
+ copy_len = sizeof(hdr);
while (!last) {
unsigned int subframe_len;
- int len;
+ int len, mesh_len = 0;
u8 padding;
- skb_copy_bits(skb, offset, &eth, sizeof(eth));
- len = ntohs(eth.h_proto);
+ skb_copy_bits(skb, offset, &hdr, copy_len);
+ if (iftype == NL80211_IFTYPE_MESH_POINT)
+ mesh_len = __ieee80211_get_mesh_hdrlen(hdr.flags);
+ if (mesh_control)
+ len = le16_to_cpu(*(__le16 *)&hdr.eth.h_proto) + mesh_len;
+ else
+ len = ntohs(hdr.eth.h_proto);
+
subframe_len = sizeof(struct ethhdr) + len;
padding = (4 - subframe_len) & 0x3;
@@ -787,16 +818,16 @@ void ieee80211_amsdu_to_8023s(struct sk_
if (subframe_len > remaining)
goto purge;
/* mitigate A-MSDU aggregation injection attacks */
- if (ether_addr_equal(eth.h_dest, rfc1042_header))
+ if (ether_addr_equal(hdr.eth.h_dest, rfc1042_header))
goto purge;
offset += sizeof(struct ethhdr);
last = remaining <= subframe_len + padding;
/* FIXME: should we really accept multicast DA? */
- if ((check_da && !is_multicast_ether_addr(eth.h_dest) &&
- !ether_addr_equal(check_da, eth.h_dest)) ||
- (check_sa && !ether_addr_equal(check_sa, eth.h_source))) {
+ if ((check_da && !is_multicast_ether_addr(hdr.eth.h_dest) &&
+ !ether_addr_equal(check_da, hdr.eth.h_dest)) ||
+ (check_sa && !ether_addr_equal(check_sa, hdr.eth.h_source))) {
offset += len + padding;
continue;
}
@@ -808,7 +839,7 @@ void ieee80211_amsdu_to_8023s(struct sk_
reuse_skb = true;
} else {
frame = __ieee80211_amsdu_copy(skb, hlen, offset, len,
- reuse_frag);
+ reuse_frag, 32 + mesh_len);
if (!frame)
goto purge;
@@ -819,10 +850,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
frame->dev = skb->dev;
frame->priority = skb->priority;
- if (likely(ieee80211_get_8023_tunnel_proto(frame->data, &eth.h_proto)))
+ if (likely(iftype != NL80211_IFTYPE_MESH_POINT &&
+ ieee80211_get_8023_tunnel_proto(frame->data, &hdr.eth.h_proto)))
skb_pull(frame, ETH_ALEN + 2);
- memcpy(skb_push(frame, sizeof(eth)), &eth, sizeof(eth));
+ memcpy(skb_push(frame, sizeof(hdr.eth)), &hdr.eth, sizeof(hdr.eth));
__skb_queue_tail(list, frame);
}

View File

@@ -1,145 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 9 Dec 2022 21:15:04 +0100
Subject: [PATCH] wifi: mac80211: add a workaround for receiving
non-standard mesh A-MSDU
At least ath10k and ath11k supported hardware (maybe more) does not implement
mesh A-MSDU aggregation in a standard compliant way.
802.11-2020 9.3.2.2.2 declares that the Mesh Control field is part of the
A-MSDU header. As such, its length must not be included in the subframe
length field.
Hardware affected by this bug treats the mesh control field as part of the
MSDU data and sets the length accordingly.
In order to avoid packet loss, keep track of which stations are affected
by this and take it into account when converting A-MSDU to 802.3 + mesh control
packets.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -6310,6 +6310,19 @@ static inline int ieee80211_data_to_8023
}
/**
+ * ieee80211_is_valid_amsdu - check if subframe lengths of an A-MSDU are valid
+ *
+ * This is used to detect non-standard A-MSDU frames, e.g. the ones generated
+ * by ath10k and ath11k, where the subframe length includes the length of the
+ * mesh control field.
+ *
+ * @skb: The input A-MSDU frame without any headers.
+ * @mesh_hdr: use standard compliant mesh A-MSDU subframe header
+ * Returns: true if subframe header lengths are valid for the @mesh_hdr mode
+ */
+bool ieee80211_is_valid_amsdu(struct sk_buff *skb, bool mesh_hdr);
+
+/**
* ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame
*
* Decode an IEEE 802.11 A-MSDU and convert it to a list of 802.3 frames.
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2905,7 +2905,6 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
static ieee80211_rx_result res;
struct ethhdr ethhdr;
const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source;
- bool mesh = false;
if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
check_da = NULL;
@@ -2923,7 +2922,6 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
case NL80211_IFTYPE_MESH_POINT:
check_sa = NULL;
check_da = NULL;
- mesh = true;
break;
default:
break;
@@ -2938,10 +2936,21 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
data_offset, true))
return RX_DROP_UNUSABLE;
+ if (rx->sta && rx->sta->amsdu_mesh_control < 0) {
+ bool valid_std = ieee80211_is_valid_amsdu(skb, true);
+ bool valid_nonstd = ieee80211_is_valid_amsdu(skb, false);
+
+ if (valid_std && !valid_nonstd)
+ rx->sta->amsdu_mesh_control = 1;
+ else if (valid_nonstd && !valid_std)
+ rx->sta->amsdu_mesh_control = 0;
+ }
+
ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
rx->sdata->vif.type,
rx->local->hw.extra_tx_headroom,
- check_da, check_sa, mesh);
+ check_da, check_sa,
+ rx->sta->amsdu_mesh_control);
while (!skb_queue_empty(&frame_list)) {
rx->skb = __skb_dequeue(&frame_list);
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -594,6 +594,9 @@ __sta_info_alloc(struct ieee80211_sub_if
sta->sta_state = IEEE80211_STA_NONE;
+ if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
+ sta->amsdu_mesh_control = -1;
+
/* Mark TID as unreserved */
sta->reserved_tid = IEEE80211_TID_UNRESERVED;
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -702,6 +702,7 @@ struct sta_info {
struct codel_params cparams;
u8 reserved_tid;
+ s8 amsdu_mesh_control;
struct cfg80211_chan_def tdls_chandef;
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -776,6 +776,38 @@ __ieee80211_amsdu_copy(struct sk_buff *s
return frame;
}
+bool ieee80211_is_valid_amsdu(struct sk_buff *skb, bool mesh_hdr)
+{
+ int offset = 0, remaining, subframe_len, padding;
+
+ for (offset = 0; offset < skb->len; offset += subframe_len + padding) {
+ struct {
+ __be16 len;
+ u8 mesh_flags;
+ } hdr;
+ u16 len;
+
+ if (skb_copy_bits(skb, offset + 2 * ETH_ALEN, &hdr, sizeof(hdr)) < 0)
+ return false;
+
+ if (mesh_hdr)
+ len = le16_to_cpu(*(__le16 *)&hdr.len) +
+ __ieee80211_get_mesh_hdrlen(hdr.mesh_flags);
+ else
+ len = ntohs(hdr.len);
+
+ subframe_len = sizeof(struct ethhdr) + len;
+ padding = (4 - subframe_len) & 0x3;
+ remaining = skb->len - offset;
+
+ if (subframe_len > remaining)
+ return false;
+ }
+
+ return true;
+}
+EXPORT_SYMBOL(ieee80211_is_valid_amsdu);
+
void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
const u8 *addr, enum nl80211_iftype iftype,
const unsigned int extra_headroom,

View File

@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
#ifdef CPTCFG_MAC80211_MESH
@@ -2007,6 +2022,11 @@ int ieee80211_tx_control_port(struct wip
@@ -2009,6 +2024,11 @@ int ieee80211_tx_control_port(struct wip
int link_id, u64 *cookie);
int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
const u8 *buf, size_t len);
@@ -698,7 +698,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2797,6 +2797,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
@@ -2778,6 +2778,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
if (mesh_hdr->flags & MESH_FLAGS_AE) {
struct mesh_path *mppath;
char *proxied_addr;
@@ -706,7 +706,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (multicast)
proxied_addr = mesh_hdr->eaddr1;
@@ -2812,11 +2813,18 @@ ieee80211_rx_mesh_data(struct ieee80211_
@@ -2793,11 +2794,18 @@ ieee80211_rx_mesh_data(struct ieee80211_
mpp_path_add(sdata, proxied_addr, eth->h_source);
} else {
spin_lock_bh(&mppath->state_lock);

View File

@@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ieee80211_fill_mesh_addresses(&hdr, &hdr.frame_control,
eth->h_dest, eth->h_source);
hdrlen = ieee80211_hdrlen(hdr.frame_control);
@@ -2868,6 +2931,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
@@ -2871,6 +2934,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
info->control.vif = &sdata->vif;
info->control.jiffies = jiffies;
@@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (multicast) {
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
@@ -2889,7 +2953,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
@@ -2892,7 +2956,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
}
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
@@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
rx_accept:
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2027,6 +2027,8 @@ void __ieee80211_xmit_fast(struct ieee80
@@ -2029,6 +2029,8 @@ void __ieee80211_xmit_fast(struct ieee80
struct ieee80211_fast_tx *fast_tx,
struct sk_buff *skb, bool ampdu,
const u8 *da, const u8 *sa);

View File

@@ -1,32 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 20 Feb 2023 12:50:50 +0100
Subject: [PATCH] mac80211: fix mesh forwarding
Linearize packets (needed for forwarding A-MSDU subframes).
Fix network header offset to fix flow dissector (and fair queueing).
Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2910,6 +2910,9 @@ ieee80211_rx_mesh_data(struct ieee80211_
if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr)))
return RX_DROP_UNUSABLE;
+
+ if (skb_linearize(fwd_skb))
+ return RX_DROP_UNUSABLE;
}
fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr));
@@ -2924,7 +2927,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
hdrlen += ETH_ALEN;
else
fwd_skb->protocol = htons(fwd_skb->len - hdrlen);
- skb_set_network_header(fwd_skb, hdrlen);
+ skb_set_network_header(fwd_skb, hdrlen + 2);
info = IEEE80211_SKB_CB(fwd_skb);
memset(info, 0, sizeof(*info));

View File

@@ -1,52 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Sun, 26 Feb 2023 20:30:20 +0100
Subject: [PATCH] wifi: mac80211: fix mesh path discovery based on unicast
packets
If a packet has reached its intended destination, it was bumped to the code
that accepts it, without first checking if a mesh_path needs to be created
based on the discovered source.
Fix this by moving the destination address check further down
Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2830,17 +2830,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
mesh_rmc_check(sdata, eth->h_source, mesh_hdr))
return RX_DROP_MONITOR;
- /* Frame has reached destination. Don't forward */
- if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
- goto rx_accept;
-
- if (!ifmsh->mshcfg.dot11MeshForwarding) {
- if (is_multicast_ether_addr(eth->h_dest))
- goto rx_accept;
-
- return RX_DROP_MONITOR;
- }
-
/* forward packet */
if (sdata->crypto_tx_tailroom_needed_cnt)
tailroom = IEEE80211_ENCRYPT_TAILROOM;
@@ -2887,6 +2876,17 @@ ieee80211_rx_mesh_data(struct ieee80211_
rcu_read_unlock();
}
+ /* Frame has reached destination. Don't forward */
+ if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
+ goto rx_accept;
+
+ if (!ifmsh->mshcfg.dot11MeshForwarding) {
+ if (is_multicast_ether_addr(eth->h_dest))
+ goto rx_accept;
+
+ return RX_DROP_MONITOR;
+ }
+
skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
if (!multicast &&

View File

@@ -34,7 +34,7 @@ Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
* @tid: the TID to BA on.
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -554,6 +554,23 @@ void ieee80211_tx_ba_session_handle_star
@@ -550,6 +550,23 @@ void ieee80211_tx_ba_session_handle_star
ieee80211_send_addba_with_timeout(sta, tid_tx);
}

View File

@@ -63,7 +63,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
u16 old_links, u16 new_links,
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1944,7 +1944,8 @@ void ieee80211_color_collision_detection
@@ -1946,7 +1946,8 @@ void ieee80211_color_collision_detection
/* interface handling */
#define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
NETIF_F_HW_CSUM | NETIF_F_SG | \
@@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MAC80211_SUPPORTED_FEATURES_RX)
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -813,6 +813,21 @@ ieee80211_get_stats64(struct net_device
@@ -834,6 +834,21 @@ ieee80211_get_stats64(struct net_device
dev_fetch_sw_netstats(stats, dev->tstats);
}
@@ -97,7 +97,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops ieee80211_dataif_ops = {
.ndo_open = ieee80211_open,
.ndo_stop = ieee80211_stop,
@@ -821,6 +836,7 @@ static const struct net_device_ops ieee8
@@ -842,6 +857,7 @@ static const struct net_device_ops ieee8
.ndo_set_rx_mode = ieee80211_set_multicast_list,
.ndo_set_mac_address = ieee80211_change_mac,
.ndo_get_stats64 = ieee80211_get_stats64,
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
#if LINUX_VERSION_IS_GEQ(5,2,0)
@@ -945,6 +961,7 @@ static const struct net_device_ops ieee8
@@ -966,6 +982,7 @@ static const struct net_device_ops ieee8
#if LINUX_VERSION_IS_GEQ(5,13,0)
.ndo_fill_forward_path = ieee80211_netdev_fill_forward_path,
#endif

View File

@@ -1,50 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Sun, 26 Mar 2023 17:11:34 +0200
Subject: [PATCH] wifi: mac80211: fix receiving mesh packets in forwarding=0
networks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When forwarding is set to 0, frames are typically sent with ttl=1.
Move the ttl decrement check below the check for local receive in order to
fix packet drops.
Reported-by: Thomas Hühn <thomas.huehn@hs-nordhausen.de>
Reported-by: Nick Hainke <vincent@systemli.org>
Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2834,14 +2834,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
if (sdata->crypto_tx_tailroom_needed_cnt)
tailroom = IEEE80211_ENCRYPT_TAILROOM;
- if (!--mesh_hdr->ttl) {
- if (multicast)
- goto rx_accept;
-
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
- return RX_DROP_MONITOR;
- }
-
if (mesh_hdr->flags & MESH_FLAGS_AE) {
struct mesh_path *mppath;
char *proxied_addr;
@@ -2880,6 +2872,14 @@ ieee80211_rx_mesh_data(struct ieee80211_
if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
goto rx_accept;
+ if (!--mesh_hdr->ttl) {
+ if (multicast)
+ goto rx_accept;
+
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
+ return RX_DROP_MONITOR;
+ }
+
if (!ifmsh->mshcfg.dot11MeshForwarding) {
if (is_multicast_ether_addr(eth->h_dest))
goto rx_accept;

View File

@@ -19,7 +19,7 @@ Reviewed-by: Greenman, Gregory <gregory.greenman@intel.com>
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1276,6 +1276,14 @@ static void __sta_info_destroy_part2(str
@@ -1290,6 +1290,14 @@ static void __sta_info_destroy_part2(str
WARN_ON_ONCE(ret);
}

View File

@@ -58,7 +58,7 @@ Reviewed-by: Greenman, Gregory <gregory.greenman@intel.com>
struct ieee80211_channel_switch *ch_switch)
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1281,8 +1281,12 @@ static void __sta_info_destroy_part2(str
@@ -1295,8 +1295,12 @@ static void __sta_info_destroy_part2(str
* frames sitting on hardware queues might be sent out without
* any encryption at all.
*/

View File

@@ -129,7 +129,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
}
new = kzalloc(size, GFP_KERNEL);
@@ -3394,8 +3394,11 @@ cfg80211_beacon_dup(struct cfg80211_beac
@@ -3396,8 +3396,11 @@ cfg80211_beacon_dup(struct cfg80211_beac
len = beacon->head_len + beacon->tail_len + beacon->beacon_ies_len +
beacon->proberesp_ies_len + beacon->assocresp_ies_len +

View File

@@ -1,25 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Tue, 11 Jul 2023 13:30:12 +0200
Subject: [PATCH] wifi: cfg80211: fix receving mesh packets without RFC1042
header
Fix ethernet header length field after stripping the mesh header
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/CT5GNZSK28AI.2K6M69OXM9RW5@syracuse/
Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Reported-by: Nicolas Escande <nico.escande@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -580,6 +580,8 @@ int ieee80211_strip_8023_mesh_hdr(struct
hdrlen += ETH_ALEN + 2;
else if (!pskb_may_pull(skb, hdrlen))
return -EINVAL;
+ else
+ payload.eth.h_proto = htons(skb->len - hdrlen);
mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
switch (payload.flags & MESH_FLAGS_AE) {

View File

@@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -491,6 +491,8 @@ void cfg80211_set_dfs_state(struct wiphy
@@ -497,6 +497,8 @@ void cfg80211_set_dfs_state(struct wiphy
enum nl80211_dfs_state dfs_state);
void cfg80211_dfs_channels_update_work(struct work_struct *work);

View File

@@ -76,7 +76,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -277,6 +277,8 @@ struct cfg80211_event {
@@ -283,6 +283,8 @@ struct cfg80211_event {
} ij;
struct {
u8 bssid[ETH_ALEN];
@@ -85,7 +85,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
} pa;
};
};
@@ -421,7 +423,8 @@ int cfg80211_disconnect(struct cfg80211_
@@ -427,7 +429,8 @@ int cfg80211_disconnect(struct cfg80211_
bool wextev);
void __cfg80211_roamed(struct wireless_dev *wdev,
struct cfg80211_roam_info *info);
@@ -97,7 +97,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
void cfg80211_autodisconnect_wk(struct work_struct *work);
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -17993,7 +17993,8 @@ void nl80211_send_roamed(struct cfg80211
@@ -18024,7 +18024,8 @@ void nl80211_send_roamed(struct cfg80211
}
void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
@@ -107,7 +107,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
{
struct sk_buff *msg;
void *hdr;
@@ -18013,6 +18014,11 @@ void nl80211_send_port_authorized(struct
@@ -18044,6 +18045,11 @@ void nl80211_send_port_authorized(struct
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid))
goto nla_put_failure;
@@ -176,7 +176,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Use the wdev event list so that if there are pending
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1059,7 +1059,9 @@ void cfg80211_process_wdev_events(struct
@@ -1065,7 +1065,9 @@ void cfg80211_process_wdev_events(struct
__cfg80211_leave(wiphy_to_rdev(wdev->wiphy), wdev);
break;
case EVENT_PORT_AUTHORIZED:

View File

@@ -94,7 +94,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
*/
#include <linux/module.h>
@@ -2389,6 +2389,13 @@ static void sta_stats_decode_rate(struct
@@ -2403,6 +2403,13 @@ static void sta_stats_decode_rate(struct
rinfo->he_ru_alloc = STA_STATS_GET(HE_RU, rate);
rinfo->he_dcm = STA_STATS_GET(HE_DCM, rate);
break;
@@ -110,7 +110,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -930,6 +930,7 @@ enum sta_stats_type {
@@ -936,6 +936,7 @@ enum sta_stats_type {
STA_STATS_RATE_TYPE_VHT,
STA_STATS_RATE_TYPE_HE,
STA_STATS_RATE_TYPE_S1G,
@@ -118,7 +118,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
};
#define STA_STATS_FIELD_HT_MCS GENMASK( 7, 0)
@@ -939,12 +940,16 @@ enum sta_stats_type {
@@ -945,12 +946,16 @@ enum sta_stats_type {
#define STA_STATS_FIELD_VHT_NSS GENMASK( 7, 4)
#define STA_STATS_FIELD_HE_MCS GENMASK( 3, 0)
#define STA_STATS_FIELD_HE_NSS GENMASK( 7, 4)
@@ -141,7 +141,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
#define STA_STATS_FIELD(_n, _v) FIELD_PREP(STA_STATS_FIELD_ ## _n, _v)
#define STA_STATS_GET(_n, _v) FIELD_GET(STA_STATS_FIELD_ ## _n, _v)
@@ -983,6 +988,13 @@ static inline u32 sta_stats_encode_rate(
@@ -989,6 +994,13 @@ static inline u32 sta_stats_encode_rate(
r |= STA_STATS_FIELD(HE_RU, s->he_ru);
r |= STA_STATS_FIELD(HE_DCM, s->he_dcm);
break;
@@ -157,7 +157,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
return STA_STATS_RATE_INVALID;
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3898,6 +3898,19 @@ u64 ieee80211_calculate_rx_timestamp(str
@@ -3902,6 +3902,19 @@ u64 ieee80211_calculate_rx_timestamp(str
/* Fill cfg80211 rate info */
switch (status->encoding) {

View File

@@ -62,7 +62,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
bool mu_mimo_owner;
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4195,7 +4195,7 @@ static int ieee80211_set_ap_chanwidth(st
@@ -4197,7 +4197,7 @@ static int ieee80211_set_ap_chanwidth(st
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_link_data *link;
int ret;
@@ -84,7 +84,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
struct ieee80211_bss_conf *link_conf = link->conf;
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2497,7 +2497,7 @@ int ieee80211_link_unreserve_chanctx(str
@@ -2499,7 +2499,7 @@ int ieee80211_link_unreserve_chanctx(str
int __must_check
ieee80211_link_change_bandwidth(struct ieee80211_link_data *link,
const struct cfg80211_chan_def *chandef,

View File

@@ -107,7 +107,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
NUM_NL80211_EXT_FEATURES,
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -819,6 +819,7 @@ static const struct nla_policy nl80211_p
@@ -829,6 +829,7 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
@@ -115,7 +115,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
};
/* policy for the key attributes */
@@ -3187,6 +3188,21 @@ static bool nl80211_can_set_dev_channel(
@@ -3197,6 +3198,21 @@ static bool nl80211_can_set_dev_channel(
wdev->iftype == NL80211_IFTYPE_P2P_GO;
}
@@ -137,7 +137,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
struct genl_info *info,
struct cfg80211_chan_def *chandef)
@@ -5938,6 +5954,14 @@ static int nl80211_start_ap(struct sk_bu
@@ -5969,6 +5985,14 @@ static int nl80211_start_ap(struct sk_bu
goto out;
}
@@ -152,7 +152,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params->chandef,
wdev->iftype)) {
err = -EINVAL;
@@ -10076,6 +10100,14 @@ skip_beacons:
@@ -10107,6 +10131,14 @@ skip_beacons:
if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
params.block_tx = true;

View File

@@ -91,7 +91,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ieee80211_operating_class_to_band - convert operating class to band
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3610,7 +3610,8 @@ static int __ieee80211_csa_finalize(stru
@@ -3612,7 +3612,8 @@ static int __ieee80211_csa_finalize(stru
if (err)
return err;
@@ -101,7 +101,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
return 0;
}
@@ -3882,7 +3883,7 @@ __ieee80211_channel_switch(struct wiphy
@@ -3884,7 +3885,7 @@ __ieee80211_channel_switch(struct wiphy
cfg80211_ch_switch_started_notify(sdata->dev,
&sdata->deflink.csa_chandef, 0,
@@ -132,7 +132,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/* use driver's channel switch callback */
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -19054,7 +19054,7 @@ static void nl80211_ch_switch_notify(str
@@ -19085,7 +19085,7 @@ static void nl80211_ch_switch_notify(str
struct cfg80211_chan_def *chandef,
gfp_t gfp,
enum nl80211_commands notif,
@@ -141,7 +141,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
{
struct wireless_dev *wdev = netdev->ieee80211_ptr;
struct sk_buff *msg;
@@ -19088,6 +19088,9 @@ static void nl80211_ch_switch_notify(str
@@ -19119,6 +19119,9 @@ static void nl80211_ch_switch_notify(str
goto nla_put_failure;
}
@@ -151,7 +151,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
genlmsg_end(msg, hdr);
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
@@ -19100,7 +19103,7 @@ static void nl80211_ch_switch_notify(str
@@ -19131,7 +19134,7 @@ static void nl80211_ch_switch_notify(str
void cfg80211_ch_switch_notify(struct net_device *dev,
struct cfg80211_chan_def *chandef,
@@ -160,7 +160,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
@@ -19109,7 +19112,7 @@ void cfg80211_ch_switch_notify(struct ne
@@ -19140,7 +19143,7 @@ void cfg80211_ch_switch_notify(struct ne
ASSERT_WDEV_LOCK(wdev);
WARN_INVALID_LINK_ID(wdev, link_id);
@@ -169,7 +169,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
switch (wdev->iftype) {
case NL80211_IFTYPE_STATION:
@@ -19137,14 +19140,15 @@ void cfg80211_ch_switch_notify(struct ne
@@ -19168,14 +19171,15 @@ void cfg80211_ch_switch_notify(struct ne
cfg80211_sched_dfs_chan_update(rdev);
nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL,
@@ -187,7 +187,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
@@ -19153,11 +19157,13 @@ void cfg80211_ch_switch_started_notify(s
@@ -19184,11 +19188,13 @@ void cfg80211_ch_switch_started_notify(s
ASSERT_WDEV_LOCK(wdev);
WARN_INVALID_LINK_ID(wdev, link_id);

View File

@@ -59,7 +59,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (sdata->vif.type == NL80211_IFTYPE_AP &&
params->mbssid_config.tx_wdev) {
err = ieee80211_set_ap_mbssid_options(sdata,
@@ -3569,6 +3574,12 @@ static int __ieee80211_csa_finalize(stru
@@ -3571,6 +3576,12 @@ static int __ieee80211_csa_finalize(stru
lockdep_assert_held(&local->mtx);
lockdep_assert_held(&local->chanctx_mtx);
@@ -72,7 +72,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/*
* using reservation isn't immediate as it may be deferred until later
* with multi-vif. once reservation is complete it will re-schedule the
@@ -3611,7 +3622,7 @@ static int __ieee80211_csa_finalize(stru
@@ -3613,7 +3624,7 @@ static int __ieee80211_csa_finalize(stru
return err;
cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0,
@@ -81,7 +81,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
return 0;
}
@@ -3873,9 +3884,13 @@ __ieee80211_channel_switch(struct wiphy
@@ -3875,9 +3886,13 @@ __ieee80211_channel_switch(struct wiphy
goto out;
}
@@ -95,7 +95,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (sdata->deflink.csa_block_tx)
ieee80211_stop_vif_queues(local, sdata,
@@ -3883,7 +3898,8 @@ __ieee80211_channel_switch(struct wiphy
@@ -3885,7 +3900,8 @@ __ieee80211_channel_switch(struct wiphy
cfg80211_ch_switch_started_notify(sdata->dev,
&sdata->deflink.csa_chandef, 0,

View File

@@ -17,7 +17,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2493,21 +2493,55 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2497,21 +2497,55 @@ int ieee80211_reconfig(struct ieee80211_
/* Finally also reconfigure all the BSS information */
list_for_each_entry(sdata, &local->interfaces, list) {
@@ -77,7 +77,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
}
switch (sdata->vif.type) {
@@ -2527,42 +2561,42 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2531,42 +2565,42 @@ int ieee80211_reconfig(struct ieee80211_
&sdata->deflink.tx_conf[i]);
break;
}
@@ -150,7 +150,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
break;
case NL80211_IFTYPE_OCB:
changed |= BSS_CHANGED_OCB;
@@ -2597,6 +2631,7 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2601,6 +2635,7 @@ int ieee80211_reconfig(struct ieee80211_
case NL80211_IFTYPE_NAN:
res = ieee80211_reconfig_nan(sdata);
if (res < 0) {
@@ -158,7 +158,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ieee80211_handle_reconfig_failure(local);
return res;
}
@@ -2614,6 +2649,10 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2618,6 +2653,10 @@ int ieee80211_reconfig(struct ieee80211_
WARN_ON(1);
break;
}

View File

@@ -17,7 +17,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2344,6 +2344,35 @@ static int ieee80211_reconfig_nan(struct
@@ -2348,6 +2348,35 @@ static int ieee80211_reconfig_nan(struct
return 0;
}
@@ -53,7 +53,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
int ieee80211_reconfig(struct ieee80211_local *local)
{
struct ieee80211_hw *hw = &local->hw;
@@ -2606,7 +2635,13 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2610,7 +2639,13 @@ int ieee80211_reconfig(struct ieee80211_
changed |= BSS_CHANGED_IBSS;
fallthrough;
case NL80211_IFTYPE_AP:
@@ -68,7 +68,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (sdata->vif.bss_conf.ftm_responder == 1 &&
wiphy_ext_feature_isset(sdata->local->hw.wiphy,
@@ -2616,6 +2651,13 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2620,6 +2655,13 @@ int ieee80211_reconfig(struct ieee80211_
if (sdata->vif.type == NL80211_IFTYPE_AP) {
changed |= BSS_CHANGED_AP_PROBE_RESP;

View File

@@ -132,7 +132,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -521,7 +521,7 @@ static void ieee80211_do_stop(struct iee
@@ -542,7 +542,7 @@ static void ieee80211_do_stop(struct iee
cancel_work_sync(&sdata->recalc_smps);
sdata_lock(sdata);
@@ -141,7 +141,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
"destroying interface with valid links 0x%04x\n",
sdata->vif.valid_links);
@@ -1834,7 +1834,7 @@ static int ieee80211_runtime_change_ifty
@@ -1855,7 +1855,7 @@ static int ieee80211_runtime_change_ifty
return -EBUSY;
/* for now, don't support changing while links exist */
@@ -485,7 +485,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
struct {
u8 id;
u8 len;
@@ -2542,7 +2542,7 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2546,7 +2546,7 @@ int ieee80211_reconfig(struct ieee80211_
continue;
sdata_lock(sdata);
@@ -494,7 +494,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
struct ieee80211_bss_conf *old[IEEE80211_MLD_MAX_NUM_LINKS] = {
[0] = &sdata->vif.bss_conf,
};
@@ -2562,7 +2562,7 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2566,7 +2566,7 @@ int ieee80211_reconfig(struct ieee80211_
for (link_id = 0;
link_id < ARRAY_SIZE(sdata->vif.link_conf);
link_id++) {
@@ -503,7 +503,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
!(sdata->vif.active_links & BIT(link_id)))
continue;
@@ -2594,12 +2594,12 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2598,12 +2598,12 @@ int ieee80211_reconfig(struct ieee80211_
if (sdata->vif.bss_conf.mu_mimo_owner)
changed |= BSS_CHANGED_MU_GROUPS;
@@ -518,7 +518,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
changed |= BSS_CHANGED_ASSOC |
BSS_CHANGED_ARP_FILTER |
BSS_CHANGED_PS;
@@ -2637,7 +2637,7 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2641,7 +2641,7 @@ int ieee80211_reconfig(struct ieee80211_
case NL80211_IFTYPE_AP:
changed |= BSS_CHANGED_P2P_PS;
@@ -527,7 +527,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ieee80211_vif_cfg_change_notify(sdata,
BSS_CHANGED_SSID);
else
@@ -2651,7 +2651,7 @@ int ieee80211_reconfig(struct ieee80211_
@@ -2655,7 +2655,7 @@ int ieee80211_reconfig(struct ieee80211_
if (sdata->vif.type == NL80211_IFTYPE_AP) {
changed |= BSS_CHANGED_AP_PROBE_RESP;

View File

@@ -56,7 +56,7 @@
__NL80211_ATTR_AFTER_LAST,
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3077,6 +3077,19 @@ static int ieee80211_get_tx_power(struct
@@ -3079,6 +3079,19 @@ static int ieee80211_get_tx_power(struct
return 0;
}
@@ -76,7 +76,7 @@
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -5007,6 +5020,7 @@ const struct cfg80211_ops mac80211_confi
@@ -5009,6 +5022,7 @@ const struct cfg80211_ops mac80211_confi
.set_wiphy_params = ieee80211_set_wiphy_params,
.set_tx_power = ieee80211_set_tx_power,
.get_tx_power = ieee80211_get_tx_power,
@@ -118,7 +118,7 @@
if (local->hw.conf.power_level != power) {
changed |= IEEE80211_CONF_CHANGE_POWER;
local->hw.conf.power_level = power;
@@ -759,6 +765,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
@@ -766,6 +772,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
IEEE80211_RADIOTAP_MCS_HAVE_BW;
local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
@@ -128,7 +128,7 @@
local->hw.max_mtu = IEEE80211_MAX_DATA_LEN;
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -820,6 +820,7 @@ static const struct nla_policy nl80211_p
@@ -830,6 +830,7 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
[NL80211_ATTR_PUNCT_BITMAP] = NLA_POLICY_RANGE(NLA_U8, 0, 0xffff),
@@ -136,7 +136,7 @@
};
/* policy for the key attributes */
@@ -3547,6 +3548,22 @@ static int nl80211_set_wiphy(struct sk_b
@@ -3584,6 +3585,22 @@ static int nl80211_set_wiphy(struct sk_b
if (result)
goto out;
}

View File

@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2368,6 +2368,13 @@ static void sta_stats_decode_rate(struct
@@ -2382,6 +2382,13 @@ static void sta_stats_decode_rate(struct
sband = local->hw.wiphy->bands[band];

View File

@@ -0,0 +1,33 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8101
PKG_VERSION:=1.039.00
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8101/releases/download/$(PKG_VERSION)
PKG_HASH:=e64e1738e71d6717dd844bf771fea4691edae63e92d7d03bb5ad2ef08e56e72b
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Alvaro Fernandez Rojas <noltari@gmail.com>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/r8101
SUBMENU:=Network Devices
TITLE:=Realtek RTL8101 PCI Fast Ethernet driver
DEPENDS:=@PCI_SUPPORT +kmod-libphy
FILES:=$(PKG_BUILD_DIR)/src/r8101.ko
AUTOLOAD:=$(call AutoProbe,r8101)
PROVIDES:=kmod-r8169
endef
define Build/Compile
+$(KERNEL_MAKE) $(PKG_JOBS) \
M="$(PKG_BUILD_DIR)/src" \
modules
endef
$(eval $(call KernelPackage,r8101))

View File

@@ -0,0 +1,100 @@
From ec0de750e20073b23c91b67f4bc3ab71c50f0eed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Sat, 17 Aug 2024 21:19:54 +0200
Subject: [PATCH] r8101: print link speed and duplex mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/r8101.h | 2 ++
src/r8101_n.c | 42 +++++++++++++++++++++++++++++++++++++++---
2 files changed, 41 insertions(+), 3 deletions(-)
--- a/src/r8101.h
+++ b/src/r8101.h
@@ -1162,6 +1162,8 @@ enum RTL8101_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8101_FULL_DUPLEX_MASK (FullDup)
+
/* ResetCounterCommand */
CounterReset = 0x1,
/* DumpCounterCommand */
--- a/src/r8101_n.c
+++ b/src/r8101_n.c
@@ -39,6 +39,7 @@ This driver is modified from r8169.c in
#include <linux/module.h>
#include <linux/version.h>
#include <linux/pci.h>
+#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -2838,6 +2839,34 @@ rtl8101_issue_offset_99_event(struct rtl
}
}
+static unsigned int rtl8101_phy_duplex(u8 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & RTL8101_FULL_DUPLEX_MASK)
+ duplex = DUPLEX_FULL;
+ else
+ duplex = DUPLEX_HALF;
+ }
+
+ return duplex;
+}
+
+static int rtl8101_phy_speed(u8 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _100bps)
+ speed = SPEED_100;
+ else if (status & _10bps)
+ speed = SPEED_10;
+ }
+
+ return speed;
+}
+
static void
rtl8101_check_link_status(struct net_device *dev)
{
@@ -2913,8 +2942,15 @@ rtl8101_check_link_status(struct net_dev
tp->phy_reg_aner = rtl8101_mdio_read(tp, MII_EXPANSION);
tp->phy_reg_anlpar = rtl8101_mdio_read(tp, MII_LPA);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u8 phy_status = RTL_R8(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8101_phy_duplex(phy_status);
+ const int phy_speed = rtl8101_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",
+ dev->name,
+ phy_speed_to_str(phy_speed),
+ phy_duplex_to_str(phy_duplex));
+ }
} else {
if (tp->mcfg == CFG_METHOD_11 || tp->mcfg == CFG_METHOD_12 ||
tp->mcfg == CFG_METHOD_13) {
@@ -2925,7 +2961,7 @@ rtl8101_check_link_status(struct net_dev
rtl8101_mdio_write(tp, 0x1F, 0x0000);
}
if (netif_msg_ifdown(tp))
- printk(KERN_INFO PFX "%s: link down\n", dev->name);
+ printk(KERN_INFO PFX "%s: Link is Down\n", dev->name);
tp->phy_reg_aner = 0;
tp->phy_reg_anlpar = 0;

View File

@@ -0,0 +1,46 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8125
PKG_VERSION:=9.013.02
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8125/releases/download/$(PKG_VERSION)
PKG_HASH:=d36410ee99c956f250d9cd08340d8c36567d190f420a8ee128ff6e51225aac0c
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Alvaro Fernandez Rojas <noltari@gmail.com>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/r8125
SUBMENU:=Network Devices
TITLE:=Realtek RTL8125 PCI 2.5 Gigabit Ethernet driver
DEPENDS:=@PCI_SUPPORT +kmod-libphy
FILES:=$(PKG_BUILD_DIR)/src/r8125.ko
AUTOLOAD:=$(call AutoProbe,r8125)
PROVIDES:=kmod-r8169
VARIANT:=regular
endef
define KernelPackage/r8125-rss
$(call KernelPackage/r8125)
TITLE+= (RSS)
VARIANT:=rss
endef
ifeq ($(BUILD_VARIANT),rss)
PKG_MAKE_FLAGS += ENABLE_RSS_SUPPORT=y
endif
define Build/Compile
+$(KERNEL_MAKE) $(PKG_JOBS) \
$(PKG_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/src" \
modules
endef
$(eval $(call KernelPackage,r8125))
$(eval $(call KernelPackage,r8125-rss))

View File

@@ -0,0 +1,26 @@
From cd20cf48c0ec2a01fd9f512e25218a6ac8131794 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Sat, 17 Aug 2024 22:07:23 +0200
Subject: [PATCH] r8125_rss: silence rxnfc log
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This log is noisy and useless, just ignore it.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
src/r8125_rss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/r8125_rss.c
+++ b/src/r8125_rss.c
@@ -91,7 +91,7 @@ int rtl8125_get_rxnfc(struct net_device
struct rtl8125_private *tp = netdev_priv(dev);
int ret = -EOPNOTSUPP;
- netif_info(tp, drv, tp->dev, "rss get rxnfc\n");
+ netif_dbg(tp, drv, tp->dev, "rss get rxnfc\n");
if (!(dev->features & NETIF_F_RXHASH))
return ret;

View File

@@ -0,0 +1,100 @@
From e351ac87bc3135e8555587e0bf80efb248ade0b7 Mon Sep 17 00:00:00 2001
From: Chukun Pan <amadeus@jmu.edu.cn>
Date: Sun, 4 Aug 2024 21:16:23 +0800
Subject: [PATCH] r8125: print link speed and duplex mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/r8125.h | 2 ++
src/r8125_n.c | 46 +++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 45 insertions(+), 3 deletions(-)
--- a/src/r8125.h
+++ b/src/r8125.h
@@ -1563,6 +1563,8 @@ enum RTL8125_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8125_FULL_DUPLEX_MASK (_2500bpsF | _1000bpsF | FullDup)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
Fix_Nak_2 = (1 << 3),
--- a/src/r8125_n.c
+++ b/src/r8125_n.c
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/pci.h>
+#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -5112,6 +5113,38 @@ rtl8125_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8125_phy_duplex(u16 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & RTL8125_FULL_DUPLEX_MASK)
+ duplex = DUPLEX_FULL;
+ else
+ duplex = DUPLEX_HALF;
+ }
+
+ return duplex;
+}
+
+static int rtl8125_phy_speed(u16 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _2500bpsF)
+ speed = SPEED_2500;
+ else if (status & _1000bpsF)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
+ else if (status & _10bps)
+ speed = SPEED_10;
+ }
+
+ return speed;
+}
+
static void
_rtl8125_check_link_status(struct net_device *dev)
{
@@ -5120,11 +5153,18 @@ _rtl8125_check_link_status(struct net_de
if (tp->link_ok(dev)) {
rtl8125_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u16 phy_status = RTL_R16(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8125_phy_duplex(phy_status);
+ const int phy_speed = rtl8125_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",
+ dev->name,
+ phy_speed_to_str(phy_speed),
+ phy_duplex_to_str(phy_duplex));
+ }
} else {
if (netif_msg_ifdown(tp))
- printk(KERN_INFO PFX "%s: link down\n", dev->name);
+ printk(KERN_INFO PFX "%s: Link is Down\n", dev->name);
rtl8125_link_down_patch(dev);
}

View File

@@ -0,0 +1,46 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8126
PKG_VERSION:=10.013.00
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8126/releases/download/$(PKG_VERSION)
PKG_HASH:=b41bda6ff3bbb7d9bc5b81c5c21355f031587d3a3a5862abcd4d766e942272e7
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Alvaro Fernandez Rojas <noltari@gmail.com>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/r8126
SUBMENU:=Network Devices
TITLE:=Realtek RTL8126 PCI 5 Gigabit Ethernet driver
DEPENDS:=@PCI_SUPPORT +kmod-libphy
FILES:=$(PKG_BUILD_DIR)/src/r8126.ko
AUTOLOAD:=$(call AutoProbe,r8126)
PROVIDES:=kmod-r8169
VARIANT:=regular
endef
define KernelPackage/r8126-rss
$(call KernelPackage/r8126)
TITLE+= (RSS)
VARIANT:=rss
endef
ifeq ($(BUILD_VARIANT),rss)
PKG_MAKE_FLAGS += ENABLE_RSS_SUPPORT=y
endif
define Build/Compile
+$(KERNEL_MAKE) $(PKG_JOBS) \
$(PKG_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/src" \
modules
endef
$(eval $(call KernelPackage,r8126))
$(eval $(call KernelPackage,r8126-rss))

View File

@@ -0,0 +1,21 @@
From 9649df50a239d1379cc8d9febd4854a0c7ca0731 Mon Sep 17 00:00:00 2001
From: Mieczyslaw Nalewaj <namiltd@poczta.onet.pl>
Date: Sat, 10 Aug 2024 17:42:44 +0200
Subject: [PATCH] r8126.h: use BIT_ULL
Fixes compilation on 32 bit systems.
---
src/r8126.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/r8126.h
+++ b/src/r8126.h
@@ -678,7 +678,7 @@ This is free software, and you are welco
#ifndef ADVERTISED_2500baseX_Full
#define ADVERTISED_2500baseX_Full 0x8000
#endif
-#define RTK_ADVERTISED_5000baseX_Full BIT(48)
+#define RTK_ADVERTISED_5000baseX_Full BIT_ULL(48)
#define RTK_ADVERTISE_2500FULL 0x80
#define RTK_ADVERTISE_5000FULL 0x100

View File

@@ -0,0 +1,27 @@
From cd20cf48c0ec2a01fd9f512e25218a6ac8131794 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Sat, 17 Aug 2024 22:07:23 +0200
Subject: [PATCH] r8126_rss: silence rxnfc log
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This log is noisy and useless, just ignore it.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/r8126_rss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/r8126_rss.c
+++ b/src/r8126_rss.c
@@ -91,7 +91,7 @@ int rtl8126_get_rxnfc(struct net_device
struct rtl8126_private *tp = netdev_priv(dev);
int ret = -EOPNOTSUPP;
- netif_info(tp, drv, tp->dev, "rss get rxnfc\n");
+ netif_dbg(tp, drv, tp->dev, "rss get rxnfc\n");
if (!(dev->features & NETIF_F_RXHASH))
return ret;

View File

@@ -0,0 +1,102 @@
From 5ca1d47e065c0318774a946ffdf76010c78cc164 Mon Sep 17 00:00:00 2001
From: Chukun Pan <amadeus@jmu.edu.cn>
Date: Sat, 10 Aug 2024 20:16:32 +0800
Subject: [PATCH] r8126: print link speed and duplex mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/r8126.h | 2 ++
src/r8126_n.c | 48 +++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 47 insertions(+), 3 deletions(-)
--- a/src/r8126.h
+++ b/src/r8126.h
@@ -1561,6 +1561,8 @@ enum RTL8126_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8126_FULL_DUPLEX_MASK (_5000bpsF | _2500bpsF | _1000bpsF | FullDup)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
Fix_Nak_2 = (1 << 3),
--- a/src/r8126_n.c
+++ b/src/r8126_n.c
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/pci.h>
+#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -4740,6 +4741,40 @@ rtl8126_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8126_phy_duplex(u16 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & RTL8126_FULL_DUPLEX_MASK)
+ duplex = DUPLEX_FULL;
+ else
+ duplex = DUPLEX_HALF;
+ }
+
+ return duplex;
+}
+
+static int rtl8126_phy_speed(u16 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _5000bpsF)
+ speed = SPEED_5000;
+ else if (status & _2500bpsF)
+ speed = SPEED_2500;
+ else if (status & _1000bpsF)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
+ else if (status & _10bps)
+ speed = SPEED_10;
+ }
+
+ return speed;
+}
+
static void
_rtl8126_check_link_status(struct net_device *dev)
{
@@ -4748,11 +4783,18 @@ _rtl8126_check_link_status(struct net_de
if (tp->link_ok(dev)) {
rtl8126_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u16 phy_status = RTL_R16(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8126_phy_duplex(phy_status);
+ const int phy_speed = rtl8126_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",
+ dev->name,
+ phy_speed_to_str(phy_speed),
+ phy_duplex_to_str(phy_duplex));
+ }
} else {
if (netif_msg_ifdown(tp))
- printk(KERN_INFO PFX "%s: link down\n", dev->name);
+ printk(KERN_INFO PFX "%s: Link is Down\n", dev->name);
rtl8126_link_down_patch(dev);
}

View File

@@ -0,0 +1,33 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8168
PKG_VERSION:=8.053.00
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8168/releases/download/$(PKG_VERSION)
PKG_HASH:=52f1e6200672b598a04d4ac21ac92a8a9e128b38208c7b03a464bfa93bbfcc8f
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Alvaro Fernandez Rojas <noltari@gmail.com>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/r8168
SUBMENU:=Network Devices
TITLE:=Realtek RTL8168 PCI Gigabit Ethernet driver
DEPENDS:=@PCI_SUPPORT +kmod-libphy
FILES:=$(PKG_BUILD_DIR)/src/r8168.ko
AUTOLOAD:=$(call AutoProbe,r8168)
PROVIDES:=kmod-r8169
endef
define Build/Compile
+$(KERNEL_MAKE) $(PKG_JOBS) \
M="$(PKG_BUILD_DIR)/src" \
modules
endef
$(eval $(call KernelPackage,r8168))

View File

@@ -0,0 +1,28 @@
From c0e1ae03f564f0e3db492ef2f25357b5da7977d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Sat, 10 Aug 2024 20:12:40 +0200
Subject: [PATCH] r8168_n: fix proc_dump_rx_desc_2 on 32 bits
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/r8168_n.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -1655,9 +1655,9 @@ static int proc_dump_rx_desc_2(struct se
j, k);
for (i=0; i<(tp->RxDescLength/4); i++) {
if (!(i % 4))
- seq_printf(m, "\n%04llx ",
- ((u64)pdword + (i * 4) -
- (u64)tp->RxDescArray));
+ seq_printf(m, "\n%04x ",
+ (u32) ((uintptr_t)pdword + (i * 4) -
+ (uintptr_t)tp->RxDescArray));
seq_printf(m, "%08x ", pdword[i]);
}
}

View File

@@ -0,0 +1,98 @@
From 0078930e0c374d327cd3281e5e2f7ff97b40b335 Mon Sep 17 00:00:00 2001
From: Chukun Pan <amadeus@jmu.edu.cn>
Date: Sun, 4 Aug 2024 16:15:12 +0800
Subject: [PATCH] r8168: print link speed and duplex mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
src/r8168.h | 2 ++
src/r8168_n.c | 44 +++++++++++++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 3 deletions(-)
--- a/src/r8168.h
+++ b/src/r8168.h
@@ -1385,6 +1385,8 @@ enum RTL8168_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8168_FULL_DUPLEX_MASK (_1000bpsF | FullDup)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
Fix_Nak_2 = (1 << 3),
--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -43,6 +43,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/pci.h>
+#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -5373,6 +5374,36 @@ rtl8168_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8168_phy_duplex(u8 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & RTL8168_FULL_DUPLEX_MASK)
+ duplex = DUPLEX_FULL;
+ else
+ duplex = DUPLEX_HALF;
+ }
+
+ return duplex;
+}
+
+static int rtl8168_phy_speed(u8 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _1000bpsF)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
+ else if (status & _10bps)
+ speed = SPEED_10;
+ }
+
+ return speed;
+}
+
static void
rtl8168_check_link_status(struct net_device *dev)
{
@@ -5392,11 +5423,18 @@ rtl8168_check_link_status(struct net_dev
if (link_status_on) {
rtl8168_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u8 phy_status = RTL_R8(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8168_phy_duplex(phy_status);
+ const int phy_speed = rtl8168_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",
+ dev->name,
+ phy_speed_to_str(phy_speed),
+ phy_duplex_to_str(phy_duplex));
+ }
} else {
if (netif_msg_ifdown(tp))
- printk(KERN_INFO PFX "%s: link down\n", dev->name);
+ printk(KERN_INFO PFX "%s: Link is Down\n", dev->name);
rtl8168_link_down_patch(dev);
}

View File

@@ -0,0 +1,30 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ubootenv-nvram
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ubootenv-nvram
SUBMENU:=Other modules
TITLE:=NVRAM environment for uboot-envtools
FILES:=$(PKG_BUILD_DIR)/ubootenv-nvram.ko
AUTOLOAD:=$(call AutoLoad,30,ubootenv-nvram,1)
KCONFIG:=
endef
define KernelPackage/ubootenv-nvram/description
Support vendor modified U-Boot storing the environment
in RAM. This driver exports the environment memory
region as a misc device named "ubootenv", pretending
it is a NOR mtd device to let existing userspace tools
work without modifications.
endef
define Build/Compile
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
endef
$(eval $(call KernelPackage,ubootenv-nvram))

View File

@@ -0,0 +1 @@
obj-m += ubootenv-nvram.o

View File

@@ -0,0 +1,158 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2022 Bjørn Mork <bjorn@mork.no>
*/
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/of.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#define NAME "ubootenv"
struct ubootenv_drvdata {
void *env;
struct reserved_mem *rmem;
struct miscdevice misc;
};
static inline struct ubootenv_drvdata *to_ubootenv_drvdata(struct file *file)
{
return container_of(file->private_data, struct ubootenv_drvdata, misc);
}
static ssize_t ubootenv_write(struct file *file, const char __user *buffer, size_t count,
loff_t *ppos)
{
struct ubootenv_drvdata *data = to_ubootenv_drvdata(file);
if (!data->env)
return -EIO;
return simple_write_to_buffer(data->env, data->rmem->size, ppos, buffer, count);
}
static ssize_t ubootenv_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
struct ubootenv_drvdata *data = to_ubootenv_drvdata(file);
if (!data->env)
return 0;
return simple_read_from_buffer(buffer, count, ppos, data->env, data->rmem->size);
}
static loff_t ubootenv_llseek(struct file *file, loff_t off, int whence)
{
struct ubootenv_drvdata *data = to_ubootenv_drvdata(file);
return fixed_size_llseek(file, off, whence, data->rmem->size);
}
/* Faking the minimal mtd ioctl subset required by the fw_env.c */
static long ubootenv_ioctl(struct file *file, u_int cmd, u_long arg)
{
struct ubootenv_drvdata *data = to_ubootenv_drvdata(file);
void __user *argp = (void __user *)arg;
struct mtd_info_user info = {
.type = MTD_NORFLASH,
.size = data->rmem->size,
};
switch (cmd) {
case MEMISLOCKED:
case MEMERASE:
break;
case MEMGETINFO:
if (copy_to_user(argp, &info, sizeof(struct mtd_info_user)))
return -EFAULT;
break;
default:
return -ENOTTY;
}
return 0;
}
static const struct file_operations ubootenv_fops = {
.owner = THIS_MODULE,
.read = ubootenv_read,
.write = ubootenv_write,
.llseek = ubootenv_llseek,
.unlocked_ioctl = ubootenv_ioctl,
};
/* We can only map a single reserved-memory range */
static struct ubootenv_drvdata drvdata = {
.misc = {
.fops = &ubootenv_fops,
.minor = MISC_DYNAMIC_MINOR,
.name = NAME,
},
};
const struct of_device_id of_ubootenv_match[] = {
{ .compatible = "ubootenv" },
{},
};
MODULE_DEVICE_TABLE(of, of_ubootenv_match);
static int ubootenv_probe(struct platform_device *pdev)
{
struct ubootenv_drvdata *data = &drvdata;
struct device *dev = &pdev->dev;
struct device_node *np;
/* enforce single instance */
if (data->env)
return -EINVAL;
np = of_parse_phandle(dev->of_node, "memory-region", 0);
if (!np)
return -ENODEV;
data->rmem = of_reserved_mem_lookup(np);
of_node_put(np);
if (!data->rmem)
return -ENODEV;
if (!data->rmem->size || (data->rmem->size > ULONG_MAX))
return -EINVAL;
if (!PAGE_ALIGNED(data->rmem->base) || !PAGE_ALIGNED(data->rmem->size))
return -EINVAL;
data->env = devm_memremap(&pdev->dev, data->rmem->base, data->rmem->size, MEMREMAP_WB);
platform_set_drvdata(pdev, data);
data->misc.parent = &pdev->dev;
return misc_register(&data->misc);
}
static int ubootenv_remove(struct platform_device *pdev)
{
struct ubootenv_drvdata *data = platform_get_drvdata(pdev);
data->env = NULL;
misc_deregister(&data->misc);
return 0;
}
static struct platform_driver ubootenv_driver = {
.probe = ubootenv_probe,
.remove = ubootenv_remove,
.driver = {
.name = NAME,
.owner = THIS_MODULE,
.of_match_table = of_ubootenv_match,
},
};
module_platform_driver(ubootenv_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Bjørn Mork <bjorn@mork.no>");
MODULE_DESCRIPTION("Access u-boot environment in RAM");

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mbedtls
PKG_VERSION:=2.28.8
PKG_VERSION:=2.28.9
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=4fef7de0d8d542510d726d643350acb3cdb9dc76ad45611b59c9aa08372b4213
PKG_HASH:=e4dbcf86a4fb31506482888560f02b161e0ecfb82fee0643abcfc86abee5817e
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=gpl-2.0.txt

View File

@@ -22,7 +22,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
* If the verification couldn't be completed, the flag value is
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -45,6 +45,10 @@
@@ -46,6 +46,10 @@
#if defined(MBEDTLS_HAVE_TIME)
#if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)
@@ -33,7 +33,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
#include <windows.h>
#else
#include <time.h>
@@ -2990,6 +2994,61 @@ find_parent:
@@ -2991,6 +2995,61 @@ find_parent:
}
}
@@ -95,7 +95,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
/*
* Check for CN match
*/
@@ -3010,24 +3069,51 @@ static int x509_crt_check_cn(const mbedt
@@ -3011,24 +3070,51 @@ static int x509_crt_check_cn(const mbedt
return -1;
}
@@ -158,7 +158,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
}
/*
@@ -3038,31 +3124,23 @@ static void x509_crt_verify_name(const m
@@ -3039,31 +3125,23 @@ static void x509_crt_verify_name(const m
uint32_t *flags)
{
const mbedtls_x509_name *name;

View File

@@ -179,6 +179,8 @@ define Build/InstallDev
$(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
$(2)/bin/ncursesw6-config
ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config
$(SED) 's,$(TOOLCHAIN_DIR),$(STAGING_DIR),g' \
$(1)/usr/lib/pkgconfig/ncursesw.pc
endef
define Host/Compile

View File

@@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=openssl
PKG_VERSION:=3.0.14
PKG_RELEASE:=2
PKG_VERSION:=3.0.15
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
PKG_BUILD_PARALLEL:=1
@@ -19,12 +19,13 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \
http://www.openssl.org/source/ \
http://www.openssl.org/source/old/$(PKG_BASE)/ \
https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ \
http://ftp.fi.muni.cz/pub/openssl/source/ \
http://ftp.fi.muni.cz/pub/openssl/source/old/$(PKG_BASE)/ \
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
PKG_HASH:=eeca035d4dd4e84fc25846d952da6297484afa0650a6f84c682e39df3a4123ca
PKG_HASH:=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
PKG_RELEASE:=7
PKG_RELEASE:=8
PKG_SOURCE_URL:=http://w1.fi/hostap.git
PKG_SOURCE_PROTO:=git

View File

@@ -434,7 +434,7 @@ append_iw_anqp_3gpp_cell_net() {
if [ -z "$iw_anqp_3gpp_cell_net_conf" ]; then
iw_anqp_3gpp_cell_net_conf="$1"
else
iw_anqp_3gpp_cell_net_conf="$iw_anqp_3gpp_cell_net_conf:$1"
iw_anqp_3gpp_cell_net_conf="$iw_anqp_3gpp_cell_net_conf;$1"
fi
}

View File

@@ -0,0 +1,43 @@
From 364c2da8741f0979dae497551e70b94c0e6c8636 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Sun, 7 Jul 2024 11:46:49 +0300
Subject: [PATCH] SAE: Check for invalid Rejected Groups element length
explicitly
Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.
Signed-off-by: Jouni Malinen <j@w1.fi>
---
src/ap/ieee802_11.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1223,7 +1223,7 @@ static int check_sae_rejected_groups(str
struct sae_data *sae)
{
const struct wpabuf *groups;
- size_t i, count;
+ size_t i, count, len;
const u8 *pos;
if (!sae->tmp)
@@ -1233,7 +1233,15 @@ static int check_sae_rejected_groups(str
return 0;
pos = wpabuf_head(groups);
- count = wpabuf_len(groups) / 2;
+ len = wpabuf_len(groups);
+ if (len & 1) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: Invalid length of the Rejected Groups element payload: %zu",
+ len);
+ return 1;
+ }
+
+ count = len / 2;
for (i = 0; i < count; i++) {
int enabled;
u16 group;

View File

@@ -0,0 +1,42 @@
From 593a7c2f8c93edd6b552f2d42e28164464b4e6ff Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Tue, 9 Jul 2024 23:33:38 +0300
Subject: [PATCH] SAE: Check for invalid Rejected Groups element length
explicitly on STA
Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.
Fixes: 444d76f74f65 ("SAE: Check that peer's rejected groups are not enabled")
Signed-off-by: Jouni Malinen <j@w1.fi>
---
wpa_supplicant/sme.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -1596,14 +1596,21 @@ static int sme_sae_is_group_enabled(stru
static int sme_check_sae_rejected_groups(struct wpa_supplicant *wpa_s,
const struct wpabuf *groups)
{
- size_t i, count;
+ size_t i, count, len;
const u8 *pos;
if (!groups)
return 0;
pos = wpabuf_head(groups);
- count = wpabuf_len(groups) / 2;
+ len = wpabuf_len(groups);
+ if (len & 1) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: Invalid length of the Rejected Groups element payload: %zu",
+ len);
+ return 1;
+ }
+ count = len / 2;
for (i = 0; i < count; i++) {
int enabled;
u16 group;

View File

@@ -0,0 +1,30 @@
From 9716bf1160beb677e965d9e6475d6c9e162e8374 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Tue, 9 Jul 2024 23:34:34 +0300
Subject: [PATCH] SAE: Reject invalid Rejected Groups element in the parser
There is no need to depend on all uses (i.e., both hostapd and
wpa_supplicant) to verify that the length of the Rejected Groups field
in the Rejected Groups element is valid (i.e., a multiple of two octets)
since the common parser can reject the message when detecting this.
Signed-off-by: Jouni Malinen <j@w1.fi>
---
src/common/sae.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/src/common/sae.c
+++ b/src/common/sae.c
@@ -2120,6 +2120,12 @@ static int sae_parse_rejected_groups(str
return WLAN_STATUS_UNSPECIFIED_FAILURE;
epos++; /* skip ext ID */
len--;
+ if (len & 1) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: Invalid length of the Rejected Groups element payload: %u",
+ len);
+ return WLAN_STATUS_UNSPECIFIED_FAILURE;
+ }
wpabuf_free(sae->tmp->peer_rejected_groups);
sae->tmp->peer_rejected_groups = wpabuf_alloc(len);

View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=lldpd
PKG_VERSION:=1.0.17
PKG_RELEASE:=1
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/
@@ -31,7 +31,7 @@ define Package/lldpd
CATEGORY:=Network
SUBMENU:=Routing and Redirection
TITLE:=Link Layer Discovery Protocol daemon
URL:=https://vincentbernat.github.io/lldpd/
URL:=https://lldpd.github.io/
DEPENDS:=+libcap +libevent2 +USE_GLIBC:libbsd +LLDPD_WITH_JSON:libjson-c +LLDPD_WITH_SNMP:libnetsnmp
USERID:=lldp=121:lldp=129
MENU:=1
@@ -68,19 +68,28 @@ define Package/lldpd/install
$(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd
$(INSTALL_CONF) ./files/lldpd.config $(1)/etc/config/lldpd
ifneq ($(CONFIG_LLDPD_WITH_CDP),y)
sed -i -e '/cdp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
sed -i -e 's/CONFIG_LLDPD_WITH_CDP=y/CONFIG_LLDPD_WITH_CDP=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/cdp/d' $(1)/etc/config/lldpd
endif
ifneq ($(CONFIG_LLDPD_WITH_FDP),y)
sed -i -e '/fdp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
sed -i -e 's/CONFIG_LLDPD_WITH_FDP=y/CONFIG_LLDPD_WITH_FDP=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/fdp/d' $(1)/etc/config/lldpd
endif
ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
sed -i -e '/edp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
sed -i -e 's/CONFIG_LLDPD_WITH_EDP=y/CONFIG_LLDPD_WITH_EDP=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/edp/d' $(1)/etc/config/lldpd
endif
ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
sed -i -e '/sonmp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
sed -i -e 's/CONFIG_LLDPD_WITH_SONMP=y/CONFIG_LLDPD_WITH_SONMP=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/sonmp/d' $(1)/etc/config/lldpd
endif
ifneq ($(CONFIG_LLDPD_WITH_SNMP),y)
sed -i -e '/agentxsocket/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
sed -i -e 's/CONFIG_LLDPD_WITH_SNMP=y/CONFIG_LLDPD_WITH_SNMP=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd
endif
ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y)
sed -i -e 's/CONFIG_LLDPD_WITH_LLDPMED=y/CONFIG_LLDPD_WITH_LLDPMED=n/g' $(1)/etc/init.d/lldpd
sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd
endif
endef

View File

@@ -7,7 +7,9 @@ config lldpd config
option agentxsocket /var/run/agentx.sock
option lldp_class 4
option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4"
# lldp_policy only needed for lldp_class 2-3
# option lldp_policy 'application streaming-video unknown'
option lldp_location "address country EU"
# if empty, the distribution description is sent
#option lldp_description "OpenWrt System"

View File

@@ -1,15 +1,29 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2015 OpenWrt.org
# shellcheck disable=1091,2034,3037,3043,3045
START=90
STOP=01
CONFIG_LLDPD_WITH_CDP=y
CONFIG_LLDPD_WITH_EDP=y
CONFIG_LLDPD_WITH_FDP=y
CONFIG_LLDPD_WITH_LLDPMED=y
CONFIG_LLDPD_WITH_SNMP=y
CONFIG_LLDPD_WITH_SONMP=y
USE_PROCD=1
LLDPDBIN=/usr/sbin/lldpd
LLDPCLI=/usr/sbin/lldpcli
LLDPSOCKET=/var/run/lldpd.socket
LLDPD_CONF=/tmp/lldpd.conf
LLDPD_CONFS_DIR=/tmp/lldpd.d
LLDPD_RUN=/var/run/lldpd
LLDPD_RESTART_HASH=${LLDPD_RUN}/lldpd.restart_hash
. "$IPKG_INSTROOT/lib/functions/network.sh"
find_release_info()
{
[ -s /etc/os-release ] && . /etc/os-release
@@ -19,10 +33,73 @@ find_release_info()
echo "${PRETTY_NAME:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)"
}
get_config_restart_hash() {
local var="$1"
local _string _hash v
config_load 'lldpd'
config_get v 'config' 'lldp_class'; append _string "$v" ","
if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then
config_get v 'config' 'agentxsocket'; append _string "$v" ","
fi
config_get v 'config' 'cid_interface'; append _string "$v" ","
config_get v 'config' 'filter'; append _string "$v" ","
config_get_bool v 'config' 'readonly_mode'; append _string "$v" ","
config_get_bool v 'config' 'lldp_no_version'; append _string "$v" ","
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
config_get_bool v 'config' 'lldpmed_no_inventory'; append _string "$v" ","
fi
config_get_bool v 'config' 'enable_lldp' 1; append _string "$v" ","
config_get_bool v 'config' 'force_lldp'; append _string "$v" ","
if [ "$CONFIG_LLDPD_WITH_CDP" = "y" ]; then
config_get_bool v 'config' 'enable_cdp'; append _string "$v" ","
config_get v 'config' 'cdp_version'; append _string "$v" ","
config_get_bool v 'config' 'force_cdp'; append _string "$v" ","
config_get_bool v 'config' 'force_cdpv2'; append _string "$v" ","
fi
if [ "$CONFIG_LLDPD_WITH_EDP" = "y" ]; then
config_get_bool v 'config' 'enable_edp'; append _string "$v" ","
config_get_bool v 'config' 'force_edp'; append _string "$v" ","
fi
if [ "$CONFIG_LLDPD_WITH_FDP" = "y" ]; then
config_get_bool v 'config' 'enable_fdp'; append _string "$v" ","
config_get_bool v 'config' 'force_fdp'; append _string "$v" ","
fi
if [ "$CONFIG_LLDPD_WITH_SONMP" = "y" ]; then
config_get_bool v 'config' 'enable_sonmp'; append _string "$v" ","
config_get_bool v 'config' 'force_sonmp'; append _string "$v" ","
fi
_hash=$(echo -n "${_string}" | md5sum | awk '{ print $1 }')
export -n "$var=$_hash"
}
get_config_cid_ifaces() {
local _ifaces
config_get _ifaces 'config' "$2"
local _iface _ifnames=""
# Set noglob to prevent '*' capturing diverse file names in the for ... in
set -o noglob
for _iface in $_ifaces; do
local _l2device=""
if network_get_physdev _l2device "$_iface" || [ -e "/sys/class/net/$_iface" ]; then
append _ifnames "${_l2device:-$_iface}" ","
else
# Glob case (interface is e.g. '!eth1' or 'eth*' or '*')
append _ifnames "$_iface" ","
fi
done
# Turn noglob off i.e. enable glob again
set +o noglob
export -n "${1}=$_ifnames"
}
write_lldpd_conf()
{
. /lib/functions/network.sh
local lldp_description
config_load 'lldpd'
@@ -31,94 +108,294 @@ write_lldpd_conf()
local lldp_hostname
config_get lldp_hostname 'config' 'lldp_hostname' "$(cat /proc/sys/kernel/hostname)"
local ifaces
config_get ifaces 'config' 'interface'
local iface ifnames=""
for iface in $ifaces; do
local ifname=""
if network_get_device ifname "$iface" || [ -e "/sys/class/net/$iface" ]; then
append ifnames "${ifname:-$iface}" ","
fi
done
local ifnames
get_config_cid_ifaces ifnames "interface"
local lldp_mgmt_ip
config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip'
# Configurable capabilities in lldpd >= v1.0.15: defaults to 'unconfigured' i.e. kernel info
local lldp_syscapabilities
config_get lldp_syscapabilities 'config' 'lldp_syscapabilities'
# Configurable capabilities in lldpd >= v1.0.15: defaults to on in lldpd
local lldp_capability_advertisements
config_get_bool lldp_capability_advertisements 'config' 'lldp_capability_advertisements' 1
# Broadcast management address in lldpd >= 0.7.15: defaults to on in lldpd
local lldp_mgmt_addr_advertisements
config_get_bool lldp_mgmt_addr_advertisements 'config' 'lldp_mgmt_addr_advertisements' 1
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
local lldpmed_fast_start
config_get_bool lldpmed_fast_start 'config' 'lldpmed_fast_start' 0
local lldpmed_fast_start_tx_interval
config_get lldpmed_fast_start_tx_interval 'config' 'lldpmed_fast_start_tx_interval' 0
local lldp_location
config_get lldp_location 'config' 'lldp_location'
local lldp_class
config_get lldp_class 'config' 'lldp_class'
local lldp_policy
config_get lldp_policy 'config' 'lldp_policy'
fi
local lldp_agenttype
config_get lldp_agenttype 'config' 'lldp_agenttype' 'nearest-bridge'
local lldp_portidsubtype
config_get lldp_portidsubtype 'config' 'lldp_portidsubtype' 'macaddress'
local lldp_platform
config_get lldp_platform 'config' 'lldp_platform' ""
local lldp_tx_interval
config_get lldp_tx_interval 'config' 'lldp_tx_interval' 0
local lldp_tx_hold
config_get lldp_tx_hold 'config' 'lldp_tx_hold' 0
# Clear out the config file first
echo -n > "$LLDPD_CONF"
[ -n "$ifnames" ] && echo "configure system interface pattern" "$ifnames" >> "$LLDPD_CONF"
[ -n "$ifnames" ] && echo "configure system interface pattern $ifnames" >> "$LLDPD_CONF"
[ -n "$lldp_description" ] && echo "configure system description" "\"$lldp_description\"" >> "$LLDPD_CONF"
[ -n "$lldp_hostname" ] && echo "configure system hostname" "\"$lldp_hostname\"" >> "$LLDPD_CONF"
[ -n "$lldp_mgmt_ip" ] && echo "configure system ip management pattern" "\"$lldp_mgmt_ip\"" >> "$LLDPD_CONF"
[ -n "$lldp_syscapabilities" ] && echo "configure system capabilities enabled $lldp_syscapabilities" >> "$LLDPD_CONF"
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ] && [ "$lldpmed_fast_start" -gt 0 ]; then
if [ "$lldpmed_fast_start_tx_interval" -gt 0 ]; then
echo "configure med fast-start tx-interval $lldpmed_fast_start_tx_interval" >> "$LLDPD_CONF"
else
echo "configure med fast-start enable" >> "$LLDPD_CONF"
fi
fi
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
# other 'configure med xxx' statements go here
[ -n "$lldp_location" ] && echo "configure med location" "$lldp_location" >> "$LLDPD_CONF"
# Manual states that if Class (-M) is 2 or 3, at least one network policy must be defined
case "$lldp_class" in
2 | 3 ) [ -n "$lldp_policy" ] && echo "configure med policy $lldp_policy" >> "$LLDPD_CONF"
;;
esac
fi
[ -n "$lldp_agenttype" ] && echo "configure lldp agent-type" "\"$lldp_agenttype\"" >> "$LLDPD_CONF"
[ -n "$lldp_portidsubtype" ] && echo "configure lldp portidsubtype" "\"$lldp_portidsubtype\"" >> "$LLDPD_CONF"
[ -n "$lldp_platform" ] && echo "configure system platform" "\"$lldp_platform\"" >> "$LLDPD_CONF"
[ -n "$lldp_tx_interval" ] && echo "configure lldp tx-interval $lldp_tx_interval" >> "$LLDPD_CONF"
[ "$lldp_tx_hold" -gt 0 ] && echo "configure lldp tx-hold $lldp_tx_hold" >> "$LLDPD_CONF"
[ "$lldp_capability_advertisements" -gt 0 ] && echo "configure lldp capabilities-advertisements" >> "$LLDPD_CONF" ||\
echo "unconfigure lldp capabilities-advertisements" >> "$LLDPD_CONF"
[ "$lldp_mgmt_addr_advertisements" -gt 0 ] && echo "configure lldp management-addresses-advertisements" >> "$LLDPD_CONF" ||\
echo "unconfigure lldp management-addresses-advertisements" >> "$LLDPD_CONF"
# Since lldpd's sysconfdir is /tmp, we'll symlink /etc/lldpd.d to /tmp/$LLDPD_CONFS_DIR
[ -e $LLDPD_CONFS_DIR ] || ln -s /etc/lldpd.d $LLDPD_CONFS_DIR
}
service_triggers() {
procd_add_reload_trigger "lldpd"
[ -e "$LLDPD_CONFS_DIR" ] || ln -s /etc/lldpd.d "$LLDPD_CONFS_DIR"
}
start_service() {
local enable_lldp
local force_lldp
local enable_cdp
local cdp_version
local force_cdp
local force_cdpv2
local enable_fdp
local force_fdp
local enable_sonmp
local force_sonmp
local enable_edp
local force_edp
local lldp_class
local lldp_location
local lldp_no_version
local lldpmed_no_inventory
local readonly_mode
local agentxsocket
local filter
config_load 'lldpd'
config_get_bool enable_cdp 'config' 'enable_cdp' 0
config_get_bool enable_fdp 'config' 'enable_fdp' 0
config_get_bool enable_sonmp 'config' 'enable_sonmp' 0
config_get_bool enable_edp 'config' 'enable_edp' 0
config_get_bool enable_lldp 'config' 'enable_lldp' 1
config_get_bool force_lldp 'config' 'force_lldp' 0
if [ "$CONFIG_LLDPD_WITH_CDP" = "y" ]; then
config_get_bool enable_cdp 'config' 'enable_cdp' 0
config_get cdp_version 'config' 'cdp_version' 'cdpv1v2'
config_get_bool force_cdp 'config' 'force_cdp' 0
config_get_bool force_cdpv2 'config' 'force_cdpv2' 0
fi
if [ "$CONFIG_LLDPD_WITH_FDP" = "y" ]; then
config_get_bool enable_fdp 'config' 'enable_fdp' 0
config_get_bool force_fdp 'config' 'force_fdp' 0
fi
if [ "$CONFIG_LLDPD_WITH_SONMP" = "y" ]; then
config_get_bool enable_sonmp 'config' 'enable_sonmp' 0
config_get_bool force_sonmp 'config' 'force_sonmp' 0
fi
if [ "$CONFIG_LLDPD_WITH_EDP" = "y" ]; then
config_get_bool enable_edp 'config' 'enable_edp' 0
config_get_bool force_edp 'config' 'force_edp' 0
fi
config_get lldp_class 'config' 'lldp_class'
config_get lldp_location 'config' 'lldp_location'
config_get_bool lldp_no_version 'config' 'lldp_no_version' 0
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
config_get_bool lldpmed_no_inventory 'config' 'lldpmed_no_inventory' 0
fi
config_get_bool readonly_mode 'config' 'readonly_mode' 0
config_get agentxsocket 'config' 'agentxsocket'
if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then
config_get agentxsocket 'config' 'agentxsocket'
fi
config_get filter 'config' 'filter' 15
mkdir -p /var/run/lldp
chown lldp:lldp /var/run/lldp
mkdir -p ${LLDPD_RUN}
chown lldp:lldp ${LLDPD_RUN}
# When lldpd starts, it also loads up what we write in this config file
write_lldpd_conf
procd_open_instance
procd_set_param command /usr/sbin/lldpd -d
procd_set_param command ${LLDPDBIN}
procd_append_param command -d
[ $enable_cdp -gt 0 ] && procd_append_param command '-c'
[ $enable_fdp -gt 0 ] && procd_append_param command '-f'
[ $enable_sonmp -gt 0 ] && procd_append_param command '-s'
[ $enable_edp -gt 0 ] && procd_append_param command '-e'
[ $readonly_mode -gt 0 ] && procd_append_param command '-r'
if [ "$enable_lldp" -gt 0 ]; then
if [ "$force_lldp" -gt 0 ]; then
procd_append_param command '-l'
fi
else
# Disable LLDP
procd_append_param command '-ll'
fi
if [ "$CONFIG_LLDPD_WITH_CDP" = "y" ] && [ "$enable_cdp" -gt 0 ]; then
if [ "$cdp_version" = "cdpv2" ]; then
if [ "$force_cdp" -gt 0 ]; then
# CDPv1 disabled, CDPv2 forced
procd_append_param command '-ccccc'
else
# CDPv1 disabled, CDPv2 enabled
procd_append_param command '-cccc'
fi
elif [ "$cdp_version" = "cdpv1v2" ]; then
if [ "$force_cdp" -gt 0 ] && [ "$force_cdpv2" -gt 0 ]; then
# CDPv1 enabled, CDPv2 forced
procd_append_param command '-ccc'
elif [ "$force_cdp" -gt 0 ]; then
# CDPv1 forced, CDPv2 enabled
procd_append_param command '-cc'
else
# CDPv1 and CDPv2 enabled
procd_append_param command '-c'
fi
fi
fi
if [ "$CONFIG_LLDPD_WITH_FDP" = "y" ] && [ "$enable_fdp" -gt 0 ]; then
if [ "$force_fdp" -gt 0 ]; then
# FDP enabled and forced
procd_append_param command '-ff'
else
# FDP enabled
procd_append_param command '-f'
fi
fi
if [ "$CONFIG_LLDPD_WITH_SONMP" = "y" ] && [ "$enable_sonmp" -gt 0 ]; then
if [ "$force_sonmp" -gt 0 ]; then
# SONMP enabled and forced
procd_append_param command '-ss'
else
# SONMP enabled
procd_append_param command '-s'
fi
fi
if [ "$CONFIG_LLDPD_WITH_EDP" = "y" ] && [ "$enable_edp" -gt 0 ]; then
if [ "$force_edp" -gt 0 ]; then
# EDP enabled and forced
procd_append_param command '-ee'
else
# EDP enabled
procd_append_param command '-e'
fi
fi
[ "$readonly_mode" -gt 0 ] && procd_append_param command '-r'
[ "$lldp_no_version" -gt 0 ] && procd_append_param command '-k'
[ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ] && [ "$lldpmed_no_inventory" -gt 0 ] && procd_append_param command '-i'
[ -n "$lldp_class" ] && procd_append_param command -M "$lldp_class"
[ -n "$agentxsocket" ] && procd_append_param command -x -X "$agentxsocket"
[ "$CONFIG_LLDPD_WITH_SNMP" = "y" ] && [ -n "$agentxsocket" ] && procd_append_param command -x -X "$agentxsocket"
[ -n "$filter" ] && procd_append_param command -H "$filter"
# ChassisID interfaces
local ifnames
get_config_cid_ifaces ifnames "cid_interface"
[ -n "$ifnames" ] && procd_append_param command -C "$ifnames"
# Overwrite default configuration locations processed by lldpcli at start
procd_append_param command -O "$LLDPD_CONF"
local restart_hash
get_config_restart_hash restart_hash
echo -n "$restart_hash" > "$LLDPD_RESTART_HASH"
# set auto respawn behavior
procd_set_param respawn
procd_close_instance
}
service_triggers() {
procd_add_config_trigger "config.change" "lldpd" /etc/init.d/lldpd reload
}
reload_service() {
running || return 1
$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
local running_hash=""
local config_hash=""
get_config_restart_hash config_hash
[ -f ${LLDPD_RESTART_HASH} ] && running_hash=$(cat "$LLDPD_RESTART_HASH")
if [ "x$running_hash" != "x$config_hash" ]; then
# Restart LLDPd
# Some parameters can't be configured at runtime
restart
return 0
fi
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
pause
unconfigure lldp custom-tlv
unconfigure lldp capabilities-advertisements
unconfigure lldp management-addresses-advertisements
# unconfigures user-configured system capabilities, and instead uses the kernel information:
unconfigure system capabilities enabled
unconfigure system interface pattern
unconfigure system description
unconfigure system hostname
unconfigure system ip management pattern
unconfigure system platform
EOF
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
unconfigure med fast-start
EOF
fi
# Rewrite lldpd.conf
# If something changed it should be included by the lldpcli call
write_lldpd_conf
$LLDPCLI -u $LLDPSOCKET -c $LLDPD_CONF -c $LLDPD_CONFS_DIR &> /dev/null
$LLDPCLI -u "$LLDPSOCKET" -c "$LLDPD_CONF" -c "$LLDPD_CONFS_DIR" >/dev/null 2>&1
# Broadcast update over the wire
$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
resume
update
EOF
@@ -126,5 +403,6 @@ reload_service() {
}
stop_service() {
rm -rf /var/run/lldp $LLDPSOCKET
rm -rf ${LLDPD_RUN} "$LLDPSOCKET" >/dev/null 2>&1
}

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ucode
PKG_RELEASE:=1
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
@@ -25,16 +25,19 @@ include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION)
CMAKE_OPTIONS += \
-DSOVERSION=$(PKG_ABI_VERSION)
CMAKE_HOST_OPTIONS += \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib"
ifeq ($(HOST_OS),Darwin)
CMAKE_HOST_OPTIONS += \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_MACOSX_RPATH=1 \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib"
-DCMAKE_MACOSX_RPATH=1
else
CMAKE_HOST_OPTIONS += \
-DSOVERSION=$(PKG_ABI_VERSION)
-DUSE_RPATH="${STAGING_DIR_HOSTPKG}/lib"
endif
CMAKE_HOST_OPTIONS += \

View File

@@ -76,6 +76,7 @@ CONFIG_ARM64_ERRATUM_2441007=y
CONFIG_ARM64_ERRATUM_2441009=y
CONFIG_ARM64_ERRATUM_2457168=y
CONFIG_ARM64_ERRATUM_2658417=y
CONFIG_ARM64_ERRATUM_3194386=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_826319=y

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