* [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link
@ 2004-03-07 1:49 Thomas Munck Steenholdt
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Munck Steenholdt @ 2004-03-07 1:49 UTC (permalink / raw)
To: hermes, netdev
Hi there!
I noticed that there wasn't a good way, from userland, to get the link
status of an orinoco device. So I implemented the basic stuff required
to support ethtool. then I implemented the get_link functionality of
ethtool (maps orinoco_private->connected the the ethtool link state). It
seems to work and will save people some boot-time (on the distros that
check for link before attempting DHCP configuration etc.) when laptop
users are not on there wireless location.
Also it lays the ground to move more functionality to the ethtool model.
Please let me know what you think!
Best regards
Thomas
--- drivers/net/wireless/orinoco.c.tmus 2004-03-07 00:25:47.000000000
+0100
+++ drivers/net/wireless/orinoco.c 2004-03-07 01:19:29.433223192 +0100
@@ -430,6 +430,7 @@
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
#include <linux/wireless.h>
+#include <linux/ethtool.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -566,6 +567,8 @@ static void orinoco_stat_gather(struct n
static struct net_device_stats *orinoco_get_stats(struct net_device
*dev);
static struct iw_statistics *orinoco_get_wireless_stats(struct
net_device *dev);
+static struct ethtool_ops orinoco_ethtool_ops;
+
/* Hardware control routines */
static int __orinoco_program_rids(struct net_device *dev);
@@ -3941,6 +3944,19 @@ orinoco_ioctl(struct net_device *dev, st
return err;
}
+/* ethtool - get link state */
+static u32 orinoco_get_link(struct net_device *dev)
+{
+ struct orinoco_private *priv = dev->priv;
+
+ return priv->connected;
+}
+
+/* ethtool - function definitions */
+static struct ethtool_ops orinoco_ethtool_ops = {
+ .get_link = orinoco_get_link,
+};
+
struct {
u16 rid;
char *name;
@@ -4150,6 +4166,9 @@ struct net_device *alloc_orinocodev(int
dev->set_multicast_list = orinoco_set_multicast_list;
/* we use the default eth_mac_addr for setting the MAC addr */
+ /* setup ethtool ops structure for this device */
+ SET_ETHTOOL_OPS(dev, &orinoco_ethtool_ops);
+
/* Set up default callbacks */
dev->open = orinoco_open;
dev->stop = orinoco_stop;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link
@ 2004-03-08 18:52 Jean Tourrilhes
2004-03-09 22:12 ` Thomas Munck Steenholdt
0 siblings, 1 reply; 6+ messages in thread
From: Jean Tourrilhes @ 2004-03-08 18:52 UTC (permalink / raw)
To: netdev, Thomas Munck Steenholdt; +Cc: Jeff Garzik
Thomas Munck Steenholdt wrote :
>
> I noticed that there wasn't a good way, from userland, to get the link
> status of an orinoco device.
I hope you realise that most often link status is meaningless
with Wireless cards. In Ad-Hoc mode, the link is always up, regardless
of the number of nodes in the cell, check the discussion on the HostAP
mailing list. And the Orinoco card will report connected even is WEP
is wrong. But, if you only use managed mode without WEP, that should
work.
I just wonder if it's better to report a 'link status' that
may be wrong/misleading or to not report anything at all.
Have fun...
Jean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link
2004-03-08 18:52 [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link Jean Tourrilhes
@ 2004-03-09 22:12 ` Thomas Munck Steenholdt
2004-03-12 18:49 ` Thomas Munck Steenholdt
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Munck Steenholdt @ 2004-03-09 22:12 UTC (permalink / raw)
To: jt; +Cc: netdev, Jeff Garzik, hermes
Jean Tourrilhes wrote:
> I hope you realise that most often link status is meaningless
> with Wireless cards. In Ad-Hoc mode, the link is always up, regardless
> of the number of nodes in the cell, check the discussion on the HostAP
> mailing list. And the Orinoco card will report connected even is WEP
> is wrong. But, if you only use managed mode without WEP, that should
> work.
> I just wonder if it's better to report a 'link status' that
> may be wrong/misleading or to not report anything at all.
Actually, if the WEP key is wrong(i guess that's what you mean) the
link is determined as down, like it should be!
For the AdHoc mode, sure the link is always determined as up, but that
is really the best way to do it given the nature of an Ad-Hoc network,
right!
The way I see it you'll gain from this patch whenever in managed mode.
Most people (in my experience) is using managed mode and thus would
benefit from this functionality!
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link
2004-03-09 22:12 ` Thomas Munck Steenholdt
@ 2004-03-12 18:49 ` Thomas Munck Steenholdt
2004-03-12 18:53 ` Jean Tourrilhes
2004-03-16 0:14 ` David Gibson
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Munck Steenholdt @ 2004-03-12 18:49 UTC (permalink / raw)
To: jt, hermes; +Cc: netdev, Jeff Garzik
Thomas Munck Steenholdt wrote:
> Jean Tourrilhes wrote:
>
>> I hope you realise that most often link status is meaningless
>> with Wireless cards. In Ad-Hoc mode, the link is always up, regardless
>> of the number of nodes in the cell, check the discussion on the HostAP
>> mailing list. And the Orinoco card will report connected even is WEP
>> is wrong. But, if you only use managed mode without WEP, that should
>> work.
>> I just wonder if it's better to report a 'link status' that
>> may be wrong/misleading or to not report anything at all.
>
>
> Actually, if the WEP key is wrong(i guess that's what you mean) the
> link is determined as down, like it should be!
>
> For the AdHoc mode, sure the link is always determined as up, but that
> is really the best way to do it given the nature of an Ad-Hoc network,
> right!
>
> The way I see it you'll gain from this patch whenever in managed mode.
> Most people (in my experience) is using managed mode and thus would
> benefit from this functionality!
>
> Thomas
>
>
Please comment on this ?
I feel it's a really good idea that would improve things for me a lot -
I'm sure I'm not the only one!
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link
2004-03-12 18:49 ` Thomas Munck Steenholdt
@ 2004-03-12 18:53 ` Jean Tourrilhes
2004-03-16 0:14 ` David Gibson
1 sibling, 0 replies; 6+ messages in thread
From: Jean Tourrilhes @ 2004-03-12 18:53 UTC (permalink / raw)
To: Thomas Munck Steenholdt; +Cc: hermes, netdev, Jeff Garzik
On Fri, Mar 12, 2004 at 07:49:35PM +0100, Thomas Munck Steenholdt wrote:
> Thomas Munck Steenholdt wrote:
> >Jean Tourrilhes wrote:
> >
> >> I hope you realise that most often link status is meaningless
> >>with Wireless cards. In Ad-Hoc mode, the link is always up, regardless
> >>of the number of nodes in the cell, check the discussion on the HostAP
> >>mailing list. And the Orinoco card will report connected even is WEP
> >>is wrong. But, if you only use managed mode without WEP, that should
> >>work.
> >> I just wonder if it's better to report a 'link status' that
> >>may be wrong/misleading or to not report anything at all.
> >
> >
> >Actually, if the WEP key is wrong(i guess that's what you mean) the
> >link is determined as down, like it should be!
> >
> >For the AdHoc mode, sure the link is always determined as up, but that
> >is really the best way to do it given the nature of an Ad-Hoc network,
> >right!
> >
> >The way I see it you'll gain from this patch whenever in managed mode.
> >Most people (in my experience) is using managed mode and thus would
> >benefit from this functionality!
> >
> >Thomas
> >
> >
>
> Please comment on this ?
>
> I feel it's a really good idea that would improve things for me a lot -
> I'm sure I'm not the only one!
>
> Thomas
You need to talk to the driver maintainers. They have some
mailings lists.
Jean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link
2004-03-12 18:49 ` Thomas Munck Steenholdt
2004-03-12 18:53 ` Jean Tourrilhes
@ 2004-03-16 0:14 ` David Gibson
1 sibling, 0 replies; 6+ messages in thread
From: David Gibson @ 2004-03-16 0:14 UTC (permalink / raw)
To: Thomas Munck Steenholdt; +Cc: jt, netdev, Jeff Garzik
On Fri, Mar 12, 2004 at 07:49:35PM +0100, Thomas Munck Steenholdt wrote:
> Thomas Munck Steenholdt wrote:
> >Jean Tourrilhes wrote:
> >
> >> I hope you realise that most often link status is meaningless
> >>with Wireless cards. In Ad-Hoc mode, the link is always up, regardless
> >>of the number of nodes in the cell, check the discussion on the HostAP
> >>mailing list. And the Orinoco card will report connected even is WEP
> >>is wrong. But, if you only use managed mode without WEP, that should
> >>work.
> >> I just wonder if it's better to report a 'link status' that
> >>may be wrong/misleading or to not report anything at all.
> >
> >
> >Actually, if the WEP key is wrong(i guess that's what you mean) the
> >link is determined as down, like it should be!
> >
> >For the AdHoc mode, sure the link is always determined as up, but that
> >is really the best way to do it given the nature of an Ad-Hoc network,
> >right!
> >
> >The way I see it you'll gain from this patch whenever in managed mode.
> >Most people (in my experience) is using managed mode and thus would
> >benefit from this functionality!
> >
> >Thomas
>
> Please comment on this ?
>
> I feel it's a really good idea that would improve things for me a lot -
> I'm sure I'm not the only one!
Sorry, I've been distracted by other things and haven't gotten around
to replying to this. I see that Pavel Roskin has taken a look at your
patch, I'll add some comments on that thread.
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-03-16 0:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-08 18:52 [PATCH] 2.6.3 orinoco.c patch to support ethtool get_link Jean Tourrilhes
2004-03-09 22:12 ` Thomas Munck Steenholdt
2004-03-12 18:49 ` Thomas Munck Steenholdt
2004-03-12 18:53 ` Jean Tourrilhes
2004-03-16 0:14 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2004-03-07 1:49 Thomas Munck Steenholdt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).