netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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
* [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

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).