]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: Get rid of search loop for rate group index
authorHelmut Schaa <helmut.schaa@googlemail.com>
Mon, 14 Nov 2011 14:28:20 +0000 (15:28 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 17 Nov 2011 20:43:57 +0000 (15:43 -0500)
commit0ee1772ef16e55de0ea0c6588c1e874a4213eb90
tree649d879ce4d9203537e5c071fcf60da3270d5355
parent7cdabc0c3fc700064db7e8f319e1d5c43f7ba595
mac80211: Get rid of search loop for rate group index

Finding the group index for a specific rate is done by looping through
all groups and returning if the correct one is found. This code is
called for each tx'ed frame and thus it makes sense to reduce its
runtime.

Do this by calculating the group index by this formula based on the SGI
and HT40 flags as well as the stream number:

idx = (HT40 * 2 * MINSTREL_MAX_STREAMS) +
      (SGI * MINSTREL_MAX_STREAMS) +
      (streams - 1)

Hence, the groups are ordered by th HT40 flag first, then by the SGI
flag and afterwards by the number of used streams.

This should reduce the runtime of minstrel_ht_get_group_idx
considerable.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/rc80211_minstrel_ht.c