From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev <netdev@vger.kernel.org>
Cc: Jiri Benc <jbenc@suse.cz>,
"John W. Linville" <linville@tuxdriver.com>,
Johannes Berg <johannes@sipsolutions.net>,
Simon Barber <simon@devicescape.com>,
Jouni Malinen <jkm@devicescape.com>,
Hong Liu <hong.liu@intel.com>,
David Kimdon <david.kimdon@devicescape.com>,
Michael Wu <flamingice@sourmilk.net>,
Michael Buesch <mbuesch@freenet.de>
Subject: Re: [PATCH] d80211 ethtool
Date: Wed, 22 Nov 2006 17:59:01 +0100 [thread overview]
Message-ID: <200611221759.01579.IvDoorn@gmail.com> (raw)
In-Reply-To: <200611221608.09234.IvDoorn@gmail.com>
Initial patch was flawed in 2 ways, it didn't go to the netdev list,
and it didn't contain a function to allow drivers to get a ieee80211_hw
pointer from the net_device structure.
So this time the correct patch.
During the latest d80211 update the netdevice reference
was removed from the drivers. This also removed the
capability to register ethtool operations for the netdevice.
This patch adds the ethtool_ops reference into the
ieee80211_ops structure, and makes sure that it will
be set on all new interfaces that will be created.
Signed-off-by Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/include/net/d80211.h b/include/net/d80211.h
index 30980e1..efa52b6 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -704,6 +704,10 @@ struct ieee80211_ops {
* needed only for IBSS mode and the result of this function is used to
* determine whether to reply to Probe Requests. */
int (*tx_last_beacon)(struct ieee80211_hw *hw);
+
+ /* Set the ethtool_ops pointer to indicate which ethtool functionality
+ * is supported by the driver. */
+ struct ethtool_ops *ethtool;
};
/* Allocate a new hardware device. This must be called once for each
@@ -888,6 +892,15 @@ void ieee80211_start_queues(struct ieee8
void ieee80211_stop_queues(struct ieee80211_hw *hw);
/**
+ * ieee80211_get_hw - Get ieee80211 pointer
+ * @dev: pointer to the net_device.
+ *
+ * Drivers can use this to convert a net_device pointer to the
+ * pointer to a ieee80211_hw structure.
+ */
+struct ieee80211_hw *ieee80211_get_hw(struct net_device *dev);
+
+/**
* ieee80211_get_mc_list_item - iteration over items in multicast list
* @hw: pointer as obtained from ieee80211_alloc_hw().
* @prev: value returned by previous call to ieee80211_get_mc_list_item() or
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 8a87c73..b55332c 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -4814,6 +4814,13 @@ void ieee80211_stop_queues(struct ieee80
}
EXPORT_SYMBOL(ieee80211_stop_queues);
+struct ieee80211_hw *ieee80211_get_hw(struct net_device *dev)
+{
+ struct ieee80211_local *local = dev->ieee80211_ptr;
+ return &local->hw;
+}
+EXPORT_SYMBOL(ieee80211_get_hw);
+
struct net_device_stats *ieee80211_dev_stats(struct net_device *dev)
{
struct ieee80211_sub_if_data *sdata;
diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c
index 4f20bd9..a04ad95 100644
--- a/net/d80211/ieee80211_iface.c
+++ b/net/d80211/ieee80211_iface.c
@@ -77,6 +77,7 @@ int ieee80211_if_add(struct net_device *
ndev->mem_end = dev->mem_end;
ndev->flags = dev->flags & IFF_MULTICAST;
SET_NETDEV_DEV(ndev, dev->class_dev.dev);
+ SET_ETHTOOL_OPS(ndev, local->ops->ethtool);
sdata = IEEE80211_DEV_TO_SUB_IF(ndev);
sdata->type = IEEE80211_IF_TYPE_AP;
@@ -125,6 +126,7 @@ int ieee80211_if_add_mgmt(struct ieee802
ndev->ieee80211_ptr = local;
memcpy(ndev->dev_addr, local->hw.perm_addr, ETH_ALEN);
SET_NETDEV_DEV(ndev, local->mdev->class_dev.dev);
+ SET_ETHTOOL_OPS(ndev, local->ops->ethtool);
nsdata = IEEE80211_DEV_TO_SUB_IF(ndev);
nsdata->type = IEEE80211_IF_TYPE_MGMT;
next parent reply other threads:[~2006-11-22 16:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200611221608.09234.IvDoorn@gmail.com>
2006-11-22 16:59 ` Ivo van Doorn [this message]
2006-11-22 17:17 ` [PATCH] d80211 ethtool Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200611221759.01579.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=david.kimdon@devicescape.com \
--cc=flamingice@sourmilk.net \
--cc=hong.liu@intel.com \
--cc=jbenc@suse.cz \
--cc=jkm@devicescape.com \
--cc=johannes@sipsolutions.net \
--cc=linville@tuxdriver.com \
--cc=mbuesch@freenet.de \
--cc=netdev@vger.kernel.org \
--cc=simon@devicescape.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.