ieee1394: sbp2: don't assume zero model_id or firmware_revision if there is none

This makes sbp2 behave more like firewire-sbp2 which reports 0xff000000
as immediate value if there are no unit directory entries for model_id
or firmware_revision.

It does not reduce matches with the currently existing quirks table; the
only zero entry there is for a device which actually does have a zero
model_id. It only changes how model_id and firmware_revision are logged
if they are missing.

Other functionally unrelated changes: The model_id member of quirks
list entries is renamed to model; the value (but not the effect) of
SBP2_ROM_VALUE_WILDCARD is changed. Now this part of the source is
identical with firewire-sbp2 for easier maintenance.

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

+20 -18
+20 -18
drivers/ieee1394/sbp2.c
··· 347 347 .sdev_attrs = sbp2_sysfs_sdev_attrs, 348 348 }; 349 349 350 - /* for match-all entries in sbp2_workarounds_table */ 351 - #define SBP2_ROM_VALUE_WILDCARD 0x1000000 350 + #define SBP2_ROM_VALUE_WILDCARD ~0 /* match all */ 351 + #define SBP2_ROM_VALUE_MISSING 0xff000000 /* not present in the unit dir. */ 352 352 353 353 /* 354 354 * List of devices with known bugs. ··· 359 359 */ 360 360 static const struct { 361 361 u32 firmware_revision; 362 - u32 model_id; 362 + u32 model; 363 363 unsigned workarounds; 364 364 } sbp2_workarounds_table[] = { 365 365 /* DViCO Momobay CX-1 with TSB42AA9 bridge */ { 366 366 .firmware_revision = 0x002800, 367 - .model_id = 0x001010, 367 + .model = 0x001010, 368 368 .workarounds = SBP2_WORKAROUND_INQUIRY_36 | 369 369 SBP2_WORKAROUND_MODE_SENSE_8 | 370 370 SBP2_WORKAROUND_POWER_CONDITION, 371 371 }, 372 372 /* DViCO Momobay FX-3A with TSB42AA9A bridge */ { 373 373 .firmware_revision = 0x002800, 374 - .model_id = 0x000000, 374 + .model = 0x000000, 375 375 .workarounds = SBP2_WORKAROUND_DELAY_INQUIRY | 376 376 SBP2_WORKAROUND_POWER_CONDITION, 377 377 }, 378 378 /* Initio bridges, actually only needed for some older ones */ { 379 379 .firmware_revision = 0x000200, 380 - .model_id = SBP2_ROM_VALUE_WILDCARD, 380 + .model = SBP2_ROM_VALUE_WILDCARD, 381 381 .workarounds = SBP2_WORKAROUND_INQUIRY_36, 382 382 }, 383 383 /* PL-3507 bridge with Prolific firmware */ { 384 384 .firmware_revision = 0x012800, 385 - .model_id = SBP2_ROM_VALUE_WILDCARD, 385 + .model = SBP2_ROM_VALUE_WILDCARD, 386 386 .workarounds = SBP2_WORKAROUND_POWER_CONDITION, 387 387 }, 388 388 /* Symbios bridge */ { 389 389 .firmware_revision = 0xa0b800, 390 - .model_id = SBP2_ROM_VALUE_WILDCARD, 390 + .model = SBP2_ROM_VALUE_WILDCARD, 391 391 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 392 392 }, 393 393 /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ { 394 394 .firmware_revision = 0x002600, 395 - .model_id = SBP2_ROM_VALUE_WILDCARD, 395 + .model = SBP2_ROM_VALUE_WILDCARD, 396 396 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 397 397 }, 398 398 /* iPod 4th generation */ { 399 399 .firmware_revision = 0x0a2700, 400 - .model_id = 0x000021, 400 + .model = 0x000021, 401 401 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, 402 402 }, 403 403 /* iPod mini */ { 404 404 .firmware_revision = 0x0a2700, 405 - .model_id = 0x000022, 405 + .model = 0x000022, 406 406 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, 407 407 }, 408 408 /* iPod mini */ { 409 409 .firmware_revision = 0x0a2700, 410 - .model_id = 0x000023, 410 + .model = 0x000023, 411 411 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, 412 412 }, 413 413 /* iPod Photo */ { 414 414 .firmware_revision = 0x0a2700, 415 - .model_id = 0x00007e, 415 + .model = 0x00007e, 416 416 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, 417 417 } 418 418 }; ··· 1341 1341 struct csr1212_keyval *kv; 1342 1342 struct csr1212_dentry *dentry; 1343 1343 u64 management_agent_addr; 1344 - u32 unit_characteristics, firmware_revision; 1344 + u32 unit_characteristics, firmware_revision, model; 1345 1345 unsigned workarounds; 1346 1346 int i; 1347 1347 1348 1348 management_agent_addr = 0; 1349 1349 unit_characteristics = 0; 1350 - firmware_revision = 0; 1350 + firmware_revision = SBP2_ROM_VALUE_MISSING; 1351 + model = ud->flags & UNIT_DIRECTORY_MODEL_ID ? 1352 + ud->model_id : SBP2_ROM_VALUE_MISSING; 1351 1353 1352 1354 csr1212_for_each_dir_entry(ud->ne->csr, kv, ud->ud_kv, dentry) { 1353 1355 switch (kv->key.id) { ··· 1390 1388 sbp2_workarounds_table[i].firmware_revision != 1391 1389 (firmware_revision & 0xffff00)) 1392 1390 continue; 1393 - if (sbp2_workarounds_table[i].model_id != 1391 + if (sbp2_workarounds_table[i].model != 1394 1392 SBP2_ROM_VALUE_WILDCARD && 1395 - sbp2_workarounds_table[i].model_id != ud->model_id) 1393 + sbp2_workarounds_table[i].model != model) 1396 1394 continue; 1397 1395 workarounds |= sbp2_workarounds_table[i].workarounds; 1398 1396 break; ··· 1405 1403 NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid), 1406 1404 workarounds, firmware_revision, 1407 1405 ud->vendor_id ? ud->vendor_id : ud->ne->vendor_id, 1408 - ud->model_id); 1406 + model); 1409 1407 1410 1408 /* We would need one SCSI host template for each target to adjust 1411 1409 * max_sectors on the fly, therefore warn only. */