Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2448

kernel-2.6.18-238.el5.src.rpm

From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 3 Sep 2010 16:43:57 -0400
Subject: [net] bnx2x: store module parameters in main structure
Message-id: <20100903164357.25415.40586.stgit@brian.englab.brq.redhat.com>
Patchwork-id: 28107
O-Subject: [RHEL5.6 BZ572012 PATCH 33/46] bnx2x: store module parameters in
	driver main structure
Bugzilla: 572012
RH-Acked-by: David S. Miller <davem@redhat.com>
RH-Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>

Store module parameters during initialization of main driver
structure. This will allow access to the parameters from different
files.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5d7cd49622af9396643f8d2c5ed17039d89fef14)

Conflicts:

	drivers/net/bnx2x/bnx2x_main.c

diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 5e36c51..ec57891 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1009,6 +1009,8 @@ struct bnx2x {
 
 	int			multi_mode;
 	int			num_queues;
+	int			disable_tpa;
+	int			int_mode;
 
 	u32			rx_mode;
 #define BNX2X_RX_MODE_NONE		0
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 26f643f..a1c627d 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -7897,7 +7897,7 @@ static int bnx2x_set_num_queues(struct bnx2x *bp)
 {
 	int rc = 0;
 
-	switch (int_mode) {
+	switch (bp->int_mode) {
 	case INT_MODE_INTx:
 	case INT_MODE_MSI:
 		bp->num_queues = 1;
@@ -9973,6 +9973,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
 		multi_mode = ETH_RSS_MODE_DISABLED;
 	}
 	bp->multi_mode = multi_mode;
+	bp->int_mode = int_mode;
 
 	bp->dev->features |= NETIF_F_GRO;
 
@@ -9988,6 +9989,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
 		bp->dev->features |= NETIF_F_LRO;
 #endif
 	}
+	bp->disable_tpa = disable_tpa;
 
 	if (CHIP_IS_E1(bp))
 		bp->dropless_fc = 0;
@@ -11036,7 +11038,7 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
 
 	/* TPA requires Rx CSUM offloading */
 	if ((data & ETH_FLAG_LRO) && bp->rx_csum) {
-		if (!disable_tpa) {
+		if (!bp->disable_tpa) {
 			if (!(dev->features & NETIF_F_LRO)) {
 				dev->features |= NETIF_F_LRO;
 				bp->flags |= TPA_ENABLE_FLAG;