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
nexedi
linux
Commits
42e1e53d
Commit
42e1e53d
authored
Aug 29, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Aug 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (14/27) ns83820 ethtool conversion
parent
2086582b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
47 deletions
+14
-47
drivers/net/ns83820.c
drivers/net/ns83820.c
+14
-47
No files found.
drivers/net/ns83820.c
View file @
42e1e53d
...
...
@@ -1192,59 +1192,26 @@ static struct net_device_stats *ns83820_get_stats(struct net_device *ndev)
return
&
dev
->
stats
;
}
static
int
ns83820_ethtool_ioctl
(
struct
ns83820
*
dev
,
void
__user
*
useraddr
)
static
void
ns83820_get_drvinfo
(
struct
net_device
*
ndev
,
struct
ethtool_drvinfo
*
info
)
{
u32
ethcmd
;
if
(
copy_from_user
(
&
ethcmd
,
useraddr
,
sizeof
(
ethcmd
)))
return
-
EFAULT
;
switch
(
ethcmd
)
{
case
ETHTOOL_GDRVINFO
:
{
struct
ethtool_drvinfo
info
=
{
ETHTOOL_GDRVINFO
};
strcpy
(
info
.
driver
,
"ns83820"
);
strcpy
(
info
.
version
,
VERSION
);
strcpy
(
info
.
bus_info
,
pci_name
(
dev
->
pci_dev
));
if
(
copy_to_user
(
useraddr
,
&
info
,
sizeof
(
info
)))
return
-
EFAULT
;
return
0
;
}
/* get link status */
case
ETHTOOL_GLINK
:
{
struct
ethtool_value
edata
=
{
ETHTOOL_GLINK
};
u32
cfg
=
readl
(
dev
->
base
+
CFG
)
^
SPDSTS_POLARITY
;
if
(
cfg
&
CFG_LNKSTS
)
edata
.
data
=
1
;
else
edata
.
data
=
0
;
if
(
copy_to_user
(
useraddr
,
&
edata
,
sizeof
(
edata
)))
return
-
EFAULT
;
return
0
;
}
default:
break
;
}
return
-
EOPNOTSUPP
;
struct
ns83820
*
dev
=
PRIV
(
ndev
);
strcpy
(
info
->
driver
,
"ns83820"
);
strcpy
(
info
->
version
,
VERSION
);
strcpy
(
info
->
bus_info
,
pci_name
(
dev
->
pci_dev
));
}
static
int
ns83820_ioctl
(
struct
net_device
*
ndev
,
struct
ifreq
*
rq
,
int
cmd
)
static
u32
ns83820_get_link
(
struct
net_device
*
ndev
)
{
struct
ns83820
*
dev
=
PRIV
(
ndev
);
switch
(
cmd
)
{
case
SIOCETHTOOL
:
return
ns83820_ethtool_ioctl
(
dev
,
rq
->
ifr_data
);
default:
return
-
EOPNOTSUPP
;
}
u32
cfg
=
readl
(
dev
->
base
+
CFG
)
^
SPDSTS_POLARITY
;
return
cfg
&
CFG_LNKSTS
?
1
:
0
;
}
static
struct
ethtool_ops
ops
=
{
.
get_drvinfo
=
ns83820_get_drvinfo
,
.
get_link
=
ns83820_get_link
};
static
void
ns83820_mib_isr
(
struct
ns83820
*
dev
)
{
spin_lock
(
&
dev
->
misc_lock
);
...
...
@@ -1884,7 +1851,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
ndev
->
get_stats
=
ns83820_get_stats
;
ndev
->
change_mtu
=
ns83820_change_mtu
;
ndev
->
set_multicast_list
=
ns83820_set_multicast
;
ndev
->
do_ioctl
=
ns83820_ioctl
;
SET_ETHTOOL_OPS
(
ndev
,
&
ops
)
;
ndev
->
tx_timeout
=
ns83820_tx_timeout
;
ndev
->
watchdog_timeo
=
5
*
HZ
;
...
...
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