diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2013-05-15 07:43:29 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-05-15 10:47:39 -0400 |
commit | ba54229db65b161d46df449638a1a386444681b0 (patch) | |
tree | e9bce225c9a990b0cf514680ddbaa3f1b3c318c7 | |
parent | aca91209775514b5a335e7ef11f1d636618590c7 (diff) |
s390/cio: add channel ID sysfs attribute
Add new attributes "chid" and "chid_external" to the channel-path
sysfs directory. These attributes contain information related to
the channel-ID of the channel-path.
Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/cio/chp.c | 36 | ||||
-rw-r--r-- | drivers/s390/cio/chsc.h | 4 |
2 files changed, 39 insertions, 1 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c index 21fabc6d5a9c..6c440d4349d4 100644 --- a/drivers/s390/cio/chp.c +++ b/drivers/s390/cio/chp.c | |||
@@ -352,12 +352,48 @@ static ssize_t chp_shared_show(struct device *dev, | |||
352 | 352 | ||
353 | static DEVICE_ATTR(shared, 0444, chp_shared_show, NULL); | 353 | static DEVICE_ATTR(shared, 0444, chp_shared_show, NULL); |
354 | 354 | ||
355 | static ssize_t chp_chid_show(struct device *dev, struct device_attribute *attr, | ||
356 | char *buf) | ||
357 | { | ||
358 | struct channel_path *chp = to_channelpath(dev); | ||
359 | ssize_t rc; | ||
360 | |||
361 | mutex_lock(&chp->lock); | ||
362 | if (chp->desc_fmt1.flags & 0x10) | ||
363 | rc = sprintf(buf, "%04x\n", chp->desc_fmt1.chid); | ||
364 | else | ||
365 | rc = 0; | ||
366 | mutex_unlock(&chp->lock); | ||
367 | |||
368 | return rc; | ||
369 | } | ||
370 | static DEVICE_ATTR(chid, 0444, chp_chid_show, NULL); | ||
371 | |||
372 | static ssize_t chp_chid_external_show(struct device *dev, | ||
373 | struct device_attribute *attr, char *buf) | ||
374 | { | ||
375 | struct channel_path *chp = to_channelpath(dev); | ||
376 | ssize_t rc; | ||
377 | |||
378 | mutex_lock(&chp->lock); | ||
379 | if (chp->desc_fmt1.flags & 0x10) | ||
380 | rc = sprintf(buf, "%x\n", chp->desc_fmt1.flags & 0x8 ? 1 : 0); | ||
381 | else | ||
382 | rc = 0; | ||
383 | mutex_unlock(&chp->lock); | ||
384 | |||
385 | return rc; | ||
386 | } | ||
387 | static DEVICE_ATTR(chid_external, 0444, chp_chid_external_show, NULL); | ||
388 | |||
355 | static struct attribute *chp_attrs[] = { | 389 | static struct attribute *chp_attrs[] = { |
356 | &dev_attr_status.attr, | 390 | &dev_attr_status.attr, |
357 | &dev_attr_configure.attr, | 391 | &dev_attr_configure.attr, |
358 | &dev_attr_type.attr, | 392 | &dev_attr_type.attr, |
359 | &dev_attr_cmg.attr, | 393 | &dev_attr_cmg.attr, |
360 | &dev_attr_shared.attr, | 394 | &dev_attr_shared.attr, |
395 | &dev_attr_chid.attr, | ||
396 | &dev_attr_chid_external.attr, | ||
361 | NULL, | 397 | NULL, |
362 | }; | 398 | }; |
363 | static struct attribute_group chp_attr_group = { | 399 | static struct attribute_group chp_attr_group = { |
diff --git a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h index 349d5fc47196..e7ef2a683b8f 100644 --- a/drivers/s390/cio/chsc.h +++ b/drivers/s390/cio/chsc.h | |||
@@ -43,7 +43,9 @@ struct channel_path_desc_fmt1 { | |||
43 | u8 chpid; | 43 | u8 chpid; |
44 | u32:24; | 44 | u32:24; |
45 | u8 chpp; | 45 | u8 chpp; |
46 | u32 unused[3]; | 46 | u32 unused[2]; |
47 | u16 chid; | ||
48 | u32:16; | ||
47 | u16 mdc; | 49 | u16 mdc; |
48 | u16:13; | 50 | u16:13; |
49 | u8 r:1; | 51 | u8 r:1; |