Date: Sat Dec 30 15:37:09 CET 2006 From: Stefan Richter Subject: ieee1394: sbp2: use a better wildcard for blacklist 0x000000 could be a valid value to match against, but anything bigger than 0xffffff cannot. Signed-off-by: Stefan Richter --- Idea stolen from Kristian Høgsbergs fw-sbp2. drivers/ieee1394/sbp2.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) Index: linux/drivers/ieee1394/sbp2.c =================================================================== --- linux.orig/drivers/ieee1394/sbp2.c +++ linux/drivers/ieee1394/sbp2.c @@ -308,6 +308,8 @@ static struct scsi_host_template sbp2_sh .sdev_attrs = sbp2_sysfs_sdev_attrs, }; +/* for match-all entries in sbp2_workarounds_table */ +#define SBP2_ROM_VALUE_WILDCARD 0x1000000 /* * List of devices with known bugs. @@ -329,22 +331,14 @@ static const struct { }, /* Initio bridges, actually only needed for some older ones */ { .firmware_revision = 0x000200, + .model_id = SBP2_ROM_VALUE_WILDCARD, .workarounds = SBP2_WORKAROUND_INQUIRY_36, }, /* Symbios bridge */ { .firmware_revision = 0xa0b800, + .model_id = SBP2_ROM_VALUE_WILDCARD, .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, }, - /* - * Note about the following Apple iPod blacklist entries: - * - * There are iPods (2nd gen, 3rd gen) with model_id==0. Since our - * matching logic treats 0 as a wildcard, we cannot match this ID - * without rewriting the matching routine. Fortunately these iPods - * do not feature the read_capacity bug according to one report. - * Read_capacity behaviour as well as model_id could change due to - * Apple-supplied firmware updates though. - */ /* iPod 4th generation */ { .firmware_revision = 0x0a2700, .model_id = 0x000021, @@ -1303,11 +1297,13 @@ static void sbp2_parse_unit_directory(st if (!(workarounds & SBP2_WORKAROUND_OVERRIDE)) for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) { - if (sbp2_workarounds_table[i].firmware_revision && + if (sbp2_workarounds_table[i].firmware_revision != + SBP2_ROM_VALUE_WILDCARD && sbp2_workarounds_table[i].firmware_revision != (firmware_revision & 0xffff00)) continue; - if (sbp2_workarounds_table[i].model_id && + if (sbp2_workarounds_table[i].model_id != + SBP2_ROM_VALUE_WILDCARD && sbp2_workarounds_table[i].model_id != ud->model_id) continue; workarounds |= sbp2_workarounds_table[i].workarounds;