aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_transport_spi.c20
-rw-r--r--include/scsi/scsi_transport_spi.h5
2 files changed, 20 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 7670919a087a..e7b9570c818b 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -35,7 +35,7 @@
35 35
36#define SPI_PRINTK(x, l, f, a...) dev_printk(l, &(x)->dev, f , ##a) 36#define SPI_PRINTK(x, l, f, a...) dev_printk(l, &(x)->dev, f , ##a)
37 37
38#define SPI_NUM_ATTRS 13 /* increase this if you add attributes */ 38#define SPI_NUM_ATTRS 14 /* increase this if you add attributes */
39#define SPI_OTHER_ATTRS 1 /* Increase this if you add "always 39#define SPI_OTHER_ATTRS 1 /* Increase this if you add "always
40 * on" attributes */ 40 * on" attributes */
41#define SPI_HOST_ATTRS 1 41#define SPI_HOST_ATTRS 1
@@ -231,6 +231,7 @@ static int spi_setup_transport_attrs(struct device *dev)
231 spi_rd_strm(starget) = 0; 231 spi_rd_strm(starget) = 0;
232 spi_rti(starget) = 0; 232 spi_rti(starget) = 0;
233 spi_pcomp_en(starget) = 0; 233 spi_pcomp_en(starget) = 0;
234 spi_hold_mcs(starget) = 0;
234 spi_dv_pending(starget) = 0; 235 spi_dv_pending(starget) = 0;
235 spi_initial_dv(starget) = 0; 236 spi_initial_dv(starget) = 0;
236 init_MUTEX(&spi_dv_sem(starget)); 237 init_MUTEX(&spi_dv_sem(starget));
@@ -347,6 +348,7 @@ spi_transport_rd_attr(wr_flow, "%d\n");
347spi_transport_rd_attr(rd_strm, "%d\n"); 348spi_transport_rd_attr(rd_strm, "%d\n");
348spi_transport_rd_attr(rti, "%d\n"); 349spi_transport_rd_attr(rti, "%d\n");
349spi_transport_rd_attr(pcomp_en, "%d\n"); 350spi_transport_rd_attr(pcomp_en, "%d\n");
351spi_transport_rd_attr(hold_mcs, "%d\n");
350 352
351/* we only care about the first child device so we return 1 */ 353/* we only care about the first child device so we return 1 */
352static int child_iter(struct device *dev, void *data) 354static int child_iter(struct device *dev, void *data)
@@ -1028,10 +1030,17 @@ void spi_display_xfer_agreement(struct scsi_target *starget)
1028 sprint_frac(tmp, picosec, 1000); 1030 sprint_frac(tmp, picosec, 1000);
1029 1031
1030 dev_info(&starget->dev, 1032 dev_info(&starget->dev,
1031 "%s %sSCSI %d.%d MB/s %s%s%s (%s ns, offset %d)\n", 1033 "%s %sSCSI %d.%d MB/s %s%s%s%s%s%s%s%s (%s ns, offset %d)\n",
1032 scsi, tp->width ? "WIDE " : "", kb100/10, kb100 % 10, 1034 scsi, tp->width ? "WIDE " : "", kb100/10, kb100 % 10,
1033 tp->dt ? "DT" : "ST", tp->iu ? " IU" : "", 1035 tp->dt ? "DT" : "ST",
1034 tp->qas ? " QAS" : "", tmp, tp->offset); 1036 tp->iu ? " IU" : "",
1037 tp->qas ? " QAS" : "",
1038 tp->rd_strm ? " RDSTRM" : "",
1039 tp->rti ? " RTI" : "",
1040 tp->wr_flow ? " WRFLOW" : "",
1041 tp->pcomp_en ? " PCOMP" : "",
1042 tp->hold_mcs ? " HMCS" : "",
1043 tmp, tp->offset);
1035 } else { 1044 } else {
1036 dev_info(&starget->dev, "%sasynchronous.\n", 1045 dev_info(&starget->dev, "%sasynchronous.\n",
1037 tp->width ? "wide " : ""); 1046 tp->width ? "wide " : "");
@@ -1154,6 +1163,7 @@ spi_attach_transport(struct spi_function_template *ft)
1154 SETUP_ATTRIBUTE(rd_strm); 1163 SETUP_ATTRIBUTE(rd_strm);
1155 SETUP_ATTRIBUTE(rti); 1164 SETUP_ATTRIBUTE(rti);
1156 SETUP_ATTRIBUTE(pcomp_en); 1165 SETUP_ATTRIBUTE(pcomp_en);
1166 SETUP_ATTRIBUTE(hold_mcs);
1157 1167
1158 /* if you add an attribute but forget to increase SPI_NUM_ATTRS 1168 /* if you add an attribute but forget to increase SPI_NUM_ATTRS
1159 * this bug will trigger */ 1169 * this bug will trigger */
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index a30d6cd4c0e8..d8ef86006e02 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -39,6 +39,7 @@ struct spi_transport_attrs {
39 unsigned int rd_strm:1; /* Read streaming enabled */ 39 unsigned int rd_strm:1; /* Read streaming enabled */
40 unsigned int rti:1; /* Retain Training Information */ 40 unsigned int rti:1; /* Retain Training Information */
41 unsigned int pcomp_en:1;/* Precompensation enabled */ 41 unsigned int pcomp_en:1;/* Precompensation enabled */
42 unsigned int hold_mcs:1;/* Hold Margin Control Settings */
42 unsigned int initial_dv:1; /* DV done to this target yet */ 43 unsigned int initial_dv:1; /* DV done to this target yet */
43 unsigned long flags; /* flags field for drivers to use */ 44 unsigned long flags; /* flags field for drivers to use */
44 /* Device Properties fields */ 45 /* Device Properties fields */
@@ -78,6 +79,7 @@ struct spi_host_attrs {
78#define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm) 79#define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm)
79#define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti) 80#define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti)
80#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en) 81#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en)
82#define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs)
81#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv) 83#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv)
82 84
83#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync) 85#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync)
@@ -114,6 +116,8 @@ struct spi_function_template {
114 void (*set_rti)(struct scsi_target *, int); 116 void (*set_rti)(struct scsi_target *, int);
115 void (*get_pcomp_en)(struct scsi_target *); 117 void (*get_pcomp_en)(struct scsi_target *);
116 void (*set_pcomp_en)(struct scsi_target *, int); 118 void (*set_pcomp_en)(struct scsi_target *, int);
119 void (*get_hold_mcs)(struct scsi_target *);
120 void (*set_hold_mcs)(struct scsi_target *, int);
117 void (*get_signalling)(struct Scsi_Host *); 121 void (*get_signalling)(struct Scsi_Host *);
118 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type); 122 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type);
119 /* The driver sets these to tell the transport class it 123 /* The driver sets these to tell the transport class it
@@ -130,6 +134,7 @@ struct spi_function_template {
130 unsigned long show_rd_strm:1; 134 unsigned long show_rd_strm:1;
131 unsigned long show_rti:1; 135 unsigned long show_rti:1;
132 unsigned long show_pcomp_en:1; 136 unsigned long show_pcomp_en:1;
137 unsigned long show_hold_mcs:1;
133}; 138};
134 139
135struct scsi_transport_template *spi_attach_transport(struct spi_function_template *); 140struct scsi_transport_template *spi_attach_transport(struct spi_function_template *);