Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
755c1c1b
Commit
755c1c1b
authored
Apr 30, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: remove useless sysfs attributes
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
475bc35d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
63 deletions
+13
-63
mockturtle-hmq.c
software/kernel/mockturtle-hmq.c
+13
-63
No files found.
software/kernel/mockturtle-hmq.c
View file @
755c1c1b
...
...
@@ -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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment