|   | 124 |  | 
          
          
            |   | 125 | == Atheros Driver's Rate Control == | 
          
          
            |   | 126 |  | 
          
          
            |   | 127 | === AutoRate (SampleRate) === | 
          
          
            |   | 128 | This is the default behavior: | 
          
          
            |   | 129 |  | 
          
          
            |   | 130 | In ''ath_rate_findrate'' function of ath_rate/sample/sample.c | 
          
          
            |   | 131 |  | 
          
          
            |   | 132 | {{{ | 
          
          
            |   | 133 |  | 
          
          
            |   | 134 |    if (sn->static_rate_ndx != -1) { | 
          
          
            |   | 135 |                 ndx = sn->static_rate_ndx; | 
          
          
            |   | 136 |                 *try0 = ATH_TXMAXTRY; | 
          
          
            |   | 137 |         } else { | 
          
          
            |   | 138 |                 *try0 = mrr ? 2 : ATH_TXMAXTRY; | 
          
          
            |   | 139 |    ... | 
          
          
            |   | 140 | }}} | 
          
          
            |   | 141 | Here , try0 means how many transmission attempts should be used for the first-rate-setting.  | 
          
          
            |   | 142 | The above code means, if static rate is used, each packet will be retransmit ATH_TXMAXTRY-1 times. | 
          
          
            |   | 143 | But if Mrr/SampleRate is used, the packet  will be tried in r0 rate only 2 times. if unsuccessful, r1, r2, r3,.. will be tried. | 
          
          
            |   | 144 | in 3,3,0 times respecitively. | 
          
          
            |   | 145 |  | 
          
          
            |   | 146 | The codes can be found in ''ath_rate_setupxtxdesc'' function of sample.c | 
          
          
            |   | 147 | {{{ | 
          
          
            |   | 148 | ...  | 
          
          
            |   | 149 |     ath_hal_setupxtxdesc(sc->sc_ah, ds | 
          
          
            |   | 150 |                              , rateCode, 3              /* series 1 */ | 
          
          
            |   | 151 |                              , sn->rates[0].rateCode, 3 /* series 2 */ | 
          
          
            |   | 152 |                              , 0, 0                     /* series 3 */ | 
          
          
            |   | 153 |                              ); | 
          
          
            |   | 154 | ... | 
          
          
            |   | 155 | }}} | 
          
          
            |   | 156 |  | 
          
          
            |   | 157 |  | 
          
          
            |   | 158 | === Static Rate === | 
          
          
            |   | 159 |  | 
          
          
            |   | 160 | In  ath/if_athvar.h | 
          
          
            |   | 161 | {{{ | 
          
          
            |   | 162 | #define ATH_TXMAXTRY    11    | 
          
          
            |   | 163 | }}} | 
          
          
            |   | 164 | So, when it is set to fix rate, each packet will be transmit at this rate 11 times. |