From b2d8bfe18578c4e50e8ba52011c9b260a1b51dac Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sat, 10 Jun 2006 10:49:07 -0500 Subject: [SCSI] aic7xxx: expose the bus setting to sysfs Read the transciever register and display in the host transport properties. I'm still not entirely sure what this does for multiple transciever adapters (like some 160 ones) however, I suspect it displays the transciever state of the switchable bus segment. Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c') diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index eadfefdd8d7..debf3e2a079 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -2537,6 +2537,22 @@ static void ahc_linux_set_iu(struct scsi_target *starget, int iu) } #endif +static void ahc_linux_get_signalling(struct Scsi_Host *shost) +{ + struct ahc_softc *ahc = *(struct ahc_softc **)shost->hostdata; + u8 mode = ahc_inb(ahc, SBLKCTL); + + if (mode & ENAB40) + spi_signalling(shost) = SPI_SIGNAL_LVD; + else if (mode & ENAB20) + spi_signalling(shost) = + ahc->features & AHC_HVD ? + SPI_SIGNAL_HVD : + SPI_SIGNAL_SE; + else + spi_signalling(shost) = SPI_SIGNAL_UNKNOWN; +} + static struct spi_function_template ahc_linux_transport_functions = { .set_offset = ahc_linux_set_offset, .show_offset = 1, @@ -2552,6 +2568,7 @@ static struct spi_function_template ahc_linux_transport_functions = { .set_qas = ahc_linux_set_qas, .show_qas = 1, #endif + .get_signalling = ahc_linux_get_signalling, }; -- cgit v1.2.3