summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>2011-06-06 17:51:35 +0200
committerPhilippe LANGLAIS <philippe.langlais@stericsson.com>2011-06-22 11:36:46 +0200
commit6e2f5de30ca3b9d11d1d919a1b29ad879065e58c (patch)
tree276ce571d803996611f31ba166d54330c946da1b
parentac56e423498d427dce581949ef28c46b41cd50b9 (diff)
cw1200: rate policy optimization.
Try to utilize higher rates as much as possible before switching to lower rates. Change-Id: Ieaba60bc17b9c8e4e676a6ed7e5061d2ba8eddcf Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24481 Reviewed-by: Robert MARKLUND <robert.marklund@stericsson.com> Tested-by: Robert MARKLUND <robert.marklund@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25621 Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
-rw-r--r--drivers/staging/cw1200/debug.c2
-rw-r--r--drivers/staging/cw1200/debug.h10
-rw-r--r--drivers/staging/cw1200/txrx.c16
3 files changed, 10 insertions, 18 deletions
diff --git a/drivers/staging/cw1200/debug.c b/drivers/staging/cw1200/debug.c
index 498f072da78..b4c2da23135 100644
--- a/drivers/staging/cw1200/debug.c
+++ b/drivers/staging/cw1200/debug.c
@@ -247,8 +247,6 @@ static int cw1200_status_show(struct seq_file *seq, void *v)
d->tx);
seq_printf(seq, "AGG TXed: %d\n",
d->tx_agg);
- seq_printf(seq, "MORE TXed: %d\n",
- d->tx_more);
seq_printf(seq, "MULTI TXed: %d (%d)\n",
d->tx_multi, d->tx_multi_frames);
seq_printf(seq, "RXed: %d\n",
diff --git a/drivers/staging/cw1200/debug.h b/drivers/staging/cw1200/debug.h
index 0c9ef1252c4..a19083a49b9 100644
--- a/drivers/staging/cw1200/debug.h
+++ b/drivers/staging/cw1200/debug.h
@@ -9,7 +9,6 @@ struct cw1200_debug_priv {
struct dentry *debugfs_phy;
int tx;
int tx_agg;
- int tx_more;
int rx;
int rx_agg;
int tx_multi;
@@ -29,11 +28,6 @@ static inline void cw1200_debug_txed_agg(struct cw1200_common *priv)
++priv->debug->tx_agg;
}
-static inline void cw1200_debug_txed_more(struct cw1200_common *priv)
-{
- ++priv->debug->tx_more;
-}
-
static inline void cw1200_debug_txed_multi(struct cw1200_common *priv,
int count)
{
@@ -70,10 +64,6 @@ static inline void cw1200_debug_txed_agg(struct cw1200_common *priv)
{
}
-static inline void cw1200_debug_txed_more(struct cw1200_common *priv)
-{
-}
-
static inline void cw1200_debug_txed_multi(struct cw1200_common *priv,
int count)
{
diff --git a/drivers/staging/cw1200/txrx.c b/drivers/staging/cw1200/txrx.c
index 16a85b39b99..eb2802af318 100644
--- a/drivers/staging/cw1200/txrx.c
+++ b/drivers/staging/cw1200/txrx.c
@@ -83,6 +83,8 @@ static void tx_policy_build(const struct cw1200_common *priv,
/* minstrel is buggy a little bit, so distille
* incoming rates first. */
+
+ /* Sort rates in descending order. */
for (i = 1; i < count; ++i) {
if (rates[i].idx < 0) {
count = i;
@@ -95,6 +97,7 @@ static void tx_policy_build(const struct cw1200_common *priv,
}
}
+ /* Eliminate duplicates. */
total = rates[0].count;
for (i = 0, j = 1; j < count; ++j) {
if (rates[j].idx == rates[i].idx) {
@@ -108,16 +111,17 @@ static void tx_policy_build(const struct cw1200_common *priv,
}
total += rates[j].count;
}
- if (i + 1 < count)
- count = i + 1;
+ count = i + 1;
+ /* Re-fill policy trying to keep every requested rate and with
+ * respect to the global max tx retransmission count. */
if (limit < count)
limit = count;
-
if (total > limit) {
- for (i = count - 1; i >= 0; --i) {
- if (rates[i].count > limit - i)
- rates[i].count = limit - i;
+ for (i = 0; i < count; ++i) {
+ int left = count - i - 1;
+ if (rates[i].count > limit - left)
+ rates[i].count = limit - left;
limit -= rates[i].count;
}
}