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
45e39485
Commit
45e39485
authored
Sep 18, 2002
by
Christoph Hellwig
Committed by
Jeff Garzik
Sep 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic ethtool support to axnet_cs, wavelan_cs net drivers
(originally by Arjan, merged and re-merged by hch)
parent
baa9f9dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/axnet_cs.c
+25
-0
drivers/net/wireless/wavelan_cs.c
drivers/net/wireless/wavelan_cs.c
+27
-0
No files found.
drivers/net/pcmcia/axnet_cs.c
View file @
45e39485
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
#include <linux/string.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/byteorder.h>
#include <asm/byteorder.h>
...
@@ -817,6 +819,27 @@ static void ei_watchdog(u_long arg)
...
@@ -817,6 +819,27 @@ static void ei_watchdog(u_long arg)
add_timer
(
&
info
->
watchdog
);
add_timer
(
&
info
->
watchdog
);
}
}
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
,
"axnet_cs"
,
sizeof
(
info
.
driver
)
-
1
);
if
(
copy_to_user
(
useraddr
,
&
info
,
sizeof
(
info
)))
return
-
EFAULT
;
return
0
;
}
}
return
-
EOPNOTSUPP
;
}
/*====================================================================*/
/*====================================================================*/
static
int
axnet_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
static
int
axnet_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
...
@@ -825,6 +848,8 @@ static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
...
@@ -825,6 +848,8 @@ static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
u16
*
data
=
(
u16
*
)
&
rq
->
ifr_data
;
u16
*
data
=
(
u16
*
)
&
rq
->
ifr_data
;
ioaddr_t
mii_addr
=
dev
->
base_addr
+
AXNET_MII_EEP
;
ioaddr_t
mii_addr
=
dev
->
base_addr
+
AXNET_MII_EEP
;
switch
(
cmd
)
{
switch
(
cmd
)
{
case
SIOCETHTOOL
:
return
netdev_ethtool_ioctl
(
dev
,
(
void
*
)
rq
->
ifr_data
);
case
SIOCDEVPRIVATE
:
case
SIOCDEVPRIVATE
:
data
[
0
]
=
info
->
phy_id
;
data
[
0
]
=
info
->
phy_id
;
case
SIOCDEVPRIVATE
+
1
:
case
SIOCDEVPRIVATE
+
1
:
...
...
drivers/net/wireless/wavelan_cs.c
View file @
45e39485
...
@@ -56,6 +56,8 @@
...
@@ -56,6 +56,8 @@
*
*
*/
*/
#include <linux/ethtool.h>
#include <asm/uaccess.h>
#include "wavelan_cs.p.h"
/* Private header */
#include "wavelan_cs.p.h"
/* Private header */
/************************* MISC SUBROUTINES **************************/
/************************* MISC SUBROUTINES **************************/
...
@@ -1858,6 +1860,27 @@ wl_his_gather(device * dev,
...
@@ -1858,6 +1860,27 @@ wl_his_gather(device * dev,
}
}
#endif
/* HISTOGRAM */
#endif
/* HISTOGRAM */
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
,
"wavelan_cs"
,
sizeof
(
info
.
driver
)
-
1
);
if
(
copy_to_user
(
useraddr
,
&
info
,
sizeof
(
info
)))
return
-
EFAULT
;
return
0
;
}
}
return
-
EOPNOTSUPP
;
}
/*------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/*
/*
* Wireless Handler : get protocol name
* Wireless Handler : get protocol name
...
@@ -2889,6 +2912,10 @@ wavelan_ioctl(struct net_device * dev, /* Device on wich the ioctl apply */
...
@@ -2889,6 +2912,10 @@ wavelan_ioctl(struct net_device * dev, /* Device on wich the ioctl apply */
/* Look what is the request */
/* Look what is the request */
switch
(
cmd
)
switch
(
cmd
)
{
{
case
SIOCETHTOOL
:
ret
=
netdev_ethtool_ioctl
(
dev
,
(
void
*
)
rq
->
ifr_data
);
break
;
/* --------------- WIRELESS EXTENSIONS --------------- */
/* --------------- WIRELESS EXTENSIONS --------------- */
case
SIOCGIWNAME
:
case
SIOCGIWNAME
:
...
...
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