The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/rndtest/rndtest.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $FreeBSD: releng/5.3/sys/dev/rndtest/rndtest.h 112125 2003-03-11 22:54:44Z sam $        */
    2 /*      $OpenBSD$       */
    3 
    4 /*
    5  * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
    6  * All rights reserved.
    7  *
    8  * Redistribution and use in source and binary forms, with or without
    9  * modification, are permitted provided that the following conditions
   10  * are met:
   11  * 1. Redistributions of source code must retain the above copyright
   12  *    notice, this list of conditions and the following disclaimer.
   13  * 2. Redistributions in binary form must reproduce the above copyright
   14  *    notice, this list of conditions and the following disclaimer in the
   15  *    documentation and/or other materials provided with the distribution.
   16  * 3. All advertising materials mentioning features or use of this software
   17  *    must display the following acknowledgement:
   18  *      This product includes software developed by Jason L. Wright
   19  * 4. The name of the author may not be used to endorse or promote products
   20  *    derived from this software without specific prior written permission.
   21  *
   22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   24  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   25  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
   26  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   27  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   30  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   32  * POSSIBILITY OF SUCH DAMAGE.
   33  */
   34 
   35 
   36 /* Some of the tests depend on these values */
   37 #define RNDTEST_NBYTES  2500
   38 #define RNDTEST_NBITS   (8 * RNDTEST_NBYTES)
   39 
   40 struct rndtest_state {
   41         device_t        rs_parent;      /* associated device */
   42         u_int8_t        *rs_end, *rs_begin, *rs_current;
   43         struct callout  rs_to;
   44         int             rs_collect;     /* collect and test data */
   45         int             rs_discard;     /* discard/accept random data */
   46         u_int8_t        rs_buf[RNDTEST_NBYTES];
   47 };
   48 
   49 struct rndtest_stats {
   50         u_int32_t       rst_discard;    /* number of bytes discarded */
   51         u_int32_t       rst_tests;      /* number of test runs */
   52         u_int32_t       rst_monobit;    /* monobit test failures */
   53         u_int32_t       rst_runs;       /* 0/1 runs failures */
   54         u_int32_t       rst_longruns;   /* longruns failures */
   55         u_int32_t       rst_chi;        /* chi^2 failures */
   56 };
   57 
   58 extern  struct rndtest_state *rndtest_attach(device_t dev);
   59 extern  void rndtest_detach(struct rndtest_state *);
   60 extern  void rndtest_harvest(struct rndtest_state *arg, void * buf, u_int len);

Cache object: e26dfe1db45385c8fe2fa5787469e3a9


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.