All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "Antonio Quartulli" <antonio@open-mesh.com>
Cc: "Antonio Quartulli" <ordex@autistici.org>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"brcm80211-dev-list@broadcom.com"
	<brcm80211-dev-list@broadcom.com>
Subject: Re: [PATCHv2 3/4] brcm80211: make mgmt_tx in brcmfmac accept a NULL channel
Date: Wed, 5 Jun 2013 16:14:07 +0200	[thread overview]
Message-ID: <51AF47AF.9060802@broadcom.com> (raw)
In-Reply-To: <20130605135757.GF2349@open-mesh.com>

On 06/05/2013 03:57 PM, Antonio Quartulli wrote:
> On Wed, Jun 05, 2013 at 06:53:32AM -0700, Arend van Spriel wrote:
>
> [...]
>
>>> +		freq = cfg->channel;
>>> +		if (chan)
>>> +			freq = chan->center_freq;
>>> +		chan_nr = ieee80211_frequency_to_channel(freq);
>>
>> Could you get rid of 'freq' variable and use
>> ieee80211_frequency_to_channel() on cfg->channel or chan->center_freq.
>>
>
> I tried that, but the line indented below the if would be longer than 80 chars
> and breaking it is quite ugly.
>
>> Another thing is that cfg->channel can be zero resulting in chan_nr
>> being zero. I had a quick look whether the device firmware can handle
>> this. I suspect not, but I will need to ask to be sure.
>>
>
> ok. But when cfg->channel is zero, where is the current freq stored?

It is not. The rf on the device is set to a certain channel so it can be 
retrieved from the device:

brcmf_fil_cmd_int_get(vif->ifp, BRCMF_C_GET_CHANNEL, &freq);

The vif pointer can be obtained using container_of() on the wdev. That 
is done in mgmt_tx() already some lines above. May you should move 
determining the vif pointer and do it unconditional.

Regards,
Arend



  reply	other threads:[~2013-06-05 14:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 11:53 [PATCHv2 1/4] nl80211: allow sending CMD_FRAME without specifying any frequency Antonio Quartulli
2013-06-05 11:53 ` [PATCHv2 2/4] mac80211: make mgmt_tx accept a NULL channel Antonio Quartulli
2013-06-05 11:53 ` [PATCHv2 3/4] brcm80211: make mgmt_tx in brcmfmac " Antonio Quartulli
2013-06-05 13:53   ` Arend van Spriel
2013-06-05 13:57     ` Antonio Quartulli
2013-06-05 14:14       ` Arend van Spriel [this message]
2013-06-05 14:17         ` Antonio Quartulli
2013-06-05 11:53 ` [PATCHv2 4/4] ath6kl: make mgmt_tx " Antonio Quartulli

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=51AF47AF.9060802@broadcom.com \
    --to=arend@broadcom.com \
    --cc=antonio@open-mesh.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=ordex@autistici.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.