Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
433dc9b3
Commit
433dc9b3
authored
Nov 14, 2013
by
Ben Hutchings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sfc: Implement the SIOCGHWTSTAMP ioctl
Signed-off-by:
Ben Hutchings
<
bhutchings@solarflare.com
>
parent
fd468c74
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/efx.c
+3
-1
drivers/net/ethernet/sfc/nic.h
drivers/net/ethernet/sfc/nic.h
+2
-1
drivers/net/ethernet/sfc/ptp.c
drivers/net/ethernet/sfc/ptp.c
+10
-1
No files found.
drivers/net/ethernet/sfc/efx.c
View file @
433dc9b3
...
...
@@ -1857,7 +1857,9 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
struct
mii_ioctl_data
*
data
=
if_mii
(
ifr
);
if
(
cmd
==
SIOCSHWTSTAMP
)
return
efx_ptp_ioctl
(
efx
,
ifr
,
cmd
);
return
efx_ptp_set_ts_config
(
efx
,
ifr
);
if
(
cmd
==
SIOCGHWTSTAMP
)
return
efx_ptp_get_ts_config
(
efx
,
ifr
);
/* Convert phy_id from older PRTAD/DEVAD format */
if
((
cmd
==
SIOCGMIIREG
||
cmd
==
SIOCSMIIREG
)
&&
...
...
drivers/net/ethernet/sfc/nic.h
View file @
433dc9b3
...
...
@@ -555,7 +555,8 @@ int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf,
struct
ethtool_ts_info
;
void
efx_ptp_probe
(
struct
efx_nic
*
efx
);
int
efx_ptp_ioctl
(
struct
efx_nic
*
efx
,
struct
ifreq
*
ifr
,
int
cmd
);
int
efx_ptp_set_ts_config
(
struct
efx_nic
*
efx
,
struct
ifreq
*
ifr
);
int
efx_ptp_get_ts_config
(
struct
efx_nic
*
efx
,
struct
ifreq
*
ifr
);
void
efx_ptp_get_ts_info
(
struct
efx_nic
*
efx
,
struct
ethtool_ts_info
*
ts_info
);
bool
efx_ptp_is_ptp_tx
(
struct
efx_nic
*
efx
,
struct
sk_buff
*
skb
);
int
efx_ptp_tx
(
struct
efx_nic
*
efx
,
struct
sk_buff
*
skb
);
...
...
drivers/net/ethernet/sfc/ptp.c
View file @
433dc9b3
...
...
@@ -1231,7 +1231,7 @@ void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info)
1
<<
HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ
);
}
int
efx_ptp_
ioctl
(
struct
efx_nic
*
efx
,
struct
ifreq
*
ifr
,
int
cmd
)
int
efx_ptp_
set_ts_config
(
struct
efx_nic
*
efx
,
struct
ifreq
*
ifr
)
{
struct
hwtstamp_config
config
;
int
rc
;
...
...
@@ -1251,6 +1251,15 @@ int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd)
?
-
EFAULT
:
0
;
}
int
efx_ptp_get_ts_config
(
struct
efx_nic
*
efx
,
struct
ifreq
*
ifr
)
{
if
(
!
efx
->
ptp_data
)
return
-
EOPNOTSUPP
;
return
copy_to_user
(
ifr
->
ifr_data
,
&
efx
->
ptp_data
->
config
,
sizeof
(
efx
->
ptp_data
->
config
))
?
-
EFAULT
:
0
;
}
static
void
ptp_event_failure
(
struct
efx_nic
*
efx
,
int
expected_frag_len
)
{
struct
efx_ptp_data
*
ptp
=
efx
->
ptp_data
;
...
...
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