#include "h/ksynch.h"
#include "h/sunddi.h"
#endif
+#include <hcrypto/rand.h>
+
+/* No hckernel-specific header for this prototype. */
+#ifndef UKERNEL
+extern void init_hckernel_mutex(void);
+#endif
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV)
#define AFS_MINBUFFERS 100
if (afs_InitSetup_done)
return EAGAIN;
+ /* Initialize a lock for the kernel hcrypto bits. */
+#ifndef UKERNEL
+ init_hckernel_mutex();
+#endif
+
#ifdef AFS_SUN510_ENV
/* Initialize a RW lock for the ifinfo global array */
rw_init(&afsifinfo_lock, NULL, RW_DRIVER, NULL);
} else if (parm == AFSOP_SET_RMTSYS_FLAG) {
afs_rmtsys_enable = parm2;
code = 0;
+#ifndef UKERNEL
+ } else if (parm == AFSOP_SEED_ENTROPY) {
+ unsigned char *seedbuf;
+
+ if (parm3 > 4096) {
+ code = EFAULT;
+ } else {
+ seedbuf = afs_osi_Alloc(parm3);
+ AFS_COPYIN(AFSKPTR(parm2), seedbuf, parm3, code);
+ RAND_seed(seedbuf, parm3);
+ memset(seedbuf, 0, parm3);
+ afs_osi_Free(seedbuf, parm3);
+ }
+#endif
} else {
code = EINVAL;
}