linux/drivers/pci/vpd.c
<<
" /spaon> /formn> a " href="../linux+v3.7.5/drivers/pci/vpd.c">" img src="../.static/gfx/right.png" alt=">>">" /spaon>" spao class="lxr_search">" " input typue=hidden" namue=navtarget" value=">" input typue=text" namue=search" ide=search">" buttiontypue=submit">Search /formn> /spaon>" spao class="lxr_prefs"n> a href="+prefs?return=drivers/pci/vpd.c"" onclick="return ajax_prefs();">" Prefs> /a>" /spaon> /divn> form acptio="ajax+*" method="post" onsubmit="return false;">" input typue=hidden" namue=ajax_lookup" ide=ajax_lookup" value=">" /formn>" div class="headingbottim"> div ide=search_results" class="search_results"> n> /divn> div ide=content">> div ide=file_contents"n
   1 /a> spao class="comment">/* /spaon>   2 /a> spao class="comment"> * File:        vpd.c /spaon>   3 /a> spao class="comment"> * Purpose:     Provide PCI VPD support /spaon>   4 /a> spao class="comment"> * /spaon>   5 /a> spao class="comment"> * Copyright (C) 2010 Broadcom Corporaptio. /spaon>   6 /a> spao class="comment"> */ /spaon>   7 /a>"   8 /a>#include <linux/pci.h /a>>"   9 /a>#include <linux/export.h /a>>"  .10"  11 /a>int  a href="+code=pci_vpd_find_tag" class="sref">pci_vpd_find_tag /a>(const  a href="+code=u8" class="sref">u8 /a> * a href="+code=buf" class="sref">buf /a>, unsigned int  a href="+code=off" class="sref">off /a>, unsigned int  a href="+code=len" class="sref">len /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=rdt" class="sref">rdt /a>)"  12 /a>{"  13 /a>        int  a href="+code=i" class="sref">i /a>;"  140"  15 /a>        for ( a href="+code=i" class="sref">i /a> =  a href="+code=off" class="sref">off /a>;  a href="+code=i" class="sref">i /a> <  a href="+code=len" class="sref">len /a>; ) {"  16 /a>                 a href="+code=u8" class="sref">u8 /a>  a href="+code= va" class="sref"> va /a> =  a href="+code=buf" class="sref">buf /a>[ a href="+code=i" class="sref">i /a>];"  17 /a>"  18 /a>                if ( a href="+code= va" class="sref"> va /a> &  a href="+code=PCI_VPD_LRDT" class="sref">PCI_VPD_LRDT /a>) {"  19 /a>                         spao class="comment">/* Don't return success of the tag isn't complete */ /spaon>  20 /a>                        if ( a href="+code=i" class="sref">i /a> +  a href="+code=PCI_VPD_LRDT_TAG_SIZE" class="sref">PCI_VPD_LRDT_TAG_SIZE /a> >  a href="+code=len" class="sref">len /a>)"  21 /a>                                break;"  22 /a>"  23 /a>                        if ( a href="+code= va" class="sref"> va /a> ==  a href="+code=rdt" class="sref">rdt /a>)"  24 /a>                                return  a href="+code=i" class="sref">i /a>;"  25 /a>"  26 /a>                         a href="+code=i" class="sref">i /a> +=  a href="+code=PCI_VPD_LRDT_TAG_SIZE" class="sref">PCI_VPD_LRDT_TAG_SIZE /a> +"  27 /a>                              a href="+code=pci_vpd_lrdt_size" class="sref">pci_vpd_lrdt_size /a>(& a href="+code=buf" class="sref">buf /a>[ a href="+code=i" class="sref">i /a>]);"  28 /a>                } else {"  29 /a>                         a href="+code=u8" class="sref">u8 /a>  a href="+code=tag" class="sref">tag /a> =  a href="+code= va" class="sref"> va /a> & ~ a href="+code=PCI_VPD_SRDT_LEN_MASK" class="sref">PCI_VPD_SRDT_LEN_MASK /a>;"  310"  31 /a>                        if ( a href="+code=tag" class="sref">tag /a> ==  a href="+code=rdt" class="sref">rdt /a>)"  32 /a>                                return  a href="+code=i" class="sref">i /a>;"  330"  34 /a>                        if ( a href="+code=tag" class="sref">tag /a> ==  a href="+code=PCI_VPD_SRDT_END" class="sref">PCI_VPD_SRDT_END /a>)"  35 /a>                                break;"  360"  37 /a>                         a href="+code=i" class="sref">i /a> +=  a href="+code=PCI_VPD_SRDT_TAG_SIZE" class="sref">PCI_VPD_SRDT_TAG_SIZE /a> +"  38 /a>                              a href="+code=pci_vpd_srdt_size" class="sref">pci_vpd_srdt_size /a>(& a href="+code=buf" class="sref">buf /a>[ a href="+code=i" class="sref">i /a>]);"  39 /a>                }>  40 /a>        }>  410"  42 /a>        return - a href="+code=ENOENT" class="sref">ENOENT /a>;"  430}>  44 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=pci_vpd_find_tag" class="sref">pci_vpd_find_tag /a>);"  45 /a>"  46 /a>int  a href="+code=pci_vpd_find_info_keyword" class="sref">pci_vpd_find_info_keyword /a>(const  a href="+code=u8" class="sref">u8 /a> * a href="+code=buf" class="sref">buf /a>, unsigned int  a href="+code=off" class="sref">off /a>,"  47 /a>                              unsigned int  a href="+code=len" class="sref">len /a>, const char * a href="+code=kw" class="sref">kw /a>)"  48 /a>{"  49 /a>        int  a href="+code=i" class="sref">i /a>;"  510"  51 /a>        for ( a href="+code=i" class="sref">i /a> =  a href="+code=off" class="sref">off /a>;  a href="+code=i" class="sref">i /a> +  a href="+code=PCI_VPD_INFO_FLD_HDR_SIZE" class="sref">PCI_VPD_INFO_FLD_HDR_SIZE /a> <=  a href="+code=off" class="sref">off /a> +  a href="+code=len" class="sref">len /a>;) {"  52 /a>                if ( a href="+code=buf" class="sref">buf /a>[ a href="+code=i" class="sref">i /a> + 0] ==  a href="+code=kw" class="sref">kw /a>[0] &&"  53 /a>                     a href="+code=buf" class="sref">buf /a>[ a href="+code=i" class="sref">i /a> + 1] ==  a href="+code=kw" class="sref">kw /a>[1])"  54 /a>                        return  a href="+code=i" class="sref">i /a>;"  55 /a>"  56 /a>                 a href="+code=i" class="sref">i /a> +=  a href="+code=PCI_VPD_INFO_FLD_HDR_SIZE" class="sref">PCI_VPD_INFO_FLD_HDR_SIZE /a> +"  57 /a>                      a href="+code=pci_vpd_info_field_size" class="sref">pci_vpd_info_field_size /a>(& a href="+code=buf" class="sref">buf /a>[ a href="+code=i" class="sref">i /a>]);"  58 /a>        }>  59 /a>"  60 /a>        return - a href="+code=ENOENT" class="sref">ENOENT /a>;"  610}>  62 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=pci_vpd_find_info_keyword" class="sref">pci_vpd_find_info_keyword /a>);"  63 /a> /pre>

 /divn>
 div class="footer">
The original LXR software by the LXR community /a>, this experimental verstionby lxr@linux.no /a>.
 /divn> div class="subfooter">
lxr.linux.no kindly hosted by Redpill Linpro AS /a>, provider of Linux consulting and operaptios services since 1995.
 /divn>
 /bodyn> /htmln>