aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2009-11-07 06:53:39 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-10 23:28:49 -0500
commit45229b420f90bb6736dfeb7e491eb46cb02a3e9c (patch)
treeb4597b71e0769406a88f8516762d20e97e18e5c4 /drivers/net/bnx2x_main.c
parente8c0ae2c04372248f2f6940a5984f5748aae9664 (diff)
bnx2x: declare MODULE_FIRMWARE
Replace run-time string formatting with preprocessor string manipulation. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 61974b74909a..5b6c68abccd9 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -49,6 +49,7 @@
49#include <linux/prefetch.h> 49#include <linux/prefetch.h>
50#include <linux/zlib.h> 50#include <linux/zlib.h>
51#include <linux/io.h> 51#include <linux/io.h>
52#include <linux/stringify.h>
52 53
53 54
54#include "bnx2x.h" 55#include "bnx2x.h"
@@ -63,8 +64,13 @@
63#include <linux/firmware.h> 64#include <linux/firmware.h>
64#include "bnx2x_fw_file_hdr.h" 65#include "bnx2x_fw_file_hdr.h"
65/* FW files */ 66/* FW files */
66#define FW_FILE_PREFIX_E1 "bnx2x-e1-" 67#define FW_FILE_VERSION \
67#define FW_FILE_PREFIX_E1H "bnx2x-e1h-" 68 __stringify(BCM_5710_FW_MAJOR_VERSION) "." \
69 __stringify(BCM_5710_FW_MINOR_VERSION) "." \
70 __stringify(BCM_5710_FW_REVISION_VERSION) "." \
71 __stringify(BCM_5710_FW_ENGINEERING_VERSION)
72#define FW_FILE_NAME_E1 "bnx2x-e1-" FW_FILE_VERSION ".fw"
73#define FW_FILE_NAME_E1H "bnx2x-e1h-" FW_FILE_VERSION ".fw"
68 74
69/* Time in jiffies before concluding the transmitter is hung */ 75/* Time in jiffies before concluding the transmitter is hung */
70#define TX_TIMEOUT (5*HZ) 76#define TX_TIMEOUT (5*HZ)
@@ -77,6 +83,8 @@ MODULE_AUTHOR("Eliezer Tamir");
77MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver"); 83MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver");
78MODULE_LICENSE("GPL"); 84MODULE_LICENSE("GPL");
79MODULE_VERSION(DRV_MODULE_VERSION); 85MODULE_VERSION(DRV_MODULE_VERSION);
86MODULE_FIRMWARE(FW_FILE_NAME_E1);
87MODULE_FIRMWARE(FW_FILE_NAME_E1H);
80 88
81static int multi_mode = 1; 89static int multi_mode = 1;
82module_param(multi_mode, int, 0); 90module_param(multi_mode, int, 0);
@@ -12111,21 +12119,14 @@ static inline void be16_to_cpu_n(const u8 *_source, u8 *_target, u32 n)
12111 12119
12112static int __devinit bnx2x_init_firmware(struct bnx2x *bp, struct device *dev) 12120static int __devinit bnx2x_init_firmware(struct bnx2x *bp, struct device *dev)
12113{ 12121{
12114 char fw_file_name[40] = {0}; 12122 const char *fw_file_name;
12115 struct bnx2x_fw_file_hdr *fw_hdr; 12123 struct bnx2x_fw_file_hdr *fw_hdr;
12116 int rc, offset; 12124 int rc;
12117 12125
12118 /* Create a FW file name */
12119 if (CHIP_IS_E1(bp)) 12126 if (CHIP_IS_E1(bp))
12120 offset = sprintf(fw_file_name, FW_FILE_PREFIX_E1); 12127 fw_file_name = FW_FILE_NAME_E1;
12121 else 12128 else
12122 offset = sprintf(fw_file_name, FW_FILE_PREFIX_E1H); 12129 fw_file_name = FW_FILE_NAME_E1H;
12123
12124 sprintf(fw_file_name + offset, "%d.%d.%d.%d.fw",
12125 BCM_5710_FW_MAJOR_VERSION,
12126 BCM_5710_FW_MINOR_VERSION,
12127 BCM_5710_FW_REVISION_VERSION,
12128 BCM_5710_FW_ENGINEERING_VERSION);
12129 12130
12130 printk(KERN_INFO PFX "Loading %s\n", fw_file_name); 12131 printk(KERN_INFO PFX "Loading %s\n", fw_file_name);
12131 12132