OSDN Git Service

r8169: improve PCI config space access
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 2 May 2018 19:39:56 +0000 (21:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 May 2018 20:23:49 +0000 (16:23 -0400)
commitff1d733155da3fdba29e2ba99be428da86070989
tree0e4c5e3ec112a88f95edafaa8fcc75c4b31b258f
parenteda40b8cbe8e4b099233ce30535cb4c835896637
r8169: improve PCI config space access

Some chips have a non-zero function id, however instead of hardcoding
the id's (CSIAR_FUNC_NIC and CSIAR_FUNC_NIC2) we can get them
dynamically via PCI_FUNC(pci_dev->devfn). This way we can get rid
of the csi_ops.

In general csi is just a fallback mechanism for PCI config space
access in case no native access is supported. Therefore let's
try native access first.

I checked with Realtek regarding the functionality of config space
byte 0x070f and according to them it controls the L0s/L1
entrance latency.
Currently ASPM is disabled in general and therefore this value
isn't used. However we may introduce a whitelist for chips
where ASPM is known to work, therefore let's keep this code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c