linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
@ 2010-05-06 18:45 John W. Linville
  2010-05-06 22:01 ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2010-05-06 18:45 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville

Also simplify the flags assignment into a single statement at the
end of ieee80211_beacon_get_tim.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 net/mac80211/tx.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f3841f4..6bd2492 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2251,8 +2251,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 
 	info->control.vif = vif;
 
-	info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
-	info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
+	info->flags |= (IEEE80211_TX_CTL_CLEAR_PS_FILT |
+			IEEE80211_TX_CTL_ASSIGN_SEQ |
+			IEEE80211_TX_CTL_FIRST_FRAGMENT);
  out:
 	rcu_read_unlock();
 	return skb;
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
  2010-05-06 18:45 [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons John W. Linville
@ 2010-05-06 22:01 ` Luis R. Rodriguez
  2010-05-07  0:13   ` John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-05-06 22:01 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

On Thu, May 6, 2010 at 11:45 AM, John W. Linville
<linville@tuxdriver.com> wrote:

Why though?

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
  2010-05-06 22:01 ` Luis R. Rodriguez
@ 2010-05-07  0:13   ` John W. Linville
  2010-05-07  2:35     ` John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2010-05-07  0:13 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

On Thu, May 06, 2010 at 03:01:25PM -0700, Luis R. Rodriguez wrote:
> On Thu, May 6, 2010 at 11:45 AM, John W. Linville
> <linville@tuxdriver.com> wrote:
> 
> Why though?

Because it is correct, appropriate, and zero additional cost.  And
because if you use the same tx path for beacons as you use for normal
frames and if in that path you manage the sequence number in software
you should be checking that flag before bumping the sequence number.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
  2010-05-07  0:13   ` John W. Linville
@ 2010-05-07  2:35     ` John W. Linville
  2010-05-07 21:43       ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2010-05-07  2:35 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

On Thu, May 06, 2010 at 08:13:20PM -0400, John W. Linville wrote:
> On Thu, May 06, 2010 at 03:01:25PM -0700, Luis R. Rodriguez wrote:
> > On Thu, May 6, 2010 at 11:45 AM, John W. Linville
> > <linville@tuxdriver.com> wrote:
> > 
> > Why though?
> 
> Because it is correct, appropriate, and zero additional cost.  And
> because if you use the same tx path for beacons as you use for normal
> frames and if in that path you manage the sequence number in software
> you should be checking that flag before bumping the sequence number.

That isn't worded too clearly...  If you manage the sequence number
in software then you should be checking that flag before bumping
the sequence number.  If you use the same tx path for beacons as is
used for normal frames and you don't set that flag for beacons,
then beacons will reuse the sequence number from the previous frame.

Does that make sense?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
  2010-05-07  2:35     ` John W. Linville
@ 2010-05-07 21:43       ` Luis R. Rodriguez
  2010-05-07 22:04         ` John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-05-07 21:43 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

On Thu, May 6, 2010 at 7:35 PM, John W. Linville <linville@tuxdriver.com> wrote:
> On Thu, May 06, 2010 at 08:13:20PM -0400, John W. Linville wrote:
>> On Thu, May 06, 2010 at 03:01:25PM -0700, Luis R. Rodriguez wrote:
>> > On Thu, May 6, 2010 at 11:45 AM, John W. Linville
>> > <linville@tuxdriver.com> wrote:
>> >
>> > Why though?
>>
>> Because it is correct, appropriate, and zero additional cost.  And
>> because if you use the same tx path for beacons as you use for normal
>> frames and if in that path you manage the sequence number in software
>> you should be checking that flag before bumping the sequence number.
>
> That isn't worded too clearly...  If you manage the sequence number
> in software then you should be checking that flag before bumping
> the sequence number.  If you use the same tx path for beacons as is
> used for normal frames and you don't set that flag for beacons,
> then beacons will reuse the sequence number from the previous frame.
>
> Does that make sense?

Yeah, thanks, perhaps the documentation should be expanded for this on
the mac80211.h. This verbiage might also come in handy on the commit
log. What do you think?

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
  2010-05-07 21:43       ` Luis R. Rodriguez
@ 2010-05-07 22:04         ` John W. Linville
  0 siblings, 0 replies; 6+ messages in thread
From: John W. Linville @ 2010-05-07 22:04 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

On Fri, May 07, 2010 at 02:43:44PM -0700, Luis R. Rodriguez wrote:
> On Thu, May 6, 2010 at 7:35 PM, John W. Linville <linville@tuxdriver.com> wrote:
> > On Thu, May 06, 2010 at 08:13:20PM -0400, John W. Linville wrote:
> >> On Thu, May 06, 2010 at 03:01:25PM -0700, Luis R. Rodriguez wrote:
> >> > On Thu, May 6, 2010 at 11:45 AM, John W. Linville
> >> > <linville@tuxdriver.com> wrote:
> >> >
> >> > Why though?
> >>
> >> Because it is correct, appropriate, and zero additional cost.  And
> >> because if you use the same tx path for beacons as you use for normal
> >> frames and if in that path you manage the sequence number in software
> >> you should be checking that flag before bumping the sequence number.
> >
> > That isn't worded too clearly...  If you manage the sequence number
> > in software then you should be checking that flag before bumping
> > the sequence number.  If you use the same tx path for beacons as is
> > used for normal frames and you don't set that flag for beacons,
> > then beacons will reuse the sequence number from the previous frame.
> >
> > Does that make sense?
> 
> Yeah, thanks, perhaps the documentation should be expanded for this on
> the mac80211.h. This verbiage might also come in handy on the commit
> log. What do you think?

Well, now that you mention it (from mac80211.h):

 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
 *      number to this frame, taking care of not overwriting the fragment
 *      number and increasing the sequence number only when the
 *      IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
 *      assign sequence numbers to QoS-data frames but cannot do so correctly
 *      for non-QoS-data and management frames because beacons need them from
 *      that counter as well and mac80211 cannot guarantee proper sequencing.
 *      If this flag is set, the driver should instruct the hardware to
 *      assign a sequence number to the frame or assign one itself. Cf. IEEE
 *      802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
 *      beacons and always be clear for frames without a sequence number field.

Seems like we should have been setting that for beacons the whole time...

Anyway, I already committed it as it is -- it is a fairly simple patch.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-07 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06 18:45 [PATCH] mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons John W. Linville
2010-05-06 22:01 ` Luis R. Rodriguez
2010-05-07  0:13   ` John W. Linville
2010-05-07  2:35     ` John W. Linville
2010-05-07 21:43       ` Luis R. Rodriguez
2010-05-07 22:04         ` John W. Linville

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).