linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: "Lukáš Turek" <8an@praha12.net>
Cc: "linville@tuxdriver.com" <linville@tuxdriver.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"ath5k-devel@lists.ath5k.org" <ath5k-devel@lists.ath5k.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [ath5k-devel] [PATCH 2/5] mac80211: Add new callback set_coverage_class
Date: Tue, 15 Dec 2009 10:11:49 -0800	[thread overview]
Message-ID: <20091215181149.GA2123@tux> (raw)
In-Reply-To: <1260899813-17585-3-git-send-email-8an@praha12.net>

On Tue, Dec 15, 2009 at 09:56:49AM -0800, Lukáš Turek wrote:
> Mac80211 callback to driver set_coverage_class() sets slot time and ACK
> timeout for given IEEE 802.11 coverage class. The callback is optional,
> but it's essential for long distance links.
> 
> Signed-off-by: Lukas Turek <8an@praha12.net>
> ---
>  include/net/mac80211.h |    5 +++++
>  net/mac80211/cfg.c     |    7 +++++++
>  2 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 2aff490..786e1d6 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -1483,6 +1483,10 @@ enum ieee80211_ampdu_mlme_action {
>   *     need to set wiphy->rfkill_poll to %true before registration,
>   *     and need to call wiphy_rfkill_set_hw_state() in the callback.
>   *
> + * @set_coverage_class: Set slot time for given coverage class as specified
> + *     in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
> + *     accordingly. This callback is not required and may sleep.
> + *
>   * @testmode_cmd: Implement a cfg80211 test mode command.
>   */
>  struct ieee80211_ops {
> @@ -1537,6 +1541,7 @@ struct ieee80211_ops {
>                             struct ieee80211_sta *sta, u16 tid, u16 *ssn);
> 
>         void (*rfkill_poll)(struct ieee80211_hw *hw);
> +       void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
>  #ifdef CONFIG_NL80211_TESTMODE
>         int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
>  #endif
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 6dc3579..c5537ae 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1237,6 +1237,13 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
>         struct ieee80211_local *local = wiphy_priv(wiphy);
>         int err;
> 
> +       if (changed & WIPHY_PARAM_COVERAGE_CLASS) {
> +               if (!local->ops->set_coverage_class)
> +                       return -EOPNOTSUPP;

Hm, it seems best to just add the capability bit that way userspace
can stuff what it wishes and the kernel will only set what is supported.
As is now this would lead to -EOPNOTSUPP but we'd have no way of knowing
from userspace what failed.

This comment is not specific to just this parameter but if you see the
current implementation of ieee80211_set_wiphy_params() doesn't fail
with -EOPNOTSUPP because I suppose WIPHY_PARAM_RTS_THRESHOLD is
required.

> +               local->ops->set_coverage_class(&local->hw,
> +                                              wiphy->coverage_class);
> +       }
> +
>         if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
>                 err = drv_set_rts_threshold(local, wiphy->rts_threshold);

  Luis

  parent reply	other threads:[~2009-12-15 18:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 17:56 [PATCH 0/5] Setting coverage class (and ACK timeout and slot time), take two Lukáš Turek
2009-12-15 17:56 ` [PATCH 1/5] nl80211: Add new WIPHY attribute COVERAGE_CLASS Lukáš Turek
2009-12-15 19:00   ` [ath5k-devel] " Luis R. Rodriguez
2009-12-15 19:02     ` Luis R. Rodriguez
2009-12-15 21:07       ` Lukáš Turek
2009-12-15 21:44         ` Luis R. Rodriguez
2009-12-16  8:03       ` Holger Schurig
2009-12-15 20:56     ` Lukáš Turek
2009-12-15 21:58       ` Luis R. Rodriguez
2009-12-15 22:48         ` Felix Fietkau
2009-12-15 22:52         ` Lukáš Turek
2009-12-16  8:30           ` Luis R. Rodriguez
2009-12-18 16:33             ` Lukáš Turek
2009-12-18 17:20               ` Luis R. Rodriguez
2009-12-15 17:56 ` [PATCH 2/5] mac80211: Add new callback set_coverage_class Lukáš Turek
2009-12-15 18:07   ` Johannes Berg
2009-12-15 18:11   ` Luis R. Rodriguez [this message]
2009-12-15 21:23     ` [ath5k-devel] " Lukáš Turek
2009-12-15 21:25     ` Johannes Berg
2009-12-15 17:56 ` [PATCH 3/5] ath5k: Fix functions for getting/setting slot time Lukáš Turek
2009-12-15 17:56 ` [PATCH 4/5] ath5k: Reimplement clock rate to usec conversion Lukáš Turek
2009-12-21 10:26   ` [ath5k-devel] " 海藻敬之
2009-12-21 12:38     ` Lukáš Turek
     [not found]       ` <4B301FE9.2020702@thinktube.com>
2009-12-22 16:08         ` Lukáš Turek
     [not found]     ` <4B2F50DD.60701@thinktube.com>
2009-12-21 12:40       ` Lukáš Turek
2009-12-21 15:08         ` Bob Copeland
2009-12-21 15:28           ` Lukáš Turek
2009-12-22  3:28             ` Bob Copeland
2009-12-15 17:56 ` [PATCH 5/5] ath5k: Implement mac80211 callback set_coverage_class Lukáš Turek
2009-12-15 18:50   ` [ath5k-devel] " Luis R. Rodriguez
2009-12-15 19:01     ` Luis R. Rodriguez
2009-12-15 21:35     ` Lukáš Turek
2009-12-15 22:07       ` Luis R. Rodriguez
2009-12-15 17:56 ` [PATCH] iw: Add support for NL80211_ATTR_WIPHY_COVERAGE_CLASS Lukáš Turek

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=20091215181149.GA2123@tux \
    --to=lrodriguez@atheros.com \
    --cc=8an@praha12.net \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).