lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1392027718.2082.11.camel@linux-fkkt.site>
Date:	Mon, 10 Feb 2014 11:21:58 +0100
From:	Oliver Neukum <oneukum@...e.de>
To:	Yijing Wang <wangyijing@...wei.com>
Cc:	Bjorn Helgaas <bhelgaas@...gle.com>, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org, Hanjun Guo <guohanjun@...wei.com>,
	Paul Bolle <pebolle@...cali.nl>,
	"RafaelJ.Wysocki" <rjw@...ysocki.net>,
	Gu Zheng <guz.fnst@...fujitsu.com>
Subject: Re: [PATCH part1 v5 3/7] PCI: Add support for Device Serial Number
 capability


On Mon, 2014-02-10 at 12:04 +0800, Yijing Wang wrote:
> +static u64 pci_device_serial_number(struct pci_bus *bus, int devfn)
> +{
> +       int pos;
> +       u32 lo, hi;
> +
> +       if (!pci_bus_find_capability(bus, devfn, PCI_CAP_ID_EXP))
> +               return 0;
> +
> +       pos = pci_bus_find_ext_capability(bus, devfn,
> PCI_EXT_CAP_ID_DSN);
> +       if (!pos)
> +               return 0;
> +
> +       pci_bus_read_config_dword(bus, devfn, pos + 4, &lo);
> +       pci_bus_read_config_dword(bus, devfn, pos + 8, &hi);

We have no macro for that?

> +       return ((u64)hi << 32) | lo;
> +}

	Regards
		Oliver



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ