From: Brandon Philips <bphilips@suse.de>
Subject: [PATCH] bnx2: entropy source
Patch-mainline: never
References: FATE#307517

Current disk-less systems have no entropy source whatsoever. Therefore, the
network drivers tg3, bnx2, e1000, e1000e, igb and ixgbe should be enabled to
feed entropy to the kernel via the IRQF_SAMPLE_RANDOM flag when loaded. This
option shall not be enabled by default but implemented via a module option to
be activated by the administrator.

Signed-off-by: Brandon Philips <bphilips@suse.de>

---
 drivers/net/bnx2.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -84,6 +84,10 @@ MODULE_FIRMWARE(FW_MIPS_FILE_09);
 MODULE_FIRMWARE(FW_RV2P_FILE_09);
 MODULE_FIRMWARE(FW_RV2P_FILE_09_Ax);
 
+static int entropy = 0;
+module_param(entropy, int, 0);
+MODULE_PARM_DESC(entropy, "Allow bnx2 to populate the /dev/random entropy pool");
+
 static int disable_msi = 0;
 
 module_param(disable_msi, int, 0);
@@ -6081,6 +6085,9 @@ bnx2_request_irq(struct bnx2 *bp)
 	else
 		flags = IRQF_SHARED;
 
+	if (entropy)
+		flags |= IRQF_SAMPLE_RANDOM;
+
 	for (i = 0; i < bp->irq_nvecs; i++) {
 		irq = &bp->irq_tbl[i];
 		rc = request_irq(irq->vector, irq->handler, flags, irq->name,
