Licensing Information
Open Source Used In Cisco Nexus 9000 Series 7.0(3)I5(1)
3243
/*
* run the random data through SHA to make it look more random
*/
n = sizeof(sha_digest); /* process digest bytes at a time */
rc = 0;
for (i = 0; i < maxwords; i += n / sizeof(*buf)) {
if ((maxwords - i) * sizeof(*buf) < n)
n = (maxwords - i) * sizeof(*buf);
sha_done = 0;
status = ixCryptoAccPkeHashPerform(IX_CRYPTO_ACC_AUTH_SHA1,
(UINT8 *) &buf[i], n, ixp_hash_cb, sha_digest);
if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
dprintk("ixCryptoAccPkeHashPerform failed %d\n", status);
return -EIO;
}
while (!sha_done)
schedule();
if (sha_done < 0) {
dprintk("ixCryptoAccPkeHashPerform failed CB %d\n", -sha_done);
return 0;
}
memcpy(&buf[i], sha_digest, n);
rc += n / sizeof(*buf);;
}
return rc;
}
#endif /* CONFIG_OCF_RANDOMHARVEST */
#endif /* __ixp46X */
/*
* our driver startup and shutdown routines
*/
static int
ixp_init(void)
{
dprintk("%s(%p)\n", __FUNCTION__, ixp_init);
if (ixp_init_crypto && ixCryptoAccInit() != IX_CRYPTO_ACC_STATUS_SUCCESS)
printk("ixCryptoAccInit failed, assuming already initialised!\n");
qcache = kmem_cache_create("ixp4xx_q", sizeof(struct ixp_q), 0,










