Search Linux Wireless

Re: [PATCH 2/2] mac80211: allow low-level drivers to set netdev feature bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/08/2012 12:53 PM, Arik Nemtsov wrote:
Allow low-level drivers to change the feature bit for a vif's underlying
net_device struct.

Signed-off-by: Arik Nemtsov<arik@xxxxxxxxxx>
---
  include/net/mac80211.h |   10 ++++++++++
  net/mac80211/tx.c      |    9 +++++++++
  2 files changed, 19 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 4d6e6c6..acc46b2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2992,6 +2992,16 @@ struct sk_buff *
  ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);

  /**
+ * ieee80211_set_netdev_features - set netdev feature bits for vif
+ * @vif: virtual interface to set netdev flags on
+ * @features: feature bits (see&struct net_device for details)
+ *
+ * This function sets netdev feature bit for the device associated with the
+ * specified vif.
+ */
+void ieee80211_set_netdev_features(struct ieee80211_vif *vif, int features);

Features are uint64 now I think.  In fact, there is a type-def
for them..probably should use that instead.

+
+/**
   * ieee80211_get_tkip_p1k_iv - get a TKIP phase 1 key for IV32
   *
   * This function returns the TKIP phase 1 key for the given IV32.
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index d67d36f..d9f94a6 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2754,3 +2754,12 @@ void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
  	ieee80211_xmit(sdata, skb);
  	local_bh_enable();
  }
+
+void ieee80211_set_netdev_features(struct ieee80211_vif *vif, int features)
+{
+	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+
+	if (sdata->dev)
+		sdata->dev->features |= features;

And how to turn off features??  I think you could
just implement the ethtool api, and then have your drivers
call that?  That way you get two features at once!

Ben


--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux