aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-card.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r--drivers/firewire/core-card.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index f58130789990..7083bcc1b9c7 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -38,7 +38,7 @@
38 38
39#include "core.h" 39#include "core.h"
40 40
41static int __compute_block_crc(__be32 *block) 41int fw_compute_block_crc(__be32 *block)
42{ 42{
43 int length; 43 int length;
44 u16 crc; 44 u16 crc;
@@ -50,19 +50,6 @@ static int __compute_block_crc(__be32 *block)
50 return length; 50 return length;
51} 51}
52 52
53int fw_compute_block_crc(u32 *block)
54{
55 __be32 be32_block[256];
56 int i, length;
57
58 length = (*block >> 16) & 0xff;
59 for (i = 0; i < length; i++)
60 be32_block[i] = cpu_to_be32(block[i + 1]);
61 *block |= crc_itu_t(0, (u8 *) be32_block, length * 4);
62
63 return length;
64}
65
66static DEFINE_MUTEX(card_mutex); 53static DEFINE_MUTEX(card_mutex);
67static LIST_HEAD(card_list); 54static LIST_HEAD(card_list);
68 55
@@ -141,7 +128,7 @@ static size_t generate_config_rom(struct fw_card *card, __be32 *config_rom)
141 * the bus info block, which is always the case for this 128 * the bus info block, which is always the case for this
142 * implementation. */ 129 * implementation. */
143 for (i = 0; i < j; i += length + 1) 130 for (i = 0; i < j; i += length + 1)
144 length = __compute_block_crc(config_rom + i); 131 length = fw_compute_block_crc(config_rom + i);
145 132
146 return j; 133 return j;
147} 134}