~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/features/all/module-firmware/0005-bnx2x-declare-MODULE_FIRMWARE.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Ben Hutchings <ben@decadent.org.uk>
2
 
Date: Sat, 7 Nov 2009 11:53:39 +0000
3
 
Subject: [PATCH 05/24] bnx2x: declare MODULE_FIRMWARE
4
 
 
5
 
commit 45229b420f90bb6736dfeb7e491eb46cb02a3e9c upstream.
6
 
 
7
 
Replace run-time string formatting with preprocessor string
8
 
manipulation.
9
 
 
10
 
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
11
 
Acked-by: Eilon Greenstein <eilong@broadcom.com>
12
 
Signed-off-by: David S. Miller <davem@davemloft.net>
13
 
---
14
 
 drivers/net/bnx2x_main.c |   27 ++++++++++++++-------------
15
 
 1 files changed, 14 insertions(+), 13 deletions(-)
16
 
 
17
 
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
18
 
index 61974b7..5b6c68a 100644
19
 
--- a/drivers/net/bnx2x_main.c
20
 
+++ b/drivers/net/bnx2x_main.c
21
 
@@ -49,6 +49,7 @@
22
 
 #include <linux/prefetch.h>
23
 
 #include <linux/zlib.h>
24
 
 #include <linux/io.h>
25
 
+#include <linux/stringify.h>
26
 
 
27
 
 
28
 
 #include "bnx2x.h"
29
 
@@ -63,8 +64,13 @@
30
 
 #include <linux/firmware.h>
31
 
 #include "bnx2x_fw_file_hdr.h"
32
 
 /* FW files */
33
 
-#define FW_FILE_PREFIX_E1      "bnx2x-e1-"
34
 
-#define FW_FILE_PREFIX_E1H     "bnx2x-e1h-"
35
 
+#define FW_FILE_VERSION                                        \
36
 
+       __stringify(BCM_5710_FW_MAJOR_VERSION) "."      \
37
 
+       __stringify(BCM_5710_FW_MINOR_VERSION) "."      \
38
 
+       __stringify(BCM_5710_FW_REVISION_VERSION) "."   \
39
 
+       __stringify(BCM_5710_FW_ENGINEERING_VERSION)
40
 
+#define FW_FILE_NAME_E1                "bnx2x-e1-" FW_FILE_VERSION ".fw"
41
 
+#define FW_FILE_NAME_E1H       "bnx2x-e1h-" FW_FILE_VERSION ".fw"
42
 
 
43
 
 /* Time in jiffies before concluding the transmitter is hung */
44
 
 #define TX_TIMEOUT             (5*HZ)
45
 
@@ -77,6 +83,8 @@ MODULE_AUTHOR("Eliezer Tamir");
46
 
 MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver");
47
 
 MODULE_LICENSE("GPL");
48
 
 MODULE_VERSION(DRV_MODULE_VERSION);
49
 
+MODULE_FIRMWARE(FW_FILE_NAME_E1);
50
 
+MODULE_FIRMWARE(FW_FILE_NAME_E1H);
51
 
 
52
 
 static int multi_mode = 1;
53
 
 module_param(multi_mode, int, 0);
54
 
@@ -12111,21 +12119,14 @@ static inline void be16_to_cpu_n(const u8 *_source, u8 *_target, u32 n)
55
 
 
56
 
 static int __devinit bnx2x_init_firmware(struct bnx2x *bp, struct device *dev)
57
 
 {
58
 
-       char fw_file_name[40] = {0};
59
 
+       const char *fw_file_name;
60
 
        struct bnx2x_fw_file_hdr *fw_hdr;
61
 
-       int rc, offset;
62
 
+       int rc;
63
 
 
64
 
-       /* Create a FW file name */
65
 
        if (CHIP_IS_E1(bp))
66
 
-               offset = sprintf(fw_file_name, FW_FILE_PREFIX_E1);
67
 
+               fw_file_name = FW_FILE_NAME_E1;
68
 
        else
69
 
-               offset = sprintf(fw_file_name, FW_FILE_PREFIX_E1H);
70
 
-
71
 
-       sprintf(fw_file_name + offset, "%d.%d.%d.%d.fw",
72
 
-               BCM_5710_FW_MAJOR_VERSION,
73
 
-               BCM_5710_FW_MINOR_VERSION,
74
 
-               BCM_5710_FW_REVISION_VERSION,
75
 
-               BCM_5710_FW_ENGINEERING_VERSION);
76
 
+               fw_file_name = FW_FILE_NAME_E1H;
77
 
 
78
 
        printk(KERN_INFO PFX "Loading %s\n", fw_file_name);
79
 
 
80
 
1.6.5.3
81