aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2007-04-27 10:01:35 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-04-27 10:01:40 -0400
commit7ad6a24970325294a22a08446d473384c15b928e (patch)
treec8f1e25035b207e2a45a29138309acaee20d6cb6 /drivers/s390/cio/device.c
parent83b3370c79b91b9be3f6540c3c914e689134b45f (diff)
[S390] cio: fix subchannel channel-path data usage
Ensure that channel-path related subchannel data is only retrieved and used when it is valid and that it is updated when it may have changed. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 34e7d77b997d..7bb44e73ea9d 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -216,12 +216,18 @@ static ssize_t
216chpids_show (struct device * dev, struct device_attribute *attr, char * buf) 216chpids_show (struct device * dev, struct device_attribute *attr, char * buf)
217{ 217{
218 struct subchannel *sch = to_subchannel(dev); 218 struct subchannel *sch = to_subchannel(dev);
219 struct ssd_info *ssd = &sch->ssd_info; 219 struct chsc_ssd_info *ssd = &sch->ssd_info;
220 ssize_t ret = 0; 220 ssize_t ret = 0;
221 int chp; 221 int chp;
222 int mask;
222 223
223 for (chp = 0; chp < 8; chp++) 224 for (chp = 0; chp < 8; chp++) {
224 ret += sprintf (buf+ret, "%02x ", ssd->chpid[chp]); 225 mask = 0x80 >> chp;
226 if (ssd->path_mask & mask)
227 ret += sprintf(buf + ret, "%02x ", ssd->chpid[chp].id);
228 else
229 ret += sprintf(buf + ret, "00 ");
230 }
225 ret += sprintf (buf+ret, "\n"); 231 ret += sprintf (buf+ret, "\n");
226 return min((ssize_t)PAGE_SIZE, ret); 232 return min((ssize_t)PAGE_SIZE, ret);
227} 233}