linux/net/mac80211/rc80211_minstrel.c
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
   3 *
   4 * This program is free software; you can redistribute it and/or modify
   5 * it under the terms of the GNU General Public License version 2 as
   6 * published by the Free Software Foundation.
   7 *
   8 * Based on minstrel.c:
   9 *   Copyright (C) 2005-2007 Derek Smithies <derek@indranet.co.nz>
  10 *   Sponsored by Indranet Technologies Ltd
  11 *
  12 * Based on sample.c:
  13 *   Copyright (c) 2005 John Bicket
  14 *   All rights reserved.
  15 *
  16 *   Redistribution and use in source and binary forms, with or without
  17 *   modification, are permitted provided that the following conditions
  18 *   are met:
  19 *   1. Redistributions of source code must retain the above copyright
  20 *      notice, this list of conditions and the following disclaimer,
  21 *      without modification.
  22 *   2. Redistributions in binary form must reproduce at minimum a disclaimer
  23 *      similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
  24 *      redistribution must be conditioned upon including a substantially
  25 *      similar Disclaimer requirement for further binary redistribution.
  26 *   3. Neither the names of the above-listed copyright holders nor the names
  27 *      of any contributors may be used to endorse or promote products derived
  28 *      from this software without specific prior written permission.
  29 *
  30 *   Alternatively, this software may be distributed under the terms of the
  31 *   GNU General Public License ("GPL") version 2 as published by the Free
  32 *   Software Foundation.
  33 *
  34 *   NO WARRANTY
  35 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  36 *   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  37 *   LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
  38 *   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  39 *   THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
  40 *   OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  41 *   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  42 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  43 *   IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  44 *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  45 *   THE POSSIBILITY OF SUCH DAMAGES.
  46 */
  47#include <linux/netdevice.h>
  48#include <linux/types.h>
  49#include <linux/skbuff.h>
  50#include <linux/debugfs.h>
  51#include <linux/random.h>
  52#include <linux/ieee80211.h>
  53#include <linux/slab.h>
  54#include <net/mac80211.h>
  55#include "rate.h"
  56#include "rc80211_minstrel.h"
  57
  58#define SAMPLE_COLUMNS  10
  59#define SAMPLE_TBL(_mi, _idx, _col) \
  60                _mi->sample_table[(_idx * SAMPLE_COLUMNS) + _col]
  61
  62/* convert mac80211 rate index to local array index */
  63static inline int
  64rix_to_ndx(struct minstrel_sta_info *mi, int rix)
  65{
  66        int i = rix;
  67        for (i = rix; i >= 0; i--)
  68                if (mi->r[i].rix == rix)
  69                        break;
  70        return i;
  71}
  72
  73static void
  74minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
  75{
  76        u32 max_tp = 0, index_max_tp = 0, index_max_tp2 = 0;
  77        u32 max_prob = 0, index_max_prob = 0;
  78        u32 usecs;
  79        u32 p;
  80        int i;
  81
  82        mi->stats_update = jiffies;
  83        for (i = 0; i < mi->n_rates; i++) {
  84                struct minstrel_rate *mr = &mi->r[i];
  85
  86                usecs = mr->perfect_tx_time;
  87                if (!usecs)
  88                        usecs = 1000000;
  89
  90                /* To avoid rounding issues, probabilities scale from 0 (0%)
  91                 * to 18000 (100%) */
  92                if (mr->attempts) {
  93                        p = (mr->success * 18000) / mr->attempts;
  94                        mr->succ_hist += mr->success;
  95                        mr->att_hist += mr->attempts;
  96                        mr->cur_prob = p;
  97                        p = ((p * (100 - mp->ewma_level)) + (mr->probability *
  98                                mp->ewma_level)) / 100;
  99                        mr->probability = p;
 100                        mr->cur_tp = p * (1000000 / usecs);
 101                }
 102
 103                mr->last_success = mr->success;
 104                mr->last_attempts = mr->attempts;
 105                mr->success = 0;
 106                mr->attempts = 0;
 107
 108                /* Sample less often below the 10% chance of success.
 109                 * Sample less often above the 95% chance of success. */
 110                if ((mr->probability > 17100) || (mr->probability < 1800)) {
 111                        mr->adjusted_retry_count = mr->retry_count >> 1;
 112                        if (mr->adjusted_retry_count > 2)
 113                                mr->adjusted_retry_count = 2;
 114                        mr->sample_limit = 4;
 115                } else {
 116                        mr->sample_limit = -1;
 117                        mr->adjusted_retry_count = mr->retry_count;
 118                }
 119                if (!mr->adjusted_retry_count)
 120                        mr->adjusted_retry_count = 2;
 121        }
 122
 123        for (i = 0; i < mi->n_rates; i++) {
 124                struct minstrel_rate *mr = &mi->r[i];
 125                if (max_tp < mr->cur_tp) {
 126                        index_max_tp = i;
 127                        max_tp = mr->cur_tp;
 128                }
 129                if (max_prob < mr->probability) {
 130                        index_max_prob = i;
 131                        max_prob = mr->probability;
 132                }
 133        }
 134
 135        max_tp = 0;
 136        for (i = 0; i < mi->n_rates; i++) {
 137                struct minstrel_rate *mr = &mi->r[i];
 138
 139                if (i == index_max_tp)
 140                        continue;
 141
 142                if (max_tp < mr->cur_tp) {
 143                        index_max_tp2 = i;
 144                        max_tp = mr->cur_tp;
 145                }
 146        }
 147        mi->max_tp_rate = index_max_tp;
 148        mi->max_tp_rate2 = index_max_tp2;
 149        mi->max_prob_rate = index_max_prob;
 150}
 151
 152static void
 153minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
 154                   struct ieee80211_sta *sta, void *priv_sta,
 155                   struct sk_buff *skb)
 156{
 157        struct minstrel_sta_info *mi = priv_sta;
 158        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 159        struct ieee80211_tx_rate *ar = info->status.rates;
 160        int i, ndx;
 161        int success;
 162
 163        success = !!(info->flags & IEEE80211_TX_STAT_ACK);
 164
 165        for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
 166                if (ar[i].idx < 0)
 167                        break;
 168
 169                ndx = rix_to_ndx(mi, ar[i].idx);
 170                if (ndx < 0)
 171                        continue;
 172
 173                mi->r[ndx].attempts += ar[i].count;
 174
 175                if ((i != IEEE80211_TX_MAX_RATES - 1) && (ar[i + 1].idx < 0))
 176                        mi->r[ndx].success += success;
 177        }
 178
 179        if ((info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) && (i >= 0))
 180                mi->sample_count++;
 181
 182        if (mi->sample_deferred > 0)
 183                mi->sample_deferred--;
 184}
 185
 186
 187static inline unsigned int
 188minstrel_get_retry_count(struct minstrel_rate *mr,
 189                         struct ieee80211_tx_info *info)
 190{
 191        unsigned int retry = mr->adjusted_retry_count;
 192
 193        if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
 194                retry = max(2U, min(mr->retry_count_rtscts, retry));
 195        else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
 196                retry = max(2U, min(mr->retry_count_cts, retry));
 197        return retry;
 198}
 199
 200
 201static int
 202minstrel_get_next_sample(struct minstrel_sta_info *mi)
 203{
 204        unsigned int sample_ndx;
 205        sample_ndx = SAMPLE_TBL(mi, mi->sample_idx, mi->sample_column);
 206        mi->sample_idx++;
 207        if ((int) mi->sample_idx > (mi->n_rates - 2)) {
 208                mi->sample_idx = 0;
 209                mi->sample_column++;
 210                if (mi->sample_column >= SAMPLE_COLUMNS)
 211                        mi->sample_column = 0;
 212        }
 213        return sample_ndx;
 214}
 215
 216static void
 217minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
 218                  void *priv_sta, struct ieee80211_tx_rate_control *txrc)
 219{
 220        struct sk_buff *skb = txrc->skb;
 221        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 222        struct minstrel_sta_info *mi = priv_sta;
 223        struct minstrel_priv *mp = priv;
 224        struct ieee80211_tx_rate *ar = info->control.rates;
 225        unsigned int ndx, sample_ndx = 0;
 226        bool mrr;
 227        bool sample_slower = false;
 228        bool sample = false;
 229        int i, delta;
 230        int mrr_ndx[3];
 231        int sample_rate;
 232
 233        if (rate_control_send_low(sta, priv_sta, txrc))
 234                return;
 235
 236        mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot;
 237
 238        if (time_after(jiffies, mi->stats_update + (mp->update_interval *
 239                        HZ) / 1000))
 240                minstrel_update_stats(mp, mi);
 241
 242        ndx = mi->max_tp_rate;
 243
 244        if (mrr)
 245                sample_rate = mp->lookaround_rate_mrr;
 246        else
 247                sample_rate = mp->lookaround_rate;
 248
 249        mi->packet_count++;
 250        delta = (mi->packet_count * sample_rate / 100) -
 251                        (mi->sample_count + mi->sample_deferred / 2);
 252
 253        /* delta > 0: sampling required */
 254        if ((delta > 0) && (mrr || !mi->prev_sample)) {
 255                struct minstrel_rate *msr;
 256                if (mi->packet_count >= 10000) {
 257                        mi->sample_deferred = 0;
 258                        mi->sample_count = 0;
 259                        mi->packet_count = 0;
 260                } else if (delta > mi->n_rates * 2) {
 261                        /* With multi-rate retry, not every planned sample
 262                         * attempt actually gets used, due to the way the retry
 263                         * chain is set up - [max_tp,sample,prob,lowest] for
 264                         * sample_rate < max_tp.
 265                         *
 266                         * If there's too much sampling backlog and the link
 267                         * starts getting worse, minstrel would start bursting
 268                         * out lots of sampling frames, which would result
 269                         * in a large throughput loss. */
 270                        mi->sample_count += (delta - mi->n_rates * 2);
 271                }
 272
 273                sample_ndx = minstrel_get_next_sample(mi);
 274                msr = &mi->r[sample_ndx];
 275                sample = true;
 276                sample_slower = mrr && (msr->perfect_tx_time >
 277                        mi->r[ndx].perfect_tx_time);
 278
 279                if (!sample_slower) {
 280                        if (msr->sample_limit != 0) {
 281                                ndx = sample_ndx;
 282                                mi->sample_count++;
 283                                if (msr->sample_limit > 0)
 284                                        msr->sample_limit--;
 285                        } else {
 286                                sample = false;
 287                        }
 288                } else {
 289                        /* Only use IEEE80211_TX_CTL_RATE_CTRL_PROBE to mark
 290                         * packets that have the sampling rate deferred to the
 291                         * second MRR stage. Increase the sample counter only
 292                         * if the deferred sample rate was actually used.
 293                         * Use the sample_deferred counter to make sure that
 294                         * the sampling is not done in large bursts */
 295                        info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
 296                        mi->sample_deferred++;
 297                }
 298        }
 299        mi->prev_sample = sample;
 300
 301        /* If we're not using MRR and the sampling rate already
 302         * has a probability of >95%, we shouldn't be attempting
 303         * to use it, as this only wastes precious airtime */
 304        if (!mrr && sample && (mi->r[ndx].probability > 17100))
 305                ndx = mi->max_tp_rate;
 306
 307        ar[0].idx = mi->r[ndx].rix;
 308        ar[0].count = minstrel_get_retry_count(&mi->r[ndx], info);
 309
 310        if (!mrr) {
 311                if (!sample)
 312                        ar[0].count = mp->max_retry;
 313                ar[1].idx = mi->lowest_rix;
 314                ar[1].count = mp->max_retry;
 315                return;
 316        }
 317
 318        /* MRR setup */
 319        if (sample) {
 320                if (sample_slower)
 321                        mrr_ndx[0] = sample_ndx;
 322                else
 323                        mrr_ndx[0] = mi->max_tp_rate;
 324        } else {
 325                mrr_ndx[0] = mi->max_tp_rate2;
 326        }
 327        mrr_ndx[1] = mi->max_prob_rate;
 328        mrr_ndx[2] = 0;
 329        for (i = 1; i < 4; i++) {
 330                ar[i].idx = mi->r[mrr_ndx[i - 1]].rix;
 331                ar[i].count = mi->r[mrr_ndx[i - 1]].adjusted_retry_count;
 332        }
 333}
 334
 335
 336static void
 337calc_rate_durations(enum ieee80211_band band,
 338                    struct minstrel_rate *d,
 339                    struct ieee80211_rate *rate)
 340{
 341        int erp = !!(rate->flags & IEEE80211_RATE_ERP_G);
 342
 343        d->perfect_tx_time = ieee80211_frame_duration(band, 1200,
 344                        rate->bitrate, erp, 1);
 345        d->ack_time = ieee80211_frame_duration(band, 10,
 346                        rate->bitrate, erp, 1);
 347}
 348
 349static void
 350init_sample_table(struct minstrel_sta_info *mi)
 351{
 352        unsigned int i, col, new_idx;
 353        unsigned int n_srates = mi->n_rates - 1;
 354        u8 rnd[8];
 355
 356        mi->sample_column = 0;

IwYt        sample_deferred<3a> = 35
 = mi" class="sref">m     unsigned int n_srates = bitrate, sample_count<3a> = 35
packet_count<3a> = 3;
 352        unsignet/m="line" name="L352"> 352        unsig   ford int m="line" name="L352"> 352        unsig= 1; i < 4;e=n_rates3 class="sref">n_rates 329        for0211_minstrel.c#L353" id="L353" class="line" name=(i = 1; i < 4;ate retry3 not every planned sampl3 =  354 , sizeof> =  354 )="+code=bitrate" class="sref">bitrate, i,  329      i" class="sref">mne" name="L354"> 354  "line" name="L3="L329"> 329       ="+co7]) line"r0211_minstrel.c#L353" id="L353" class="line" name=(+code=bitrate" class="sref">bitrate,  = i,  352        unsig)r" claref="net/mac80211/rc80211_minstrel.c#L334" i ="L355" c                        3i, i, bitrate,  302 301(i.e.am =                          * packets that ha3sampling 3rames, which would resul3
 301worksomment">                         * packets that ha3   * in a3large throughput loss. *3                         * packets that ha3de=n_rate3" class="sref">n_rates * 237
 318         271         3     37
 = i,  352        unsig)rf="+code=d" class="L329"> 329      i""+code=mi" class="sref">mi->3272
(3i3;
        3x" class="sref">sample_n3x3;
="L355" code=true" class="sref">t3ueperfect_tx_time<3a> &g3;
perfect_tx_ti3e3;
 338<_L350et/ma_table(structass="sref">minstrel_privieee80211_band 3278
(structs="+code=rate_control_send_t/ma_table(structass=ate_control_send_low(sample_slowe3)38
sample_limit3!= 0)3{
 350init_sample_table(struct (mi->sample_3dx 350minstrelef="+codeass=mple_table(struct class="sref">ar[1]=minstrel_priv" class="sref">minstrel_privmi->sample_coun3+3;
 339                    ct38" class="line" namect38" clvmi->sample_limit3> 3)
mi->sample_limi3-3;
 303         * to use it, as t"> 285fa3seidx = mrr38<_ =  =  321        ="+code=rate_control_sen="+code=bitrate" class="sref">bitrate, 3287                 3     38
 slc_rate_durations" sode=ieeename="L346"> 346       id="L353" class=       i/a>  "line" name="L311_minstrel.c#L212" id=3deferred"31/rc80211idx" class="sref">idx = u8                 3 else3{
d->ack_time =  346 e=ieee80211_frame_duration" class="sref">ieee80211_frame_duration( 346                        ieee80211_frame_duration( 346ass="sref">erp = !!(rate->flagsref="+code=bitrate" class="sref">bitrate,  329        for0211_minstrel.cslc_rate_durations" sode=ieeename="L346"> 346n_       id="L353" class=n_       iame=(i = 1; i < 4;_deferred3counter to make sure tha3 338                  mtrel.c#L310" id="Lv nstrel_get_retry_count" class="sref">minstrel_get_retry_count(&u8 
 343        "+code=d" clas0ned int mi->IEEE30211_TX_CTL_RATE_CTRL_PR3BE _" cltrel.c#L350" id="t343"> _" cltrvmi->sample_deferre3+3;
ar[1].mi->3"L297"> 297         3     39
 298 3     39
mrr38<_supporde=e =  346 e=ieee80211_frame_duration" a href="+code=i" class="sref">i ss="sref">ndx].sam4lemi->4300        de=miass="sref">mi->bitrate, 
bitrate, minstre" class="sref">mrr_ndx 329     "+code=bitrate" class="sref">bitrate, minstr                         321        lc_rate_durations" sode=ieeename="L346"> 346       id="L353" class=       i/a>  "line" name="L3="L331"> 331                bitrate,  346 e=ieee80211_frame_duration" a href="+code=i1trel.c#L310" id="Lv slc_rate_durations" sode=ieeename="L346"> 346       id="L353" class=       i/a>  "line" name="L3="L331"> 331      ="+code=bitrate" class="sref">bitrate, sample_deferre43064ix                         * packets that ha4 href="+c4de=info" class="sref">in4o40
         * to use it, as 4d="L309" 4lass="line" name="L309">4309minstr                      if (mi->mr4)4{
minstresref">mrr_ndx[29" ccode=mi" class="sref">mi->sam4leminstresref">mrr__c0" class="line" nesref">mrr__c0"ef">29" ccode=mi" class="sref">mi->max_re4ryminstresref">mrr__rtsc0" class="line" nesref">mrr__rtsc0"ef">29" ccode=mi" class="sref">mi->lowest_4ix 343        "+code=d" clas1/rc80211_minstmtrel.c#L310" id="Lvminstr" name="L343"> 343        m11_minstrel.c#L212" id=3deferred"31/rc80211_p_    duL320" class="linep_    duLa hrccode=mi" class="sref">mi->max_re4ryi < 44ame="L3154> 315               4retur41
         * to use it, as 4d7;, we s4e" name="L316"> 316 4     41
 _" cltrel.c#L350" id="t343"> _" cltrvminstr" name="L345"> 345        m1trel.c#L310" id="Lvminstr" name="L343"> 343        mi->4317/* MRR setup *4         * to use it, as 4="+code=s4mple" class="sref">sampl4)4{
 _" cltrel.c#L350" id="t343"> _" cltrvmimcwass="line" namecwa hr)de=nde=ndx"ccode=mi" class="sref">mi->sample_slo4erar[1].mrcwgta _sen="+code=bitrate" class="sref">bitrate, sample_4dx 322            4   el4e
 343        "+code=d" cl+e" name="L275"> 27343"> _" cltrel.c#L350" id="t343"> _" cltrvmi->max_tp_r4te _c0" class="line" n"+code=_c0"d" cl+e" name="L275"> 27343"> _" cltrel.c#L350" id="t343"> _" cltrvm11_minstrel.c#L212" id=3deferred"31/rc80211_p_    duL320" class="linep_    duLa hrccode=mi" class="sref">mi-> 324        4 else4{
 _rtsc0" class="line" n"+code=_rtsc0"e=mi"+e" name="L275"> 27343"> _" cltrel.c#L350" id="t343"> _" cltrvm     unsigned int mi->max_tp_ra4e2mi _c0" class="line" n"+code=_c0"d" cl  for0211_minstrel.c1class="sref">ar[1].mi-> 326 4     42
minstresref">mrr__c0" class="line" nesref">mrr__c0"ef">2  for0211_minstrel.c1class="sref">ar[1].count = ndx].max_prob_r4teminstresref">mrr__c0" class="line" nesref">mrr__c0"ef">ass="sref">mi->mrr_ndx42] = 42
mi _rtsc0" class="line" n"+code=_rtsc0"e=mi"  for0211_minstrel.c1class="sref">ar[1].mi->i<4a>++)4{
minstresref">mrr__rtsc0" class="line" nesref">mrr__rtsc0"ef">2  for0211_minstrel.c1class="sref">ar[1].count = ndx].4ixminstresref">mrr__rtsc0" class="line" nesref">mrr__rtsc0"ef">ass="sref">mi->adjusted_retry_co4ntmi 343        "+code=d" cl  for0211_minstrel.c1class="sref">ar[1].mi-> 332 4     43
minstresref">mrr_ndx[2  for0211_minstrel.c1class="sref">ar[1].count = mi-> 433minstrx" class="sref">mrr_ndx[las1/rc80211_minstmtrel.c#L310" id="Lvminstresref">mrr_ndx[acode=mi" class="sref">mi->43344335 336sta4ic vo43
        de=mim="line" name="L3="L329"> 329        for0211_minstrel.cslc_rate_durations" sode=ieeename="L346"> 346n_       id="L353" class=n_       iame=(i = 1; i < 44a href="+4ode=band" class="sref">b4nd 338                  mtrel.c#L310" id="Lv nstrel_get_retry_count" class="sref">minstrel_get_retry_count(& 331      acode=mi" class="sref">mi->minstre" class="sref">mrr_ndxmi->r4te 440IEEE80211_RATE_ERP4G44
 nstrel_get_retry_count" class="sref">minstrclass="sref">n_srates =         de=mimef="net/mac80211/rc80211_minstrel.c#L347" i4= name="L4lass="line" name="L342">4342
n_sratesbanderp<4a>, 14;
mi->band<4a>, 14,
erp<4a>, 144
 4474348
(structass="sref">minstrel_priv(structs="+code=rate_control_send_able(structgfp__ndx[(structgfpndx[ 349sta4ic vo45
 * 350mi-> 451 350init_sample_table(struct mi->new_4dxminstrelef="+codeass=mple_table(struct class="sref">ar[1]=minstrel_priv" class="sref">minstrel_privmi->n_rates<4a> - 4;
 350(structhwass="line" namehwa href="+code=d" class class="sref">ar[1].mi->rnd4/a>[845
n_srates<> = mi->4355
mi->sample_column<4a> = 45
sample_deferred<4a> = 45
e="L350"> 350init_sample)d_able(structgfpndx[mi->sample_count<4a> = 45
minstrel_sta_infopacket_count<4a> = 46
mi->n_rates 329        for0211_minstrel.cflags" claNUM_BAND+code=sample_colflags" claNUM_BAND+ame=(i = 1; i < 44gets used4 due to the way the retr4count(& 331      acode=mi" class="sref">mi-> 346n_       id="L353" class=n_       iame=de=nd80211_minstrel.c> = n_srates<> = minstrel_sta_info = n_srates<> =  346n_       id="L353" class=n_       iame=(_sta_info" class="sref">minstrel_sta_infominstrel_get_retry_counte="L350"> 350 338 )mi" class="sref">m  = n_srates<> = (structgfpndx[mi->minstrel_get_retry_countminstrel_sta_info(structerroel_get_retry_couerroeame=(_sta_info" class="sref">minstrel_sta_infon_rates * 247
 271         4     47
 nstrel_get_retry_count" class="sref">minstr_minstrinstrel.c#L350" id=" class="line" na=minstrel_priv" clkmalloca href="+code=mkmalloc" namnstrel_priv" cl>mi" class="sref">m  = n_srates<> = (structgfpndx[mi->4272
minstr_minstrinstrel.c#L350" id=" class="line" nal_sta_info" class="sref">minstrel_sta_info4i47
minstrel_sta_infosample_n4x47
="L355" 4ode=true" class="sref">t4uen_sratesperfect_tx_time<4a> &g47
mi->perfect_tx_ti4e47
4278sample_slowe4)480minstrel_get_retry_countmi->sample_limit4!= 0)4{
(structerroel_get_retry_couerroeame=:ref="net/mac80211/rc80211_minstrel.c#L348" 4_ne" name4dx" class="sref">sample_4dx kfrelass="line" namekfrel" nam/mac80211/rc802     unsigned int mi->sample_coun4+4;
mi->sample_limit4> 4)
sample_limi4-48
 285fa4se frelate_control_send_lo id="L338frelate_" namt/ma_table(structass="sref">minstrel_priv(structs="+code=rate_control_send_t/ma_table(structass=ate_control_send_low(4287                 4     48
i < 44me="L288"4 288                4 else4{
 350init_sample_table(struct (mi->mi->minstr_minstrinstrel.c#L350" id=" class="line" nal+code=mi" class="sref">mi-> kfrelass="line" namekfrel" nam/mac80211/rc802     unsigned int minstrel_get_retry_countmi->mi->IEEE40211_TX_CTL_RATE_CTRL_PR4BEsample_deferre4+49
 alloca href="+code=m="L338"> alloc" nams="L350"> 350(structhwass="line" namehwa hr,c80211_minstrel.c#L339"denss="sref">count(structdebugfsdiel_get_retry_coudebugfsdie hrearef="net/mac80211/rc80211_minstrel.c#L334" 4e="L287">4"L297"> 297         4     49
i < 44class="li4e" name="L298"> 298 4     49
 350minstrelef="+codeass=mple_table(struct class="sref">ar[1]acode=mi" class="sref">mi->sam5lemi->5300ar[1]=minstrel_priv" clkzalloca href="+code=mkzalloc" namsizeof>e="L350"> 350minstrelef="+codeass=mple)d_able(structGFP_ATOMIC"sref">minstrelGFP_ATOMICa hrlacode=mi" class="sref">mi->ar[1]aref="net/mac80211/rc80211_minstrel.c#L334" 537;, we s5ouldn't be attemptin5mi->                         * packets that ha536;, we s5o211_TX_CTL_RATE_CTRL_PR5te                         * packets that ha537;, we s5os="sref">sample_deferre5306         * to use it, as 5.5ixar[1].bitrate, in5o50
ar[1].mrcwgta _sen29" 023"+code=bitrate" class="sref">bitrate, 5309mi->mr5)5{
         * to use it, as 5a MRR and5sample" class="sref">sam5le         * to use it, as 5a7;, we s5try" class="sref">max_re5ry         * to use it, as 5a4;, we s5ix" class="sref">lowest_5ixar[1].bitrate, max_re5ryar[1].bitrate,  315               5retur51
 316 5     51
         * to use it, as 5a5317ar[1]. 352      ewma_leve"_sen29"75"+code=bitrate" class="sref">bitrate, /* MRR setup *5bitrate, sampl5)5{
 30ass="" nahw is allowed to stay in onesMRR seg1/rce3         * to use it, as 5le_slower5 class="sref">sample_slo5erar[1].bitrate, sample_5dx 322            5   el52
n_sratesmax_tp_r5tear[1].count = n_sratesbitrate,  324        5 else5{
bitrate, max_tp_ra5e2         * to use it, as 5l7;, we s5e" name="L326"> 326 5     52
ar[1].count = bitrate, max_prob_r5temrr_ndx52] = 52
n_srates<> = i<5a>++)5{
ar[1].bitrate, 5ixadjusted_retry_co5nt nclass="sref">ar[1].bitrate,  332 5     53
ar[1]. 352      upd cl_interva"_sen29" 00"+code=bitrate" class="sref">bitrate,  53353345335ar[1].mrfixede" cl_id _sen29"cnstrel_priv" clu"sref">adju      u3
mi-> 336sta5ic vo53
ar[1].adju      debugfs_cre cl_u"s" nam/mac80211/rc8a h301">"fixede" cl_id "/a>ieee80211_frame_duration(b5ndadju      S_IRUGOadju      S_IWUGO(structdebugfsdiel_get_retry_coudebugfsdie hre, "line" name="L274"> 1class="sref">ar[1].mrfixede" cl_id _senlacode=mi" class="sref">mi->mi->r5temi-> 540ar[1]acode=mi" class="sref">mi->IEEE80211_RATE_ERP5G54
5342bitrate, banderp<5a>, 15;
 350(structass="sref">minstrel_privband<5a>, 15,
i < 45=ss="line5e=erp" class="sref">erp<5a>, 154
 547e="L350"> 350minstrelef="+codeass=mple *)able(structass="sref">minstrel_privmi->5348mi-> 349sta5ic vo550minstrel_privmi-> 551new_5dx 350n_srates<> 1_minstrel.c#L3a hr=mi i < 45ode=n_rat5s" class="sref">n_rates<5a> - 5;
n_srates<_rata hr=minmac80211/rc8a h301">"i &l"/a>ieee80211_frame_duration(rnd5/a>[855
ieee80211_frame_duration(5355
ieee80211_frame_duration(sample_column<5a> = 557ieee80211_frame_duration(sample_deferred<5a> = 55
 alloc" na,ss="sref">ieee80211_frame_duration(sample_count<5a> = 55
ieee80211_frame_duration(packet_count<5a> = 56
ieee80211_frame_duration(n_ratesieee80211_frame_duration(inidebugfscontrol_send_loadd">inidebugfs" na=minstrel_priv" clef="+codeadd">inidebugfscontrol_send_loef="+codeadd">inidebugfs" na,ss="sref">ieee80211_frame_duration(inidebugfscontrol_send_loremovl">inidebugfsa hr=minstrel_priv" clef="+code"emovl">inidebugfscontrol_send_loef="+code"emovl">inidebugfs" na,ss="sref">ieee80211_frame_duration(mi->mi->n_rates * 257
 1"1_minstrel.c#L3sref">n_srates<> 1_minstrel.c#L3a hraacode=mi" class="sref">mi-> 271         5     57
5272bitrate, 5i57
sample_n5x57
 350t5uei < 45ime" clas5="sref">perfect_tx_time<5a> &g57
 1"1_minstrel.c#L3sref">n_srates<> 1_minstrel.c#L3a hraacode=mi" class="sref">mi->perfect_tx_ti5e57
5278bitrate, sample_slowe5)580


Tss=original LXR software by"" nacode=bitrhttp://sourceforge.ate"projects/lxel>LXR 0211un y hre, this experi1_mial vers" n0by"code=bitrmailto:lxe@>saux.no">lxe@>saux.no hre.
lxe.>saux.no kindny hoode=0by"code=bitrhttp://www.redpill->sapro.no">Redpill Lsapro AS hre, providclasfsLsauxeconsult301"nnd oper 3" na servicea since 1995.