* Re: ath5k: controlling powersave with iw or iwconfig fails
From: Bob Copeland @ 2011-10-20 14:29 UTC (permalink / raw)
To: Mohammed Shafi
Cc: sedat.dilek, Joerg Pommnitz, linux-wireless@vger.kernel.org,
ath5k-users@lists.ath5k.org
In-Reply-To: <CAD2nsn3zkAgCf=_Y1CUt0X1qw7py4oEJ5sqaod_KYJxo68G1nQ@mail.gmail.com>
On Thu, Oct 20, 2011 at 7:46 AM, Mohammed Shafi
<shafi.wireless@gmail.com> wrote:
> On Thu, Oct 20, 2011 at 5:03 PM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
>> Which iw version?
>
> looks like its ath5k does not supports station power save.
Yes, that is the reason.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH] mac80211: Fix off-channel problem in work task.
From: Stanislaw Gruszka @ 2011-10-20 14:58 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless, Eliad Peller, Johannes Berg
In-Reply-To: <1319049876-16243-1-git-send-email-greearb@candelatech.com>
On Wed, Oct 19, 2011 at 11:44:36AM -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> The ieee80211_cfg_on_oper_channel method compared the
> current hardware config as well as the desired hardware
> config. In most cases, this is proper, but when deciding
> whether to go back on-channel, if the hardware is not
> configured on-channel, but logically it *should* be
> on-channel, then we must go on-channel.
>
> This patch adds a flag to the ieee80211_cfg_on_oper_channel
> logic to disable comparing the actual hardware so we do not
> have to create another tricky method with similar logic.
>
> Reported-by: Eliad Peller <eliad@wizery.com>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
I much more prefer previous one-line patch from Eliad
http://news.gmane.org/find-root.php?message_id=%3c1311607763%2d12603%2d3%2dgit%2dsend%2demail%2deliad%40wizery.com%3e
this one seems to provide unneeded code complexity, but
behaviour i.e. number of channel switches in hardware
is the same.
Stanislaw
> ---
>
> NOTE: This is tricky stuff, please do not apply until at
> least Johannes gets time to review this.
>
> :100644 100644 4c3d1f5... 40ca484... M net/mac80211/ieee80211_i.h
> :100644 100644 d4ee6d2... 3ead637... M net/mac80211/main.c
> :100644 100644 397343a... d1b6b29... M net/mac80211/scan.c
> :100644 100644 bf5be22... 62a3357... M net/mac80211/work.c
> net/mac80211/ieee80211_i.h | 3 ++-
> net/mac80211/main.c | 13 ++++++++-----
> net/mac80211/scan.c | 10 +++++-----
> net/mac80211/work.c | 11 +++++++----
> 4 files changed, 22 insertions(+), 15 deletions(-)
>
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index 4c3d1f5..40ca484 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -1139,7 +1139,8 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
> void ieee80211_sched_scan_stopped_work(struct work_struct *work);
>
> /* off-channel helpers */
> -bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local);
> +bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local,
> + bool check_current_hw_cfg);
> void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local,
> bool tell_ap);
> void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
> index d4ee6d2..3ead637 100644
> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -94,11 +94,13 @@ static void ieee80211_reconfig_filter(struct work_struct *work)
>
> /*
> * Returns true if we are logically configured to be on
> - * the operating channel AND the hardware-conf is currently
> - * configured on the operating channel. Compares channel-type
> + * the operating channel and channel-type.
> + * If the check_current_hw_cfg argument is TRUE,
> + * the currently configured hardware value is checked
> * as well.
> */
> -bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
> +bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local,
> + bool check_current_hw_cfg)
> {
> struct ieee80211_channel *chan, *scan_chan;
> enum nl80211_channel_type channel_type;
> @@ -126,8 +128,9 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
> return false;
>
> /* Check current hardware-config against oper_channel. */
> - if ((local->oper_channel != local->hw.conf.channel) ||
> - (local->_oper_channel_type != local->hw.conf.channel_type))
> + if (check_current_hw_cfg &&
> + ((local->oper_channel != local->hw.conf.channel) ||
> + (local->_oper_channel_type != local->hw.conf.channel_type)))
> return false;
>
> return true;
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index 397343a..d1b6b29 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -216,7 +216,7 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
> * current channel, pass the pkt on up the stack so that
> * the rest of the stack can make use of it.
> */
> - if (ieee80211_cfg_on_oper_channel(sdata->local)
> + if (ieee80211_cfg_on_oper_channel(sdata->local, true)
> && (channel == sdata->local->oper_channel))
> return RX_CONTINUE;
>
> @@ -297,7 +297,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
> local->scanning = 0;
> local->scan_channel = NULL;
>
> - on_oper_chan = ieee80211_cfg_on_oper_channel(local);
> + on_oper_chan = ieee80211_cfg_on_oper_channel(local, true);
>
> if (was_hw_scan || !on_oper_chan)
> ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
> @@ -309,7 +309,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
> bool on_oper_chan2;
> ieee80211_configure_filter(local);
> drv_sw_scan_complete(local);
> - on_oper_chan2 = ieee80211_cfg_on_oper_channel(local);
> + on_oper_chan2 = ieee80211_cfg_on_oper_channel(local, true);
> /* We should always be on-channel at this point. */
> WARN_ON(!on_oper_chan2);
> if (on_oper_chan2 && (on_oper_chan != on_oper_chan2))
> @@ -509,7 +509,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
>
> next_chan = local->scan_req->channels[local->scan_channel_idx];
>
> - if (ieee80211_cfg_on_oper_channel(local)) {
> + if (ieee80211_cfg_on_oper_channel(local, true)) {
> /* We're currently on operating channel. */
> if (next_chan == local->oper_channel)
> /* We don't need to move off of operating channel. */
> @@ -587,7 +587,7 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca
> {
> /* switch back to the operating channel */
> local->scan_channel = NULL;
> - if (!ieee80211_cfg_on_oper_channel(local))
> + if (!ieee80211_cfg_on_oper_channel(local, true))
> ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
>
> /*
> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
> index bf5be22..62a3357 100644
> --- a/net/mac80211/work.c
> +++ b/net/mac80211/work.c
> @@ -973,7 +973,8 @@ static void ieee80211_work_work(struct work_struct *work)
> bool tmp_chan_changed = false;
> bool on_oper_chan2;
> enum nl80211_channel_type wk_ct;
> - on_oper_chan = ieee80211_cfg_on_oper_channel(local);
> + on_oper_chan = ieee80211_cfg_on_oper_channel(local,
> + true);
>
> /* Work with existing channel type if possible. */
> wk_ct = wk->chan_type;
> @@ -993,7 +994,8 @@ static void ieee80211_work_work(struct work_struct *work)
> * happen to be on the same channel as
> * the requested channel.
> */
> - on_oper_chan2 = ieee80211_cfg_on_oper_channel(local);
> + on_oper_chan2 = ieee80211_cfg_on_oper_channel(local,
> + true);
> if (on_oper_chan != on_oper_chan2) {
> if (on_oper_chan2) {
> /* going off oper channel, PS too */
> @@ -1091,7 +1093,7 @@ static void ieee80211_work_work(struct work_struct *work)
> }
>
> if (!remain_off_channel && local->tmp_channel) {
> - bool on_oper_chan = ieee80211_cfg_on_oper_channel(local);
> + bool on_oper_chan = ieee80211_cfg_on_oper_channel(local, true);
> local->tmp_channel = NULL;
> /* If tmp_channel wasn't operating channel, then
> * we need to go back on-channel.
> @@ -1101,7 +1103,8 @@ static void ieee80211_work_work(struct work_struct *work)
> * we still need to do a hardware config. Currently,
> * we cannot be here while scanning, however.
> */
> - if (ieee80211_cfg_on_oper_channel(local) && !on_oper_chan)
> + if (ieee80211_cfg_on_oper_channel(local, false) &&
> + !on_oper_chan)
> ieee80211_hw_config(local, 0);
>
> /* At the least, we need to disable offchannel_ps,
> --
> 1.7.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] mac80211: Fix off-channel problem in work task.
From: Ben Greear @ 2011-10-20 15:22 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-wireless, Eliad Peller, Johannes Berg
In-Reply-To: <20111020145852.GB2293@redhat.com>
On 10/20/2011 07:58 AM, Stanislaw Gruszka wrote:
> On Wed, Oct 19, 2011 at 11:44:36AM -0700, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> The ieee80211_cfg_on_oper_channel method compared the
>> current hardware config as well as the desired hardware
>> config. In most cases, this is proper, but when deciding
>> whether to go back on-channel, if the hardware is not
>> configured on-channel, but logically it *should* be
>> on-channel, then we must go on-channel.
>>
>> This patch adds a flag to the ieee80211_cfg_on_oper_channel
>> logic to disable comparing the actual hardware so we do not
>> have to create another tricky method with similar logic.
>>
>> Reported-by: Eliad Peller<eliad@wizery.com>
>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>
> I much more prefer previous one-line patch from Eliad
> http://news.gmane.org/find-root.php?message_id=%3c1311607763%2d12603%2d3%2dgit%2dsend%2demail%2deliad%40wizery.com%3e
>
> this one seems to provide unneeded code complexity, but
> behaviour i.e. number of channel switches in hardware
> is the same.
I believe it's possible to set tmp_channel to NULL and not actually
change the on/off channel configuration, and my patch should allow us to
skip a hardware config in that case.
However, this might only be possible if we are in this code while
scanning, and currently, I don't believe we can be in this work
code while scanning.
So, his patch is probably good enough for now, and if the scanning change
ever happens, we can do something more like what I have.
Thanks,
Ben
>
> Stanislaw
>
>> ---
>>
>> NOTE: This is tricky stuff, please do not apply until at
>> least Johannes gets time to review this.
>>
>> :100644 100644 4c3d1f5... 40ca484... M net/mac80211/ieee80211_i.h
>> :100644 100644 d4ee6d2... 3ead637... M net/mac80211/main.c
>> :100644 100644 397343a... d1b6b29... M net/mac80211/scan.c
>> :100644 100644 bf5be22... 62a3357... M net/mac80211/work.c
>> net/mac80211/ieee80211_i.h | 3 ++-
>> net/mac80211/main.c | 13 ++++++++-----
>> net/mac80211/scan.c | 10 +++++-----
>> net/mac80211/work.c | 11 +++++++----
>> 4 files changed, 22 insertions(+), 15 deletions(-)
>>
>> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
>> index 4c3d1f5..40ca484 100644
>> --- a/net/mac80211/ieee80211_i.h
>> +++ b/net/mac80211/ieee80211_i.h
>> @@ -1139,7 +1139,8 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
>> void ieee80211_sched_scan_stopped_work(struct work_struct *work);
>>
>> /* off-channel helpers */
>> -bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local);
>> +bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local,
>> + bool check_current_hw_cfg);
>> void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local,
>> bool tell_ap);
>> void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
>> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
>> index d4ee6d2..3ead637 100644
>> --- a/net/mac80211/main.c
>> +++ b/net/mac80211/main.c
>> @@ -94,11 +94,13 @@ static void ieee80211_reconfig_filter(struct work_struct *work)
>>
>> /*
>> * Returns true if we are logically configured to be on
>> - * the operating channel AND the hardware-conf is currently
>> - * configured on the operating channel. Compares channel-type
>> + * the operating channel and channel-type.
>> + * If the check_current_hw_cfg argument is TRUE,
>> + * the currently configured hardware value is checked
>> * as well.
>> */
>> -bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
>> +bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local,
>> + bool check_current_hw_cfg)
>> {
>> struct ieee80211_channel *chan, *scan_chan;
>> enum nl80211_channel_type channel_type;
>> @@ -126,8 +128,9 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
>> return false;
>>
>> /* Check current hardware-config against oper_channel. */
>> - if ((local->oper_channel != local->hw.conf.channel) ||
>> - (local->_oper_channel_type != local->hw.conf.channel_type))
>> + if (check_current_hw_cfg&&
>> + ((local->oper_channel != local->hw.conf.channel) ||
>> + (local->_oper_channel_type != local->hw.conf.channel_type)))
>> return false;
>>
>> return true;
>> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
>> index 397343a..d1b6b29 100644
>> --- a/net/mac80211/scan.c
>> +++ b/net/mac80211/scan.c
>> @@ -216,7 +216,7 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
>> * current channel, pass the pkt on up the stack so that
>> * the rest of the stack can make use of it.
>> */
>> - if (ieee80211_cfg_on_oper_channel(sdata->local)
>> + if (ieee80211_cfg_on_oper_channel(sdata->local, true)
>> && (channel == sdata->local->oper_channel))
>> return RX_CONTINUE;
>>
>> @@ -297,7 +297,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
>> local->scanning = 0;
>> local->scan_channel = NULL;
>>
>> - on_oper_chan = ieee80211_cfg_on_oper_channel(local);
>> + on_oper_chan = ieee80211_cfg_on_oper_channel(local, true);
>>
>> if (was_hw_scan || !on_oper_chan)
>> ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
>> @@ -309,7 +309,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
>> bool on_oper_chan2;
>> ieee80211_configure_filter(local);
>> drv_sw_scan_complete(local);
>> - on_oper_chan2 = ieee80211_cfg_on_oper_channel(local);
>> + on_oper_chan2 = ieee80211_cfg_on_oper_channel(local, true);
>> /* We should always be on-channel at this point. */
>> WARN_ON(!on_oper_chan2);
>> if (on_oper_chan2&& (on_oper_chan != on_oper_chan2))
>> @@ -509,7 +509,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
>>
>> next_chan = local->scan_req->channels[local->scan_channel_idx];
>>
>> - if (ieee80211_cfg_on_oper_channel(local)) {
>> + if (ieee80211_cfg_on_oper_channel(local, true)) {
>> /* We're currently on operating channel. */
>> if (next_chan == local->oper_channel)
>> /* We don't need to move off of operating channel. */
>> @@ -587,7 +587,7 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca
>> {
>> /* switch back to the operating channel */
>> local->scan_channel = NULL;
>> - if (!ieee80211_cfg_on_oper_channel(local))
>> + if (!ieee80211_cfg_on_oper_channel(local, true))
>> ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
>>
>> /*
>> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
>> index bf5be22..62a3357 100644
>> --- a/net/mac80211/work.c
>> +++ b/net/mac80211/work.c
>> @@ -973,7 +973,8 @@ static void ieee80211_work_work(struct work_struct *work)
>> bool tmp_chan_changed = false;
>> bool on_oper_chan2;
>> enum nl80211_channel_type wk_ct;
>> - on_oper_chan = ieee80211_cfg_on_oper_channel(local);
>> + on_oper_chan = ieee80211_cfg_on_oper_channel(local,
>> + true);
>>
>> /* Work with existing channel type if possible. */
>> wk_ct = wk->chan_type;
>> @@ -993,7 +994,8 @@ static void ieee80211_work_work(struct work_struct *work)
>> * happen to be on the same channel as
>> * the requested channel.
>> */
>> - on_oper_chan2 = ieee80211_cfg_on_oper_channel(local);
>> + on_oper_chan2 = ieee80211_cfg_on_oper_channel(local,
>> + true);
>> if (on_oper_chan != on_oper_chan2) {
>> if (on_oper_chan2) {
>> /* going off oper channel, PS too */
>> @@ -1091,7 +1093,7 @@ static void ieee80211_work_work(struct work_struct *work)
>> }
>>
>> if (!remain_off_channel&& local->tmp_channel) {
>> - bool on_oper_chan = ieee80211_cfg_on_oper_channel(local);
>> + bool on_oper_chan = ieee80211_cfg_on_oper_channel(local, true);
>> local->tmp_channel = NULL;
>> /* If tmp_channel wasn't operating channel, then
>> * we need to go back on-channel.
>> @@ -1101,7 +1103,8 @@ static void ieee80211_work_work(struct work_struct *work)
>> * we still need to do a hardware config. Currently,
>> * we cannot be here while scanning, however.
>> */
>> - if (ieee80211_cfg_on_oper_channel(local)&& !on_oper_chan)
>> + if (ieee80211_cfg_on_oper_channel(local, false)&&
>> + !on_oper_chan)
>> ieee80211_hw_config(local, 0);
>>
>> /* At the least, we need to disable offchannel_ps,
>> --
>> 1.7.3.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH] mac80211: Fix off-channel problem in work task.
From: Stanislaw Gruszka @ 2011-10-20 16:09 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless, Eliad Peller, Johannes Berg
In-Reply-To: <4EA03CCF.6090604@candelatech.com>
On Thu, Oct 20, 2011 at 08:22:55AM -0700, Ben Greear wrote:
> On 10/20/2011 07:58 AM, Stanislaw Gruszka wrote:
> >On Wed, Oct 19, 2011 at 11:44:36AM -0700, greearb@candelatech.com wrote:
> >>From: Ben Greear<greearb@candelatech.com>
> >>
> >>The ieee80211_cfg_on_oper_channel method compared the
> >>current hardware config as well as the desired hardware
> >>config. In most cases, this is proper, but when deciding
> >>whether to go back on-channel, if the hardware is not
> >>configured on-channel, but logically it *should* be
> >>on-channel, then we must go on-channel.
> >>
> >>This patch adds a flag to the ieee80211_cfg_on_oper_channel
> >>logic to disable comparing the actual hardware so we do not
> >>have to create another tricky method with similar logic.
> >>
> >>Reported-by: Eliad Peller<eliad@wizery.com>
> >>Signed-off-by: Ben Greear<greearb@candelatech.com>
> >
> >I much more prefer previous one-line patch from Eliad
> >http://news.gmane.org/find-root.php?message_id=%3c1311607763%2d12603%2d3%2dgit%2dsend%2demail%2deliad%40wizery.com%3e
> >
> >this one seems to provide unneeded code complexity, but
> >behaviour i.e. number of channel switches in hardware
> >is the same.
>
> I believe it's possible to set tmp_channel to NULL and not actually
> change the on/off channel configuration, and my patch should allow us to
> skip a hardware config in that case.
>
> However, this might only be possible if we are in this code while
> scanning, and currently, I don't believe we can be in this work
> code while scanning.
So you want to optimize a case that is not even possible at present.
Do you know that "premature optimization is the root of all evil" ? :-)
I'm not quite against by that change, but I would like to have -stable
fixes, since bug we are talking about not only annoys people by warning,
but also disallow to associate to wireless network. I prefer that we
apply Eliad patches and cc -stable and do possible further optimization
on top of that (ideally if some measurement will be available that show
optimization really works).
Thanks
Stanislaw
^ permalink raw reply
* Re: [PATCH] mac80211: Fix off-channel problem in work task.
From: Ben Greear @ 2011-10-20 16:12 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-wireless, Eliad Peller, Johannes Berg
In-Reply-To: <20111020160859.GC2293@redhat.com>
On 10/20/2011 09:09 AM, Stanislaw Gruszka wrote:
> On Thu, Oct 20, 2011 at 08:22:55AM -0700, Ben Greear wrote:
>> On 10/20/2011 07:58 AM, Stanislaw Gruszka wrote:
>>> On Wed, Oct 19, 2011 at 11:44:36AM -0700, greearb@candelatech.com wrote:
>>>> From: Ben Greear<greearb@candelatech.com>
>>>>
>>>> The ieee80211_cfg_on_oper_channel method compared the
>>>> current hardware config as well as the desired hardware
>>>> config. In most cases, this is proper, but when deciding
>>>> whether to go back on-channel, if the hardware is not
>>>> configured on-channel, but logically it *should* be
>>>> on-channel, then we must go on-channel.
>>>>
>>>> This patch adds a flag to the ieee80211_cfg_on_oper_channel
>>>> logic to disable comparing the actual hardware so we do not
>>>> have to create another tricky method with similar logic.
>>>>
>>>> Reported-by: Eliad Peller<eliad@wizery.com>
>>>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>>>
>>> I much more prefer previous one-line patch from Eliad
>>> http://news.gmane.org/find-root.php?message_id=%3c1311607763%2d12603%2d3%2dgit%2dsend%2demail%2deliad%40wizery.com%3e
>>>
>>> this one seems to provide unneeded code complexity, but
>>> behaviour i.e. number of channel switches in hardware
>>> is the same.
>>
>> I believe it's possible to set tmp_channel to NULL and not actually
>> change the on/off channel configuration, and my patch should allow us to
>> skip a hardware config in that case.
>>
>> However, this might only be possible if we are in this code while
>> scanning, and currently, I don't believe we can be in this work
>> code while scanning.
>
> So you want to optimize a case that is not even possible at present.
> Do you know that "premature optimization is the root of all evil" ? :-)
I was trying to clean out some of the sloppiness in the on/off channel
logic, but in this case, I don't think the extra parania helped much,
and my attempt at cleverness obviously introduced some bugs...
> I'm not quite against by that change, but I would like to have -stable
> fixes, since bug we are talking about not only annoys people by warning,
> but also disallow to associate to wireless network. I prefer that we
> apply Eliad patches and cc -stable and do possible further optimization
> on top of that (ideally if some measurement will be available that show
> optimization really works).
That is fine with me.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [RFC 1/2] mac80211: fix remain_off_channel regression
From: Eliad Peller @ 2011-10-20 16:47 UTC (permalink / raw)
To: Ben Greear; +Cc: Johannes Berg, linux-wireless, John W. Linville
In-Reply-To: <4E9F110A.5000608@candelatech.com>
hi Ben,
On Wed, Oct 19, 2011 at 8:03 PM, Ben Greear <greearb@candelatech.com> wrote:
> On 07/25/2011 08:29 AM, Eliad Peller wrote:
>>
>> i'm not familiar enough with the off_channel flow,
>> but this one looks completely broken - we should
>> remain_off_channel if the work was started, and
>> the work's channel and channel_type are the same
>> as local->tmp_channel and local->tmp_channel_type.
>>
>> however, if wk->chan_type and local->tmp_channel_type
>> coexist (e.g. have the same channel type), we won't
>> remain_off_channel.
>>
>> this behavior was introduced by commit da2fd1f
>> ("mac80211: Allow work items to use existing
>> channel type.")
>>
>> Signed-off-by: Eliad Peller<eliad@wizery.com>
>
> Both Johannes and I agreed with this patch shortly after it
> was posted, and I have just done a quick test with multiple
> stations and it appears to work fine.
>
> Eliad: Please re-send this patch w/out the RFC, and you
> can add:
>
> Tested-by: Ben Greear <greearb@candelatech.com>
>
it seems that i forgot to resubmit the RFCs as patches.
thanks for testing, i'll submit them shortly.
(John - i see there is some ongoing discussion regarding similar
patches, so feel free to take only some of them, according to the
conclusion)
Eliad.
^ permalink raw reply
* Re: [PATCH 4/6] mac80211: allow frame aggregation for mesh
From: Thomas Pedersen @ 2011-10-20 16:48 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, anagar6, devel, johannes, linville
In-Reply-To: <201110201146.00505.chunkeey@googlemail.com>
On Thu, Oct 20, 2011 at 2:46 AM, Christian Lamparter
<chunkeey@googlemail.com> wrote:
> On Thursday, October 20, 2011 03:03:24 AM Thomas Pedersen wrote:
>> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
>> Signed-off-by: Ashok Nagarajan <anagar6@uic.edu>
>> ---
>> net/mac80211/agg-rx.c | 3 ++-
>> net/mac80211/agg-tx.c | 4 +++-
>> net/mac80211/ht.c | 3 ++-
>> net/mac80211/rx.c | 1 +
>> 4 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
>> index 2ac0339..36c2836 100644
>> --- a/net/mac80211/agg-tx.c
>> +++ b/net/mac80211/agg-tx.c
>> @@ -378,6 +379,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
>> * by drivers or the standard.
>> */
>> if (sdata->vif.type != NL80211_IFTYPE_STATION &&
>> + sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
>> sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
>> sdata->vif.type != NL80211_IFTYPE_AP)
>> return -EINVAL;
>
> just a nitpick, but it looks like the comment in agg-tx.c
> seems to be a little out of date. Hence, would you mind
> removing it as well?
>
No problem :)
> /*
> * The aggregation code is not prepared to handle
> * anything but STA/AP due to the BSSID handling.
> * IBSS could work in the code but isn't supported
> * by drivers or the standard.
> */
> if (sdata->vif.type != NL80211_IFTYPE_STATION &&
> sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
> sdata->vif.type != NL80211_IFTYPE_AP)
> return -EINVAL;
>
> Regards,
> Chr
>
^ permalink raw reply
* [PATCH 1/2] mac80211: fix remain_off_channel regression
From: Eliad Peller @ 2011-10-20 17:05 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
The offchannel code is currently broken - we should
remain_off_channel if the work was started, and
the work's channel and channel_type are the same
as local->tmp_channel and local->tmp_channel_type.
However, if wk->chan_type and local->tmp_channel_type
coexist (e.g. have the same channel type), we won't
remain_off_channel.
This behavior was introduced by commit da2fd1f
("mac80211: Allow work items to use existing
channel type.")
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
net/mac80211/work.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index af374fa..b4de5dc 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -1084,8 +1084,8 @@ static void ieee80211_work_work(struct work_struct *work)
continue;
if (wk->chan != local->tmp_channel)
continue;
- if (ieee80211_work_ct_coexists(wk->chan_type,
- local->tmp_channel_type))
+ if (!ieee80211_work_ct_coexists(wk->chan_type,
+ local->tmp_channel_type))
continue;
remain_off_channel = true;
}
--
1.7.6.401.g6a319
^ permalink raw reply related
* [PATCH 2/2] mac80211: config hw when going back on-channel
From: Eliad Peller @ 2011-10-20 17:05 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1319130350-15514-1-git-send-email-eliad@wizery.com>
When going back on-channel, we should reconfigure
the hw iff the hardware is not already configured
to the operational channel.
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
net/mac80211/work.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index b4de5dc..92ad8d6 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -1091,7 +1091,6 @@ static void ieee80211_work_work(struct work_struct *work)
}
if (!remain_off_channel && local->tmp_channel) {
- bool on_oper_chan = ieee80211_cfg_on_oper_channel(local);
local->tmp_channel = NULL;
/* If tmp_channel wasn't operating channel, then
* we need to go back on-channel.
@@ -1101,7 +1100,7 @@ static void ieee80211_work_work(struct work_struct *work)
* we still need to do a hardware config. Currently,
* we cannot be here while scanning, however.
*/
- if (ieee80211_cfg_on_oper_channel(local) && !on_oper_chan)
+ if (!ieee80211_cfg_on_oper_channel(local))
ieee80211_hw_config(local, 0);
/* At the least, we need to disable offchannel_ps,
--
1.7.6.401.g6a319
^ permalink raw reply related
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Thomas Pedersen @ 2011-10-20 17:41 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <1319109412.3959.7.camel@jlt3.sipsolutions.net>
On Thu, Oct 20, 2011 at 4:16 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Wed, 2011-10-19 at 18:03 -0700, Thomas Pedersen wrote:
>> Include the WMM IE in mesh peering and beacon frames. This is needed
>> tell any potential peers what our WMM / EDCA parameters are.
>
> The goal seems fine but why bother building the WMM IE out of the actual
> TX queue configuration? Shouldn't it normally be the other way around?
> But I have no idea how QoS is supposed to work in a mesh...
I'm not sure what you mean, this is the only way to get the WMM
parameters? Usually these are just set with ieee80211_set_wmm_defaul()
on bringing up the interface.
Thomas
^ permalink raw reply
* Re: [PATCH 2/3] mac80211: find correct IE offset in mesh beacons
From: Thomas Pedersen @ 2011-10-20 17:48 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linville
In-Reply-To: <1319109210.3959.6.camel@jlt3.sipsolutions.net>
On Thu, Oct 20, 2011 at 4:13 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
>
>> - baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
>> + switch (stype) {
>> + case IEEE80211_STYPE_PROBE_RESP:
>> + ies = (u8 *) mgmt->u.probe_resp.variable;
>> + break;
>> + case IEEE80211_STYPE_BEACON:
>> + ies = (u8 *) mgmt->u.beacon.variable;
>> + break;
>> + default:
>> + return;
>> + }
>> +
>
> Does that really make sense? the offset is the same anyway and we don't
> get here with other frames.
I don't think so:
struct {
__le64 timestamp;
__le16 beacon_int;
__le16 capab_info;
/* followed by some of SSID, Supported rates,
* FH Params, DS Params, CF Params, IBSS Params, TIM */
u8 variable[0];
} __attribute__ ((packed)) beacon;
struct {
/* only variable items: SSID, Supported rates */
u8 variable[0];
} __attribute__ ((packed)) probe_req;
True, we don't currently get probe responses in a mesh, but the
function _is_ named "_rx_bcn_presp" so we should be ready to handle
these in the future. Previously we always getting the wrong offset.
Thomas
^ permalink raw reply
* Re: [PATCH 2/3] mac80211: find correct IE offset in mesh beacons
From: Johannes Berg @ 2011-10-20 17:51 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, linville
In-Reply-To: <CAG6hwVOVHSN_-vfvVNQsGrZZtipArNs9UoPQb-gy1ZhC0owC=w@mail.gmail.com>
On Thu, 2011-10-20 at 10:48 -0700, Thomas Pedersen wrote:
> On Thu, Oct 20, 2011 at 4:13 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> >
> >> - baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
> >> + switch (stype) {
> >> + case IEEE80211_STYPE_PROBE_RESP:
> >> + ies = (u8 *) mgmt->u.probe_resp.variable;
> >> + break;
> >> + case IEEE80211_STYPE_BEACON:
> >> + ies = (u8 *) mgmt->u.beacon.variable;
> >> + break;
> >> + default:
> >> + return;
> >> + }
> >> +
> >
> > Does that really make sense? the offset is the same anyway and we don't
> > get here with other frames.
>
> I don't think so:
>
> struct {
> __le64 timestamp;
> __le16 beacon_int;
> __le16 capab_info;
> /* followed by some of SSID, Supported rates,
> * FH Params, DS Params, CF Params, IBSS Params, TIM */
> u8 variable[0];
> } __attribute__ ((packed)) beacon;
> struct {
> /* only variable items: SSID, Supported rates */
> u8 variable[0];
> } __attribute__ ((packed)) probe_req;
Err, probe_req != probe_resp.
johannes
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Johannes Berg @ 2011-10-20 17:51 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <CAG6hwVMUhJ=nV=6N+DpoagKWJxMjythPYMYCCzEb=mTr6TfytQ@mail.gmail.com>
On Thu, 2011-10-20 at 10:41 -0700, Thomas Pedersen wrote:
> On Thu, Oct 20, 2011 at 4:16 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Wed, 2011-10-19 at 18:03 -0700, Thomas Pedersen wrote:
> >> Include the WMM IE in mesh peering and beacon frames. This is needed
> >> tell any potential peers what our WMM / EDCA parameters are.
> >
> > The goal seems fine but why bother building the WMM IE out of the actual
> > TX queue configuration? Shouldn't it normally be the other way around?
> > But I have no idea how QoS is supposed to work in a mesh...
>
> I'm not sure what you mean, this is the only way to get the WMM
> parameters? Usually these are just set with ieee80211_set_wmm_defaul()
> on bringing up the interface.
Right, but
a) if you're using just the default, no need to derive from the default
b) should they be changeable?
johannes
^ permalink raw reply
* Re: [PATCH 2/3] mac80211: find correct IE offset in mesh beacons
From: Thomas Pedersen @ 2011-10-20 17:53 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linville
In-Reply-To: <1319133075.17101.4.camel@jlt3.sipsolutions.net>
On Thu, Oct 20, 2011 at 10:51 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2011-10-20 at 10:48 -0700, Thomas Pedersen wrote:
>> On Thu, Oct 20, 2011 at 4:13 AM, Johannes Berg
>> <johannes@sipsolutions.net> wrote:
>> >
>> >> - baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
>> >> + switch (stype) {
>> >> + case IEEE80211_STYPE_PROBE_RESP:
>> >> + ies = (u8 *) mgmt->u.probe_resp.variable;
>> >> + break;
>> >> + case IEEE80211_STYPE_BEACON:
>> >> + ies = (u8 *) mgmt->u.beacon.variable;
>> >> + break;
>> >> + default:
>> >> + return;
>> >> + }
>> >> +
>> >
>> > Does that really make sense? the offset is the same anyway and we don't
>> > get here with other frames.
>>
>> I don't think so:
>>
>> struct {
>> __le64 timestamp;
>> __le16 beacon_int;
>> __le16 capab_info;
>> /* followed by some of SSID, Supported rates,
>> * FH Params, DS Params, CF Params, IBSS Params, TIM */
>> u8 variable[0];
>> } __attribute__ ((packed)) beacon;
>> struct {
>> /* only variable items: SSID, Supported rates */
>> u8 variable[0];
>> } __attribute__ ((packed)) probe_req;
>
> Err, probe_req != probe_resp.
Wow, I need glasses. In that case, I'll drop this patch and resubmit.
Thanks!
Thomas
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Thomas Pedersen @ 2011-10-20 17:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <1319133104.17101.5.camel@jlt3.sipsolutions.net>
On Thu, Oct 20, 2011 at 10:51 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2011-10-20 at 10:41 -0700, Thomas Pedersen wrote:
>> On Thu, Oct 20, 2011 at 4:16 AM, Johannes Berg
>> <johannes@sipsolutions.net> wrote:
>> > On Wed, 2011-10-19 at 18:03 -0700, Thomas Pedersen wrote:
>> >> Include the WMM IE in mesh peering and beacon frames. This is needed
>> >> tell any potential peers what our WMM / EDCA parameters are.
>> >
>> > The goal seems fine but why bother building the WMM IE out of the actual
>> > TX queue configuration? Shouldn't it normally be the other way around?
>> > But I have no idea how QoS is supposed to work in a mesh...
>>
>> I'm not sure what you mean, this is the only way to get the WMM
>> parameters? Usually these are just set with ieee80211_set_wmm_defaul()
>> on bringing up the interface.
>
> Right, but
> a) if you're using just the default, no need to derive from the default
The user might wish to customize the queue parameters though.
> b) should they be changeable?
Why not?
Thomas
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Johannes Berg @ 2011-10-20 18:03 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <CAG6hwVMmvu5jMQLeOWG2via0wqkHGs=nHSi_mKvgy9U2+m1FXA@mail.gmail.com>
On Thu, 2011-10-20 at 10:56 -0700, Thomas Pedersen wrote:
> >> I'm not sure what you mean, this is the only way to get the WMM
> >> parameters? Usually these are just set with ieee80211_set_wmm_defaul()
> >> on bringing up the interface.
> >
> > Right, but
> > a) if you're using just the default, no need to derive from the default
>
> The user might wish to customize the queue parameters though.
>
> > b) should they be changeable?
>
> Why not?
Well there no API for it now, is there?
johannes
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Thomas Pedersen @ 2011-10-20 18:08 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <1319133820.20837.0.camel@jlt3.sipsolutions.net>
On Thu, Oct 20, 2011 at 11:03 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2011-10-20 at 10:56 -0700, Thomas Pedersen wrote:
>
>> >> I'm not sure what you mean, this is the only way to get the WMM
>> >> parameters? Usually these are just set with ieee80211_set_wmm_defaul()
>> >> on bringing up the interface.
>> >
>> > Right, but
>> > a) if you're using just the default, no need to derive from the default
>>
>> The user might wish to customize the queue parameters though.
>>
>> > b) should they be changeable?
>>
>> Why not?
>
> Well there no API for it now, is there?
>
NL80211_ATTR_WIPHY_TXQ_PARAMS?
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Johannes Berg @ 2011-10-20 18:11 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <CAG6hwVOaLp9SdPezdw=aLhKrKpPdp8m5vXf6rySTvCfriaziVw@mail.gmail.com>
On Thu, 2011-10-20 at 11:08 -0700, Thomas Pedersen wrote:
> On Thu, Oct 20, 2011 at 11:03 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Thu, 2011-10-20 at 10:56 -0700, Thomas Pedersen wrote:
> >
> >> >> I'm not sure what you mean, this is the only way to get the WMM
> >> >> parameters? Usually these are just set with ieee80211_set_wmm_defaul()
> >> >> on bringing up the interface.
> >> >
> >> > Right, but
> >> > a) if you're using just the default, no need to derive from the default
> >>
> >> The user might wish to customize the queue parameters though.
> >>
> >> > b) should they be changeable?
> >>
> >> Why not?
> >
> > Well there no API for it now, is there?
> >
>
> NL80211_ATTR_WIPHY_TXQ_PARAMS?
Oh, hmm. Ok I guess that's allowed on mesh -- but when it changes you
won't update IEs?
johannes
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Thomas Pedersen @ 2011-10-20 18:14 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <1319134298.20837.1.camel@jlt3.sipsolutions.net>
On Thu, Oct 20, 2011 at 11:11 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2011-10-20 at 11:08 -0700, Thomas Pedersen wrote:
>> On Thu, Oct 20, 2011 at 11:03 AM, Johannes Berg
>> <johannes@sipsolutions.net> wrote:
>> > On Thu, 2011-10-20 at 10:56 -0700, Thomas Pedersen wrote:
>> >
>> >> >> I'm not sure what you mean, this is the only way to get the WMM
>> >> >> parameters? Usually these are just set with ieee80211_set_wmm_defaul()
>> >> >> on bringing up the interface.
>> >> >
>> >> > Right, but
>> >> > a) if you're using just the default, no need to derive from the default
>> >>
>> >> The user might wish to customize the queue parameters though.
>> >>
>> >> > b) should they be changeable?
>> >>
>> >> Why not?
>> >
>> > Well there no API for it now, is there?
>> >
>>
>> NL80211_ATTR_WIPHY_TXQ_PARAMS?
>
> Oh, hmm. Ok I guess that's allowed on mesh -- but when it changes you
> won't update IEs?
>
We reconstruct IEs on every beacon_get() (I know...), so it should be OK.
Thomas
^ permalink raw reply
* Re: [PATCH 5/6] mac80211: add WMM IE to mesh frames
From: Johannes Berg @ 2011-10-20 18:22 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, anagar6, devel, linville
In-Reply-To: <CAG6hwVNsLR0Ts1izDea8zJ8nw9FvM4c0n=nNCr0TBBQaUbkk=g@mail.gmail.com>
On Thu, 2011-10-20 at 11:14 -0700, Thomas Pedersen wrote:
> > Oh, hmm. Ok I guess that's allowed on mesh -- but when it changes you
> > won't update IEs?
> >
>
> We reconstruct IEs on every beacon_get() (I know...), so it should be OK.
Yeah I guess it's ok at least for now.
Changing the parameters while active would cause all kinds of problems
though since you don't peer if they differ?
Anyway, no big deal. Let's keep it this way.
johannes
^ permalink raw reply
* [PATCH v2 1/2] mac80211: comment allocation of mesh frames
From: Thomas Pedersen @ 2011-10-20 18:30 UTC (permalink / raw)
To: linux-wireless; +Cc: Thomas Pedersen, johannes, linville
Remove most references to magic numbers, save a few bytes and hopefully
improve readability.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/mesh_hwmp.c | 36 ++++++++++++++++++------------------
net/mac80211/mesh_plink.c | 28 +++++++++++++++++-----------
net/mac80211/tx.c | 19 +++++++++++++------
3 files changed, 48 insertions(+), 35 deletions(-)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 174040a..9a1f8bb 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -113,20 +113,20 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
- struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
+ struct sk_buff *skb;
struct ieee80211_mgmt *mgmt;
- u8 *pos;
- int ie_len;
+ u8 *pos, ie_len;
+ int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.mesh_action) +
+ sizeof(mgmt->u.action.u.mesh_action);
+ skb = dev_alloc_skb(local->hw.extra_tx_headroom +
+ hdr_len +
+ 2 + 37); /* max HWMP IE */
if (!skb)
return -1;
skb_reserve(skb, local->hw.extra_tx_headroom);
- /* 25 is the size of the common mgmt part (24) plus the size of the
- * common action part (1)
- */
- mgmt = (struct ieee80211_mgmt *)
- skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action));
- memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action));
+ mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
+ memset(mgmt, 0, hdr_len);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
@@ -240,20 +240,20 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn,
struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
- struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
+ struct sk_buff *skb;
struct ieee80211_mgmt *mgmt;
- u8 *pos;
- int ie_len;
+ u8 *pos, ie_len;
+ int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.mesh_action) +
+ sizeof(mgmt->u.action.u.mesh_action);
+ skb = dev_alloc_skb(local->hw.extra_tx_headroom +
+ hdr_len +
+ 2 + 15 /* PERR IE */);
if (!skb)
return -1;
skb_reserve(skb, local->tx_headroom + local->hw.extra_tx_headroom);
- /* 25 is the size of the common mgmt part (24) plus the size of the
- * common action part (1)
- */
- mgmt = (struct ieee80211_mgmt *)
- skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action));
- memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action));
+ mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
+ memset(mgmt, 0, hdr_len);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 7e57f5d..351e48c 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -153,23 +153,29 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
enum ieee80211_self_protected_actioncode action,
u8 *da, __le16 llid, __le16 plid, __le16 reason) {
struct ieee80211_local *local = sdata->local;
- struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 +
- sdata->u.mesh.ie_len);
+ struct sk_buff *skb;
struct ieee80211_mgmt *mgmt;
bool include_plid = false;
- int ie_len = 4;
u16 peering_proto = 0;
- u8 *pos;
-
+ u8 *pos, ie_len = 4;
+ int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.self_prot) +
+ sizeof(mgmt->u.action.u.self_prot);
+
+ skb = dev_alloc_skb(local->hw.extra_tx_headroom +
+ hdr_len +
+ 2 + /* capability info */
+ 2 + /* AID */
+ 2 + 8 + /* supported rates */
+ 2 + (IEEE80211_MAX_SUPP_RATES - 8) +
+ 2 + sdata->u.mesh.mesh_id_len +
+ 2 + sizeof(struct ieee80211_meshconf_ie) +
+ 2 + 8 + /* peering IE */
+ sdata->u.mesh.ie_len);
if (!skb)
return -1;
skb_reserve(skb, local->hw.extra_tx_headroom);
- /* 25 is the size of the common mgmt part (24) plus the size of the
- * common action part (1)
- */
- mgmt = (struct ieee80211_mgmt *)
- skb_put(skb, 25 + sizeof(mgmt->u.action.u.self_prot));
- memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.self_prot));
+ mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
+ memset(mgmt, 0, hdr_len);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
memcpy(mgmt->da, da, ETH_ALEN);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 48bbb96..f4dd339 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2278,22 +2278,29 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
} else if (ieee80211_vif_is_mesh(&sdata->vif)) {
struct ieee80211_mgmt *mgmt;
u8 *pos;
+ int hdr_len = offsetof(struct ieee80211_mgmt, u.beacon) +
+ sizeof(mgmt->u.beacon);
#ifdef CONFIG_MAC80211_MESH
if (!sdata->u.mesh.mesh_id_len)
goto out;
#endif
- /* headroom, head length, tail length and maximum TIM length */
- skb = dev_alloc_skb(local->tx_headroom + 400 +
- sdata->u.mesh.ie_len);
+ skb = dev_alloc_skb(local->tx_headroom +
+ hdr_len +
+ 2 + /* NULL SSID */
+ 2 + 8 + /* supported rates */
+ 2 + 3 + /* DS params */
+ 2 + (IEEE80211_MAX_SUPP_RATES - 8) +
+ 2 + sdata->u.mesh.mesh_id_len +
+ 2 + sizeof(struct ieee80211_meshconf_ie) +
+ sdata->u.mesh.ie_len);
if (!skb)
goto out;
skb_reserve(skb, local->hw.extra_tx_headroom);
- mgmt = (struct ieee80211_mgmt *)
- skb_put(skb, 24 + sizeof(mgmt->u.beacon));
- memset(mgmt, 0, 24 + sizeof(mgmt->u.beacon));
+ mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
+ memset(mgmt, 0, hdr_len);
mgmt->frame_control =
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON);
memset(mgmt->da, 0xff, ETH_ALEN);
--
1.7.5.4
^ permalink raw reply related
* [PATCH v2 2/2] mac80211: select queue for fwded mesh frames
From: Thomas Pedersen @ 2011-10-20 18:30 UTC (permalink / raw)
To: linux-wireless; +Cc: Thomas Pedersen, johannes, linville
In-Reply-To: <1319135408-6370-1-git-send-email-thomas@cozybit.com>
Set proper queue mapping and timestamp for forwarded mesh frames.
Thanks to Luis Rodriguez for investigating and fixing this.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
v2:
We were already doing this for mcast frames, so don't duplicate
the code.
net/mac80211/rx.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b867bd5..1408472 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1952,13 +1952,15 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
info = IEEE80211_SKB_CB(fwd_skb);
memset(info, 0, sizeof(*info));
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.jiffies = jiffies;
info->control.vif = &rx->sdata->vif;
+ skb_set_queue_mapping(fwd_skb,
+ ieee80211_select_queue(sdata, fwd_skb));
+ ieee80211_set_qos_hdr(sdata, fwd_skb);
+
if (is_multicast_ether_addr(fwd_hdr->addr1)) {
IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
fwded_mcast);
- skb_set_queue_mapping(fwd_skb,
- ieee80211_select_queue(sdata, fwd_skb));
- ieee80211_set_qos_hdr(sdata, fwd_skb);
} else {
int err;
/*
--
1.7.5.4
^ permalink raw reply related
* [PATCH v2 0/6] HT support for mesh
From: Thomas Pedersen @ 2011-10-20 18:34 UTC (permalink / raw)
To: linux-wireless; +Cc: Thomas Pedersen, johannes, linville
This patchset adds basic HT support for mesh nodes. We avoid the question of
how to negotiate channel types, by simply disallowing peering with mismatched
HT modes. Needs the mesh fixes posted earlier today for patch context.
Many thanks to Luis Rodriguez for his assistance, and Ashok Nagarajan for
co-authoring this patchset.
v2:
Remove outdated BA comments (Christian)
Alexander Simon (1):
mac80211: Add HT helper functions
Thomas Pedersen (5):
mac80211: add HT IEs to mesh frames
mac80211: set HT capabilities for mesh peer
mac80211: allow frame aggregation for mesh
mac80211: add WMM IE to mesh frames
mac80211: check mesh peer's WMM parameters
include/linux/ieee80211.h | 26 ++++++
include/net/mac80211.h | 4 +
net/mac80211/agg-rx.c | 3 +-
net/mac80211/agg-tx.c | 10 +--
net/mac80211/ht.c | 3 +-
net/mac80211/ieee80211_i.h | 8 ++
net/mac80211/mesh.c | 75 ++++++++++++++--
net/mac80211/mesh.h | 4 +
net/mac80211/mesh_plink.c | 24 +++++-
net/mac80211/rx.c | 7 +--
net/mac80211/tx.c | 6 ++
net/mac80211/util.c | 208 ++++++++++++++++++++++++++++++++++++++++----
net/mac80211/work.c | 29 +------
13 files changed, 336 insertions(+), 71 deletions(-)
--
1.7.5.4
^ permalink raw reply
* [PATCH v2 1/6] mac80211: Add HT helper functions
From: Thomas Pedersen @ 2011-10-20 18:34 UTC (permalink / raw)
To: linux-wireless; +Cc: Alexander Simon, johannes, linville
In-Reply-To: <1319135679-6740-1-git-send-email-thomas@cozybit.com>
From: Alexander Simon <an.alexsimon@googlemail.com>
Some refactoring for IBSS HT.
Move HT info and capability IEs building code into separate functions.
Add function to get the channel type from an HT info IE.
Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com>
---
net/mac80211/ieee80211_i.h | 8 +++
net/mac80211/util.c | 116 +++++++++++++++++++++++++++++++++++++------
net/mac80211/work.c | 29 +-----------
3 files changed, 108 insertions(+), 45 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 4c3d1f5..30fc9e7 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1333,6 +1333,12 @@ void ieee80211_recalc_smps(struct ieee80211_local *local);
size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
const u8 *ids, int n_ids, size_t offset);
size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
+u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_supported_band *sband,
+ u16 cap);
+u8 *ieee80211_ie_build_ht_info(u8 *pos,
+ struct ieee80211_sta_ht_cap *ht_cap,
+ struct ieee80211_channel *channel,
+ enum nl80211_channel_type channel_type);
/* internal work items */
void ieee80211_work_init(struct ieee80211_local *local);
@@ -1361,6 +1367,8 @@ ieee80211_get_channel_mode(struct ieee80211_local *local,
bool ieee80211_set_channel_type(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
enum nl80211_channel_type chantype);
+enum nl80211_channel_type
+ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info);
#ifdef CONFIG_MAC80211_NOINLINE
#define debug_noinline noinline
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 7439d26..72b3a2e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -811,23 +811,8 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
offset = noffset;
}
- if (sband->ht_cap.ht_supported) {
- u16 cap = sband->ht_cap.cap;
- __le16 tmp;
-
- *pos++ = WLAN_EID_HT_CAPABILITY;
- *pos++ = sizeof(struct ieee80211_ht_cap);
- memset(pos, 0, sizeof(struct ieee80211_ht_cap));
- tmp = cpu_to_le16(cap);
- memcpy(pos, &tmp, sizeof(u16));
- pos += sizeof(u16);
- *pos++ = sband->ht_cap.ampdu_factor |
- (sband->ht_cap.ampdu_density <<
- IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
- memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
- pos += sizeof(sband->ht_cap.mcs);
- pos += 2 + 4 + 1; /* ext info, BF cap, antsel */
- }
+ if (sband->ht_cap.ht_supported)
+ pos = ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap);
/*
* If adding more here, adjust code in main.c
@@ -1362,6 +1347,103 @@ void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif)
}
EXPORT_SYMBOL(ieee80211_disable_rssi_reports);
+u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_supported_band *sband,
+ u16 cap)
+{
+ __le16 tmp;
+
+ *pos++ = WLAN_EID_HT_CAPABILITY;
+ *pos++ = sizeof(struct ieee80211_ht_cap);
+ memset(pos, 0, sizeof(struct ieee80211_ht_cap));
+
+ /* capability flags */
+ tmp = cpu_to_le16(cap);
+ memcpy(pos, &tmp, sizeof(u16));
+ pos += sizeof(u16);
+
+ /* AMPDU parameters */
+ *pos++ = sband->ht_cap.ampdu_factor |
+ (sband->ht_cap.ampdu_density <<
+ IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
+
+ /* MCS set */
+ memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+ pos += sizeof(sband->ht_cap.mcs);
+
+ /* extended capabilities */
+ pos += sizeof(__le16);
+
+ /* BF capabilities */
+ pos += sizeof(__le32);
+
+ /* antenna selection */
+ pos += sizeof(u8);
+
+ return pos;
+}
+
+u8 *ieee80211_ie_build_ht_info(u8 *pos,
+ struct ieee80211_sta_ht_cap *ht_cap,
+ struct ieee80211_channel *channel,
+ enum nl80211_channel_type channel_type)
+{
+ struct ieee80211_ht_info *ht_info;
+ /* Build HT Information */
+ *pos++ = WLAN_EID_HT_INFORMATION;
+ *pos++ = sizeof(struct ieee80211_ht_info);
+ ht_info = (struct ieee80211_ht_info *)pos;
+ ht_info->control_chan =
+ ieee80211_frequency_to_channel(channel->center_freq);
+ switch (channel_type) {
+ case NL80211_CHAN_HT40MINUS:
+ ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+ break;
+ case NL80211_CHAN_HT40PLUS:
+ ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+ break;
+ case NL80211_CHAN_HT20:
+ default:
+ ht_info->ht_param = IEEE80211_HT_PARAM_CHA_SEC_NONE;
+ break;
+ }
+ if (ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
+ ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
+ ht_info->operation_mode = 0x0000;
+ ht_info->stbc_param = 0x0000;
+
+ /* It seems that Basic MCS set and Supported MCS set
+ are identical for the first 10 bytes */
+ memset(&ht_info->basic_set, 0, 16);
+ memcpy(&ht_info->basic_set, &ht_cap->mcs, 10);
+
+ return pos + sizeof(struct ieee80211_ht_info);
+}
+
+enum nl80211_channel_type
+ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info)
+{
+ enum nl80211_channel_type channel_type;
+
+ if (!ht_info)
+ return NL80211_CHAN_NO_HT;
+
+ switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+ case IEEE80211_HT_PARAM_CHA_SEC_NONE:
+ channel_type = NL80211_CHAN_HT20;
+ break;
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+ channel_type = NL80211_CHAN_HT40PLUS;
+ break;
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+ channel_type = NL80211_CHAN_HT40MINUS;
+ break;
+ default:
+ channel_type = NL80211_CHAN_NO_HT;
+ }
+
+ return channel_type;
+}
+
int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb)
{
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 94472eb..fab5092 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -103,7 +103,6 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
u8 *pos;
u32 flags = channel->flags;
u16 cap = sband->ht_cap.cap;
- __le16 tmp;
if (!sband->ht_cap.ht_supported)
return;
@@ -154,34 +153,8 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
}
/* reserve and fill IE */
-
pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
- *pos++ = WLAN_EID_HT_CAPABILITY;
- *pos++ = sizeof(struct ieee80211_ht_cap);
- memset(pos, 0, sizeof(struct ieee80211_ht_cap));
-
- /* capability flags */
- tmp = cpu_to_le16(cap);
- memcpy(pos, &tmp, sizeof(u16));
- pos += sizeof(u16);
-
- /* AMPDU parameters */
- *pos++ = sband->ht_cap.ampdu_factor |
- (sband->ht_cap.ampdu_density <<
- IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
-
- /* MCS set */
- memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
- pos += sizeof(sband->ht_cap.mcs);
-
- /* extended capabilities */
- pos += sizeof(__le16);
-
- /* BF capabilities */
- pos += sizeof(__le32);
-
- /* antenna selection */
- pos += sizeof(u8);
+ ieee80211_ie_build_ht_cap(pos, sband, cap);
}
static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
--
1.7.5.4
^ permalink raw reply related
* [PATCH v2 2/6] mac80211: add HT IEs to mesh frames
From: Thomas Pedersen @ 2011-10-20 18:34 UTC (permalink / raw)
To: linux-wireless; +Cc: Thomas Pedersen, johannes, linville
In-Reply-To: <1319135679-6740-1-git-send-email-thomas@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Ashok Nagarajan <anagar6@uic.edu>
---
net/mac80211/mesh.c | 43 +++++++++++++++++++++++++++++++++++++++++++
net/mac80211/mesh.h | 4 ++++
net/mac80211/mesh_plink.c | 9 +++++++++
net/mac80211/tx.c | 4 ++++
4 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index a7078fd..2dc76a9 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -341,6 +341,49 @@ int mesh_add_ds_params_ie(struct sk_buff *skb,
return 0;
}
+int mesh_add_ht_cap_ie(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_supported_band *sband;
+ u8 *pos;
+
+ sband = local->hw.wiphy->bands[local->oper_channel->band];
+ if (!sband->ht_cap.ht_supported ||
+ local->_oper_channel_type == NL80211_CHAN_NO_HT)
+ return 0;
+
+ if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap))
+ return -ENOMEM;
+
+ pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_cap));
+ ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap);
+
+ return 0;
+}
+
+int mesh_add_ht_info_ie(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_channel *channel = local->oper_channel;
+ enum nl80211_channel_type channel_type = local->_oper_channel_type;
+ struct ieee80211_supported_band *sband =
+ local->hw.wiphy->bands[channel->band];
+ struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap;
+ u8 *pos;
+
+ if (!ht_cap->ht_supported || channel_type == NL80211_CHAN_NO_HT)
+ return 0;
+
+ if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_info))
+ return -ENOMEM;
+
+ pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_info));
+ ieee80211_ie_build_ht_info(pos, ht_cap, channel, channel_type);
+
+ return 0;
+}
static void ieee80211_mesh_path_timer(unsigned long data)
{
struct ieee80211_sub_if_data *sdata =
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 8c00e2d..0f2c4e6 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -212,6 +212,10 @@ int mesh_add_vendor_ies(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata);
int mesh_add_ds_params_ie(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata);
+int mesh_add_ht_cap_ie(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata);
+int mesh_add_ht_info_ie(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata);
void mesh_rmc_free(struct ieee80211_sub_if_data *sdata);
int mesh_rmc_init(struct ieee80211_sub_if_data *sdata);
void ieee80211s_init(void);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 42a0544..bbfbd45 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -168,6 +168,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
2 + (IEEE80211_MAX_SUPP_RATES - 8) +
2 + sdata->u.mesh.mesh_id_len +
2 + sizeof(struct ieee80211_meshconf_ie) +
+ 2 + sizeof(struct ieee80211_ht_cap) +
+ 2 + sizeof(struct ieee80211_ht_info) +
2 + 8 + /* peering IE */
sdata->u.mesh.ie_len);
if (!skb)
@@ -244,6 +246,13 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
memcpy(pos, &reason, 2);
pos += 2;
}
+
+ if (action != WLAN_SP_MESH_PEERING_CLOSE) {
+ if (mesh_add_ht_cap_ie(skb, sdata) ||
+ mesh_add_ht_info_ie(skb, sdata))
+ return -1;
+ }
+
if (mesh_add_vendor_ies(skb, sdata))
return -1;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f28a920..faca189 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2290,6 +2290,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
2 + 8 + /* supported rates */
2 + 3 + /* DS params */
2 + (IEEE80211_MAX_SUPP_RATES - 8) +
+ 2 + sizeof(struct ieee80211_ht_cap) +
+ 2 + sizeof(struct ieee80211_ht_info) +
2 + sdata->u.mesh.mesh_id_len +
2 + sizeof(struct ieee80211_meshconf_ie) +
sdata->u.mesh.ie_len);
@@ -2318,6 +2320,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
mesh_add_ds_params_ie(skb, sdata) ||
ieee80211_add_ext_srates_ie(&sdata->vif, skb) ||
mesh_add_rsn_ie(skb, sdata) ||
+ mesh_add_ht_cap_ie(skb, sdata) ||
+ mesh_add_ht_info_ie(skb, sdata) ||
mesh_add_meshid_ie(skb, sdata) ||
mesh_add_meshconf_ie(skb, sdata) ||
mesh_add_vendor_ies(skb, sdata)) {
--
1.7.5.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox