* Re: [PATCH] d80211 ethtool
[not found] <200611221608.09234.IvDoorn@gmail.com>
@ 2006-11-22 16:59 ` Ivo van Doorn
2006-11-22 17:17 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Ivo van Doorn @ 2006-11-22 16:59 UTC (permalink / raw)
To: netdev
Cc: Jiri Benc, John W. Linville, Johannes Berg, Simon Barber,
Jouni Malinen, Hong Liu, David Kimdon, Michael Wu, Michael Buesch
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] d80211 ethtool
2006-11-22 16:59 ` [PATCH] d80211 ethtool Ivo van Doorn
@ 2006-11-22 17:17 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2006-11-22 17:17 UTC (permalink / raw)
To: Ivo van Doorn
Cc: netdev, Jiri Benc, John W. Linville, Simon Barber, Jouni Malinen,
Hong Liu, David Kimdon, Michael Wu, Michael Buesch
[-- Attachment #1: Type: text/plain, Size: 920 bytes --]
On Wed, 2006-11-22 at 17:59 +0100, Ivo van Doorn wrote:
> 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.
I disagree. Most ethtool ops are really tied to actual ethernet (TSO or
UFO for wireless?) and make no sense to have on wireless devices. From
what I can tell, you're using
(a) get_link
(b) eeprom dump
(c) message level
(d) driver info
(e) register dump
(f) get perm addr
(f) will be added to the wiphy stuff in cfg80211/nl80211. (a) has a bit
of a semantic problem, when, for example, does an access point or
monitor device have carrier/lower level ok?
(b) and (e) can be in debugfs, (c) can be a sysfs-modifiable module
parameter.
That leaves just (d) which isn't all that useful anyway.
I just don't see why the ethtool ops should be there at all.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-22 17:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200611221608.09234.IvDoorn@gmail.com>
2006-11-22 16:59 ` [PATCH] d80211 ethtool Ivo van Doorn
2006-11-22 17:17 ` Johannes Berg
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.