From b70c9ac750a12959ca64a0435b475c5f6f51b455 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Wed, 8 Mar 2006 12:59:35 +0100 Subject: [PATCH] --- yaml --- r: 22595 b: refs/heads/master c: 986a25f96accc8272059ae8b3eb63055f58cadb0 h: refs/heads/master i: 22593: 8aaaf5edf567848655cdc7e587e4a03ba42010a5 22591: 84e09fe2473fb85a3f8ff7d592a1244d8f60fdbd v: v3 --- [refs] | 2 +- trunk/drivers/scsi/aic7xxx/aic79xx_osm.c | 35 +++++++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4c9d7c9b0e49..e41bc4833bd5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9e691dfba56f7d7a38b09edc5252264bc1bab659 +refs/heads/master: 986a25f96accc8272059ae8b3eb63055f58cadb0 diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c index 00d48a0fb7e1..0fbd1ec58340 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -481,6 +481,7 @@ ahd_linux_target_alloc(struct scsi_target *starget) { struct ahd_softc *ahd = *((struct ahd_softc **)dev_to_shost(&starget->dev)->hostdata); + struct seeprom_config *sc = ahd->seep_config; unsigned long flags; struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); struct ahd_linux_target *targ = scsi_transport_target_data(starget); @@ -496,18 +497,38 @@ ahd_linux_target_alloc(struct scsi_target *starget) *ahd_targp = starget; memset(targ, 0, sizeof(*targ)); + if (sc) { + int flags = sc->device_flags[starget->id]; + + tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id, + starget->id, &tstate); + + if ((flags & CFPACKETIZED) == 0) { + /* Do not negotiate packetized transfers */ + spi_rd_strm(starget) = 0; + spi_pcomp_en(starget) = 0; + spi_rti(starget) = 0; + spi_wr_flow(starget) = 0; + spi_hold_mcs(starget) = 0; + } else { + if ((ahd->features & AHD_RTI) == 0) + spi_rti(starget) = 0; + } + + if ((flags & CFQAS) == 0) + spi_qas(starget) = 0; + + /* Transinfo values have been set to BIOS settings */ + spi_max_width(starget) = (flags & CFWIDEB) ? 1 : 0; + spi_min_period(starget) = tinfo->user.period; + spi_max_offset(starget) = tinfo->user.offset; + } + tinfo = ahd_fetch_transinfo(ahd, channel, ahd->our_id, starget->id, &tstate); ahd_compile_devinfo(&devinfo, ahd->our_id, starget->id, CAM_LUN_WILDCARD, channel, ROLE_INITIATOR); - spi_min_period(starget) = AHD_SYNCRATE_MAX; /* We can do U320 */ - if ((ahd->bugs & AHD_PACED_NEGTABLE_BUG) != 0) - spi_max_offset(starget) = MAX_OFFSET_PACED_BUG; - else - spi_max_offset(starget) = MAX_OFFSET_PACED; - spi_max_width(starget) = ahd->features & AHD_WIDE; - ahd_set_syncrate(ahd, &devinfo, 0, 0, 0, AHD_TRANS_GOAL, /*paused*/FALSE); ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,