summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/wdvar.h4
-rw-r--r--sys/dev/gpib/rd.c6
-rw-r--r--sys/dev/ic/comvar.h4
-rw-r--r--sys/dev/ic/cs89x0var.h4
-rw-r--r--sys/dev/ic/dp8390var.h4
-rw-r--r--sys/dev/ic/elink3var.h4
-rw-r--r--sys/dev/ic/elinkxlvar.h4
-rw-r--r--sys/dev/ic/gemvar.h4
-rw-r--r--sys/dev/ic/hmevar.h4
-rw-r--r--sys/dev/ic/i82557var.h4
-rw-r--r--sys/dev/ic/lan9118var.h4
-rw-r--r--sys/dev/ic/lancevar.h4
-rw-r--r--sys/dev/ic/lemacvar.h4
-rw-r--r--sys/dev/ic/mb86950var.h4
-rw-r--r--sys/dev/ic/mb86960var.h4
-rw-r--r--sys/dev/ic/mtd803var.h4
-rw-r--r--sys/dev/ic/pckbc.c6
-rw-r--r--sys/dev/ic/rtl81x9var.h4
-rw-r--r--sys/dev/ic/seeq8005var.h4
-rw-r--r--sys/dev/ic/smc91cxxvar.h4
-rw-r--r--sys/dev/ic/tulipvar.h4
-rw-r--r--sys/dev/isa/fdvar.h4
-rw-r--r--sys/dev/isa/if_eg.c6
-rw-r--r--sys/dev/isa/if_el.c6
-rw-r--r--sys/dev/isa/if_iy.c6
-rw-r--r--sys/dev/ldvar.h4
-rw-r--r--sys/dev/marvell/if_gfevar.h4
-rw-r--r--sys/dev/marvell/if_mvgbe.c6
-rw-r--r--sys/dev/mca/edvar.h4
-rw-r--r--sys/dev/pci/amdpmvar.h4
-rw-r--r--sys/dev/pci/hifn7751.c15
-rw-r--r--sys/dev/pci/hifn7751var.h4
-rw-r--r--sys/dev/pci/if_bce.c6
-rw-r--r--sys/dev/pci/if_bgevar.h4
-rw-r--r--sys/dev/pci/if_casvar.h4
-rw-r--r--sys/dev/pci/if_devar.h4
-rw-r--r--sys/dev/pci/if_dge.c6
-rw-r--r--sys/dev/pci/if_iwi.c8
-rw-r--r--sys/dev/pci/if_jme.c6
-rw-r--r--sys/dev/pci/if_mskvar.h4
-rw-r--r--sys/dev/pci/if_pcn.c6
-rw-r--r--sys/dev/pci/if_sip.c6
-rw-r--r--sys/dev/pci/if_skvar.h4
-rw-r--r--sys/dev/pci/if_tlvar.h4
-rw-r--r--sys/dev/pci/if_vr.c6
-rw-r--r--sys/dev/pci/if_vtevar.h4
-rw-r--r--sys/dev/pci/if_wm.c6
-rw-r--r--sys/dev/pci/ixgbe/ixgbe.c4
-rw-r--r--sys/dev/pci/ubsec.c9
-rw-r--r--sys/dev/pcmcia/if_xivar.h4
-rw-r--r--sys/dev/rnd.c668
-rw-r--r--sys/dev/scsipi/cdvar.h4
-rw-r--r--sys/dev/scsipi/sdvar.h4
-rw-r--r--sys/dev/scsipi/stvar.h4
-rw-r--r--sys/dev/usb/if_auereg.h4
-rw-r--r--sys/dev/usb/if_axereg.h4
-rw-r--r--sys/dev/usb/if_cdcereg.h4
-rw-r--r--sys/dev/usb/if_cuereg.h4
-rw-r--r--sys/dev/usb/if_kuereg.h4
-rw-r--r--sys/dev/usb/if_udavreg.h4
-rw-r--r--sys/dev/usb/if_upl.c6
-rw-r--r--sys/dev/usb/if_urlreg.h4
-rw-r--r--sys/dev/usb/ucom.c6
-rw-r--r--sys/dev/usb/uhidev.h4
64 files changed, 632 insertions, 338 deletions
diff --git a/sys/dev/ata/wdvar.h b/sys/dev/ata/wdvar.h
index 1a89f05d8a8..fea02e9ffdd 100644
--- a/sys/dev/ata/wdvar.h
+++ b/sys/dev/ata/wdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: wdvar.h,v 1.38 2009/12/17 21:03:10 bouyer Exp $ */
+/* $NetBSD: wdvar.h,v 1.39 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -67,7 +67,7 @@ struct wd_softc {
u_int sc_bscount;
#endif
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/gpib/rd.c b/sys/dev/gpib/rd.c
index 3bd348a0eed..069179d9b81 100644
--- a/sys/dev/gpib/rd.c
+++ b/sys/dev/gpib/rd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rd.c,v 1.28 2011/02/08 20:20:27 rmind Exp $ */
+/* $NetBSD: rd.c,v 1.29 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.28 2011/02/08 20:20:27 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.29 2011/11/19 22:51:22 tls Exp $");
#include "rnd.h"
@@ -143,7 +143,7 @@ struct rd_softc {
struct callout sc_restart_ch;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h
index 867be2ac84c..52e804dbe74 100644
--- a/sys/dev/ic/comvar.h
+++ b/sys/dev/ic/comvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: comvar.h,v 1.71 2010/11/13 15:35:50 uebayasi Exp $ */
+/* $NetBSD: comvar.h,v 1.72 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -228,7 +228,7 @@ struct com_softc {
struct pps_state sc_pps_state; /* pps state */
#if NRND > 0 && defined(RND_COM)
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
kmutex_t sc_lock;
};
diff --git a/sys/dev/ic/cs89x0var.h b/sys/dev/ic/cs89x0var.h
index b1a740b7ce7..6d433d83530 100644
--- a/sys/dev/ic/cs89x0var.h
+++ b/sys/dev/ic/cs89x0var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cs89x0var.h,v 1.14 2009/09/22 14:55:19 tsutsui Exp $ */
+/* $NetBSD: cs89x0var.h,v 1.15 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright 1997
@@ -105,7 +105,7 @@ struct cs_softc {
u_int16_t *eeprom_data; /* copy of the eeprom data */
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
/* power management */
diff --git a/sys/dev/ic/dp8390var.h b/sys/dev/ic/dp8390var.h
index ca927d5b6c8..daf23afd520 100644
--- a/sys/dev/ic/dp8390var.h
+++ b/sys/dev/ic/dp8390var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dp8390var.h,v 1.30 2009/05/12 14:25:17 cegger Exp $ */
+/* $NetBSD: dp8390var.h,v 1.31 2011/11/19 22:51:22 tls Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -72,7 +72,7 @@ struct dp8390_softc {
int sc_enabled; /* boolean; power enabled on interface */
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
int (*test_mem)(struct dp8390_softc *);
diff --git a/sys/dev/ic/elink3var.h b/sys/dev/ic/elink3var.h
index 226c7959254..bef646843f0 100644
--- a/sys/dev/ic/elink3var.h
+++ b/sys/dev/ic/elink3var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: elink3var.h,v 1.36 2009/09/05 12:30:59 tsutsui Exp $ */
+/* $NetBSD: elink3var.h,v 1.37 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 1994 Herb Peyerl <hpeyerl@beer.org>
@@ -102,7 +102,7 @@ struct ep_softc {
int ep_pktlenshift; /* scale factor for pkt lengths */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
/* power management hooks */
diff --git a/sys/dev/ic/elinkxlvar.h b/sys/dev/ic/elinkxlvar.h
index ed33fdfa396..b327dfa9302 100644
--- a/sys/dev/ic/elinkxlvar.h
+++ b/sys/dev/ic/elinkxlvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: elinkxlvar.h,v 1.22 2010/03/22 23:03:30 dyoung Exp $ */
+/* $NetBSD: elinkxlvar.h,v 1.23 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -110,7 +110,7 @@ struct ex_softc {
#define EX_FLAGS_ATTACHED 0x4000 /* attach has succeeded */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
/* power management hooks */
diff --git a/sys/dev/ic/gemvar.h b/sys/dev/ic/gemvar.h
index bfef0f25da0..cdf5b5b1406 100644
--- a/sys/dev/ic/gemvar.h
+++ b/sys/dev/ic/gemvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: gemvar.h,v 1.21 2010/02/24 22:37:58 dyoung Exp $ */
+/* $NetBSD: gemvar.h,v 1.22 2011/11/19 22:51:22 tls Exp $ */
/*
*
@@ -217,7 +217,7 @@ struct gem_softc {
void (*sc_hwinit)(struct gem_softc *);
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
struct evcnt sc_ev_intr;
diff --git a/sys/dev/ic/hmevar.h b/sys/dev/ic/hmevar.h
index 32fb983f100..ed24b11d4f1 100644
--- a/sys/dev/ic/hmevar.h
+++ b/sys/dev/ic/hmevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hmevar.h,v 1.21 2009/09/18 12:40:15 tsutsui Exp $ */
+/* $NetBSD: hmevar.h,v 1.22 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@ struct hme_softc {
void (*sc_hwinit)(struct hme_softc *);
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/i82557var.h b/sys/dev/ic/i82557var.h
index 4d9be3ba861..792913ef555 100644
--- a/sys/dev/ic/i82557var.h
+++ b/sys/dev/ic/i82557var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: i82557var.h,v 1.48 2010/02/25 23:40:39 dyoung Exp $ */
+/* $NetBSD: i82557var.h,v 1.49 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -242,7 +242,7 @@ struct fxp_softc {
int sc_eeprom_size; /* log2 size of EEPROM */
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
};
diff --git a/sys/dev/ic/lan9118var.h b/sys/dev/ic/lan9118var.h
index 2cb8bb61227..7a4fc836550 100644
--- a/sys/dev/ic/lan9118var.h
+++ b/sys/dev/ic/lan9118var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lan9118var.h,v 1.2 2009/11/28 08:44:00 kiyohara Exp $ */
+/* $NetBSD: lan9118var.h,v 1.3 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 2008 KIYOHARA Takashi
* All rights reserved.
@@ -76,7 +76,7 @@ struct lan9118_softc {
#define LAN9118_FLAGS_NO_EEPROM 0x00000002
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/lancevar.h b/sys/dev/ic/lancevar.h
index 482adbab542..ed8d5a53b5d 100644
--- a/sys/dev/ic/lancevar.h
+++ b/sys/dev/ic/lancevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lancevar.h,v 1.13 2009/09/04 16:21:24 tsutsui Exp $ */
+/* $NetBSD: lancevar.h,v 1.14 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@ struct lance_softc {
uint8_t sc_enaddr[ETHER_ADDR_LEN];
uint8_t sc_pad[2];
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
void (*sc_meminit)(struct lance_softc *);
diff --git a/sys/dev/ic/lemacvar.h b/sys/dev/ic/lemacvar.h
index 0300026c5c1..6b1cf6c5e7d 100644
--- a/sys/dev/ic/lemacvar.h
+++ b/sys/dev/ic/lemacvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lemacvar.h,v 1.9 2005/12/11 12:21:27 christos Exp $ */
+/* $NetBSD: lemacvar.h,v 1.10 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 1997 Matt Thomas <matt@3am-software.com>
@@ -80,7 +80,7 @@ typedef struct {
char sc_prodname[LEMAC_EEP_PRDNMSZ+1]; /* product name DE20x-xx */
u_int8_t sc_eeprom[LEMAC_EEP_SIZE]; /* local copy eeprom */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
} lemac_softc_t;
diff --git a/sys/dev/ic/mb86950var.h b/sys/dev/ic/mb86950var.h
index 01242496bb4..b4e2aafbb4c 100644
--- a/sys/dev/ic/mb86950var.h
+++ b/sys/dev/ic/mb86950var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mb86950var.h,v 1.5 2009/05/12 14:25:17 cegger Exp $ */
+/* $NetBSD: mb86950var.h,v 1.6 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 1995 Mika Kortelainen
@@ -60,7 +60,7 @@ struct mb86950_softc {
u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
u_int32_t sc_stat; /* driver status */
diff --git a/sys/dev/ic/mb86960var.h b/sys/dev/ic/mb86960var.h
index 45468ec3ccc..dc703308ebf 100644
--- a/sys/dev/ic/mb86960var.h
+++ b/sys/dev/ic/mb86960var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mb86960var.h,v 1.37 2009/05/12 14:25:17 cegger Exp $ */
+/* $NetBSD: mb86960var.h,v 1.38 2011/11/19 22:51:22 tls Exp $ */
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@@ -162,7 +162,7 @@ struct mb86960_softc {
uint8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
uint32_t sc_stat; /* driver status */
diff --git a/sys/dev/ic/mtd803var.h b/sys/dev/ic/mtd803var.h
index 0ab54c4fb13..bb4f95f7c51 100644
--- a/sys/dev/ic/mtd803var.h
+++ b/sys/dev/ic/mtd803var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mtd803var.h,v 1.6 2008/04/28 20:23:50 martin Exp $ */
+/* $NetBSD: mtd803var.h,v 1.7 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@ struct mtd_softc {
bus_dmamap_t buf_dma_map;
#if NRND > 0
- rndsource_element_t rnd_src;
+ krndsource_t rnd_src;
#endif
};
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index 5795126a308..ca567b5b144 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc.c,v 1.51 2010/08/08 09:33:05 isaki Exp $ */
+/* $NetBSD: pckbc.c,v 1.52 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 2004 Ben Harris.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.51 2010/08/08 09:33:05 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.52 2011/11/19 22:51:22 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,7 +59,7 @@ struct pckbc_slotdata {
int poll_data; /* data read from inr handler if polling */
int poll_stat; /* status read from inr handler if polling */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/rtl81x9var.h b/sys/dev/ic/rtl81x9var.h
index e944695471c..467a049b232 100644
--- a/sys/dev/ic/rtl81x9var.h
+++ b/sys/dev/ic/rtl81x9var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl81x9var.h,v 1.50 2010/07/27 21:02:00 jakllsch Exp $ */
+/* $NetBSD: rtl81x9var.h,v 1.51 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -226,7 +226,7 @@ struct rtk_softc {
int (*sc_enable) (struct rtk_softc *);
void (*sc_disable) (struct rtk_softc *);
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/seeq8005var.h b/sys/dev/ic/seeq8005var.h
index e0d7c3b9234..3585f92117b 100644
--- a/sys/dev/ic/seeq8005var.h
+++ b/sys/dev/ic/seeq8005var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: seeq8005var.h,v 1.5 2001/11/07 20:01:58 bjh21 Exp $ */
+/* $NetBSD: seeq8005var.h,v 1.6 2011/11/19 22:51:22 tls Exp $ */
/*
* Copyright (c) 2000 Ben Harris
@@ -86,7 +86,7 @@ struct seeq8005_softc {
int sc_flags;
#define SF_8BIT 0x01
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/smc91cxxvar.h b/sys/dev/ic/smc91cxxvar.h
index 4c9c1052298..fb5a1b8b8ad 100644
--- a/sys/dev/ic/smc91cxxvar.h
+++ b/sys/dev/ic/smc91cxxvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: smc91cxxvar.h,v 1.16 2009/05/12 14:25:18 cegger Exp $ */
+/* $NetBSD: smc91cxxvar.h,v 1.17 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@ struct smc91cxx_softc {
uint8_t sc_intmask;
uint8_t sc_txpacketno; /* cached packetno */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ic/tulipvar.h b/sys/dev/ic/tulipvar.h
index c74264a03d0..72e2e6b2363 100644
--- a/sys/dev/ic/tulipvar.h
+++ b/sys/dev/ic/tulipvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tulipvar.h,v 1.65 2011/07/09 23:18:05 christos Exp $ */
+/* $NetBSD: tulipvar.h,v 1.66 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -448,7 +448,7 @@ struct tulip_softc {
int sc_rxptr; /* next ready RX descriptor/descsoft */
#if NRND > 0
- rndsource_element_t sc_rnd_source; /* random source */
+ krndsource_t sc_rnd_source; /* random source */
#endif
};
#endif
diff --git a/sys/dev/isa/fdvar.h b/sys/dev/isa/fdvar.h
index 9ff1204d2f4..eb35a97b631 100644
--- a/sys/dev/isa/fdvar.h
+++ b/sys/dev/isa/fdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fdvar.h,v 1.6 2008/04/28 20:23:52 martin Exp $ */
+/* $NetBSD: fdvar.h,v 1.7 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -91,6 +91,6 @@ struct fd_softc {
int sc_active; /* number of active I/O operations */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c
index b4fe0a2207e..4f0a6455310 100644
--- a/sys/dev/isa/if_eg.c
+++ b/sys/dev/isa/if_eg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eg.c,v 1.82 2010/04/05 07:20:24 joerg Exp $ */
+/* $NetBSD: if_eg.c,v 1.83 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.82 2010/04/05 07:20:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.83 2011/11/19 22:51:23 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -114,7 +114,7 @@ struct eg_softc {
void * eg_outbuf; /* Outgoing packet buffer */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c
index 9ea4e8c51ce..beb042d365b 100644
--- a/sys/dev/isa/if_el.c
+++ b/sys/dev/isa/if_el.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_el.c,v 1.86 2010/04/05 07:20:24 joerg Exp $ */
+/* $NetBSD: if_el.c,v 1.87 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_el.c,v 1.86 2010/04/05 07:20:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_el.c,v 1.87 2011/11/19 22:51:23 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -80,7 +80,7 @@ struct el_softc {
bus_space_handle_t sc_ioh; /* i/o handle */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/isa/if_iy.c b/sys/dev/isa/if_iy.c
index fed9a014d44..37d4c0cf873 100644
--- a/sys/dev/isa/if_iy.c
+++ b/sys/dev/isa/if_iy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iy.c,v 1.88 2010/04/05 07:20:24 joerg Exp $ */
+/* $NetBSD: if_iy.c,v 1.89 2011/11/19 22:51:23 tls Exp $ */
/* #define IYDEBUG */
/* #define IYMEMDEBUG */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.88 2010/04/05 07:20:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.89 2011/11/19 22:51:23 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -129,7 +129,7 @@ struct iy_softc {
#endif
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/ldvar.h b/sys/dev/ldvar.h
index e8913f0e949..dccadae861b 100644
--- a/sys/dev/ldvar.h
+++ b/sys/dev/ldvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ldvar.h,v 1.18 2010/09/20 06:54:06 kiyohara Exp $ */
+/* $NetBSD: ldvar.h,v 1.19 2011/11/19 22:51:22 tls Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@ struct ld_softc {
struct bufq_state *sc_bufq;
kmutex_t sc_mutex;
#if NRND > 0
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
#endif
int sc_queuecnt; /* current h/w queue depth */
int sc_ncylinders; /* # cylinders */
diff --git a/sys/dev/marvell/if_gfevar.h b/sys/dev/marvell/if_gfevar.h
index db0f2065d7e..f3e1478515e 100644
--- a/sys/dev/marvell/if_gfevar.h
+++ b/sys/dev/marvell/if_gfevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gfevar.h,v 1.10 2010/04/28 13:51:56 kiyohara Exp $ */
+/* $NetBSD: if_gfevar.h,v 1.11 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -168,7 +168,7 @@ struct gfe_softc {
struct gfe_rxqueue sc_rxq[4]; /* Hi/MedHi/MedLo/Lo receive queues */
#if NRND > 0
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
#endif
};
#endif /* _IF_GFEVAR_H_ */
diff --git a/sys/dev/marvell/if_mvgbe.c b/sys/dev/marvell/if_mvgbe.c
index 2bb2a640237..0679be5661d 100644
--- a/sys/dev/marvell/if_mvgbe.c
+++ b/sys/dev/marvell/if_mvgbe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mvgbe.c,v 1.14 2011/11/19 17:01:38 jakllsch Exp $ */
+/* $NetBSD: if_mvgbe.c,v 1.15 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2007, 2008 KIYOHARA Takashi
* All rights reserved.
@@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.14 2011/11/19 17:01:38 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.15 2011/11/19 22:51:23 tls Exp $");
#include "rnd.h"
@@ -216,7 +216,7 @@ struct mvgbe_softc {
SIMPLEQ_HEAD(__mvgbe_txmaphead, mvgbe_txmap_entry) sc_txmap_head;
#if NRND > 0
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
#endif
};
diff --git a/sys/dev/mca/edvar.h b/sys/dev/mca/edvar.h
index 8cf6ef1fe0b..b7262dfb13f 100644
--- a/sys/dev/mca/edvar.h
+++ b/sys/dev/mca/edvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: edvar.h,v 1.13 2008/05/04 13:11:14 martin Exp $ */
+/* $NetBSD: edvar.h,v 1.14 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -61,6 +61,6 @@ struct ed_softc {
u_int32_t rba; /* # of RBAs */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/pci/amdpmvar.h b/sys/dev/pci/amdpmvar.h
index af186f22355..25fc789770e 100644
--- a/sys/dev/pci/amdpmvar.h
+++ b/sys/dev/pci/amdpmvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: amdpmvar.h,v 1.6 2008/04/28 20:23:54 martin Exp $ */
+/* $NetBSD: amdpmvar.h,v 1.7 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@ struct amdpm_softc {
void *sc_ih;
struct callout sc_rnd_ch;
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
#ifdef AMDPM_RND_COUNTERS
struct evcnt sc_rnd_hits;
struct evcnt sc_rnd_miss;
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index 9cd187bddac..4cdd258bfd9 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hifn7751.c,v 1.46 2010/11/13 13:52:05 uebayasi Exp $ */
+/* $NetBSD: hifn7751.c,v 1.47 2011/11/19 22:51:23 tls Exp $ */
/* $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */
/* $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $ */
@@ -48,14 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.46 2010/11/13 13:52:05 uebayasi Exp $");
-
-#include "rnd.h"
-
-#if NRND == 0
-#error hifn7751 requires rnd pseudo-devices
-#endif
-
+__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.47 2011/11/19 22:51:23 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -71,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.46 2010/11/13 13:52:05 uebayasi Exp $
#include <dev/rndvar.h>
#else
#include <opencrypto/cryptodev.h>
-#include <sys/rnd.h>
+#include <sys/cprng.h>
#endif
#include <dev/pci/pcireg.h>
@@ -2077,7 +2070,7 @@ hifn_newsession(void *arg, u_int32_t *sidp, struct cryptoini *cri)
to generate IVs has been FIPS140-2
certified by several labs. */
#ifdef __NetBSD__
- arc4randbytes(sc->sc_sessions[i].hs_iv,
+ cprng_fast(sc->sc_sessions[i].hs_iv,
c->cri_alg == CRYPTO_AES_CBC ?
HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
#else /* FreeBSD and OpenBSD have get_random_bytes */
diff --git a/sys/dev/pci/hifn7751var.h b/sys/dev/pci/hifn7751var.h
index d3ed8ede489..edfa62a112d 100644
--- a/sys/dev/pci/hifn7751var.h
+++ b/sys/dev/pci/hifn7751var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hifn7751var.h,v 1.7 2005/12/11 12:22:49 christos Exp $ */
+/* $NetBSD: hifn7751var.h,v 1.8 2011/11/19 22:51:23 tls Exp $ */
/* $OpenBSD: hifn7751var.h,v 1.18 2000/06/02 22:36:45 deraadt Exp $ */
/*
@@ -168,7 +168,7 @@ struct hifn_softc {
struct callout sc_rngto; /* rng timeout */
struct callout sc_tickto; /* led-clear timeout */
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
int sc_rngfirst;
int sc_rnghz;
int sc_c_busy; /* command ring busy */
diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c
index b492e23bb88..ff3b7dd5ccd 100644
--- a/sys/dev/pci/if_bce.c
+++ b/sys/dev/pci/if_bce.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.33 2010/11/13 13:52:05 uebayasi Exp $ */
+/* $NetBSD: if_bce.c,v 1.34 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.33 2010/11/13 13:52:05 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.34 2011/11/19 22:51:23 tls Exp $");
#include "vlan.h"
#include "rnd.h"
@@ -139,7 +139,7 @@ struct bce_softc {
int bce_txsnext; /* next available tx slot */
callout_t bce_timeout;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/pci/if_bgevar.h b/sys/dev/pci/if_bgevar.h
index a87d92aefa3..db681571ea6 100644
--- a/sys/dev/pci/if_bgevar.h
+++ b/sys/dev/pci/if_bgevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bgevar.h,v 1.7 2011/05/18 01:02:43 dyoung Exp $ */
+/* $NetBSD: if_bgevar.h,v 1.8 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -290,7 +290,7 @@ struct bge_softc {
struct sysctllog *bge_log;
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
};
diff --git a/sys/dev/pci/if_casvar.h b/sys/dev/pci/if_casvar.h
index 4d4c5b3b912..04ed095caaf 100644
--- a/sys/dev/pci/if_casvar.h
+++ b/sys/dev/pci/if_casvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_casvar.h,v 1.2 2010/01/18 18:09:22 jdc Exp $ */
+/* $NetBSD: if_casvar.h,v 1.3 2011/11/19 22:51:23 tls Exp $ */
/* $OpenBSD: if_casvar.h,v 1.6 2009/06/13 12:18:58 kettenis Exp $ */
/*
@@ -195,7 +195,7 @@ struct cas_softc {
void *sc_sh; /* shutdownhook cookie */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
struct evcnt sc_ev_intr;
diff --git a/sys/dev/pci/if_devar.h b/sys/dev/pci/if_devar.h
index 9c85d36cbf5..ae292477be3 100644
--- a/sys/dev/pci/if_devar.h
+++ b/sys/dev/pci/if_devar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_devar.h,v 1.55 2010/04/05 07:20:25 joerg Exp $ */
+/* $NetBSD: if_devar.h,v 1.56 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -695,7 +695,7 @@ struct _tulip_softc_t {
tulip_desc_t *tulip_rxdescs;
tulip_desc_t *tulip_txdescs;
#if defined(__NetBSD__) && NRND > 0
- rndsource_element_t tulip_rndsource;
+ krndsource_t tulip_rndsource;
#endif
};
diff --git a/sys/dev/pci/if_dge.c b/sys/dev/pci/if_dge.c
index 0a869b9618b..b269af890c2 100644
--- a/sys/dev/pci/if_dge.c
+++ b/sys/dev/pci/if_dge.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_dge.c,v 1.31 2010/11/13 13:52:06 uebayasi Exp $ */
+/* $NetBSD: if_dge.c,v 1.32 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.31 2010/11/13 13:52:06 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.32 2011/11/19 22:51:23 tls Exp $");
#include "rnd.h"
@@ -334,7 +334,7 @@ struct dge_softc {
uint16_t sc_eeprom[EEPROM_SIZE];
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
#ifdef DGE_OFFBYONE_RXBUG
void *sc_bugbuf;
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 64e73687878..b5b74307f10 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwi.c,v 1.87 2011/05/23 15:37:36 drochner Exp $ */
+/* $NetBSD: if_iwi.c,v 1.88 2011/11/19 22:51:23 tls Exp $ */
/* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */
/*-
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.87 2011/05/23 15:37:36 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.88 2011/11/19 22:51:23 tls Exp $");
/*-
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.87 2011/05/23 15:37:36 drochner Exp $")
#include <sys/conf.h>
#include <sys/kauth.h>
#include <sys/proc.h>
+#include <sys/cprng.h>
#include <sys/bus.h>
#include <machine/endian.h>
@@ -2386,7 +2387,8 @@ iwi_config(struct iwi_softc *sc)
return error;
}
- data = htole32(arc4random());
+ cprng_fast(&data, sizeof(data));
+ data = htole32(data);
DPRINTF(("Setting initialization vector to %u\n", le32toh(data)));
error = iwi_cmd(sc, IWI_CMD_SET_IV, &data, sizeof data, 0);
if (error != 0)
diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c
index 05d10bd64a8..153327c5a91 100644
--- a/sys/dev/pci/if_jme.c
+++ b/sys/dev/pci/if_jme.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_jme.c,v 1.17 2011/03/30 18:11:37 bouyer Exp $ */
+/* $NetBSD: if_jme.c,v 1.18 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2008 Manuel Bouyer. All rights reserved.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.17 2011/03/30 18:11:37 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.18 2011/11/19 22:51:23 tls Exp $");
#include <sys/param.h>
@@ -168,7 +168,7 @@ struct jme_softc {
uint32_t jme_txcsr; /* TX config register */
uint32_t jme_rxcsr; /* RX config register */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
/* interrupt coalition parameters */
struct sysctllog *jme_clog;
diff --git a/sys/dev/pci/if_mskvar.h b/sys/dev/pci/if_mskvar.h
index 1fb3299e7d9..01ac7e2df75 100644
--- a/sys/dev/pci/if_mskvar.h
+++ b/sys/dev/pci/if_mskvar.h
@@ -1,5 +1,5 @@
/* $OpenBSD: if_mskvar.h,v 1.3 2006/12/28 16:34:42 kettenis Exp $ */
-/* $NetBSD: if_mskvar.h,v 1.8 2009/12/24 18:27:32 christos Exp $ */
+/* $NetBSD: if_mskvar.h,v 1.9 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -210,7 +210,7 @@ struct sk_softc {
int sk_status_idx;
int sk_status_own_idx;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c
index 15035e4ee84..d49408332ef 100644
--- a/sys/dev/pci/if_pcn.c
+++ b/sys/dev/pci/if_pcn.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pcn.c,v 1.52 2010/11/13 13:52:06 uebayasi Exp $ */
+/* $NetBSD: if_pcn.c,v 1.53 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.52 2010/11/13 13:52:06 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.53 2011/11/19 22:51:23 tls Exp $");
#include "rnd.h"
@@ -313,7 +313,7 @@ struct pcn_softc {
uint32_t sc_mode; /* prototype MODE register */
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
};
diff --git a/sys/dev/pci/if_sip.c b/sys/dev/pci/if_sip.c
index bcf9e4282a9..eb9c8293561 100644
--- a/sys/dev/pci/if_sip.c
+++ b/sys/dev/pci/if_sip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sip.c,v 1.150 2011/10/15 19:50:20 dholland Exp $ */
+/* $NetBSD: if_sip.c,v 1.151 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.150 2011/10/15 19:50:20 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.151 2011/11/19 22:51:23 tls Exp $");
#include "rnd.h"
@@ -355,7 +355,7 @@ struct sip_softc {
void (*sc_rxintr)(struct sip_softc *);
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
};
diff --git a/sys/dev/pci/if_skvar.h b/sys/dev/pci/if_skvar.h
index d66022ccd4b..79b3479f900 100644
--- a/sys/dev/pci/if_skvar.h
+++ b/sys/dev/pci/if_skvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skvar.h,v 1.15 2008/09/08 21:20:03 christos Exp $ */
+/* $NetBSD: if_skvar.h,v 1.16 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -205,7 +205,7 @@ struct sk_softc {
bus_dma_tag_t sc_dmatag;
struct sk_if_softc *sk_if[2];
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/pci/if_tlvar.h b/sys/dev/pci/if_tlvar.h
index fc254659442..ad34eda5450 100644
--- a/sys/dev/pci/if_tlvar.h
+++ b/sys/dev/pci/if_tlvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tlvar.h,v 1.14 2009/10/19 18:41:15 bouyer Exp $ */
+/* $NetBSD: if_tlvar.h,v 1.15 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@@ -85,7 +85,7 @@ struct tl_softc {
int oerr_mcopy;
#endif
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
#define tl_if tl_ec.ec_if
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index badd3839c19..95bb018d4f5 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vr.c,v 1.107 2010/12/16 17:07:44 jakllsch Exp $ */
+/* $NetBSD: if_vr.c,v 1.108 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.107 2010/12/16 17:07:44 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.108 2011/11/19 22:51:23 tls Exp $");
#include "rnd.h"
@@ -234,7 +234,7 @@ struct vr_softc {
uint32_t vr_save_irq;
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
};
diff --git a/sys/dev/pci/if_vtevar.h b/sys/dev/pci/if_vtevar.h
index 3b7d3aaaa82..9abc8928ee5 100644
--- a/sys/dev/pci/if_vtevar.h
+++ b/sys/dev/pci/if_vtevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vtevar.h,v 1.1 2011/01/26 18:48:13 bouyer Exp $ */
+/* $NetBSD: if_vtevar.h,v 1.2 2011/11/19 22:51:23 tls Exp $ */
/*-
* Copyright (c) 2010, Pyun YongHyeon <yongari@FreeBSD.org>
@@ -139,7 +139,7 @@ struct vte_softc {
int vte_int_tx_mod;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c
index 4919c455444..97ff118eef6 100644
--- a/sys/dev/pci/if_wm.c
+++ b/sys/dev/pci/if_wm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.223 2011/07/01 07:45:39 matt Exp $ */
+/* $NetBSD: if_wm.c,v 1.224 2011/11/19 22:51:23 tls Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.223 2011/07/01 07:45:39 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.224 2011/11/19 22:51:23 tls Exp $");
#include "rnd.h"
@@ -379,7 +379,7 @@ struct wm_softc {
int sc_mchash_type; /* multicast filter offset */
#if NRND > 0
- rndsource_element_t rnd_source; /* random source */
+ krndsource_t rnd_source; /* random source */
#endif
};
diff --git a/sys/dev/pci/ixgbe/ixgbe.c b/sys/dev/pci/ixgbe/ixgbe.c
index 7a05c96d8e7..475047aa3ec 100644
--- a/sys/dev/pci/ixgbe/ixgbe.c
+++ b/sys/dev/pci/ixgbe/ixgbe.c
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: src/sys/dev/ixgbe/ixgbe.c,v 1.51 2011/04/25 23:34:21 jfv Exp $*/
-/*$NetBSD: ixgbe.c,v 1.1 2011/08/12 21:55:29 dyoung Exp $*/
+/*$NetBSD: ixgbe.c,v 1.2 2011/11/19 22:51:24 tls Exp $*/
#include "opt_inet.h"
@@ -4160,7 +4160,7 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
reta = 0;
/* set up random bits */
- arc4randbytes(&r, sizeof(r));
+ cprng_fast(&r, sizeof(r));
/* Set up the redirection table */
for (i = 0, j = 0; i < 128; i++, j++) {
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index 69edacd7c39..28755e95d1d 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ubsec.c,v 1.25 2010/11/13 13:52:09 uebayasi Exp $ */
+/* $NetBSD: ubsec.c,v 1.26 2011/11/19 22:51:24 tls Exp $ */
/* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */
/* $OpenBSD: ubsec.c,v 1.127 2003/06/04 14:04:58 jason Exp $ */
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.25 2010/11/13 13:52:09 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.26 2011/11/19 22:51:24 tls Exp $");
#undef UBSEC_DEBUG
@@ -65,7 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.25 2010/11/13 13:52:09 uebayasi Exp $");
#include <dev/rndvar.h>
#include <sys/md5k.h>
#else
- #include <sys/rnd.h>
+ #include <sys/cprng.h>
#include <sys/md5.h>
#endif
#include <sys/sha1.h>
@@ -808,8 +808,7 @@ ubsec_newsession(void *arg, u_int32_t *sidp, struct cryptoini *cri)
if (encini) {
/* get an IV, network byte order */
#ifdef __NetBSD__
- rnd_extract_data(ses->ses_iv,
- sizeof(ses->ses_iv), RND_EXTRACT_ANY);
+ cprng_fast(ses->ses_iv, sizeof(ses->ses_iv));
#else
get_random_bytes(ses->ses_iv, sizeof(ses->ses_iv));
#endif
diff --git a/sys/dev/pcmcia/if_xivar.h b/sys/dev/pcmcia/if_xivar.h
index 8a5c458cd45..2b493881546 100644
--- a/sys/dev/pcmcia/if_xivar.h
+++ b/sys/dev/pcmcia/if_xivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xivar.h,v 1.6 2009/12/06 23:05:39 dyoung Exp $ */
+/* $NetBSD: if_xivar.h,v 1.7 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@@ -45,7 +45,7 @@ struct xi_softc {
u_int8_t sc_rev; /* Chip revision */
#if NRND > 0
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
#endif
};
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index 0f0960a6e16..54445b4c676 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,12 +1,13 @@
-/* $NetBSD: rnd.c,v 1.82 2011/10/11 23:55:30 yamt Exp $ */
+/* $NetBSD: rnd.c,v 1.83 2011/11/19 22:51:22 tls Exp $ */
/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
- * by Michael Graff <explorer@flame.org>. This code uses ideas and
- * algorithms from the Linux driver written by Ted Ts'o.
+ * by Michael Graff <explorer@flame.org> and Thor Lancelot Simon.
+ * This code uses ideas and algorithms from the Linux driver written by
+ * Ted Ts'o.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.82 2011/10/11 23:55:30 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.83 2011/11/19 22:51:22 tls Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -50,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.82 2011/10/11 23:55:30 yamt Exp $");
#include <sys/pool.h>
#include <sys/kauth.h>
#include <sys/once.h>
+#include <sys/rngtest.h>
#if defined(__HAVE_CPU_COUNTER) && !defined(_RUMPKERNEL) /* XXX: bad pooka */
#include <machine/cpu_counter.h>
@@ -89,7 +91,7 @@ int rnd_debug = 0;
#define RND_SAMPLE_COUNT 64 /* collect N samples, then compress */
typedef struct _rnd_sample_t {
SIMPLEQ_ENTRY(_rnd_sample_t) next;
- rndsource_t *source;
+ krndsource_t *source;
int cursor;
int entropy;
u_int32_t ts[RND_SAMPLE_COUNT];
@@ -105,6 +107,14 @@ SIMPLEQ_HEAD(, _rnd_sample_t) rnd_samples;
kmutex_t rnd_mtx;
/*
+ * Entropy sinks: usually other generators waiting to be rekeyed.
+ *
+ * A sink's callback MUST NOT re-add the sink to the list, or
+ * list corruption will occur.
+ */
+TAILQ_HEAD(, rndsink) rnd_sinks;
+
+/*
* our select/poll queue
*/
struct selinfo rnd_selq;
@@ -130,12 +140,18 @@ kcondvar_t rndpool_cv;
* This source is used to easily "remove" queue entries when the source
* which actually generated the events is going away.
*/
-static rndsource_t rnd_source_no_collect = {
- { 'N', 'o', 'C', 'o', 'l', 'l', 'e', 'c', 't', 0, 0, 0, 0, 0, 0, 0 },
- 0, 0, 0, 0,
- RND_TYPE_UNKNOWN,
- (RND_FLAG_NO_COLLECT | RND_FLAG_NO_ESTIMATE | RND_TYPE_UNKNOWN),
- NULL
+static krndsource_t rnd_source_no_collect = {
+ /* LIST_ENTRY list */
+ .name = { 'N', 'o', 'C', 'o', 'l', 'l', 'e', 'c', 't',
+ 0, 0, 0, 0, 0, 0, 0 },
+ .last_time = 0, .last_delta = 0, .last_delta2 = 0, .total = 0,
+ .type = RND_TYPE_UNKNOWN,
+ .flags = (RND_FLAG_NO_COLLECT |
+ RND_FLAG_NO_ESTIMATE |
+ RND_TYPE_UNKNOWN),
+ .state = NULL,
+ .test_cnt = 0,
+ .test = NULL
};
struct callout rnd_callout;
@@ -155,15 +171,17 @@ const struct cdevsw rnd_cdevsw = {
};
static inline void rnd_wakeup_readers(void);
-static inline u_int32_t rnd_estimate_entropy(rndsource_t *, u_int32_t);
+static inline u_int32_t rnd_estimate_entropy(krndsource_t *, u_int32_t);
static inline u_int32_t rnd_counter(void);
static void rnd_timeout(void *);
+static void rnd_process_events(void *);
static u_int32_t rnd_extract_data_locked(void *, u_int32_t, u_int32_t);
static int rnd_ready = 0;
static int rnd_have_entropy = 0;
+static int rnd_tested = 0;
-LIST_HEAD(, __rndsource_element) rnd_sources;
+LIST_HEAD(, krndsource) rnd_sources;
/*
* Generate a 32-bit counter. This should be more machine dependent,
@@ -192,24 +210,67 @@ rnd_counter(void)
static inline void
rnd_wakeup_readers(void)
{
+ rndsink_t *sink, *tsink;
+ TAILQ_HEAD(, rndsink) sunk = TAILQ_HEAD_INITIALIZER(sunk);
+ mutex_spin_enter(&rndpool_mtx);
+ if (rndpool_get_entropy_count(&rnd_pool) < RND_ENTROPY_THRESHOLD * 8) {
+ mutex_spin_exit(&rndpool_mtx);
+ return;
+ }
+
+ /*
+ * First, take care of in-kernel consumers needing rekeying.
+ */
+ TAILQ_FOREACH_SAFE(sink, &rnd_sinks, tailq, tsink) {
+ if ((sink->len + RND_ENTROPY_THRESHOLD) * 8 <
+ rndpool_get_entropy_count(&rnd_pool)) {
+ /* We have enough entropy to sink some here. */
+ if (rndpool_extract_data(&rnd_pool, sink->data,
+ sink->len, RND_EXTRACT_GOOD)
+ != sink->len) {
+ panic("could not extract estimated "
+ "entropy from pool");
+ }
+ /* Move this sink to the list of pending callbacks */
+ TAILQ_REMOVE(&rnd_sinks, sink, tailq);
+ TAILQ_INSERT_HEAD(&sunk, sink, tailq);
+ }
+ }
+
/*
- * If we have added new bits, and now have enough to do something,
- * wake up sleeping readers.
+ * If we still have enough new bits to do something, feed userspace.
*/
- mutex_enter(&rndpool_mtx);
if (rndpool_get_entropy_count(&rnd_pool) > RND_ENTROPY_THRESHOLD * 8) {
- cv_broadcast(&rndpool_cv);
- selnotify(&rnd_selq, 0, 0);
-
#ifdef RND_VERBOSE
if (!rnd_have_entropy)
printf("rnd: have initial entropy (%u)\n",
rndpool_get_entropy_count(&rnd_pool));
#endif
rnd_have_entropy = 1;
+ cv_broadcast(&rndpool_cv);
+ mutex_spin_exit(&rndpool_mtx);
+ selnotify(&rnd_selq, 0, 0);
+ } else {
+ mutex_spin_exit(&rndpool_mtx);
+ }
+
+ /*
+ * Now that we have dropped the mutex, we can run sinks' callbacks.
+ * Since we have reused the "tailq" member of the sink structure for
+ * this temporary on-stack queue, the callback must NEVER re-add
+ * the sink to the main queue, or our on-stack queue will become
+ * corrupt.
+ */
+ while ((sink = TAILQ_FIRST(&sunk))) {
+#ifdef RND_VERBOSE
+ printf("supplying %d bytes to entropy sink \"%s\""
+ " (cb %p, arg %p).\n",
+ (int)sink->len, sink->name, sink->cb, sink->arg);
+#endif
+ sink->cb(sink->arg);
+ TAILQ_REMOVE(&sunk, sink, tailq);
}
- mutex_exit(&rndpool_mtx);
}
/*
@@ -218,7 +279,7 @@ rnd_wakeup_readers(void)
* non-zero. If any of these are zero, return zero.
*/
static inline u_int32_t
-rnd_estimate_entropy(rndsource_t *rs, u_int32_t t)
+rnd_estimate_entropy(krndsource_t *rs, u_int32_t t)
{
int32_t delta, delta2, delta3;
@@ -287,7 +348,9 @@ rndattach(int num)
/* mix in another counter */
c = rnd_counter();
+ mutex_spin_enter(&rndpool_mtx);
rndpool_add_data(&rnd_pool, &c, sizeof(u_int32_t), 1);
+ mutex_spin_exit(&rndpool_mtx);
}
/*
@@ -306,6 +369,7 @@ rnd_init(void)
mutex_init(&rnd_mtx, MUTEX_DEFAULT, IPL_VM);
callout_init(&rnd_callout, CALLOUT_MPSAFE);
+ callout_setfunc(&rnd_callout, rnd_timeout, NULL);
/*
* take a counter early, hoping that there's some variance in
@@ -315,10 +379,11 @@ rnd_init(void)
LIST_INIT(&rnd_sources);
SIMPLEQ_INIT(&rnd_samples);
+ TAILQ_INIT(&rnd_sinks);
selinit(&rnd_selq);
rndpool_init(&rnd_pool);
- mutex_init(&rndpool_mtx, MUTEX_DEFAULT, IPL_SOFTCLOCK);
+ mutex_init(&rndpool_mtx, MUTEX_DEFAULT, IPL_VM);
cv_init(&rndpool_cv, "rndread");
/* Mix *something*, *anything* into the pool to help it get started.
@@ -327,9 +392,11 @@ rnd_init(void)
* XXX more things to add would be nice.
*/
if (c) {
- rndpool_add_data(&rnd_pool, &c, sizeof(u_int32_t), 1);
+ mutex_spin_enter(&rndpool_mtx);
+ rndpool_add_data(&rnd_pool, &c, sizeof(c), 1);
c = rnd_counter();
- rndpool_add_data(&rnd_pool, &c, sizeof(u_int32_t), 1);
+ rndpool_add_data(&rnd_pool, &c, sizeof(c), 1);
+ mutex_spin_exit(&rndpool_mtx);
}
rnd_ready = 1;
@@ -393,7 +460,7 @@ rndread(dev_t dev, struct uio *uio, int ioflag)
*
* If not requesting strong randomness, we can always read.
*/
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
if (mode != RND_EXTRACT_ANY) {
for (;;) {
/*
@@ -408,19 +475,19 @@ rndread(dev_t dev, struct uio *uio, int ioflag)
* Data is not available.
*/
if (ioflag & IO_NDELAY) {
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
ret = EWOULDBLOCK;
goto out;
}
ret = cv_wait_sig(&rndpool_cv, &rndpool_mtx);
if (ret) {
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
goto out;
}
}
}
nread = rnd_extract_data_locked(bf, n, mode);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
/*
* Copy (possibly partial) data to the user.
@@ -460,9 +527,9 @@ rndwrite(dev_t dev, struct uio *uio, int ioflag)
/*
* Mix in the bytes.
*/
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
rndpool_add_data(&rnd_pool, bf, n, 0);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
DPRINTF(RND_DEBUG_WRITE, ("Random: Copied in %d bytes\n", n));
}
@@ -470,11 +537,21 @@ rndwrite(dev_t dev, struct uio *uio, int ioflag)
return (ret);
}
+static void
+krndsource_to_rndsource(krndsource_t *kr, rndsource_t *r)
+{
+ memset(r, 0, sizeof(*r));
+ strlcpy(r->name, kr->name, sizeof(r->name));
+ r->total = kr->total;
+ r->type = kr->type;
+ r->flags = kr->flags;
+}
+
int
rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
struct lwp *l)
{
- rndsource_element_t *rse;
+ krndsource_t *kr;
rndstat_t *rst;
rndstat_name_t *rstnm;
rndctl_t *rctl;
@@ -528,15 +605,15 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
break;
case RNDGETENTCNT:
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
*(u_int32_t *)addr = rndpool_get_entropy_count(&rnd_pool);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
break;
case RNDGETPOOLSTAT:
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
rndpool_get_stats(&rnd_pool, addr, sizeof(rndpoolstat_t));
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
break;
case RNDGETSRCNUM:
@@ -552,10 +629,10 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
* Find the starting source by running through the
* list of sources.
*/
- rse = rnd_sources.lh_first;
+ kr = rnd_sources.lh_first;
start = rst->start;
- while (rse != NULL && start >= 1) {
- rse = rse->list.le_next;
+ while (kr != NULL && start >= 1) {
+ kr = kr->list.le_next;
start--;
}
@@ -564,15 +641,9 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
* for. If we run out of sources, a count of zero
* will be returned, without an error.
*/
- for (count = 0; count < rst->count && rse != NULL; count++) {
- memcpy(&rst->source[count], &rse->data,
- sizeof(rndsource_t));
- /* Zero out information which may leak */
- rst->source[count].last_time = 0;
- rst->source[count].last_delta = 0;
- rst->source[count].last_delta2 = 0;
- rst->source[count].state = 0;
- rse = rse->list.le_next;
+ for (count = 0; count < rst->count && kr != NULL; count++) {
+ krndsource_to_rndsource(kr, &rst->source[count]);
+ kr = kr->list.le_next;
}
rst->count = count;
@@ -584,15 +655,15 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
* Scan through the list, trying to find the name.
*/
rstnm = (rndstat_name_t *)addr;
- rse = rnd_sources.lh_first;
- while (rse != NULL) {
- if (strncmp(rse->data.name, rstnm->name, 16) == 0) {
- memcpy(&rstnm->source, &rse->data,
- sizeof(rndsource_t));
-
+ kr = rnd_sources.lh_first;
+ while (kr != NULL) {
+ if (strncmp(kr->name, rstnm->name,
+ MIN(sizeof(kr->name),
+ sizeof(*rstnm))) == 0) {
+ krndsource_to_rndsource(kr, &rstnm->source);
return (0);
}
- rse = rse->list.le_next;
+ kr = kr->list.le_next;
}
ret = ENOENT; /* name not found */
@@ -605,19 +676,19 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
* collection.
*/
rctl = (rndctl_t *)addr;
- rse = rnd_sources.lh_first;
+ kr = rnd_sources.lh_first;
/*
* Flags set apply to all sources of this type.
*/
if (rctl->type != 0xff) {
- while (rse != NULL) {
- if (rse->data.type == rctl->type) {
- rse->data.flags &= ~rctl->mask;
- rse->data.flags |=
+ while (kr != NULL) {
+ if (kr->type == rctl->type) {
+ kr->flags &= ~rctl->mask;
+ kr->flags |=
(rctl->flags & rctl->mask);
}
- rse = rse->list.le_next;
+ kr = kr->list.le_next;
}
return (0);
@@ -626,14 +697,16 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
/*
* scan through the list, trying to find the name
*/
- while (rse != NULL) {
- if (strncmp(rse->data.name, rctl->name, 16) == 0) {
- rse->data.flags &= ~rctl->mask;
- rse->data.flags |= (rctl->flags & rctl->mask);
+ while (kr != NULL) {
+ if (strncmp(kr->name, rctl->name,
+ MIN(sizeof(kr->name),
+ sizeof(rctl->name))) == 0) {
+ kr->flags &= ~rctl->mask;
+ kr->flags |= (rctl->flags & rctl->mask);
return (0);
}
- rse = rse->list.le_next;
+ kr = kr->list.le_next;
}
ret = ENOENT; /* name not found */
@@ -646,10 +719,10 @@ rndioctl(dev_t dev, u_long cmd, void *addr, int flag,
if (rnddata->len > sizeof(rnddata->data))
return EINVAL;
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
rndpool_add_data(&rnd_pool, rnddata->data, rnddata->len,
rnddata->entropy);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
rnd_wakeup_readers();
@@ -690,13 +763,13 @@ rndpoll(dev_t dev, int events, struct lwp *l)
/*
* Make certain we have enough entropy to be readable.
*/
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
entcnt = rndpool_get_entropy_count(&rnd_pool);
+ mutex_spin_exit(&rndpool_mtx);
if (entcnt >= RND_ENTROPY_THRESHOLD * 8)
revents |= events & (POLLIN | POLLRDNORM);
else
selrecord(l, &rnd_selq);
- mutex_exit(&rndpool_mtx);
return (revents);
}
@@ -704,9 +777,9 @@ rndpoll(dev_t dev, int events, struct lwp *l)
static void
filt_rnddetach(struct knote *kn)
{
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
SLIST_REMOVE(&rnd_selq.sel_klist, kn, knote, kn_selnext);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
}
static int
@@ -714,9 +787,9 @@ filt_rndread(struct knote *kn, long hint)
{
uint32_t entcnt;
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
entcnt = rndpool_get_entropy_count(&rnd_pool);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
if (entcnt >= RND_ENTROPY_THRESHOLD * 8) {
kn->kn_data = RND_TEMP_BUFFER_SIZE;
return (1);
@@ -755,15 +828,15 @@ rndkqfilter(dev_t dev, struct knote *kn)
kn->kn_hook = NULL;
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
SLIST_INSERT_HEAD(klist, kn, kn_selnext);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
return (0);
}
static rnd_sample_t *
-rnd_sample_allocate(rndsource_t *source)
+rnd_sample_allocate(krndsource_t *source)
{
rnd_sample_t *c;
@@ -782,7 +855,7 @@ rnd_sample_allocate(rndsource_t *source)
* Don't wait on allocation. To be used in an interrupt context.
*/
static rnd_sample_t *
-rnd_sample_allocate_isr(rndsource_t *source)
+rnd_sample_allocate_isr(krndsource_t *source)
{
rnd_sample_t *c;
@@ -800,7 +873,7 @@ rnd_sample_allocate_isr(rndsource_t *source)
static void
rnd_sample_free(rnd_sample_t *c)
{
- memset(c, 0, sizeof(rnd_sample_t));
+ memset(c, 0, sizeof(*c));
pool_put(&rnd_mempool, c);
}
@@ -808,7 +881,7 @@ rnd_sample_free(rnd_sample_t *c)
* Add a source to our list of sources.
*/
void
-rnd_attach_source(rndsource_element_t *rs, const char *name, u_int32_t type,
+rnd_attach_source(krndsource_t *rs, const char *name, u_int32_t type,
u_int32_t flags)
{
u_int32_t ts;
@@ -817,11 +890,11 @@ rnd_attach_source(rndsource_element_t *rs, const char *name, u_int32_t type,
ts = rnd_counter();
- strlcpy(rs->data.name, name, sizeof(rs->data.name));
- rs->data.last_time = ts;
- rs->data.last_delta = 0;
- rs->data.last_delta2 = 0;
- rs->data.total = 0;
+ strlcpy(rs->name, name, sizeof(rs->name));
+ rs->last_time = ts;
+ rs->last_delta = 0;
+ rs->last_delta2 = 0;
+ rs->total = 0;
/*
* Force network devices to not collect any entropy by
@@ -830,15 +903,27 @@ rnd_attach_source(rndsource_element_t *rs, const char *name, u_int32_t type,
if (type == RND_TYPE_NET)
flags |= (RND_FLAG_NO_COLLECT | RND_FLAG_NO_ESTIMATE);
- rs->data.type = type;
- rs->data.flags = flags;
+ /*
+ * Hardware RNGs get extra space for statistical testing.
+ */
+ if (type == RND_TYPE_RNG) {
+ rs->test = kmem_alloc(sizeof(rngtest_t), KM_NOSLEEP);
+ rs->test_cnt = 0;
+ } else {
+ rs->test = NULL;
+ rs->test_cnt = -1;
+ }
+
+ rs->type = type;
+ rs->flags = flags;
- rs->data.state = rnd_sample_allocate(&rs->data);
+ rs->state = rnd_sample_allocate(rs);
+ mutex_spin_enter(&rndpool_mtx);
LIST_INSERT_HEAD(&rnd_sources, rs, list);
#ifdef RND_VERBOSE
- printf("rnd: %s attached as an entropy source (", rs->data.name);
+ printf("rnd: %s attached as an entropy source (", rs->name);
if (!(flags & RND_FLAG_NO_COLLECT)) {
printf("collecting");
if (flags & RND_FLAG_NO_ESTIMATE)
@@ -854,28 +939,30 @@ rnd_attach_source(rndsource_element_t *rs, const char *name, u_int32_t type,
* XXX Bogus, but harder to guess than zeros.
*/
rndpool_add_data(&rnd_pool, &ts, sizeof(u_int32_t), 1);
+ mutex_spin_exit(&rndpool_mtx);
}
/*
* Remove a source from our list of sources.
*/
void
-rnd_detach_source(rndsource_element_t *rs)
+rnd_detach_source(krndsource_t *source)
{
rnd_sample_t *sample;
- rndsource_t *source;
-
- mutex_enter(&rnd_mtx);
- LIST_REMOVE(rs, list);
+ mutex_spin_enter(&rnd_mtx);
- source = &rs->data;
+ LIST_REMOVE(source, list);
if (source->state) {
rnd_sample_free(source->state);
source->state = NULL;
}
+ if (source->test) {
+ kmem_free(source->test, sizeof(rngtest_t));
+ }
+
/*
* If there are samples queued up "remove" them from the sample queue
* by setting the source to the no-collect pseudosource.
@@ -888,9 +975,9 @@ rnd_detach_source(rndsource_element_t *rs)
sample = SIMPLEQ_NEXT(sample, next);
}
- mutex_exit(&rnd_mtx);
+ mutex_spin_exit(&rnd_mtx);
#ifdef RND_VERBOSE
- printf("rnd: %s detached as an entropy source\n", rs->data.name);
+ printf("rnd: %s detached as an entropy source\n", source->name);
#endif
}
@@ -899,16 +986,12 @@ rnd_detach_source(rndsource_element_t *rs)
* source-specific source structure.
*/
void
-rnd_add_uint32(rndsource_element_t *rs, u_int32_t val)
+rnd_add_uint32(krndsource_t *rs, u_int32_t val)
{
- rndsource_t *rst;
- rnd_sample_t *state;
u_int32_t ts;
+ u_int32_t entropy = 0;
-
- rst = &rs->data;
-
- if (rst->flags & RND_FLAG_NO_COLLECT)
+ if (rs->flags & RND_FLAG_NO_COLLECT)
return;
/*
@@ -918,134 +1001,264 @@ rnd_add_uint32(rndsource_element_t *rs, u_int32_t val)
ts = rnd_counter();
/*
- * If the sample buffer is NULL, try to allocate one here. If this
- * fails, drop this sample.
- */
- state = rst->state;
- if (state == NULL) {
- state = rnd_sample_allocate_isr(rst);
- if (state == NULL)
- return;
- rst->state = state;
- }
-
- /*
* If we are estimating entropy on this source,
* calculate differentials.
*/
- if ((rst->flags & RND_FLAG_NO_ESTIMATE) == 0)
- state->entropy += rnd_estimate_entropy(rst, ts);
+ if ((rs->flags & RND_FLAG_NO_ESTIMATE) == 0) {
+ entropy = rnd_estimate_entropy(rs, ts);
+ }
+
+ rnd_add_data(rs, &val, sizeof(val), entropy);
+}
- state->ts[state->cursor] = ts;
- state->values[state->cursor] = val;
- state->cursor++;
+void
+rnd_add_data(krndsource_t *rs, const void *const data, u_int32_t len,
+ u_int32_t entropy)
+{
+ rnd_sample_t *state = NULL;
+ uint32_t ts;
+ const uint32_t *dint = data;
+ int todo, done, filled = 0;
+ SIMPLEQ_HEAD(, _rnd_sample_t) tmp_samples =
+ SIMPLEQ_HEAD_INITIALIZER(tmp_samples);
+
+ if (rs->flags & RND_FLAG_NO_COLLECT) {
+ return;
+ }
+
+ /*
+ * Sample the counter as soon as possible to avoid entropy
+ * overestimation.
+ */
+ ts = rnd_counter();
/*
- * If the state arrays are not full, we're done.
+ * Loop over data packaging it into sample buffers.
+ * If a sample buffer allocation fails, drop all data.
*/
- if (state->cursor < RND_SAMPLE_COUNT)
+ todo = len / sizeof(*dint);
+ for (done = 0; done < todo ; done++) {
+ state = rs->state;
+ if (state == NULL) {
+ state = rnd_sample_allocate_isr(rs);
+ if (__predict_false(state == NULL)) {
+ break;
+ }
+ rs->state = state;
+ }
+
+ state->ts[state->cursor] = ts;
+ state->values[state->cursor] = dint[done];
+ state->cursor++;
+
+ if (state->cursor == RND_SAMPLE_COUNT) {
+ SIMPLEQ_INSERT_HEAD(&tmp_samples, state, next);
+ filled++;
+ rs->state = NULL;
+ }
+ }
+
+ if (__predict_false(state == NULL)) {
+ while ((state = SIMPLEQ_FIRST(&tmp_samples))) {
+ SIMPLEQ_REMOVE_HEAD(&tmp_samples, next);
+ rnd_sample_free(state);
+ }
return;
+ }
/*
- * State arrays are full. Queue this chunk on the processing queue.
+ * Claim all the entropy on the last one we send to
+ * the pool, so we don't rely on it being evenly distributed
+ * in the supplied data.
+ *
+ * XXX The rndpool code must accept samples with more
+ * XXX claimed entropy than bits for this to work right.
*/
- mutex_enter(&rnd_mtx);
- SIMPLEQ_INSERT_HEAD(&rnd_samples, state, next);
- rst->state = NULL;
+ state->entropy += entropy;
+ rs->total += entropy;
/*
- * If the timeout isn't pending, have it run in the near future.
+ * If we didn't finish any sample buffers, we're done.
*/
- if (rnd_timeout_pending == 0) {
- rnd_timeout_pending = 1;
- callout_reset(&rnd_callout, 1, rnd_timeout, NULL);
+ if (!filled) {
+ return;
+ }
+
+ mutex_spin_enter(&rnd_mtx);
+ while ((state = SIMPLEQ_FIRST(&tmp_samples))) {
+ SIMPLEQ_REMOVE_HEAD(&tmp_samples, next);
+ SIMPLEQ_INSERT_HEAD(&rnd_samples, state, next);
}
- mutex_exit(&rnd_mtx);
/*
- * To get here we have to have queued the state up, and therefore
- * we need a new state buffer. If we can, allocate one now;
- * if we don't get it, it doesn't matter; we'll try again on
- * the next random event.
+ * If we are still starting up, cause immediate processing of
+ * the queued samples. Otherwise, if the timeout isn't
+ * pending, have it run in the near future.
*/
- rst->state = rnd_sample_allocate_isr(rst);
+ if (__predict_false(cold)) {
+#ifdef RND_VERBOSE
+ printf("rnd: directly processing boot-time events.\n");
+#endif
+ rnd_process_events(NULL); /* Drops lock! */
+ return;
+ }
+ if (rnd_timeout_pending == 0) {
+ rnd_timeout_pending = 1;
+ mutex_spin_exit(&rnd_mtx);
+ callout_schedule(&rnd_callout, 1);
+ return;
+ }
+ mutex_spin_exit(&rnd_mtx);
}
-void
-rnd_add_data(rndsource_element_t *rs, void *data, u_int32_t len,
- u_int32_t entropy)
+static int
+rnd_hwrng_test(rnd_sample_t *sample)
{
- rndsource_t *rst;
+ krndsource_t *source = sample->source;
+ size_t cmplen;
+ uint8_t *v1, *v2;
+ size_t resid, totest;
- /* Mix in the random data directly into the pool. */
- rndpool_add_data(&rnd_pool, data, len, entropy);
+ KASSERT(source->type = RND_TYPE_RNG);
- if (rs != NULL) {
- rst = &rs->data;
- rst->total += entropy;
-
- if ((rst->flags & RND_FLAG_NO_ESTIMATE) == 0)
- /* Estimate entropy using timing information */
- rnd_add_uint32(rs, *(u_int8_t *)data);
+ /*
+ * Continuous-output test: compare two halves of the
+ * sample buffer to each other. The sample buffer (64 ints,
+ * so either 256 or 512 bytes on any modern machine) should be
+ * much larger than a typical hardware RNG output, so this seems
+ * a reasonable way to do it without retaining extra data.
+ */
+ cmplen = sizeof(sample->values) / 2;
+ v1 = (uint8_t *)sample->values;
+ v2 = (uint8_t *)sample->values + cmplen;
+
+ if (__predict_false(memcmp(v1, v2, cmplen))) {
+ printf("rnd: source \"%s\" failed continuous-output test.",
+ source->name);
+ return 1;
}
- /* Wake up any potential readers since we've just added some data. */
- rnd_wakeup_readers();
+ /*
+ * FIPS 140 statistical RNG test. We must accumulate 20,000 bits.
+ */
+ if (__predict_true(source->test_cnt == -1)) {
+ /* already passed the test */
+ return 0;
+ }
+ resid = FIPS140_RNG_TEST_BYTES - source->test_cnt;
+ totest = MIN(RND_SAMPLE_COUNT * 4, resid);
+ memcpy(source->test->rt_b + source->test_cnt, sample->values, totest);
+ resid -= totest;
+ source->test_cnt += totest;
+ if (resid == 0) {
+ strlcpy(source->test->rt_name, source->name,
+ sizeof(source->test->rt_name));
+ if (rngtest(source->test)) {
+ printf("rnd: source \"%s\" failed statistical test.",
+ source->name);
+ return 1;
+ }
+ source->test_cnt = -1;
+ memset(source->test, 0, sizeof(*source->test));
+ }
+ return 0;
}
/*
- * Timeout, run to process the events in the ring buffer.
+ * Process the events in the ring buffer. Called by rnd_timeout or
+ * by the add routines directly if the callout has never fired (that
+ * is, if we are "cold" -- just booted).
+ *
+ * Call with rnd_mtx held -- WILL RELEASE IT.
*/
static void
-rnd_timeout(void *arg)
+rnd_process_events(void *arg)
{
rnd_sample_t *sample;
- rndsource_t *source;
+ krndsource_t *source, *badsource = NULL;
u_int32_t entropy;
+ SIMPLEQ_HEAD(, _rnd_sample_t) dq_samples =
+ SIMPLEQ_HEAD_INITIALIZER(dq_samples);
+ SIMPLEQ_HEAD(, _rnd_sample_t) df_samples =
+ SIMPLEQ_HEAD_INITIALIZER(df_samples);
+ TAILQ_HEAD(, rndsink) sunk = TAILQ_HEAD_INITIALIZER(sunk);
/*
- * Sample queue is protected by rnd_mtx, take it briefly to dequeue.
+ * Sample queue is protected by rnd_mtx, drain to onstack queue
+ * and drop lock.
*/
- mutex_enter(&rnd_mtx);
- rnd_timeout_pending = 0;
- sample = SIMPLEQ_FIRST(&rnd_samples);
- while (sample != NULL) {
+ while ((sample = SIMPLEQ_FIRST(&rnd_samples))) {
SIMPLEQ_REMOVE_HEAD(&rnd_samples, next);
- mutex_exit(&rnd_mtx);
+ /*
+ * We repeat this check here, since it is possible
+ * the source was disabled before we were called, but
+ * after the entry was queued.
+ */
+ if (__predict_false(sample->source->flags
+ & RND_FLAG_NO_COLLECT)) {
+ SIMPLEQ_INSERT_TAIL(&df_samples, sample, next);
+ } else {
+ SIMPLEQ_INSERT_TAIL(&dq_samples, sample, next);
+ }
+ }
+ mutex_spin_exit(&rnd_mtx);
+ /* Don't thrash the rndpool mtx either. Hold, add all samples. */
+ mutex_spin_enter(&rndpool_mtx);
+ while ((sample = SIMPLEQ_FIRST(&dq_samples))) {
+ SIMPLEQ_REMOVE_HEAD(&dq_samples, next);
source = sample->source;
+ entropy = sample->entropy;
+ if (source->flags & RND_FLAG_NO_ESTIMATE)
+ entropy = 0;
/*
- * We repeat this check here, since it is possible the source
- * was disabled before we were called, but after the entry
- * was queued.
+ * Hardware generators are great but sometimes they
+ * have...hardware issues. Don't use any data from
+ * them unless it passes some tests.
*/
- if ((source->flags & RND_FLAG_NO_COLLECT) == 0) {
- entropy = sample->entropy;
- if (source->flags & RND_FLAG_NO_ESTIMATE)
- entropy = 0;
+ if (source->type == RND_TYPE_RNG) {
+ if (__predict_false(rnd_hwrng_test(sample))) {
+ /*
+ * Detach the bad source. See below.
+ */
+ badsource = source;
+ printf("rnd: detaching source \"%s\".",
+ badsource->name);
+ break;
+ }
+ }
+ rndpool_add_data(&rnd_pool, sample->values,
+ RND_SAMPLE_COUNT * 4, 0);
- mutex_enter(&rndpool_mtx);
- rndpool_add_data(&rnd_pool, sample->values,
- RND_SAMPLE_COUNT * 4, 0);
+ rndpool_add_data(&rnd_pool, sample->ts,
+ RND_SAMPLE_COUNT * 4, entropy);
- rndpool_add_data(&rnd_pool, sample->ts,
- RND_SAMPLE_COUNT * 4,
- entropy);
- mutex_exit(&rndpool_mtx);
+ source->total += sample->entropy;
+ SIMPLEQ_INSERT_TAIL(&df_samples, sample, next);
+ }
+ mutex_spin_exit(&rndpool_mtx);
- source->total += sample->entropy;
+ /* Now we hold no locks: clean up. */
+ if (__predict_false(badsource)) {
+ /*
+ * The detach routine frees any samples we have not
+ * dequeued ourselves. For sanity's sake, we simply
+ * free (without using) all dequeued samples from the
+ * point at which we detected a problem onwards.
+ */
+ rnd_detach_source(badsource);
+ while ((sample = SIMPLEQ_FIRST(&dq_samples))) {
+ SIMPLEQ_REMOVE_HEAD(&dq_samples, next);
+ rnd_sample_free(sample);
}
-
+ }
+ while ((sample = SIMPLEQ_FIRST(&df_samples))) {
+ SIMPLEQ_REMOVE_HEAD(&df_samples, next);
rnd_sample_free(sample);
-
- /* Get mtx back to dequeue the next one.. */
- mutex_enter(&rnd_mtx);
- sample = SIMPLEQ_FIRST(&rnd_samples);
}
- mutex_exit(&rnd_mtx);
/*
* Wake up any potential readers waiting.
@@ -1053,6 +1266,17 @@ rnd_timeout(void *arg)
rnd_wakeup_readers();
}
+/*
+ * Timeout, run to process the events in the ring buffer.
+ */
+static void
+rnd_timeout(void *arg)
+{
+ mutex_spin_enter(&rnd_mtx);
+ rnd_timeout_pending = 0;
+ rnd_process_events(arg);
+}
+
static u_int32_t
rnd_extract_data_locked(void *p, u_int32_t len, u_int32_t flags)
{
@@ -1069,6 +1293,48 @@ rnd_extract_data_locked(void *p, u_int32_t len, u_int32_t flags)
c = rnd_counter();
rndpool_add_data(&rnd_pool, &c, sizeof(u_int32_t), 1);
}
+ if (!rnd_tested) {
+ rngtest_t rt;
+ uint8_t testbits[sizeof(rt.rt_b)];
+ int entropy_count;
+
+ entropy_count = rndpool_get_entropy_count(&rnd_pool);
+#ifdef RND_VERBOSE
+ printf("rnd: starting statistical RNG test, entropy = %d.\n",
+ entropy_count);
+#endif
+ if (rndpool_extract_data(&rnd_pool, rt.rt_b,
+ sizeof(rt.rt_b), RND_EXTRACT_ANY) != sizeof(rt.rt_b)) {
+ panic("rnd: could not get bits for statistical test");
+ }
+ /*
+ * Stash the tested bits so we can put them back in the
+ * pool, restoring the entropy count. DO NOT rely on
+ * rngtest to maintain the bits pristine -- we could end
+ * up adding back non-random data claiming it were pure
+ * entropy.
+ */
+ memcpy(testbits, rt.rt_b, sizeof(rt.rt_b));
+ strlcpy(rt.rt_name, "entropy pool", sizeof(rt.rt_name));
+ if (rngtest(&rt)) {
+ /*
+ * The probabiliity of a Type I error is 3/10000,
+ * but note this can only happen at boot time.
+ * The relevant standard says to reset the module,
+ * so that's what we do.
+ */
+ panic("rnd: entropy pool failed statistical test");
+ }
+ memset(&rt, 0, sizeof(rt));
+ rndpool_add_data(&rnd_pool, testbits, sizeof(testbits),
+ entropy_count);
+ memset(testbits, 0, sizeof(testbits));
+#ifdef RND_VERBOSE
+ printf("rnd: statistical RNG test done, entropy = %d.\n",
+ rndpool_get_entropy_count(&rnd_pool));
+#endif
+ rnd_tested++;
+ }
return rndpool_extract_data(&rnd_pool, p, len, flags);
}
@@ -1077,8 +1343,42 @@ rnd_extract_data(void *p, u_int32_t len, u_int32_t flags)
{
uint32_t retval;
- mutex_enter(&rndpool_mtx);
+ mutex_spin_enter(&rndpool_mtx);
retval = rnd_extract_data_locked(p, len, flags);
- mutex_exit(&rndpool_mtx);
+ mutex_spin_exit(&rndpool_mtx);
return retval;
}
+
+void
+rndsink_attach(rndsink_t *rs)
+{
+#ifdef RND_VERBOSE
+ printf("rnd: entropy sink \"%s\" wants %d bytes of data.\n",
+ rs->name, (int)rs->len);
+#endif
+ mutex_spin_enter(&rndpool_mtx);
+ TAILQ_INSERT_TAIL(&rnd_sinks, rs, tailq);
+ mutex_spin_exit(&rndpool_mtx);
+ mutex_spin_enter(&rnd_mtx);
+ if (rnd_timeout_pending == 0) {
+ rnd_timeout_pending = 1;
+ callout_schedule(&rnd_callout, 1);
+ }
+ mutex_spin_exit(&rnd_mtx);
+}
+
+void
+rndsink_detach(rndsink_t *rs)
+{
+ rndsink_t *sink, *tsink;
+#ifdef RND_VERBOSE
+ printf("rnd: entropy sink \"%s\" no longer wants data.\n", rs->name);
+#endif
+ mutex_spin_enter(&rndpool_mtx);
+ TAILQ_FOREACH_SAFE(sink, &rnd_sinks, tailq, tsink) {
+ if (sink == rs) {
+ TAILQ_REMOVE(&rnd_sinks, rs, tailq);
+ }
+ }
+ mutex_spin_exit(&rndpool_mtx);
+}
diff --git a/sys/dev/scsipi/cdvar.h b/sys/dev/scsipi/cdvar.h
index 5187e018373..5f48abdbe5f 100644
--- a/sys/dev/scsipi/cdvar.h
+++ b/sys/dev/scsipi/cdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cdvar.h,v 1.29 2009/10/19 18:41:16 bouyer Exp $ */
+/* $NetBSD: cdvar.h,v 1.30 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@@ -48,6 +48,6 @@ struct cd_softc {
struct callout sc_callout;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/scsipi/sdvar.h b/sys/dev/scsipi/sdvar.h
index 93f46c28604..11646e20434 100644
--- a/sys/dev/scsipi/sdvar.h
+++ b/sys/dev/scsipi/sdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sdvar.h,v 1.32 2009/04/10 17:36:42 dyoung Exp $ */
+/* $NetBSD: sdvar.h,v 1.33 2011/11/19 22:51:24 tls Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@ struct sd_softc {
char name[16]; /* product name, for default disklabel */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/scsipi/stvar.h b/sys/dev/scsipi/stvar.h
index 88a2cbc1a1f..45e32e29468 100644
--- a/sys/dev/scsipi/stvar.h
+++ b/sys/dev/scsipi/stvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stvar.h,v 1.21 2009/12/06 22:48:17 dyoung Exp $ */
+/* $NetBSD: stvar.h,v 1.22 2011/11/19 22:51:24 tls Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -147,7 +147,7 @@ struct st_softc {
struct io_stats *stats; /* statistics for the drive */
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};
diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h
index 6d1bfb86571..56f9839f8df 100644
--- a/sys/dev/usb/if_auereg.h
+++ b/sys/dev/usb/if_auereg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_auereg.h,v 1.23 2009/09/04 18:10:08 dyoung Exp $ */
+/* $NetBSD: if_auereg.h,v 1.24 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -229,7 +229,7 @@ struct aue_softc {
struct ethercom aue_ec;
struct mii_data aue_mii;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
struct lwp *aue_thread;
int aue_closing;
diff --git a/sys/dev/usb/if_axereg.h b/sys/dev/usb/if_axereg.h
index 6b0ede7a731..cb3d55fd0d4 100644
--- a/sys/dev/usb/if_axereg.h
+++ b/sys/dev/usb/if_axereg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axereg.h,v 1.12 2010/08/14 10:47:57 tsutsui Exp $ */
+/* $NetBSD: if_axereg.h,v 1.13 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -200,7 +200,7 @@ struct axe_softc {
struct ethercom axe_ec;
struct mii_data axe_mii;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
usbd_device_handle axe_udev;
usbd_interface_handle axe_iface;
diff --git a/sys/dev/usb/if_cdcereg.h b/sys/dev/usb/if_cdcereg.h
index 533d9a0022c..90f2da7be4e 100644
--- a/sys/dev/usb/if_cdcereg.h
+++ b/sys/dev/usb/if_cdcereg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cdcereg.h,v 1.5 2009/09/04 18:10:08 dyoung Exp $ */
+/* $NetBSD: if_cdcereg.h,v 1.6 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
@@ -69,7 +69,7 @@ struct cdce_softc {
device_t cdce_dev;
struct ethercom cdce_ec;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
#define GET_IFP(sc) (&(sc)->cdce_ec.ec_if)
usbd_device_handle cdce_udev;
diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h
index d3ffc3e3802..f5d53b894d4 100644
--- a/sys/dev/usb/if_cuereg.h
+++ b/sys/dev/usb/if_cuereg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cuereg.h,v 1.16 2009/09/04 18:10:08 dyoung Exp $ */
+/* $NetBSD: if_cuereg.h,v 1.17 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -169,7 +169,7 @@ struct cue_softc {
struct ethercom cue_ec;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
#define GET_IFP(sc) (&(sc)->cue_ec.ec_if)
diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h
index 4746832e27c..5920c98e4b1 100644
--- a/sys/dev/usb/if_kuereg.h
+++ b/sys/dev/usb/if_kuereg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kuereg.h,v 1.16 2010/11/03 22:30:50 dyoung Exp $ */
+/* $NetBSD: if_kuereg.h,v 1.17 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -163,7 +163,7 @@ struct kue_softc {
struct ethercom kue_ec;
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
#define GET_IFP(sc) (&(sc)->kue_ec.ec_if)
diff --git a/sys/dev/usb/if_udavreg.h b/sys/dev/usb/if_udavreg.h
index 4aea9f9c791..9aa6f1b2513 100644
--- a/sys/dev/usb/if_udavreg.h
+++ b/sys/dev/usb/if_udavreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_udavreg.h,v 1.6 2010/11/03 22:30:50 dyoung Exp $ */
+/* $NetBSD: if_udavreg.h,v 1.7 2011/11/19 22:51:24 tls Exp $ */
/* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */
/*
* Copyright (c) 2003
@@ -190,7 +190,7 @@ struct udav_softc {
int sc_link;
#define sc_media udav_mii.mii_media
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
struct udav_cdata sc_cdata;
diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c
index d263f4e235a..336c8e70bd2 100644
--- a/sys/dev/usb/if_upl.c
+++ b/sys/dev/usb/if_upl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_upl.c,v 1.38 2010/11/03 22:28:31 dyoung Exp $ */
+/* $NetBSD: if_upl.c,v 1.39 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.38 2010/11/03 22:28:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.39 2011/11/19 22:51:24 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -135,7 +135,7 @@ struct upl_softc {
struct ifnet sc_if;
#if NRND > 0
- rndsource_element_t sc_rnd_source;
+ krndsource_t sc_rnd_source;
#endif
struct callout sc_stat_ch;
diff --git a/sys/dev/usb/if_urlreg.h b/sys/dev/usb/if_urlreg.h
index 86a3af5ad80..8a0ed59fb0d 100644
--- a/sys/dev/usb/if_urlreg.h
+++ b/sys/dev/usb/if_urlreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_urlreg.h,v 1.6 2010/11/03 22:30:50 dyoung Exp $ */
+/* $NetBSD: if_urlreg.h,v 1.7 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 2001, 2002
* Shingo WATANABE <nabe@nabechan.org>. All rights reserved.
@@ -176,7 +176,7 @@ struct url_softc {
int sc_link;
#define sc_media url_mii.mii_media
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
struct url_cdata sc_cdata;
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 548e503652f..5dd961925c6 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.87 2011/04/24 16:27:01 rmind Exp $ */
+/* $NetBSD: ucom.c,v 1.88 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.87 2011/04/24 16:27:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.88 2011/11/19 22:51:24 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -147,7 +147,7 @@ struct ucom_softc {
u_char sc_dying; /* disconnecting */
#if defined(__NetBSD__) && NRND > 0
- rndsource_element_t sc_rndsource; /* random source */
+ krndsource_t sc_rndsource; /* random source */
#endif
};
diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h
index b3d44267060..425189f0eec 100644
--- a/sys/dev/usb/uhidev.h
+++ b/sys/dev/usb/uhidev.h
@@ -1,4 +1,4 @@
-/* $NetBSD: uhidev.h,v 1.10 2010/11/03 22:34:24 dyoung Exp $ */
+/* $NetBSD: uhidev.h,v 1.11 2011/11/19 22:51:24 tls Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ struct uhidev {
#define UHIDEV_OPEN 0x01 /* device is open */
void (*sc_intr)(struct uhidev *, void *, u_int);
#if NRND > 0
- rndsource_element_t rnd_source;
+ krndsource_t rnd_source;
#endif
};