Commit 755c1c1b authored by Federico Vaga's avatar Federico Vaga

sw:drv: remove useless sysfs attributes

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 475bc35d
......@@ -378,6 +378,8 @@ static ssize_t trtl_show_full(struct device *dev,
return sprintf(buf, "%d\n", !!(status & 0x1));
}
DEVICE_ATTR(full, S_IRUGO, trtl_show_full, NULL);
/**
* It return 1 if the message quque slot is empty
......@@ -394,50 +396,19 @@ static ssize_t trtl_show_empty(struct device *dev,
return sprintf(buf, "%d\n", !!(status & 0x2));
}
DEVICE_ATTR(empty, S_IRUGO, trtl_show_empty, NULL);
static struct attribute *trtl_hmq_attr[] = {
&dev_attr_flush.attr,
&dev_attr_full.attr,
&dev_attr_empty.attr,
NULL,
};
/**
* It returns the number of messages in the TRTL queue
*/
static ssize_t trtl_show_count(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct trtl_hmq *hmq = to_trtl_hmq(dev);
struct trtl_dev *trtl = to_trtl_dev(dev->parent);
uint32_t status;
status = trtl_ioread(trtl, hmq->base_in + TRTL_MQ_SLOT_STATUS);
return sprintf(buf, "%d\n", ((status >> 2) & 0xFF));
}
/**
* It returns the maximum number of messages in the TRTL queue
*/
static ssize_t trtl_show_count_max_hw(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct trtl_hmq *hmq = to_trtl_hmq(dev);
return sprintf(buf, "%d\n", hmq->max_depth);
}
/**
* It returns the maximum number bytes per message
*/
static ssize_t trtl_show_width_max(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct trtl_hmq *hmq = to_trtl_hmq(dev);
static const struct attribute_group trtl_hmq_group = {
.attrs = trtl_hmq_attr,
};
return sprintf(buf, "%d\n", hmq->max_width * 4);
}
static ssize_t trtl_message_sent(struct device *dev,
struct device_attribute *attr,
......@@ -459,27 +430,6 @@ static ssize_t trtl_message_received(struct device *dev,
}
DEVICE_ATTR(message_received, S_IRUGO, trtl_message_received, NULL);
DEVICE_ATTR(full, S_IRUGO, trtl_show_full, NULL);
DEVICE_ATTR(empty, S_IRUGO, trtl_show_empty, NULL);
DEVICE_ATTR(count_hw, S_IRUGO, trtl_show_count, NULL);
DEVICE_ATTR(count_max_hw, S_IRUGO, trtl_show_count_max_hw, NULL);
DEVICE_ATTR(width_max, S_IRUGO, trtl_show_width_max, NULL);
static struct attribute *trtl_hmq_attr[] = {
&dev_attr_flush.attr,
&dev_attr_full.attr,
&dev_attr_empty.attr,
&dev_attr_count_hw.attr,
&dev_attr_count_max_hw.attr,
&dev_attr_width_max.attr,
NULL,
};
static const struct attribute_group trtl_hmq_group = {
.attrs = trtl_hmq_attr,
};
static struct attribute *trtl_hmq_attr_stat[] = {
&dev_attr_message_received.attr,
&dev_attr_message_sent.attr,
......@@ -491,6 +441,7 @@ static const struct attribute_group trtl_hmq_group_stat = {
.attrs = trtl_hmq_attr_stat,
};
static const struct attribute_group *trtl_hmq_groups[] = {
&trtl_hmq_group,
&trtl_hmq_group_stat,
......@@ -498,7 +449,6 @@ static const struct attribute_group *trtl_hmq_groups[] = {
};
/**
* It simply opens a HMQ device
*/
......
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