netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hostap: Use ethtool_ops
@ 2005-03-25  3:23 Jouni Malinen
  2005-03-25  3:34 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Jouni Malinen @ 2005-03-25  3:23 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Convert ethtool ioctl handler to use ethtool_ops.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>


Index: wireless-2.6/drivers/net/wireless/hostap/hostap.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/hostap/hostap.c	2005-03-22 20:07:48.000000000 -0800
+++ wireless-2.6/drivers/net/wireless/hostap/hostap.c	2005-03-22 21:27:00.000000000 -0800
@@ -934,6 +934,8 @@
 		dev->tx_queue_len = 0;
 	}
 
+	SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops);
+
 	netif_stop_queue(dev);
 }
 
Index: wireless-2.6/drivers/net/wireless/hostap/hostap_ioctl.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/hostap/hostap_ioctl.c	2005-03-22 21:15:44.000000000 -0800
+++ wireless-2.6/drivers/net/wireless/hostap/hostap_ioctl.c	2005-03-22 21:27:23.000000000 -0800
@@ -3925,31 +3925,28 @@
 }
 
 
-static int prism2_ioctl_ethtool(local_info_t *local, void __user *useraddr)
+static void prism2_get_drvinfo(struct net_device *dev,
+			       struct ethtool_drvinfo *info)
 {
-	u32 ethcmd;
-	struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
-
-	if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
-		return -EFAULT;
+	struct hostap_interface *iface;
+	local_info_t *local;
 
-	switch (ethcmd) {
-	case ETHTOOL_GDRVINFO:
-		strncpy(info.driver, "hostap", sizeof(info.driver) - 1);
-		strncpy(info.version, PRISM2_VERSION,
-			sizeof(info.version) - 1);
-		snprintf(info.fw_version, sizeof(info.fw_version) - 1,
-			 "%d.%d.%d", (local->sta_fw_ver >> 16) & 0xff,
-			 (local->sta_fw_ver >> 8) & 0xff,
-			 local->sta_fw_ver & 0xff);
-		if (copy_to_user(useraddr, &info, sizeof(info)))
-			return -EFAULT;
-		return 0;
-	}
+	iface = netdev_priv(dev);
+	local = iface->local;
 
-	return -EOPNOTSUPP;
+	strncpy(info->driver, "hostap", sizeof(info->driver) - 1);
+	strncpy(info->version, PRISM2_VERSION,
+		sizeof(info->version) - 1);
+	snprintf(info->fw_version, sizeof(info->fw_version) - 1,
+		 "%d.%d.%d", (local->sta_fw_ver >> 16) & 0xff,
+		 (local->sta_fw_ver >> 8) & 0xff,
+		 local->sta_fw_ver & 0xff);
 }
 
+static struct ethtool_ops prism2_ethtool_ops = {
+	.get_drvinfo = prism2_get_drvinfo
+};
+
 
 /* Structures to export the Wireless Handlers */
 
@@ -4117,10 +4114,6 @@
 		else ret = prism2_ioctl_priv_hostapd(local, &wrq->u.data);
 		break;
 
-	case SIOCETHTOOL:
-		ret = prism2_ioctl_ethtool(local, ifr->ifr_data);
-		break;
-
 	default:
 		ret = -EOPNOTSUPP;
 		break;


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hostap: Use ethtool_ops
  2005-03-25  3:23 [PATCH] hostap: Use ethtool_ops Jouni Malinen
@ 2005-03-25  3:34 ` Jeff Garzik
  2005-03-25  3:41   ` Jouni Malinen
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2005-03-25  3:34 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev

Both these patches look OK to me.

In which order should they be applied?

	Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hostap: Use ethtool_ops
  2005-03-25  3:34 ` Jeff Garzik
@ 2005-03-25  3:41   ` Jouni Malinen
  2005-03-25  3:47     ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Jouni Malinen @ 2005-03-25  3:41 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

On Thu, Mar 24, 2005 at 10:34:40PM -0500, Jeff Garzik wrote:

> Both these patches look OK to me.
> 
> In which order should they be applied?

1/2 hostap_stack_use.patch
2/2 hostap_ethtool.patch

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hostap: Use ethtool_ops
  2005-03-25  3:41   ` Jouni Malinen
@ 2005-03-25  3:47     ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2005-03-25  3:47 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: netdev

Jouni Malinen wrote:
> On Thu, Mar 24, 2005 at 10:34:40PM -0500, Jeff Garzik wrote:
> 
> 
>>Both these patches look OK to me.
>>
>>In which order should they be applied?
> 
> 
> 1/2 hostap_stack_use.patch
> 2/2 hostap_ethtool.patch

Thanks, applied both patches to wireless-2.6.

	Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-25  3:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-25  3:23 [PATCH] hostap: Use ethtool_ops Jouni Malinen
2005-03-25  3:34 ` Jeff Garzik
2005-03-25  3:41   ` Jouni Malinen
2005-03-25  3:47     ` Jeff Garzik

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