bnx2: Add SA_SAMPLE_RANDOM flag to bnx2 as a module option

This patch allows for the bnx2 to add to the /dev/random entropy pool
via a module parameter, entropy.

0 - default for EL5 - do not populate the entropy pool
1 - optional  - Uses SA_SAMPLE_RANDOM flag on request_irq calls to populate
                the /dev/random pool

Signed-off-by: John Sobecki <john.sobecki@oracle.com>

--- linux-2.6.18.x86_64/drivers/net/bnx2.c.orig	2007-08-20 22:26:54.000000000 -0700
+++ linux-2.6.18.x86_64/drivers/net/bnx2.c	2007-08-20 23:13:58.000000000 -0700
@@ -54,7 +54,7 @@
 
 #define DRV_MODULE_NAME		"bnx2"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"1.5.11"
+#define DRV_MODULE_VERSION	"1.5.11ora"
 #define DRV_MODULE_RELDATE	"June 4, 2007"
 
 #define RUN_AT(x) (jiffies + (x))
@@ -75,6 +75,11 @@
 module_param(disable_msi, int, 0);
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
+static int entropy = 0;
+
+module_param(entropy, int, 0);
+MODULE_PARM_DESC(entropy, "Allow bnx2 to populate the /dev/random entropy pool");
+
 typedef enum {
 	BCM5706 = 0,
 	NC370T,
@@ -4668,16 +4673,30 @@
 	struct net_device *dev = bp->dev;
 	int rc = 0;
 
-	if (bp->flags & USING_MSI_FLAG) {
+	if (entropy) {
+	   if (bp->flags & USING_MSI_FLAG) {
+
+		if (bp->flags & ONE_SHOT_MSI_FLAG)
+			rc = request_irq(bp->pdev->irq, bnx2_msi_1shot, SA_SAMPLE_RANDOM, dev->name, dev);
+		else
+			rc = request_irq(bp->pdev->irq, bnx2_msi, SA_SAMPLE_RANDOM, dev->name, dev);
+
+	   } else
+		rc = request_irq(bp->pdev->irq, bnx2_interrupt,
+				 IRQF_SHARED|SA_SAMPLE_RANDOM, dev->name, dev);
+	} 
+	else {
+	   if (bp->flags & USING_MSI_FLAG) {
 
 		if (bp->flags & ONE_SHOT_MSI_FLAG)
 			rc = request_irq(bp->pdev->irq, bnx2_msi_1shot, 0, dev->name, dev);
 		else
 			rc = request_irq(bp->pdev->irq, bnx2_msi, 0, dev->name, dev);
 
-	} else
+	   } else
 		rc = request_irq(bp->pdev->irq, bnx2_interrupt,
 				 IRQF_SHARED, dev->name, dev);
+	}
 	return rc;
 }
 
