From: Michal Schmidt <mschmidt@redhat.com> Date: Fri, 3 Sep 2010 16:44:02 -0400 Subject: [net] bnx2x: move global variable load_count to bnx2x.h Message-id: <20100903164402.25415.55159.stgit@brian.englab.brq.redhat.com> Patchwork-id: 28108 O-Subject: [RHEL5.6 BZ572012 PATCH 34/46] bnx2x: move global variable load_count to bnx2x.h Bugzilla: 572012 RH-Acked-by: David S. Miller <davem@redhat.com> RH-Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> From: Dmitry Kravkov <dmitry@broadcom.com> This will allow access to this global variable (used in no-mcp mode) from different object 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 b0efbb996e8554ed8fe59e3f79e0bc83218083ab) diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index ec57891..59d2236 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -1383,6 +1383,14 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, #define BNX2X_VPD_LEN 128 #define VENDOR_ID_LEN 4 +#ifdef BNX2X_MAIN +#define BNX2X_EXTERN +#else +#define BNX2X_EXTERN extern +#endif + +BNX2X_EXTERN int load_count[3]; /* 0-common, 1-port0, 2-port1 */ + /* MISC_REG_RESET_REG - this is here for the hsi to work don't touch */ #endif /* bnx2x.h */ diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index a1c627d..dce7f3a 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c @@ -50,7 +50,7 @@ #include <linux/zlib.h> #include <linux/io.h> - +#define BNX2X_MAIN #include "bnx2x.h" #include "bnx2x_init.h" #include "bnx2x_init_ops.h" @@ -114,8 +114,6 @@ static int debug; module_param(debug, int, 0); MODULE_PARM_DESC(debug, " Default debug msglevel"); -static int load_count[3]; /* 0-common, 1-port0, 2-port1 */ - static struct workqueue_struct *bnx2x_wq; enum bnx2x_board_type {