linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Arik Nemtsov <arik@wizery.com>
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH 2/2] mac80211: allow low-level drivers to set netdev feature bits
Date: Tue, 08 May 2012 13:15:38 -0700	[thread overview]
Message-ID: <4FA97EEA.3070900@candelatech.com> (raw)
In-Reply-To: <1336506821-23709-2-git-send-email-arik@wizery.com>

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@wizery.com>
> ---
>   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@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2012-05-08 20:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 19:53 [PATCH 1/2] mac80211: fix network header location when adding encryption headers Arik Nemtsov
2012-05-08 19:53 ` [PATCH 2/2] mac80211: allow low-level drivers to set netdev feature bits Arik Nemtsov
2012-05-08 20:15   ` Ben Greear [this message]
2012-05-09  6:11   ` Johannes Berg
2012-05-09 14:19     ` Ben Greear
2012-05-09 15:02       ` Arik Nemtsov

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=4FA97EEA.3070900@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=arik@wizery.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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 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).