• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/otus/80211core/

Lines Matching defs:rcCell

150 void zfRateCtrlInitCell(zdev_t* dev, struct zsRcCell* rcCell, u8_t type,
165 rcCell->operationRateSet[i] = (u8_t)i;
169 rcCell->operationRateSet[i] = 2+i;
171 rcCell->operationRateCount = 10;
172 rcCell->currentRateIndex = 5; //18M
180 rcCell->operationRateSet[i] = zcHtRateTable[i][3];
182 if(!SG40) rcCell->operationRateSet[13] = 27;
183 rcCell->operationRateCount = 14+SG40;
184 rcCell->currentRateIndex = 10;
192 rcCell->operationRateSet[i] = zcHtRateTable[i][3];
194 if(!SG40) rcCell->operationRateSet[13] = 27;
195 rcCell->operationRateCount = 14+SG40;
196 rcCell->currentRateIndex = 10;
202 rcCell->operationRateSet[i] = zcHtRateTable[i][2];
204 rcCell->operationRateCount = 13;
205 rcCell->currentRateIndex = 9;
223 rcCell->operationRateSet[i] = zcHtOneTxStreamRateTable[i][3];
225 rcCell->operationRateCount = i;
226 rcCell->currentRateIndex = ((i+1)*3)/4;
232 rcCell->operationRateSet[i] = zcHtOneTxStreamRateTable[i][2];
234 rcCell->operationRateCount = i;
235 rcCell->currentRateIndex = ((i+1)*3)/4;
242 rcCell->operationRateSet[i] = (u8_t)i;
244 rcCell->operationRateCount = 4;
245 rcCell->currentRateIndex = rcCell->operationRateCount-1;
256 rcCell->operationRateSet[i] = zcHtRateTable[i][1];
258 rcCell->operationRateCount = 12+SG40;
259 rcCell->currentRateIndex = 8;
267 rcCell->operationRateSet[i] = zcHtRateTable[i][1];
269 rcCell->operationRateCount = 12+SG40;
270 rcCell->currentRateIndex = 8;
276 rcCell->operationRateSet[i] = zcHtRateTable[i][0];
278 rcCell->operationRateCount = 11;
279 rcCell->currentRateIndex = 7;
297 rcCell->operationRateSet[i] = zcHtOneTxStreamRateTable[i][1];
299 rcCell->operationRateCount = i;
300 rcCell->currentRateIndex = ((i+1)*3)/4;
306 rcCell->operationRateSet[i] = zcHtOneTxStreamRateTable[i][0];
308 rcCell->operationRateCount = i;
309 rcCell->currentRateIndex = ((i+1)*3)/4;
316 rcCell->operationRateSet[i] = i+4;
318 rcCell->operationRateCount = 8;
319 rcCell->currentRateIndex = 4; //24M
323 rcCell->flag = 0;
324 rcCell->txCount = 0;
325 rcCell->failCount = 0;
326 rcCell->currentRate = rcCell->operationRateSet[rcCell->currentRateIndex];
327 rcCell->lasttxCount = 0;
328 rcCell->lastTime = wd->tick;
329 rcCell->probingTime = wd->tick;
353 /* rcCell : rate control cell */
362 u8_t zfRateCtrlGetHigherRate(struct zsRcCell* rcCell)
366 rateIndex = rcCell->currentRateIndex
367 + (((rcCell->currentRateIndex+1) < rcCell->operationRateCount)?1:0);
368 return rcCell->operationRateSet[rateIndex];
378 /* rcCell : rate control cell */
387 u8_t zfRateCtrlNextLowerRate(zdev_t* dev, struct zsRcCell* rcCell)
390 if (rcCell->currentRateIndex > 0)
392 rcCell->currentRateIndex--;
393 rcCell->currentRate = rcCell->operationRateSet[rcCell->currentRateIndex];
395 zm_msg1_tx(ZM_LV_0, "Lower Tx Rate=", rcCell->currentRate);
396 //DbgPrint("Lower Tx Rate=%d", rcCell->currentRate);
397 rcCell->failCount = rcCell->txCount = 0;
398 rcCell->lasttxCount = 0;
399 rcCell->lastTime = wd->tick;
400 return rcCell->currentRate;
410 /* rcCell : rate control cell */
420 u8_t zfRateCtrlRateDiff(struct zsRcCell* rcCell, u8_t retryRate)
425 for (i=0; i<rcCell->operationRateCount; i++)
427 if (retryRate == rcCell->operationRateSet[i])
429 if (i < rcCell->currentRateIndex)
431 return ((rcCell->currentRateIndex - i)+1)>>1;
433 else if (i == rcCell->currentRateIndex == 0)
456 u8_t zfRateCtrlFindMaxUDPTP(zdev_t* dev, struct zsRcCell* rcCell) {
462 rateIndex = zm_agg_min(rcCell->currentRateIndex+3, rcCell->operationRateCount-1);
463 for (i=rcCell->currentRateIndex; i < rateIndex; i++) {
464 UDPThroughput = zfRateCtrlUDPTP(dev, zcRate[rcCell->operationRateSet[i]],
465 wd->PER[rcCell->operationRateSet[i]]);
472 return rcCell->operationRateSet[maxIndex];
481 /* rcCell : rate control cell */
491 u16_t zfRateCtrlGetTxRate(zdev_t* dev, struct zsRcCell* rcCell, u16_t* probing)
496 zm_msg1_tx(ZM_LV_3, "txCount=", rcCell->txCount);
497 zm_msg1_tx(ZM_LV_3, "probingTime=", rcCell->probingTime);
500 newRate = rcCell->currentRate;
515 newRate=zfRateCtrlGetHigherRate(rcCell);
518 rcCell->probingTime = wd->tick;
522 else if ((((wd->tick - rcCell->probingTime) > (ZM_RATE_CTRL_PROBING_INTERVAL_MS/ZM_MS_PER_TICK))
523 && (rcCell->txCount >= ZM_RATE_CTRL_MIN_PROBING_PACKET))
524 || (rcCell->txCount >= 1000))
530 if (wd->txMPDU[rcCell->currentRate] != 0) {
531 wd->PER[rcCell->currentRate] = zm_agg_min(100,
532 (wd->txFail[rcCell->currentRate]*100)/wd->txMPDU[rcCell->currentRate]);
533 if (!wd->PER[rcCell->currentRate]) wd->PER[rcCell->currentRate] ++;
537 if ((wd->PER[rcCell->currentRate] <= (ZM_RATE_PROBING_THRESHOLD+15)) ||
538 ((rcCell->currentRate <= 16) &&
539 ((wd->PER[rcCell->currentRate]/2) <= ZM_RATE_PROBING_THRESHOLD)))
541 newRate = zfRateCtrlGetHigherRate(rcCell);
542 if (newRate != rcCell->currentRate)
548 (rcCell->currentRate <= 16)? (ZM_RATE_SUCCESS_PROBING/2) : ZM_RATE_SUCCESS_PROBING;
556 rcCell->failCount = rcCell->failCount>>1;
557 rcCell->txCount = rcCell->txCount>>1;
558 wd->txFail[rcCell->currentRate] = wd->txFail[rcCell->currentRate] >> 1;
559 wd->txMPDU[rcCell->currentRate] = wd->txMPDU[rcCell->currentRate] >> 1;
562 if (rcCell->currentRate > 15) {
563 highRate = zfRateCtrlGetHigherRate(rcCell);
564 if ((highRate != rcCell->currentRate) && wd->PER[highRate] &&
565 ((wd->PER[rcCell->currentRate] + FailDiff[rcCell->currentRate]) >
569 zfRateCtrlTxSuccessEvent(dev, rcCell, highRate);
573 highRate = zfRateCtrlFindMaxUDPTP(dev, rcCell);
574 if (rcCell->currentRate < highRate) {
577 zfRateCtrlTxSuccessEvent(dev, rcCell, highRate);
580 rcCell->probingTime = wd->tick;
584 && ((wd->tick - rcCell->lastTime) > 3840) )
586 if (rcCell->lasttxCount < 70)
588 rcCell->failCount = rcCell->failCount>>1;
589 rcCell->txCount = rcCell->txCount>>1;
590 wd->txFail[rcCell->currentRate] = wd->txFail[rcCell->currentRate] >> 1;
591 wd->txMPDU[rcCell->currentRate] = wd->txMPDU[rcCell->currentRate] >> 1;
593 rcCell->failCount = (rcCell->failCount < rcCell->txCount)?
594 rcCell->failCount : rcCell->txCount;
595 wd->txFail[rcCell->currentRate] = (wd->txFail[rcCell->currentRate] < wd->txMPDU[rcCell->currentRate])?
596 wd->txFail[rcCell->currentRate] : wd->txMPDU[rcCell->currentRate];
599 rcCell->lastTime = wd->tick;
600 rcCell->lasttxCount = 0;
603 rcCell->txCount++;
604 rcCell->lasttxCount++;
605 wd->txMPDU[rcCell->currentRate]++;
618 /* rcCell : rate control cell */
628 void zfRateCtrlTxFailEvent(zdev_t* dev, struct zsRcCell* rcCell, u8_t aggRate, u32_t retryRate)
636 if (aggRate && (aggRate != rcCell->currentRate)) {
642 retryRate = (zfRateCtrlRateDiff(rcCell, (u8_t)retryRate)+1)>>1;
643 if (rcCell->currentRate <12) //legacy rate
648 rcCell->failCount += retryRate;
649 wd->txFail[rcCell->currentRate] += retryRate;
651 //DbgPrint("failCount=%d", rcCell->failCount);
652 if (rcCell->failCount > ZM_MIN_RATE_FAIL_COUNT)
654 if (wd->txMPDU[rcCell->currentRate] != 0) {
655 wd->PER[rcCell->currentRate] = zm_agg_min(100,
656 (wd->txFail[rcCell->currentRate]*100)/wd->txMPDU[rcCell->currentRate]);
657 if (!wd->PER[rcCell->currentRate]) wd->PER[rcCell->currentRate] ++;
660 //DbgPrint("PER=%d, txFail=%d, txMPDU=%d", wd->PER[rcCell->currentRate], wd->txFail[rcCell->currentRate], wd->txMPDU[rcCell->currentRate]);
661 if (wd->PER[rcCell->currentRate] > PERThreshold[rcCell->currentRate])
664 zfRateCtrlNextLowerRate(dev, rcCell);
665 rcCell->flag |= ZM_RC_TRAINED_BIT;
668 if(rcCell->currentRate == 15)
675 wd->txFail[rcCell->currentRate] = wd->txFail[rcCell->currentRate] >> 1;
676 wd->txMPDU[rcCell->currentRate] = wd->txMPDU[rcCell->currentRate] >> 1;
693 /* rcCell : rate control cell */
703 void zfRateCtrlTxSuccessEvent(zdev_t* dev, struct zsRcCell* rcCell, u8_t successRate)
730 if (PERProbe < ((rcCell->currentRate < 16)? 80:100))
736 for (i=0; i<rcCell->operationRateCount; i++)
738 if (successRate == rcCell->operationRateSet[i])
740 if (i > rcCell->currentRateIndex)
747 if((rcCell->currentRate <= 15) && (successRate > 15))
754 rcCell->currentRate = successRate;
755 rcCell->currentRateIndex = (u8_t)i;
756 rcCell->failCount = rcCell->txCount = 0;
757 rcCell->lasttxCount = 0;
758 rcCell->lastTime = wd->tick;
759 wd->txFail[rcCell->currentRate] = wd->txFail[rcCell->currentRate] >> 1;
760 wd->txMPDU[rcCell->currentRate] = wd->txMPDU[rcCell->currentRate] >> 1;
776 /* rcCell : rate control cell */
786 void zfRateCtrlRxRssiEvent(struct zsRcCell* rcCell, u16_t rxRssi)
788 /* if delta(rcCell->rxRssi, rxRssi) > ZM_RATE_CTRL_RSSI_VARIATION */
789 if ((rcCell->rxRssi - rxRssi) > ZM_RATE_CTRL_RSSI_VARIATION)
791 /* Accelerate rate probing via decreaing rcCell->probingTime */
792 rcCell->probingTime -= ZM_RATE_CTRL_PROBING_INTERVAL_MS/ZM_MS_PER_TICK;
796 rcCell->rxRssi = (((rcCell->rxRssi*7) + rxRssi)+4) >> 3;
819 u8_t RateMapToRateIndex(u8_t Rate, struct zsRcCell* rcCell) {
821 for (i=0; i<rcCell->operationRateCount; i++) {
822 if (Rate == rcCell->operationRateSet[i]) {
836 RateIndex = wd->sta.oppositeInfo[0].rcCell.currentRateIndex;
837 Rate = wd->sta.oppositeInfo[0].rcCell.operationRateSet[RateIndex];
872 wd->sta.oppositeInfo[0].rcCell.currentRate = Rate;
873 wd->sta.oppositeInfo[0].rcCell.currentRateIndex = RateMapToRateIndex(Rate, &wd->sta.oppositeInfo[0].rcCell);