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