]> git.ipfire.org Git - thirdparty/linux.git/commit
net: libwx: fix device bus LAN ID
authorJiawen Wu <jiawenwu@trustnetic.com>
Tue, 4 Nov 2025 06:23:21 +0000 (14:23 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Nov 2025 01:52:13 +0000 (17:52 -0800)
commita04ea57aae375bdda1cb57034d8bcbb351e1f973
tree0f6525367bd5ad486635c0979938eb29d9d9fa48
parentb1d9154878ce310d46dde5a8545366d807179b28
net: libwx: fix device bus LAN ID

The device bus LAN ID was obtained from PCI_FUNC(), but when a PF
port is passthrough to a virtual machine, the function number may not
match the actual port index on the device. This could cause the driver
to perform operations such as LAN reset on the wrong port.

Fix this by reading the LAN ID from port status register.

Fixes: a34b3e6ed8fb ("net: txgbe: Store PCI info")
Cc: stable@vger.kernel.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/B60A670C1F52CB8E+20251104062321.40059-1-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/libwx/wx_hw.c
drivers/net/ethernet/wangxun/libwx/wx_type.h