diff options
Diffstat (limited to 'drivers/s390/cio/chp.c')
-rw-r--r-- | drivers/s390/cio/chp.c | 36 |
1 files changed, 36 insertions, 0 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 = { |