Skip to content

Commit

Permalink
bnx2x: declare MODULE_FIRMWARE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Nov 11, 2009
1 parent e8c0ae2 commit 45229b4
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <linux/prefetch.h>
#include <linux/zlib.h>
#include <linux/io.h>
#include <linux/stringify.h>


#include "bnx2x.h"
Expand All @@ -63,8 +64,13 @@
#include <linux/firmware.h>
#include "bnx2x_fw_file_hdr.h"
/* FW files */
#define FW_FILE_PREFIX_E1 "bnx2x-e1-"
#define FW_FILE_PREFIX_E1H "bnx2x-e1h-"
#define FW_FILE_VERSION \
__stringify(BCM_5710_FW_MAJOR_VERSION) "." \
__stringify(BCM_5710_FW_MINOR_VERSION) "." \
__stringify(BCM_5710_FW_REVISION_VERSION) "." \
__stringify(BCM_5710_FW_ENGINEERING_VERSION)
#define FW_FILE_NAME_E1 "bnx2x-e1-" FW_FILE_VERSION ".fw"
#define FW_FILE_NAME_E1H "bnx2x-e1h-" FW_FILE_VERSION ".fw"

/* Time in jiffies before concluding the transmitter is hung */
#define TX_TIMEOUT (5*HZ)
Expand All @@ -77,6 +83,8 @@ MODULE_AUTHOR("Eliezer Tamir");
MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_MODULE_VERSION);
MODULE_FIRMWARE(FW_FILE_NAME_E1);
MODULE_FIRMWARE(FW_FILE_NAME_E1H);

static int multi_mode = 1;
module_param(multi_mode, int, 0);
Expand Down Expand Up @@ -12111,21 +12119,14 @@ static inline void be16_to_cpu_n(const u8 *_source, u8 *_target, u32 n)

static int __devinit bnx2x_init_firmware(struct bnx2x *bp, struct device *dev)
{
char fw_file_name[40] = {0};
const char *fw_file_name;
struct bnx2x_fw_file_hdr *fw_hdr;
int rc, offset;
int rc;

/* Create a FW file name */
if (CHIP_IS_E1(bp))
offset = sprintf(fw_file_name, FW_FILE_PREFIX_E1);
fw_file_name = FW_FILE_NAME_E1;
else
offset = sprintf(fw_file_name, FW_FILE_PREFIX_E1H);

sprintf(fw_file_name + offset, "%d.%d.%d.%d.fw",
BCM_5710_FW_MAJOR_VERSION,
BCM_5710_FW_MINOR_VERSION,
BCM_5710_FW_REVISION_VERSION,
BCM_5710_FW_ENGINEERING_VERSION);
fw_file_name = FW_FILE_NAME_E1H;

printk(KERN_INFO PFX "Loading %s\n", fw_file_name);

Expand Down

0 comments on commit 45229b4

Please sign in to comment.