These patches introduce the ability to report PCI link width and speed for all PCI devices in kernel log. It also warns if the BW capability is bellow maximum. This would reduce code duplication between drivers and unify the approach for reporting PCI link status. Implemented and tested for Mellanox devices. v1: Split to multiple patches, calculate BW limitation and remove MACRO definition for LNKCAP shift (suggested by Bjorn Helgaas). Multiple fixes - conventions, typos, function naming and functional (suggested by Tariq Toukan). Tal Gilboa (7): PCI: Add a query function for PCI device's speed cap PCI: Add a query function for PCI device's width cap PCI: Calculate BW limitation for PCI devices PCI: Print PCI device link status in kernel log net/mlx4_core: Report PCI properties using dedicated function net/mlx5: Report device PCI link status and issues net/mlx5e: Use generic PCI function for BW calculation drivers/net/ethernet/mellanox/mlx4/main.c | 81 +---------- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 17 +-- drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 + drivers/pci/pci-sysfs.c | 28 ++-- drivers/pci/pci.c | 163 +++++++++++++++++++++- include/linux/pci.h | 17 +++ 6 files changed, 191 insertions(+), 117 deletions(-) -- 1.8.3.1