From: Michael Buesch <mb@bu3sch.de>
To: "Alina Friedrichsen" <x-alina@gmx.net>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
johannes@sipsolutions.net
Subject: Re: [PATCH v2] mac80211: Call commit() on channel setting
Date: Fri, 27 Feb 2009 15:03:13 +0100 [thread overview]
Message-ID: <200902271503.13308.mb@bu3sch.de> (raw)
In-Reply-To: <20090226234307.51520@gmx.net>
On Friday 27 February 2009 00:43:07 Alina Friedrichsen wrote:
> This calls commit() on all logical interfaces of a physical interface, if the channel of it is changed. Before it works as it should, I must fix the joining process of STA and IBSS a little, which I will make tomorrow.
Could you explain what commit is supposed to to after the channel switch?
To me it's not clear what the difference in functionality is.
What do you expect to happen on the commit call after the channel change.
> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
> ---
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index c43129e..015062e 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1173,11 +1173,19 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
> enum nl80211_channel_type channel_type)
> {
> struct ieee80211_local *local = wiphy_priv(wiphy);
> + struct ieee80211_sub_if_data *sdata;
> + int ret;
>
> local->oper_channel = chan;
> local->oper_channel_type = channel_type;
>
> - return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
> + ret = ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
> +
> + list_for_each_entry(sdata, &local->interfaces, list) {
> + ieee80211_commit(sdata);
> + }
Why do you commit, even if channel change failed?
> +
> + return ret;
> }
>
> static int set_mgmt_extra_ie_sta(struct ieee80211_sub_if_data *sdata,
> diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
> index 1ac0516..dce1618 100644
> --- a/net/mac80211/wext.c
> +++ b/net/mac80211/wext.c
> @@ -157,7 +157,10 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
> struct iw_request_info *info,
> struct iw_freq *freq, char *extra)
> {
> + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> + struct ieee80211_sub_if_data *nsdata;
> + int ret;
>
> if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
> sdata->u.ibss.flags &= ~IEEE80211_IBSS_AUTO_CHANNEL_SEL;
> @@ -173,19 +176,25 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
> else if (sdata->vif.type == NL80211_IFTYPE_STATION)
> sdata->u.mgd.flags |=
> IEEE80211_STA_AUTO_CHANNEL_SEL;
> - return 0;
> + ret = 0;
> } else
> - return ieee80211_set_freq(sdata,
> + ret = ieee80211_set_freq(sdata,
> ieee80211_channel_to_frequency(freq->m));
> } else {
> int i, div = 1000000;
> for (i = 0; i < freq->e; i++)
> div /= 10;
> if (div > 0)
> - return ieee80211_set_freq(sdata, freq->m / div);
> + ret = ieee80211_set_freq(sdata, freq->m / div);
> else
> - return -EINVAL;
> + ret = -EINVAL;
> }
> +
> + list_for_each_entry(nsdata, &local->interfaces, list) {
> + ieee80211_commit(nsdata);
> + }
dito.
> +
> + return ret;
> }
>
>
>
--
Greetings, Michael.
next prev parent reply other threads:[~2009-02-27 14:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-26 23:43 [PATCH v2] mac80211: Call commit() on channel setting Alina Friedrichsen
2009-02-27 14:03 ` Michael Buesch [this message]
2009-02-27 15:35 ` Alina Friedrichsen
2009-02-27 15:39 ` Alina Friedrichsen
[not found] ` <20090227153418.254900@gmx.net>
2009-02-27 16:14 ` Michael Buesch
2009-02-27 17:16 ` Alina Friedrichsen
2009-02-27 18:25 ` [PATCH v3] " Alina Friedrichsen
2009-02-27 16:20 ` [PATCH v2] " Johannes Berg
2009-02-27 21:26 ` Alina Friedrichsen
2009-02-27 21:35 ` 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=200902271503.13308.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=x-alina@gmx.net \
/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).