diff options
author | Michael Buesch <mbuesch@freenet.de> | 2006-02-02 13:11:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-03-27 11:18:28 -0500 |
commit | 6465ce1bbf7fede82dccec342417105b10793b51 (patch) | |
tree | 948b292fc322e70e23cfaa39b0f95a893b1c670b /drivers/net | |
parent | 9e4a375b15c9940b13e66e224570b35c471c0128 (diff) |
[PATCH] bcm43xx: basic ethtool support
This patch contains the beginnings of ethtool support for bcm43xx.
It only implements get_drvinfo and get_link, but that's enough for
ifplugd to use ethtool to know whether we're associated or not and then
start or stop dhcp as necessary.
Signed-off-by: Jason Lunz <lunz@falooley.org>
Signed-off-by: Michael Buesch <mbuesch@freenet.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/bcm43xx/Makefile | 3 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 2 |
4 files changed, 62 insertions, 1 deletions
diff --git a/drivers/net/wireless/bcm43xx/Makefile b/drivers/net/wireless/bcm43xx/Makefile index 3e5ed77835e2..e025e9f052b2 100644 --- a/drivers/net/wireless/bcm43xx/Makefile +++ b/drivers/net/wireless/bcm43xx/Makefile | |||
@@ -5,4 +5,5 @@ bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o \ | |||
5 | bcm43xx_radio.o bcm43xx_phy.o \ | 5 | bcm43xx_radio.o bcm43xx_phy.o \ |
6 | bcm43xx_power.o bcm43xx_wx.o \ | 6 | bcm43xx_power.o bcm43xx_wx.o \ |
7 | bcm43xx_pio.o bcm43xx_ilt.o \ | 7 | bcm43xx_pio.o bcm43xx_ilt.o \ |
8 | bcm43xx_leds.o $(bcm43xx-obj-y) | 8 | bcm43xx_leds.o bcm43xx_ethtool.o \ |
9 | $(bcm43xx-obj-y) | ||
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c new file mode 100644 index 000000000000..b3ffcf501311 --- /dev/null +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | |||
3 | Broadcom BCM43xx wireless driver | ||
4 | |||
5 | ethtool support | ||
6 | |||
7 | Copyright (c) 2006 Jason Lunz <lunz@falooley.org> | ||
8 | |||
9 | Some code in this file is derived from the 8139too.c driver | ||
10 | Copyright (C) 2002 Jeff Garzik | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of the GNU General Public License as published by | ||
14 | the Free Software Foundation; either version 2 of the License, or | ||
15 | (at your option) any later version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, | ||
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | GNU General Public License for more details. | ||
21 | |||
22 | You should have received a copy of the GNU General Public License | ||
23 | along with this program; see the file COPYING. If not, write to | ||
24 | the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, | ||
25 | Boston, MA 02110-1301, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #include "bcm43xx.h" | ||
30 | #include "bcm43xx_ethtool.h" | ||
31 | |||
32 | #include <linux/netdevice.h> | ||
33 | #include <linux/pci.h> | ||
34 | #include <linux/string.h> | ||
35 | #include <linux/version.h> | ||
36 | |||
37 | |||
38 | static void bcm43xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | ||
39 | { | ||
40 | struct bcm43xx_private *bcm = bcm43xx_priv(dev); | ||
41 | |||
42 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); | ||
43 | strncpy(info->version, UTS_RELEASE, sizeof(info->version)); | ||
44 | strncpy(info->bus_info, pci_name(bcm->pci_dev), ETHTOOL_BUSINFO_LEN); | ||
45 | } | ||
46 | |||
47 | struct ethtool_ops bcm43xx_ethtool_ops = { | ||
48 | .get_drvinfo = bcm43xx_get_drvinfo, | ||
49 | .get_link = ethtool_op_get_link, | ||
50 | }; | ||
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h new file mode 100644 index 000000000000..813704991f62 --- /dev/null +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef BCM43xx_ETHTOOL_H_ | ||
2 | #define BCM43xx_ETHTOOL_H_ | ||
3 | |||
4 | #include <linux/ethtool.h> | ||
5 | |||
6 | extern struct ethtool_ops bcm43xx_ethtool_ops; | ||
7 | |||
8 | #endif /* BCM43xx_ETHTOOL_H_ */ | ||
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index c0ec503102c8..1051a49ddafe 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include "bcm43xx_pio.h" | 49 | #include "bcm43xx_pio.h" |
50 | #include "bcm43xx_power.h" | 50 | #include "bcm43xx_power.h" |
51 | #include "bcm43xx_wx.h" | 51 | #include "bcm43xx_wx.h" |
52 | #include "bcm43xx_ethtool.h" | ||
52 | 53 | ||
53 | 54 | ||
54 | MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver"); | 55 | MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver"); |
@@ -4249,6 +4250,7 @@ static int __devinit bcm43xx_init_one(struct pci_dev *pdev, | |||
4249 | #endif | 4250 | #endif |
4250 | net_dev->wireless_handlers = &bcm43xx_wx_handlers_def; | 4251 | net_dev->wireless_handlers = &bcm43xx_wx_handlers_def; |
4251 | net_dev->irq = pdev->irq; | 4252 | net_dev->irq = pdev->irq; |
4253 | SET_ETHTOOL_OPS(net_dev, &bcm43xx_ethtool_ops); | ||
4252 | 4254 | ||
4253 | /* initialize the bcm43xx_private struct */ | 4255 | /* initialize the bcm43xx_private struct */ |
4254 | bcm = bcm43xx_priv(net_dev); | 4256 | bcm = bcm43xx_priv(net_dev); |