linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: Replacement for local->hw.conf.channel
Date: Tue, 09 Jul 2013 16:35:45 +0200	[thread overview]
Message-ID: <1373380545.8241.1.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <51DB0937.2020609@candelatech.com>


> > No, don't use that in any new code. It's purely for compatibility with
> > drivers that aren't converted to channel contexts (yet).
> >
> >> In 3.9, ath9k_htc was giving me a null channel in the code below:
> >>
> >> 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> >> 	if (chanctx_conf)
> >> 		channel = chanctx_conf->def.chan;
> >> 	else
> >> 		channel = NULL;
> >
> > Well that of course happens if the vif isn't bound to a channel context.
> 
> Any opinions on what to return in ethtool stats for frequency if
> there is no channel context?

Why even bother doing so? "iw dev" shows the frequency and channel width
just fine, no?

> If there is a quick way to just return whatever the hardware is
> currently using, I think that is best, but if there is not
> a reliable way to do this then, some hard coded default
> like 0 is probably best.

Well there's no such concept as "what the hardware is currently using"
in this case, the channel is completely pointless when there's no
channel context at all. There might be something like the current scan
channel, but what value would there be in returning that?

johannes


  reply	other threads:[~2013-07-09 14:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04  0:01 Replacement for local->hw.conf.channel Ben Greear
2013-07-04  7:27 ` Johannes Berg
2013-07-08 18:20   ` Ben Greear
2013-07-08 18:31     ` Johannes Berg
2013-07-08 18:47       ` Ben Greear
2013-07-09 14:35         ` Johannes Berg [this message]
2013-07-09 16:32           ` Ben Greear

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=1373380545.8241.1.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --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).