linux/drivers/fmc/fru-parse.c
<<
itemv4./spa2 v4./form v4.a itemv4 href="../linux+v3pti.2/drivers/fmc/fru-parse.c">itemv4.img src="../.static/gfx/right.png" alt=">>">it./spa2 it.spa2 class="lxr_search">itemitemv4.input typ.17hidden" nam.17navtarget" <4.8.17">itemv4.input typ.17text" nam.17search" id17search">itemv4.butt 11typ.17submit">Searchitemv4Prefs v4./a>it./spa2 emv4 4./div emv4 4.form ac3 2="ajax+*" method="post" onsubmit="return false;">it.input typ.17hidden" nam.17ajax_lookup" id17ajax_lookup" <4.8.17">iemv4 4./form iemv4 4.div class="headingbott m">
.div id17file_contents"
4 41./a>.spa2 class="comment">/*./spa2	 4 42./a>.spa2 class="comment"> * Copyright (C) 2012 CERN (www.cern.ch)./spa2	 4 43./a>.spa2 class="comment"> * Author: Alessandro Rubini <rubini@gnudd.com>./spa2	 4 44./a>.spa2 class="comment"> *./spa2	 4 45./a>.spa2 class="comment"> * Released according to the GNU GPL, vers>
112 or any later vers>
1../spa2	 4 46./a>.spa2 class="comment"> *./spa2	 4 47./a>.spa2 class="comment"> * This work is part of the White Rabbit project, a research effort led./spa2	 4 48./a>.spa2 class="comment"> * by CERN, the Europea2 Institute for Nuclear Research../spa2	 4 49./a>.spa2 class="comment"> */./spa2	 4 #include <linux/ipmi-fru.hpta>> 4 11./a> 4 12./a>.spa2 class="comment">/* Some internal helpers */./spa2	 4 13./a>static struct4.a href="+code=fru_typ._length" class="sref">fru_typ._length./a> * 4 14./a>.a href="+code=__fru_get_board_tl" class="sref">__fru_get_board_tl./a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>, int4.a href="+code=nr" class="sref">nr./a>) 4 15./a>{ 4 16./a>        struct4.a href="+code=fru_board_info_area" class="sref">fru_board_info_area./a> *.a href="+code=bia" class="sref">bia./a>; 4 17./a>        struct4.a href="+code=fru_typ._length" class="sref">fru_typ._length./a> *.a href="+code=tl" class="sref">tl./a>; 4 18./a> 4 19./a>        .a href="+code=bia" class="sref">bia./a> =4.a href="+code=fru_get_board_area" class="sref">fru_get_board_area./a>(.a href="+code=header" class="sref">header./a>); 4 20./a>        .a href="+code=tl" class="sref">tl./a> =4.a href="+code=bia" class="sref">bia./a>->.a href="+code=tl" class="sref">tl./a>; 4 21./a>        while (.a href="+code=nr" class="sref">nr./a> > 0 && !.a href="+code=fru_is_eof" class="sref">fru_is_eof./a>(.a href="+code=tl" class="sref">tl./a>)) { 4 22./a>                .a href="+code=tl" class="sref">tl./a> =4.a href="+code=fru_next_tl" class="sref">fru_next_tl./a>(.a href="+code=tl" class="sref">tl./a>); 4 23./a>                .a href="+code=nr" class="sref">nr./a>--; 4 24./a>        } 4 25./a>        if (.a href="+code=fru_is_eof" class="sref">fru_is_eof./a>(.a href="+code=tl" class="sref">tl./a>)) 4 26./a>                return .a href="+code=NULL" class="sref">NULL./a>; 4 27./a>        return .a href="+code=tl" class="sref">tl./a>; 4 28./a>} 4 29./a> 4 30./a>static char *.a href="+code=__fru_alloc_get_tl" class="sref">__fru_alloc_get_tl./a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>, int4.a href="+code=nr" class="sref">nr./a>) 4 31./a>{ 4 32./a>        struct4.a href="+code=fru_typ._length" class="sref">fru_typ._length./a> *.a href="+code=tl" class="sref">tl./a>; 4 33./a>        char *.a href="+code=res" class="sref">res./a>; 4 34./a>        int4.a href="+code=len" class="sref">len./a>; 4 35./a> 4 36./a>        .a href="+code=tl" class="sref">tl./a> =4.a href="+code=__fru_get_board_tl" class="sref">__fru_get_board_tl./a>(.a href="+code=header" class="sref">header./a>, .a href="+code=nr" class="sref">nr./a>); 4 37./a>        if (!.a href="+code=tl" class="sref">tl./a>) 4 38./a>                return .a href="+code=NULL" class="sref">NULL./a>; 4 39./a>        .a href="+code=len" class="sref">len./a> =4.a href="+code=fru_strlen" class="sref">fru_strlen./a>(.a href="+code=tl" class="sref">tl./a>); 4 40./a>        .a href="+code=res" class="sref">res./a> =4.a href="+code=fru_alloc" class="sref">fru_alloc./a>(.a href="+code=fru_strlen" class="sref">fru_strlen./a>(.a href="+code=tl" class="sref">tl./a>) + 1); 4 41./a>        if (!.a href="+code=res" class="sref">res./a>) 4 42./a>                return .a href="+code=NULL" class="sref">NULL./a>; 4 43./a>        return .a href="+code=fru_strcpy" class="sref">fru_strcpy./a>(.a href="+code=res" class="sref">res./a>, .a href="+code=tl" class="sref">tl./a>); 4 44./a>} 4 45./a> 4 46./a>.spa2 class="comment">/* Public checksum verifiers */./spa2	 4 47./a>int4.a href="+code=fru_header_cksum_ok" class="sref">fru_header_cksum_ok./a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>) 4 48./a>{ 4 49./a>        .a href="+code=uint8_t" class="sref">uint8_t./a> *.a href="+code=ptr" class="sref">ptr./a> =4(void *).a href="+code=header" class="sref">header./a>; 4 50./a>        int4.a href="+code=i" class="sref">i./a>, .a href="+code=sum" class="sref">sum./a>; 4 51./a> 4 52./a>        for (.a href="+code=i" class="sref">i./a> =4.a href="+code=sum" class="sref">sum./a> =40;4.a href="+code=i" class="sref">i./a> < sizeof(*.a href="+code=header" class="sref">header./a>);4.a href="+code=i" class="sref">i./a>++) 4 53./a>                .a href="+code=sum" class="sref">sum./a> +=4.a href="+code=ptr" class="sref">ptr./a>[.a href="+code=i" class="sref">i./a>]; 4 54./a>        return (.a href="+code=sum" class="sref">sum./a> & 0xff) ==40; 4 55./a>} 4 56./a>int4.a href="+code=fru_bia_cksum_ok" class="sref">fru_bia_cksum_ok./a>(struct4.a href="+code=fru_board_info_area" class="sref">fru_board_info_area./a> *.a href="+code=bia" class="sref">bia./a>) 4 57./a>{ 4 58./a>        .a href="+code=uint8_t" class="sref">uint8_t./a> *.a href="+code=ptr" class="sref">ptr./a> =4(void *).a href="+code=bia" class="sref">bia./a>; 4 59./a>        int4.a href="+code=i" class="sref">i./a>, .a href="+code=sum" class="sref">sum./a>; 4 60./a> 4 61./a>        for (.a href="+code=i" class="sref">i./a> =4.a href="+code=sum" class="sref">sum./a> =40;4.a href="+code=i" class="sref">i./a> < 8 *4.a href="+code=bia" class="sref">bia./a>->.a href="+code=area_len" class="sref">area_len./a>;4.a href="+code=i" class="sref">i./a>++) 4 62./a>                .a href="+code=sum" class="sref">sum./a> +=4.a href="+code=ptr" class="sref">ptr./a>[.a href="+code=i" class="sref">i./a>]; 4 63./a>        return (.a href="+code=sum" class="sref">sum./a> & 0xff) ==40; 4 64./a>} 4 65./a> 4 66./a>.spa2 class="comment">/* Get various stuff, trivial */./spa2	 4 67./a>char *.a href="+code=fru_get_board_manufacturer" class="sref">fru_get_board_manufacturer./a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>) 4 68./a>{ 4 69./a>        return .a href="+code=__fru_alloc_get_tl" class="sref">__fru_alloc_get_tl./a>(.a href="+code=header" class="sref">header./a>, 0); 4 70./a>} 4 71./a>char *.a href="+code=fru_get_product_nam." class="sref">fru_get_product_nam../a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>) 4 72./a>{ 4 73./a>        return .a href="+code=__fru_alloc_get_tl" class="sref">__fru_alloc_get_tl./a>(.a href="+code=header" class="sref">header./a>, 1); 4 74./a>} 4 75./a>char *.a href="+code=fru_get_serial_number" class="sref">fru_get_serial_number./a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>) 4 76./a>{ 4 77./a>        return .a href="+code=__fru_alloc_get_tl" class="sref">__fru_alloc_get_tl./a>(.a href="+code=header" class="sref">header./a>, 2); 4 78./a>} 4 79./a>char *.a href="+code=fru_get_part_number" class="sref">fru_get_part_number./a>(struct4.a href="+code=fru_common_header" class="sref">fru_common_header./a> *.a href="+code=header" class="sref">header./a>) 4 80./a>{ 4 81./a>        return .a href="+code=__fru_alloc_get_tl" class="sref">__fru_alloc_get_tl./a>(.a href="+code=header" class="sref">header./a>, 3); 4 82./a>} 4 83./a>./pre>
The original LXR software by the LXR community./a>, this experimental vers> 11by lxr@linux.no./a>. ./div .div class="subfooter"> lxr.linux.no kindly hosted1by Redpill Linpro AS./a>, provider of Linux consulting and opera3 2s services since 1995. ./div ./body ./html