lkml.org 
[lkml]   [2014]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH part1 v5 3/7] PCI: Add support for Device Serial Number capability
    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



    \
     
     \ /
      Last update: 2014-02-11 03:21    [W:16.791 / U:0.168 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site