linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Cc: javier@cozybit.com, linux-wireless@vger.kernel.org
Subject: Re: [RFC 09/14] mac80211: add power save support structure to mesh interface
Date: Sat, 17 Nov 2012 10:26:10 +0100	[thread overview]
Message-ID: <1353144370.9543.29.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1353134886-13256-10-git-send-email-marco.porsch@etit.tu-chemnitz.de>

On Fri, 2012-11-16 at 22:48 -0800, Marco Porsch wrote:

>  #ifdef CONFIG_MAC80211_MESH
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index bc3e3e1..8396602 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -769,6 +769,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>  		/* free all potentially still buffered bcast frames */
>  		local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps.bc_buf);
>  		skb_queue_purge(&sdata->u.ap.ps.bc_buf);
> +	} else if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) {
> +		local->total_ps_buffered -= skb_queue_len(&sdata->u.mesh.ps.bc_buf);
> +		skb_queue_purge(&sdata->u.mesh.ps.bc_buf);
>  	} else if (sdata->vif.type == NL80211_IFTYPE_STATION) {
>  		ieee80211_mgd_stop(sdata);
>  	}

This will not apply, and is in the wrong place anyway.

> +	/* reset in case we have been in a mesh with PS peers before */

should amend the comment to say "and leak all the frames that might be
on the queue now.

> +	} else if (sta->sdata->vif.type == NL80211_IFTYPE_MESH_POINT) {
> +		ps = &sta->sdata->u.mesh.ps;
> +		/* TIM map only for AID <= IEEE80211_MAX_AID */

AID? Seems more like PLID to me:

> +		id = le16_to_cpu(sta->plid) % IEEE80211_MAX_AID;

> -	/* This is only necessary for stations on BSS interfaces */
> -	if (!sta->sdata->bss)
> +	/* This is only necessary for stations on BSS/MBSS interfaces */
> +	if (!sta->sdata->bss &&
> +	    !ieee80211_vif_is_mesh(&sta->sdata->vif))
>  		return false;

Instead of cluttering all the code paths like this, what if we changed

struct ieee80211_if_ap *sdata->bss

to

struct ps_data *sdata->ps


If we know the interface type is AP/AP_VLAN, we can still get the AP
sdata from that pointer:
	container_of(sdata->ps, struct ieee80211_sub_if_sdata, u.ap.ps);

This is only in a few places, and might keep all the RX/TX code simpler?
 
> +++ b/net/mac80211/tx.c
> @@ -329,6 +329,8 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
>  
>  		if (sdata->vif.type == NL80211_IFTYPE_AP)
>  			ps = &sdata->u.ap.ps;
> +		else if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
> +			ps = &sdata->u.mesh.ps;

This could just be "ps = sdata->ps" etc.

johannes


  reply	other threads:[~2012-11-17  9:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-17  6:47 [RFC 00/14] mesh powersave - basics Marco Porsch
2012-11-17  6:47 ` [RFC 01/14] {nl,cfg,mac}80211: add beacon interval and DTIM period to mesh config Marco Porsch
2012-11-17  8:54   ` Johannes Berg
2012-11-17  6:47 ` [RFC 02/14] {cfg,nl}80211: mesh power mode config parameters Marco Porsch
2012-11-17  8:57   ` Johannes Berg
2012-11-17  6:47 ` [RFC 03/14] {cfg,nl}80211: set and get default mesh power mode Marco Porsch
2012-11-17  8:59   ` Johannes Berg
2012-11-17 23:38     ` Thomas Pedersen
2012-11-17  6:47 ` [RFC 04/14] mac80211: local link-specific mesh power mode logic Marco Porsch
2012-11-17  9:05   ` Johannes Berg
2012-11-17  6:47 ` [RFC 05/14] mac80211: mesh power mode indication in transmitted frames Marco Porsch
2012-11-17  9:10   ` Johannes Berg
2012-11-19 20:07     ` Marco Porsch
2012-11-19 20:32       ` Johannes Berg
2012-11-17  6:47 ` [RFC 06/14] mac80211: track neighbor STA power modes Marco Porsch
2012-11-17  9:14   ` Johannes Berg
2012-11-17  6:47 ` [RFC 07/14] {cfg,nl}80211: set local link-specific power mode Marco Porsch
2012-11-17  9:16   ` Johannes Berg
2012-11-17  6:48 ` [RFC 08/14] {cfg,nl}80211: get local and peer mesh power modes Marco Porsch
2012-11-17  6:48 ` [RFC 09/14] mac80211: add power save support structure to mesh interface Marco Porsch
2012-11-17  9:26   ` Johannes Berg [this message]
2012-11-20 23:53     ` Marco Porsch
2012-11-26 10:39       ` Johannes Berg
2012-11-17  6:48 ` [RFC 10/14] mac80211: enable frame buffering for PS STA Marco Porsch
2012-11-17  9:28   ` Johannes Berg
2012-11-17  6:48 ` [RFC 11/14] {cfg,nl}80211: add awake window to mesh config Marco Porsch
2012-11-17  9:29   ` Johannes Berg
2012-11-17  6:48 ` [RFC 12/14] mac80211: add awake window IE to mesh beacons Marco Porsch
2012-11-17  9:30   ` Johannes Berg
2012-11-17  6:48 ` [RFC 13/14] mac80211: add TIM " Marco Porsch
2012-11-17  9:33   ` Johannes Berg
2012-11-17  6:48 ` [RFC 14/14] mac80211: mesh PS individually-addressed frame release Marco Porsch
2012-11-17  9:40   ` Johannes Berg
2012-11-20 18:11     ` Marco Porsch
2012-11-26 10:45       ` Johannes Berg
2012-11-26 18:27         ` Marco Porsch
2012-11-28 13:07           ` Johannes Berg
2012-11-17  9:41 ` [RFC 00/14] mesh powersave - basics 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=1353144370.9543.29.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=javier@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marco.porsch@etit.tu-chemnitz.de \
    /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).