···1049 return -ENOENT;1050}105100000000000000000010521053/* Parse a chunk of data as a Config ROM */1054···1110 return ret;1111 }11121113- /* Apparently there are many different wrong implementations of the CRC1114- * algorithm. We don't fail, we just warn. */1115- if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) &&1116- (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc))1117- printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n");11181119 cr = CSR1212_MALLOC(sizeof(*cr));1120 if (!cr)···1220 &cache->data[bytes_to_quads(kv->offset - cache->offset)];1221 kvi_len = be16_to_cpu(kvi->length);12221223- /* Apparently there are many different wrong implementations of the CRC1224- * algorithm. We don't fail, we just warn. */1225- if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) &&1226- (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc))1227- printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n");12281229 switch (kv->key.type) {1230 case CSR1212_KV_TYPE_DIRECTORY:
···1049 return -ENOENT;1050}10511052+/*1053+ * Apparently there are many different wrong implementations of the CRC1054+ * algorithm. We don't fail, we just warn... approximately once per GUID.1055+ */1056+static void1057+csr1212_check_crc(const u32 *buffer, size_t length, u16 crc, __be32 *guid)1058+{1059+ static u64 last_bad_eui64;1060+ u64 eui64 = ((u64)be32_to_cpu(guid[0]) << 32) | be32_to_cpu(guid[1]);1061+1062+ if (csr1212_crc16(buffer, length) == crc ||1063+ csr1212_msft_crc16(buffer, length) == crc ||1064+ eui64 == last_bad_eui64)1065+ return;1066+1067+ printk(KERN_DEBUG "ieee1394: config ROM CRC error\n");1068+ last_bad_eui64 = eui64;1069+}10701071/* Parse a chunk of data as a Config ROM */1072···1092 return ret;1093 }10941095+ csr1212_check_crc(bi->data, bi->crc_length, bi->crc,1096+ &csr->bus_info_data[3]);00010971098 cr = CSR1212_MALLOC(sizeof(*cr));1099 if (!cr)···1205 &cache->data[bytes_to_quads(kv->offset - cache->offset)];1206 kvi_len = be16_to_cpu(kvi->length);12071208+ /* GUID is wrong in here in case of extended ROM. We don't care. */1209+ csr1212_check_crc(kvi->data, kvi_len, kvi->crc, &cache->data[3]);00012101211 switch (kv->key.type) {1212 case CSR1212_KV_TYPE_DIRECTORY: