diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ieee1394/csr1212.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 43f5b7f814ae..d08166bda1c5 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c | |||
@@ -34,6 +34,7 @@ | |||
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
37 | #include <linux/kernel.h> | ||
37 | #include <linux/string.h> | 38 | #include <linux/string.h> |
38 | #include <asm/bug.h> | 39 | #include <asm/bug.h> |
39 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |
@@ -113,10 +114,7 @@ static u16 csr1212_crc16(const u32 *buffer, size_t length) | |||
113 | return cpu_to_be16(crc); | 114 | return cpu_to_be16(crc); |
114 | } | 115 | } |
115 | 116 | ||
116 | #if 0 | 117 | /* Microsoft computes the CRC with the bytes in reverse order. */ |
117 | /* Microsoft computes the CRC with the bytes in reverse order. Therefore we | ||
118 | * have a special version of the CRC algorithm to account for their buggy | ||
119 | * software. */ | ||
120 | static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) | 118 | static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) |
121 | { | 119 | { |
122 | int shift; | 120 | int shift; |
@@ -135,7 +133,6 @@ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) | |||
135 | 133 | ||
136 | return cpu_to_be16(crc); | 134 | return cpu_to_be16(crc); |
137 | } | 135 | } |
138 | #endif | ||
139 | 136 | ||
140 | static struct csr1212_dentry * | 137 | static struct csr1212_dentry * |
141 | csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) | 138 | csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) |
@@ -1096,13 +1093,11 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr) | |||
1096 | return ret; | 1093 | return ret; |
1097 | } | 1094 | } |
1098 | 1095 | ||
1099 | #if 0 | 1096 | /* Apparently there are many different wrong implementations of the CRC |
1100 | /* Apparently there are too many differnt wrong implementations of the | 1097 | * algorithm. We don't fail, we just warn. */ |
1101 | * CRC algorithm that verifying them is moot. */ | ||
1102 | if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && | 1098 | if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && |
1103 | (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) | 1099 | (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) |
1104 | return -EINVAL; | 1100 | printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); |
1105 | #endif | ||
1106 | 1101 | ||
1107 | cr = CSR1212_MALLOC(sizeof(*cr)); | 1102 | cr = CSR1212_MALLOC(sizeof(*cr)); |
1108 | if (!cr) | 1103 | if (!cr) |
@@ -1207,15 +1202,11 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, | |||
1207 | &cache->data[bytes_to_quads(kv->offset - cache->offset)]; | 1202 | &cache->data[bytes_to_quads(kv->offset - cache->offset)]; |
1208 | kvi_len = be16_to_cpu(kvi->length); | 1203 | kvi_len = be16_to_cpu(kvi->length); |
1209 | 1204 | ||
1210 | #if 0 | 1205 | /* Apparently there are many different wrong implementations of the CRC |
1211 | /* Apparently there are too many differnt wrong implementations of the | 1206 | * algorithm. We don't fail, we just warn. */ |
1212 | * CRC algorithm that verifying them is moot. */ | ||
1213 | if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && | 1207 | if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && |
1214 | (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) { | 1208 | (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) |
1215 | ret = -EINVAL; | 1209 | printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); |
1216 | goto out; | ||
1217 | } | ||
1218 | #endif | ||
1219 | 1210 | ||
1220 | switch (kv->key.type) { | 1211 | switch (kv->key.type) { |
1221 | case CSR1212_KV_TYPE_DIRECTORY: | 1212 | case CSR1212_KV_TYPE_DIRECTORY: |