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
ca7ee5f4
Commit
ca7ee5f4
authored
Aug 26, 2003
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr xircom_cb] ethtool_ops support
Also, export PCI bus id via ETHTOOL_GDRVINFO.
parent
5f505b2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
28 deletions
+10
-28
drivers/net/tulip/xircom_cb.c
drivers/net/tulip/xircom_cb.c
+10
-28
No files found.
drivers/net/tulip/xircom_cb.c
View file @
ca7ee5f4
...
...
@@ -175,37 +175,19 @@ static void print_binary(unsigned int number)
}
#endif
static
int
netdev_ethtool_ioctl
(
struct
net_device
*
dev
,
void
*
useraddr
)
{
u32
ethcmd
;
if
(
copy_from_user
(
&
ethcmd
,
useraddr
,
sizeof
(
ethcmd
)))
return
-
EFAULT
;
switch
(
ethcmd
)
{
case
ETHTOOL_GDRVINFO
:
{
struct
ethtool_drvinfo
info
=
{
ETHTOOL_GDRVINFO
};
strncpy
(
info
.
driver
,
"xircom_cb"
,
sizeof
(
info
.
driver
)
-
1
);
if
(
copy_to_user
(
useraddr
,
&
info
,
sizeof
(
info
)))
return
-
EFAULT
;
return
0
;
}
}
return
-
EOPNOTSUPP
;
}
static
int
private_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
static
void
netdev_get_drvinfo
(
struct
net_device
*
dev
,
struct
ethtool_drvinfo
*
info
)
{
struct
xircom_private
*
private
=
dev
->
priv
;
switch
(
cmd
)
{
case
SIOCETHTOOL
:
return
netdev_ethtool_ioctl
(
dev
,
(
void
*
)
rq
->
ifr_data
);
default:
return
-
EOPNOTSUPP
;
}
strcpy
(
info
->
driver
,
"xircom_cb"
);
strcpy
(
info
->
bus_info
,
pci_name
(
private
->
pdev
));
}
static
struct
ethtool_ops
netdev_ethtool_ops
=
{
.
get_drvinfo
=
netdev_get_drvinfo
,
};
/* xircom_probe is the code that gets called on device insertion.
it sets up the hardware and registers the device to the networklayer.
...
...
@@ -287,7 +269,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
dev
->
stop
=
&
xircom_close
;
dev
->
get_stats
=
&
xircom_get_stats
;
dev
->
priv
=
private
;
dev
->
do_ioctl
=
&
private_ioctl
;
SET_ETHTOOL_OPS
(
dev
,
&
netdev_ethtool_ops
)
;
pci_set_drvdata
(
pdev
,
dev
);
...
...
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