firewire: sbp2: define some magic numbers as macros

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+12 -11
+12 -11
drivers/firewire/fw-sbp2.c
··· 311 dma_addr_t page_table_bus; 312 }; 313 314 /* 315 * List of devices with known bugs. 316 * 317 * The firmware_revision field, masked with 0xffff00, is the best 318 * indicator for the type of bridge chip of a device. It yields a few 319 * false positives but this did not break correctly behaving devices 320 - * so far. We use ~0 as a wildcard, since the 24 bit values we get 321 - * from the config rom can never match that. 322 */ 323 static const struct { 324 u32 firmware_revision; ··· 342 }, 343 /* Initio bridges, actually only needed for some older ones */ { 344 .firmware_revision = 0x000200, 345 - .model = ~0, 346 .workarounds = SBP2_WORKAROUND_INQUIRY_36, 347 }, 348 /* PL-3507 bridge with Prolific firmware */ { 349 .firmware_revision = 0x012800, 350 - .model = ~0, 351 .workarounds = SBP2_WORKAROUND_POWER_CONDITION, 352 }, 353 /* Symbios bridge */ { 354 .firmware_revision = 0xa0b800, 355 - .model = ~0, 356 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 357 }, 358 /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ { 359 .firmware_revision = 0x002600, 360 - .model = ~0, 361 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 362 }, 363 ··· 1095 continue; 1096 1097 if (sbp2_workarounds_table[i].model != model && 1098 - sbp2_workarounds_table[i].model != ~0) 1099 continue; 1100 1101 w |= sbp2_workarounds_table[i].workarounds; ··· 1145 fw_device_get(device); 1146 fw_unit_get(unit); 1147 1148 - /* Initialize to values that won't match anything in our table. */ 1149 - firmware_revision = 0xff000000; 1150 - model = 0xff000000; 1151 - 1152 /* implicit directory ID */ 1153 tgt->directory_id = ((unit->directory - device->config_rom) * 4 1154 + CSR_CONFIG_ROM) & 0xffffff; 1155 1156 if (sbp2_scan_unit_dir(tgt, unit->directory, &model, 1157 &firmware_revision) < 0)
··· 311 dma_addr_t page_table_bus; 312 }; 313 314 + #define SBP2_ROM_VALUE_WILDCARD ~0 /* match all */ 315 + #define SBP2_ROM_VALUE_MISSING 0xff000000 /* not present in the unit dir. */ 316 + 317 /* 318 * List of devices with known bugs. 319 * 320 * The firmware_revision field, masked with 0xffff00, is the best 321 * indicator for the type of bridge chip of a device. It yields a few 322 * false positives but this did not break correctly behaving devices 323 + * so far. 324 */ 325 static const struct { 326 u32 firmware_revision; ··· 340 }, 341 /* Initio bridges, actually only needed for some older ones */ { 342 .firmware_revision = 0x000200, 343 + .model = SBP2_ROM_VALUE_WILDCARD, 344 .workarounds = SBP2_WORKAROUND_INQUIRY_36, 345 }, 346 /* PL-3507 bridge with Prolific firmware */ { 347 .firmware_revision = 0x012800, 348 + .model = SBP2_ROM_VALUE_WILDCARD, 349 .workarounds = SBP2_WORKAROUND_POWER_CONDITION, 350 }, 351 /* Symbios bridge */ { 352 .firmware_revision = 0xa0b800, 353 + .model = SBP2_ROM_VALUE_WILDCARD, 354 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 355 }, 356 /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ { 357 .firmware_revision = 0x002600, 358 + .model = SBP2_ROM_VALUE_WILDCARD, 359 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 360 }, 361 ··· 1093 continue; 1094 1095 if (sbp2_workarounds_table[i].model != model && 1096 + sbp2_workarounds_table[i].model != SBP2_ROM_VALUE_WILDCARD) 1097 continue; 1098 1099 w |= sbp2_workarounds_table[i].workarounds; ··· 1143 fw_device_get(device); 1144 fw_unit_get(unit); 1145 1146 /* implicit directory ID */ 1147 tgt->directory_id = ((unit->directory - device->config_rom) * 4 1148 + CSR_CONFIG_ROM) & 0xffffff; 1149 + 1150 + firmware_revision = SBP2_ROM_VALUE_MISSING; 1151 + model = SBP2_ROM_VALUE_MISSING; 1152 1153 if (sbp2_scan_unit_dir(tgt, unit->directory, &model, 1154 &firmware_revision) < 0)