linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Christian Lamparter <chunkeey@web.de>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org,
	John W Linville <linville@tuxdriver.com>,
	Stefan Steuerwald <salsasepp@googlemail.com>
Subject: Re: [PATCH 1/6 v2.1] mac80211: add sta_notify_ps callback
Date: Sat, 29 Nov 2008 17:21:02 -0600	[thread overview]
Message-ID: <4931CE5E.9030402@lwfinger.net> (raw)
In-Reply-To: <200811292309.38521.chunkeey@web.de>

Christian Lamparter wrote:
> This patch is necessary in order to provide a proper Access point support for p54.
>  
> Unfortunately for us, there is no documented way to disable the interfering
> power save buffering mechanism in firmware completely.
>  
> Therefore we give in and notify the driver through our new sta_notify_ps callback, 
> so that we can update the filter state.
>  
> Signed-off-by: Christian Lamparter <chunkeey@web.de>
> Acked-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> the extra patch for mac80211_hwsim is no longer needed...
> This whole series is all for wireless-testing.
> 
> erm... now with a updated documentation!!1one
> ---
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 6a1d4ea..a6baf37 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -779,6 +779,19 @@ enum sta_notify_cmd {
>  };
>  
>  /**
> + * enum sta_notify_ps_cmd - sta power save notify command
> + *
> + * Used with the sta_notify_ps() callback in &struct ieee80211_ops to
> + * notify the driver if a station made a power state transition.
> + *
> + * @STA_NOTIFY_SLEEP: a station is now sleeping
> + * @STA_NOTIFY_AWAKE: a sleeping station woke up
> + */
> +enum sta_notify_ps_cmd {
> +	STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE,
> +};
> +
> +/**
>   * enum ieee80211_tkip_key_type - get tkip key
>   *
>   * Used by drivers which need to get a tkip key for skb. Some drivers need a
> @@ -1248,6 +1261,9 @@ enum ieee80211_ampdu_mlme_action {
>   * @sta_notify: Notifies low level driver about addition or removal
>   *	of associated station or AP.
>   *
> + * @sta_ps_notify: Notifies low level driver about the power state transition
> + *	of a associated station. Must be atomic.
> + *
>   * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
>   *	bursting) for a hardware TX queue.
>   *
> @@ -1314,6 +1330,8 @@ struct ieee80211_ops {
>  	int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
>  	void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>  			enum sta_notify_cmd, struct ieee80211_sta *sta);
> +	void (*sta_notify_ps)(struct ieee80211_hw *hw,
> +			enum sta_notify_ps_cmd, struct ieee80211_sta *sta);
>  	int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
>  		       const struct ieee80211_tx_queue_params *params);
>  	int (*get_tx_stats)(struct ieee80211_hw *hw,
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 5a1a60f..3bf056e 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -654,10 +654,14 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
>  static void ap_sta_ps_start(struct sta_info *sta)
>  {
>  	struct ieee80211_sub_if_data *sdata = sta->sdata;
> +	struct ieee80211_local *local = sdata->local;
>  	DECLARE_MAC_BUF(mac);
>  
>  	atomic_inc(&sdata->bss->num_sta_ps);
>  	set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL);
> +	if (local->ops->sta_notify_ps)
> +		local->ops->sta_notify_ps(local_to_hw(local), STA_WILL_SLEEP,
> +					  &sta->sta);
>  #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
>  	printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n",
>  	       sdata->dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid);
> @@ -675,6 +679,9 @@ static int ap_sta_ps_end(struct sta_info *sta)
>  	atomic_dec(&sdata->bss->num_sta_ps);
>  
>  	clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL);
> +	if (local->ops->sta_notify_ps)
> +		local->ops->sta_notify_ps(local_to_hw(local), STA_WOKE_UP,
> +					  &sta->sta);

With this patch, STA_WILL_SLEEP and STA_WOKE_UP are undefined. Is there a
prerequisite that I missed?

Larry

  reply	other threads:[~2008-11-29 23:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-29 21:32 [PATCH 1/6 v2] mac80211: add sta_notify_ps callback Christian Lamparter
2008-11-29 21:41 ` Johannes Berg
2008-11-29 22:09   ` [PATCH 1/6 v2.1] " Christian Lamparter
2008-11-29 23:21     ` Larry Finger [this message]
2008-11-29 23:48       ` [PATCH 1/6 v2.2] " Christian Lamparter
2008-12-01 19:17         ` Luis R. Rodriguez
2008-12-02 15:55           ` Christian Lamparter
2008-12-02  9:35             ` Luis R. Rodriguez
2008-12-08 10:16             ` Johannes Berg
2008-12-08 14:20               ` Christian Lamparter
2008-12-08 19:53                 ` 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=4931CE5E.9030402@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=chunkeey@web.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=salsasepp@googlemail.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 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).