Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
76457783
Commit
76457783
authored
Jan 24, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel modules: added an ioctl to read EP registers
parent
61494330
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
nic-core.c
kernel/wr_nic/nic-core.c
+11
-0
wr-nic.h
kernel/wr_nic/wr-nic.h
+4
-3
No files found.
kernel/wr_nic/nic-core.c
View file @
76457783
...
...
@@ -221,6 +221,7 @@ static int wrn_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
int
res
;
u32
reg
;
switch
(
cmd
)
{
case
SIOCSHWTSTAMP
:
...
...
@@ -229,6 +230,16 @@ static int wrn_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return
wrn_calib_ioctl
(
dev
,
rq
,
cmd
);
case
PRIV_IOCGGETPHASE
:
return
wrn_phase_ioctl
(
dev
,
rq
,
cmd
);
case
PRIV_IOCREADREG
:
if
(
get_user
(
reg
,
(
u32
*
)
rq
->
ifr_data
)
<
0
)
return
-
EFAULT
;
if
(
reg
>
sizeof
(
struct
EP_WB
)
||
reg
&
3
)
return
-
EINVAL
;
reg
=
readl
((
void
*
)
ep
->
ep_regs
+
reg
);
if
(
put_user
(
reg
,
(
u32
*
)
rq
->
ifr_data
)
<
0
)
return
-
EFAULT
;
return
0
;
default:
spin_lock_irq
(
&
ep
->
lock
);
res
=
generic_mii_ioctl
(
&
ep
->
mii
,
if_mii
(
rq
),
cmd
,
NULL
);
...
...
kernel/wr_nic/wr-nic.h
View file @
76457783
...
...
@@ -158,9 +158,10 @@ enum wrn_resnames {
#define wrn_ep_read(ep, reg) __raw_readl(&(ep)->ep_regs->reg)
#define wrn_ep_write(ep, reg, val) __raw_writel((val), &(ep)->ep_regs->reg)
/* Private ioctls, like in wr_minic.c */
#define PRIV_IOCGCALIBRATE (SIOCDEVPRIVATE+1)
#define PRIV_IOCGGETPHASE (SIOCDEVPRIVATE+2)
/* Private ioctls, (the first 2 are the same as they were in wr_minic.c */
#define PRIV_IOCGCALIBRATE (SIOCDEVPRIVATE + 1)
#define PRIV_IOCGGETPHASE (SIOCDEVPRIVATE + 2)
#define PRIV_IOCREADREG (SIOCDEVPRIVATE + 3)
/* Structures straight from wr_minic.c -- should user-space include this? */
struct
wrn_calibration_req
{
...
...
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