Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Network Interface Card
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
White Rabbit Network Interface Card
Commits
a5cac0f7
Commit
a5cac0f7
authored
Feb 07, 2013
by
Alessandro Rubini
Committed by
Miguel Jimenez Lopez
Sep 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_nic: define weak mezzanine functions (for spec)
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
cf6446c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
device.c
kernel/wr_nic/device.c
+7
-0
nic-core.c
kernel/wr_nic/nic-core.c
+26
-0
No files found.
kernel/wr_nic/device.c
View file @
a5cac0f7
...
...
@@ -42,6 +42,7 @@ static int wrn_remove(struct platform_device *pdev)
/* Then remove devices, memory maps, interrupts */
for
(
i
=
0
;
i
<
WRN_NR_ENDPOINTS
;
i
++
)
{
if
(
wrn
->
dev
[
i
])
{
wrn_mezzanine_exit
(
wrn
->
dev
[
i
]);
wrn_endpoint_remove
(
wrn
->
dev
[
i
]);
free_netdev
(
wrn
->
dev
[
i
]);
wrn
->
dev
[
i
]
=
NULL
;
...
...
@@ -168,7 +169,13 @@ static int __devinit wrn_probe(struct platform_device *pdev)
goto
out
;
/* This endpoint went in properly */
wrn
->
dev
[
i
]
=
netdev
;
err
=
wrn_mezzanine_init
(
netdev
);
if
(
err
)
dev_err
(
&
pdev
->
dev
,
"Init mezzanine code: "
"error %i
\n
"
,
err
);
}
if
(
i
==
0
)
return
-
ENODEV
;
/* no endpoints */
for
(
i
=
0
;
i
<
WRN_NR_TXDESC
;
i
++
)
{
/* Clear all tx descriptors */
struct
wrn_txd
*
tx
;
...
...
kernel/wr_nic/nic-core.c
View file @
a5cac0f7
...
...
@@ -264,6 +264,27 @@ struct net_device_stats *wrn_get_stats(struct net_device *dev)
return
NULL
;
}
/*
* If we have a mezzanine, we need the ioctl as well as init/exit. Provide
* three weak functions here, so to link even if no mezzanine is there.
*/
int
__weak
wrn_mezzanine_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
{
return
-
ENOIOCTLCMD
;
}
int
__weak
wrn_mezzanine_init
(
struct
net_device
*
dev
)
{
return
0
;
}
void
__weak
wrn_mezzanine_exit
(
struct
net_device
*
dev
)
{
return
;
}
static
int
wrn_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
{
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
...
...
@@ -300,6 +321,11 @@ static int wrn_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return
-
EFAULT
;
return
0
;
case
PRIV_MEZZANINE_ID
:
case
PRIV_MEZZANINE_CMD
:
/* Pass this to the mezzanine driver, or use internal weak */
return
wrn_mezzanine_ioctl
(
dev
,
rq
,
cmd
);
default:
spin_lock_irq
(
&
ep
->
lock
);
res
=
generic_mii_ioctl
(
&
ep
->
mii
,
if_mii
(
rq
),
cmd
,
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