]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Introduce pci_get_dsn
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 3 Mar 2020 02:25:00 +0000 (18:25 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Mar 2020 01:36:24 +0000 (17:36 -0800)
commita72c636f4b6308d70aa4cfced2b901f32553fd48
tree13fa85fb4022d726761d0e49f3c01ffc014d8d03
parent92778898edc3370d6caf4f0975c7390fd1e07995
PCI: Introduce pci_get_dsn

Several device drivers read their Device Serial Number from the PCIe
extended config space.

Introduce a new helper function, pci_get_dsn(). This function reads the
eight bytes of the DSN and returns them as a u64. If the capability does not
exist for the device, the function returns 0.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/pci/pci.c
include/linux/pci.h