Commit 3c587519 authored by Federico Vaga's avatar Federico Vaga Committed by Federico Vaga

sysfs: show interleaving status

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 92daf48a
...@@ -859,6 +859,14 @@ static ssize_t zio_show_pref(struct device *dev, ...@@ -859,6 +859,14 @@ static ssize_t zio_show_pref(struct device *dev,
} }
static ssize_t zio_show_inte(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct zio_channel *chan = to_zio_chan(dev);
return sprintf(buf, "%d\n", !!(chan->flags & ZIO_CSET_CHAN_INTERLEAVE));
}
#if ZIO_HAS_BINARY_CONTROL #if ZIO_HAS_BINARY_CONTROL
/* /*
* zobj_read_cur_ctrl * zobj_read_cur_ctrl
...@@ -938,6 +946,7 @@ enum zio_default_attribute_numeration { ...@@ -938,6 +946,7 @@ enum zio_default_attribute_numeration {
ZIO_DAN_ALAR, /* alarms */ ZIO_DAN_ALAR, /* alarms */
ZIO_DAN_DIRE, /* direction */ ZIO_DAN_DIRE, /* direction */
ZIO_DAN_PREF, /* prefer-new */ ZIO_DAN_PREF, /* prefer-new */
ZIO_DAN_INTE, /* interleave */
}; };
/* default zio attributes */ /* default zio attributes */
...@@ -962,6 +971,8 @@ static struct device_attribute zio_default_attributes[] = { ...@@ -962,6 +971,8 @@ static struct device_attribute zio_default_attributes[] = {
zio_show_dire, NULL), zio_show_dire, NULL),
[ZIO_DAN_PREF] = __ATTR(prefer-new, ZIO_RW_PERM, [ZIO_DAN_PREF] = __ATTR(prefer-new, ZIO_RW_PERM,
zio_show_pref, zio_store_pref), zio_show_pref, zio_store_pref),
[ZIO_DAN_INTE] = __ATTR(interleave, ZIO_RW_PERM,
zio_show_inte, NULL),
__ATTR_NULL, __ATTR_NULL,
}; };
/* default attributes for most of the zio objects */ /* default attributes for most of the zio objects */
...@@ -986,6 +997,7 @@ static struct attribute *def_cset_attrs_ptr[] = { ...@@ -986,6 +997,7 @@ static struct attribute *def_cset_attrs_ptr[] = {
/* default attributes for channel */ /* default attributes for channel */
static struct attribute *def_chan_attrs_ptr[] = { static struct attribute *def_chan_attrs_ptr[] = {
&zio_default_attributes[ZIO_DAN_ALAR].attr, &zio_default_attributes[ZIO_DAN_ALAR].attr,
&zio_default_attributes[ZIO_DAN_INTE].attr,
NULL, NULL,
}; };
/* default attributes for buffer instance */ /* default attributes for buffer instance */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment