From: Yijing Wang <wangyijing@huawei.com>
To: Oliver Neukum <oneukum@suse.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
<linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
Hanjun Guo <guohanjun@huawei.com>,
Paul Bolle <pebolle@tiscali.nl>,
"RafaelJ.Wysocki" <rjw@rjwysocki.net>,
Gu Zheng <guz.fnst@cn.fujitsu.com>
Subject: Re: [PATCH part1 v5 3/7] PCI: Add support for Device Serial Number capability
Date: Tue, 11 Feb 2014 09:55:11 +0800 [thread overview]
Message-ID: <52F982FF.2070007@huawei.com> (raw)
In-Reply-To: <1392027718.2082.11.camel@linux-fkkt.site>
On 2014/2/10 18:21, Oliver Neukum wrote:
>
> 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?
Yes, I will try to define macros for them, thanks!
>
>> + return ((u64)hi << 32) | lo;
>> +}
>
> Regards
> Oliver
>
>
>
>
> .
>
--
Thanks!
Yijing
next prev parent reply other threads:[~2014-02-11 1:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 4:04 [PATCH part1 v5 0/7] Introduce PCIe Device Serial Number capability support Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 1/7] PCI: rework pci_find_next_ext_capability() Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 2/7] PCI: introduce pci_bus_find_ext_capability() Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 3/7] PCI: Add support for Device Serial Number capability Yijing Wang
2014-02-10 10:21 ` Oliver Neukum
2014-02-11 1:55 ` Yijing Wang [this message]
2014-02-10 4:04 ` [PATCH part1 v5 4/7] PCI: Introduce pci_serial_number_changed() Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily Yijing Wang
2014-02-10 6:56 ` Oliver Neukum
2014-02-10 7:59 ` Yijing Wang
2014-02-10 10:07 ` Oliver Neukum
2014-02-11 1:49 ` Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 6/7] PCI: Check pci device serial number when scan device Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 7/7] PCI: pciehp: Don't enable/disable slot on resume unless status changed Yijing Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52F982FF.2070007@huawei.com \
--to=wangyijing@huawei.com \
--cc=bhelgaas@google.com \
--cc=guohanjun@huawei.com \
--cc=guz.fnst@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=pebolle@tiscali.nl \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.