]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dlink: enable RMON MMIO access on supported devices
authorMoon Yeounsu <yyyynoom@gmail.com>
Tue, 10 Jun 2025 00:01:30 +0000 (09:01 +0900)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Jun 2025 00:47:13 +0000 (17:47 -0700)
commit7fc18f9476256c03755d93b1cec0d42cf64d850a
treea4e407ed12a7d2b8b0c3addc28fb24608e79ef81
parent34355b6712bf9c8b803b4616ed3c66a96ccbdfa4
net: dlink: enable RMON MMIO access on supported devices

Enable memory-mapped I/O access to RMON statistics registers for devices
known to work correctly. Currently, only the D-Link DGE-550T (`0x4000`)
with PCI revision A3 (`0x0c`) is allowed.

To avoid issues on other hardware, a runtime check was added to restrict
MMIO usage. The `MEM_MAPPING` macro was removed in favor of runtime
detection.

To access RMON registers, the code `dw32(RmonStatMask, 0x0007ffff);`
must also be skipped, so this patch conditionally disables it as well.

Tested-on: D-Link DGE-550T Rev-A3
Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com>
Link: https://patch.msgid.link/20250610000130.49065-2-yyyynoom@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/dlink/dl2k.c
drivers/net/ethernet/dlink/dl2k.h