Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
87
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
8e8d6301
Commit
8e8d6301
authored
14 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
nic: added ioctl method, calling external functions
parent
95fd5c81
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nic/nic-core.c
+16
-2
16 additions, 2 deletions
nic/nic-core.c
nic/wr-nic.h
+37
-1
37 additions, 1 deletion
nic/wr-nic.h
with
53 additions
and
3 deletions
nic/nic-core.c
+
16
−
2
View file @
8e8d6301
...
...
@@ -104,8 +104,22 @@ struct net_device_stats *wrn_get_stats(struct net_device *dev)
static
int
wrn_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
{
/* FIXME: ioctl is missing */
return
-
ENOIOCTLCMD
;
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
int
res
;
switch
(
cmd
)
{
case
SIOCSHWTSTAMP
:
return
wrn_tstamp_ioctl
(
dev
,
rq
,
cmd
);
case
PRIV_IOCGCALIBRATE
:
return
wrn_calib_ioctl
(
dev
,
rq
,
cmd
);
case
PRIV_IOCGGETPHASE
:
return
wrn_phase_ioctl
(
dev
,
rq
,
cmd
);
default:
spin_lock_irq
(
&
ep
->
lock
);
res
=
generic_mii_ioctl
(
&
ep
->
mii
,
if_mii
(
rq
),
cmd
,
NULL
);
spin_unlock_irq
(
&
ep
->
lock
);
return
res
;
}
}
static
const
struct
net_device_ops
wrn_netdev_ops
=
{
...
...
This diff is collapsed.
Click to expand it.
nic/wr-nic.h
+
37
−
1
View file @
8e8d6301
...
...
@@ -113,9 +113,37 @@ 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)
/* Structures straight from wr_minic.c -- should user-space include this? */
struct
wrn_calibration_req
{
int
cmd
;
int
cal_present
;
};
struct
wrn_phase_req
{
int
ready
;
u32
phase
;
};
#define WRN_DMTD_AVG_SAMPLES 256
#define WRN_DMTD_MAX_PHASE 16384
#define WRN_CAL_TX_ON 1
#define WRN_CAL_TX_OFF 2
#define WRN_CAL_RX_ON 3
#define WRN_CAL_RX_OFF 4
#define WRN_CAL_RX_CHECK 5
/* This a WR-specific register in the dmdio space */
#define WRN_MDIO_WR_SPEC 0x00000010
#define WRN_MDIO_WR_SPEC_TX_CAL 0x01
/* TX calib pattern */
#define WRN_MDIO_WR_SPEC_RX_CAL_STAT 0x02
/* RX calib status */
#define WRN_MDIO_WR_SPEC_CAL_CRST 0x04
/* Reset calibration counter */
/* Following functions in in nic-core.c */
/* Following functions are in nic-core.c */
extern
irqreturn_t
wrn_interrupt
(
int
irq
,
void
*
dev_id
);
extern
int
wrn_netops_init
(
struct
net_device
*
netdev
);
...
...
@@ -136,4 +164,12 @@ extern int wrn_ep_close(struct net_device *dev);
extern
int
wrn_endpoint_probe
(
struct
net_device
*
netdev
);
extern
void
wrn_endpoint_remove
(
struct
net_device
*
netdev
);
/* Following functions from timestamp.c */
extern
int
wrn_tstamp_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
);
/* Following functions from dmtd.c */
extern
int
wrn_phase_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
);
extern
int
wrn_calib_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
);
#endif
/* __WR_NIC_H__ */
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment