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
8cb52b56
Commit
8cb52b56
authored
Oct 20, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: export new sysfs HMQ attributes
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
47ac8375
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
wrnc-hmq.c
kernel/wrnc-hmq.c
+29
-0
No files found.
kernel/wrnc-hmq.c
View file @
8cb52b56
...
...
@@ -211,6 +211,31 @@ static ssize_t wrnc_show_count(struct device *dev,
}
/**
* It returns the maximum number of messages in the WRNC queue
*/
static
ssize_t
wrnc_show_count_max
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
wrnc_hmq
*
hmq
=
to_wrnc_hmq
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
hmq
->
max_depth
);
}
/**
* It returns the maximum number bytes per message
*/
static
ssize_t
wrnc_show_width_max
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
wrnc_hmq
*
hmq
=
to_wrnc_hmq
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
hmq
->
max_width
*
4
);
}
/**
* Show the current share status of the HMQ slot
*/
...
...
@@ -262,6 +287,8 @@ static ssize_t wrnc_store_share(struct device *dev,
DEVICE_ATTR
(
full
,
S_IRUGO
,
wrnc_show_full
,
NULL
);
DEVICE_ATTR
(
empty
,
S_IRUGO
,
wrnc_show_empty
,
NULL
);
DEVICE_ATTR
(
count
,
S_IRUGO
,
wrnc_show_count
,
NULL
);
DEVICE_ATTR
(
count_max
,
S_IRUGO
,
wrnc_show_count_max
,
NULL
);
DEVICE_ATTR
(
width_max
,
S_IRUGO
,
wrnc_show_width_max
,
NULL
);
DEVICE_ATTR
(
shared_by_users
,
(
S_IRUGO
|
S_IWUSR
|
S_IWGRP
|
S_IWOTH
),
wrnc_show_share
,
wrnc_store_share
);
...
...
@@ -269,6 +296,8 @@ static struct attribute *wrnc_hmq_attr[] = {
&
dev_attr_full
.
attr
,
&
dev_attr_empty
.
attr
,
&
dev_attr_count
.
attr
,
&
dev_attr_count_max
.
attr
,
&
dev_attr_width_max
.
attr
,
&
dev_attr_shared_by_users
.
attr
,
NULL
,
};
...
...
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