From: Johannes Berg <johannes@sipsolutions.net>
To: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Cc: linux-wireless@vger.kernel.org,
Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>,
Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: Re: [PATCHv5 03/18] mac80211: fix timing for 5 MHz and 10 MHz channels
Date: Fri, 05 Jul 2013 15:15:56 +0200 [thread overview]
Message-ID: <1373030156.8548.22.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1372352340-20663-4-git-send-email-siwu@hrz.tu-chemnitz.de>
On Thu, 2013-06-27 at 18:58 +0200, Simon Wunderlich wrote:
> * change divisor to shift to avoid unnecesary integer divisions
That didn't really do much ;-)
> d->perfect_tx_time = ieee80211_frame_duration(band, 1200,
> - rate->bitrate, erp, 1);
> + DIV_ROUND_UP(rate->bitrate, 1 << shift), erp, 1,
That's still the integer division, unless the compiler can do something
about it?
> + DIV_ROUND_UP(rate->bitrate, 1 << shift), erp, 1,
ditto
> + mr->bitrate = DIV_ROUND_UP(sband->bitrates[i].bitrate,
> + (1 << shift) * 5);
That looks even weirder?
> + /* IEEE 802.11-2012 18.3.2.4: all values above are:
> + * * times 4 for 5 MHz
> + * * times 2 for 10 MHz
> + */
> + dur *= 1 << shift;
Isn't that just "dur <<= shift"?
I think "DIV_ROUND_UP(x, 1 << shift)" can probably be written more
efficiently? Unless the compiler will do something by itself?
Something like
DIV_ROUND_UP(x, 1<<shift) == (x + (1<<shift) -1) >> shift
I think?
OK, it looks like if "x" is *unsigned* then the compiler will do this,
but with *signed* values it can't actually know because for negative
values it's obviously not actually equivalent.
johannes
next prev parent reply other threads:[~2013-07-05 13:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 16:58 [PATCHv5 00/18] Add support for 5 and 10 MHz channels Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 01/18] nl80211: add scan width to bss and scan request structs Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 02/18] mac80211/rc80211: add chandef to rate initialization Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 03/18] mac80211: fix timing for 5 MHz and 10 MHz channels Simon Wunderlich
2013-07-05 13:15 ` Johannes Berg [this message]
2013-06-27 16:58 ` [PATCHv5 04/18] mac80211: select and adjust bitrates according to channel mode Simon Wunderlich
2013-07-05 13:17 ` Johannes Berg
2013-06-27 16:58 ` [PATCHv5 05/18] cfg80211/mac80211: get mandatory rates based on rate flags Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 05/18] cfg80211/mac80211: get mandatory rates based on scan width Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 06/18] cfg80211/mac80211: use reduced txpower for 5 and 10 MHz Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 07/18] mac80211: add radiotap flag and handling for 5/10 MHz Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 08/18] mac80211: allow scanning for 5/10 MHz channels in IBSS Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 09/18] mac80211: return if IBSS chandef can not be used Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 10/18] nl80211: allow 5 and 10 MHz channels for IBSS Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 11/18] ath9k: always use SIFS times from OFDM for 5/10 MHz Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 12/18] ath9k: use chandef instead of channel_type Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 13/18] ath9k: report 5/10 MHz channels Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 14/18] ath9k: set 5/10 MHz supported channels and fix bitrate Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 15/18] ath9k: announce that ath9k supports 5/10 MHz Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 16/18] ath5k: report 5/10 MHz channels Simon Wunderlich
2013-06-27 16:58 ` [PATCHv5 17/18] ath5k: set 5/10 MHz supported channels and fix duration Simon Wunderlich
2013-06-27 16:59 ` [PATCHv5 18/18] ath5k: enable support for 5 MHz and 10 MHz channels Simon Wunderlich
2013-07-08 11:03 ` [PATCHv5 00/18] Add support for 5 " Johannes Berg
2013-07-08 14:37 ` Simon Wunderlich
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=1373030156.8548.22.camel@jlt4.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=mathias.kretschmer@fokus.fraunhofer.de \
--cc=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=siwu@hrz.tu-chemnitz.de \
/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).