Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	devel@lists.open80211s.org, distro11s@cozybit.com
Subject: Re: [PATCH 1/5] mac80211: process the CSA frame for mesh accordingly
Date: Tue, 01 Oct 2013 13:21:54 +0200	[thread overview]
Message-ID: <1380626514.14430.25.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1379115372-28426-2-git-send-email-yeohchunyeow@cozybit.com> (sfid-20130914_013631_722279_4FCA5354)

On Fri, 2013-09-13 at 16:36 -0700, Chun-Yeow Yeoh wrote:

> +	skb = dev_alloc_skb(local->tx_headroom + len);
> +	if (!skb)
> +		return -1;

-ENOMEM ?

> +	skb_reserve(skb, local->tx_headroom);
> +	mgmt_fwd = (struct ieee80211_mgmt *) skb_put(skb, len);
> +
> +	/* offset_ttl is based on whether the secondary channel
> +	 * offset is available or not. Substract 1 from the mesh TTL
> +	 * and disable the initiator flag before forwarding.
> +	 */
> +	offset_ttl = (len < 42) ? 7 : 10;
> +	*(pos + offset_ttl) -= 1;
> +	*(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR;

That's somewhat ugly, is there no better way to express that? Maybe with
different structs or something? I guess I can live with it, just asking
though.


> +	/* forward or re-broadcast the CSA frame */
> +	if (fwd_csa) {
> +		if (mesh_fwd_csa_frame(sdata, mgmt, len) < 0)
> +			mcsa_dbg(sdata, "Failed to forward the CSA frame");
> +	}
> +
> +	/* block the Tx only after fowarding the CSA frame if required */

typo: forwarding

> +	block_tx = !!(elems.mesh_chansw_params_ie->mesh_flags
> +		      & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT);

No need for !! with bool variables

johannes


  reply	other threads:[~2013-10-01 11:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 23:36 [PATCH 0/5] Add Mesh Channel Switch Support Chun-Yeow Yeoh
2013-09-13 23:36 ` [PATCH 1/5] mac80211: process the CSA frame for mesh accordingly Chun-Yeow Yeoh
2013-10-01 11:21   ` Johannes Berg [this message]
2013-10-01 22:38     ` Chun-Yeow Yeoh
2013-09-13 23:36 ` [PATCH 2/5] {nl,cfg,mac}80211: enable the triggering of CSA frame in mesh Chun-Yeow Yeoh
2013-10-01 11:24   ` Johannes Berg
2013-09-13 23:36 ` [PATCH 3/5] mac80211: adding the CSA and MCSP elements in mesh beaconing Chun-Yeow Yeoh
2013-10-01 11:25   ` Johannes Berg
2013-10-01 22:39     ` Chun-Yeow Yeoh
2013-09-13 23:36 ` [PATCH 4/5] {nl,cfg,mac}80211: finalizing mesh channel switching Chun-Yeow Yeoh
2013-10-01 11:27   ` Johannes Berg
2013-10-01 22:39     ` Chun-Yeow Yeoh
2013-09-13 23:36 ` [PATCH 5/5] mac80211: process mesh channel switching using beacon Chun-Yeow Yeoh
2013-10-01 11:30   ` Johannes Berg
2013-10-01 22:39     ` Chun-Yeow Yeoh
2013-10-01 11:31 ` [PATCH 0/5] Add Mesh Channel Switch Support Johannes Berg
2013-10-01 22:39   ` Chun-Yeow Yeoh

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=1380626514.14430.25.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=devel@lists.open80211s.org \
    --cc=distro11s@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=yeohchunyeow@cozybit.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