Skip to content

Commit

Permalink
[SCSI] aic7xxx: expose the bus setting to sysfs
Browse files Browse the repository at this point in the history
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 <James.Bottomley@SteelEye.com>
  • Loading branch information
James Bottomley committed Jun 10, 2006
1 parent b9f051e commit b2d8bfe
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 7 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/aic7xxx/aic7xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ typedef enum {
AHC_TARGETMODE = 0x20000, /* Has tested target mode support */
AHC_MULTIROLE = 0x40000, /* Space for two roles at a time */
AHC_REMOVABLE = 0x80000, /* Hot-Swap supported */
AHC_HVD = 0x100000, /* HVD rather than SE */
AHC_AIC7770_FE = AHC_FENONE,
/*
* The real 7850 does not support Ultra modes, but there are
Expand Down
17 changes: 17 additions & 0 deletions drivers/scsi/aic7xxx/aic7xxx_osm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
};


Expand Down
81 changes: 74 additions & 7 deletions drivers/scsi/aic7xxx/aic7xxx_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,22 @@ static ahc_device_setup_t ahc_aic785X_setup;
static ahc_device_setup_t ahc_aic7860_setup;
static ahc_device_setup_t ahc_apa1480_setup;
static ahc_device_setup_t ahc_aic7870_setup;
static ahc_device_setup_t ahc_aic7870h_setup;
static ahc_device_setup_t ahc_aha394X_setup;
static ahc_device_setup_t ahc_aha394Xh_setup;
static ahc_device_setup_t ahc_aha494X_setup;
static ahc_device_setup_t ahc_aha494Xh_setup;
static ahc_device_setup_t ahc_aha398X_setup;
static ahc_device_setup_t ahc_aic7880_setup;
static ahc_device_setup_t ahc_aic7880h_setup;
static ahc_device_setup_t ahc_aha2940Pro_setup;
static ahc_device_setup_t ahc_aha394XU_setup;
static ahc_device_setup_t ahc_aha394XUh_setup;
static ahc_device_setup_t ahc_aha398XU_setup;
static ahc_device_setup_t ahc_aic7890_setup;
static ahc_device_setup_t ahc_aic7892_setup;
static ahc_device_setup_t ahc_aic7895_setup;
static ahc_device_setup_t ahc_aic7895h_setup;
static ahc_device_setup_t ahc_aic7896_setup;
static ahc_device_setup_t ahc_aic7899_setup;
static ahc_device_setup_t ahc_aha29160C_setup;
Expand Down Expand Up @@ -225,19 +231,19 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
ID_AHA_2944,
ID_ALL_MASK,
"Adaptec 2944 SCSI adapter",
ahc_aic7870_setup
ahc_aic7870h_setup
},
{
ID_AHA_3944,
ID_ALL_MASK,
"Adaptec 3944 SCSI adapter",
ahc_aha394X_setup
ahc_aha394Xh_setup
},
{
ID_AHA_4944,
ID_ALL_MASK,
"Adaptec 4944 SCSI adapter",
ahc_aha494X_setup
ahc_aha494Xh_setup
},
/* aic7880 based controllers */
{
Expand All @@ -256,13 +262,13 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
ID_AHA_2944U & ID_DEV_VENDOR_MASK,
ID_DEV_VENDOR_MASK,
"Adaptec 2944 Ultra SCSI adapter",
ahc_aic7880_setup
ahc_aic7880h_setup
},
{
ID_AHA_3944U & ID_DEV_VENDOR_MASK,
ID_DEV_VENDOR_MASK,
"Adaptec 3944 Ultra SCSI adapter",
ahc_aha394XU_setup
ahc_aha394XUh_setup
},
{
ID_AHA_398XU & ID_DEV_VENDOR_MASK,
Expand All @@ -278,7 +284,7 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
ID_AHA_4944U & ID_DEV_VENDOR_MASK,
ID_DEV_VENDOR_MASK,
"Adaptec 4944 Ultra SCSI adapter",
ahc_aic7880_setup
ahc_aic7880h_setup
},
{
ID_AHA_2930U & ID_DEV_VENDOR_MASK,
Expand Down Expand Up @@ -414,7 +420,7 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
ID_AHA_3944AU,
ID_ALL_MASK,
"Adaptec 3944A Ultra SCSI adapter",
ahc_aic7895_setup
ahc_aic7895h_setup
},
{
ID_AIC7895_ARO,
Expand Down Expand Up @@ -2120,6 +2126,16 @@ ahc_aic7870_setup(struct ahc_softc *ahc)
return (0);
}

static int
ahc_aic7870h_setup(struct ahc_softc *ahc)
{
int error = ahc_aic7870_setup(ahc);

ahc->features |= AHC_HVD;

return error;
}

static int
ahc_aha394X_setup(struct ahc_softc *ahc)
{
Expand All @@ -2131,6 +2147,16 @@ ahc_aha394X_setup(struct ahc_softc *ahc)
return (error);
}

static int
ahc_aha394Xh_setup(struct ahc_softc *ahc)
{
int error = ahc_aha394X_setup(ahc);

ahc->features |= AHC_HVD;

return error;
}

static int
ahc_aha398X_setup(struct ahc_softc *ahc)
{
Expand All @@ -2153,6 +2179,16 @@ ahc_aha494X_setup(struct ahc_softc *ahc)
return (error);
}

static int
ahc_aha494Xh_setup(struct ahc_softc *ahc)
{
int error = ahc_aha494X_setup(ahc);

ahc->features |= AHC_HVD;

return error;
}

static int
ahc_aic7880_setup(struct ahc_softc *ahc)
{
Expand All @@ -2174,6 +2210,17 @@ ahc_aic7880_setup(struct ahc_softc *ahc)
return (0);
}

static int
ahc_aic7880h_setup(struct ahc_softc *ahc)
{
int error = ahc_aic7880_setup(ahc);

ahc->features |= AHC_HVD;

return error;
}


static int
ahc_aha2940Pro_setup(struct ahc_softc *ahc)
{
Expand All @@ -2193,6 +2240,16 @@ ahc_aha394XU_setup(struct ahc_softc *ahc)
return (error);
}

static int
ahc_aha394XUh_setup(struct ahc_softc *ahc)
{
int error = ahc_aha394XU_setup(ahc);

ahc->features |= AHC_HVD;

return error;
}

static int
ahc_aha398XU_setup(struct ahc_softc *ahc)
{
Expand Down Expand Up @@ -2291,6 +2348,16 @@ ahc_aic7895_setup(struct ahc_softc *ahc)
return (0);
}

static int
ahc_aic7895h_setup(struct ahc_softc *ahc)
{
int error = ahc_aic7895_setup(ahc);

ahc->features |= AHC_HVD;

return error;
}

static int
ahc_aic7896_setup(struct ahc_softc *ahc)
{
Expand Down

0 comments on commit b2d8bfe

Please sign in to comment.