Print this page
7154 arn(7D) walks out of bounds when byteswapping the 4K eeprom
7152 weird condition in arn(7D) needs clarification
7153 delete unused code in arn(7D)
7155 arn(7D) should include the mac fields in the eeprom enumeration


 707                         break;
 708                 drv_usecwait(10);
 709         }
 710 
 711         for (i = 0; i < NUM_NF_READINGS; i++) {
 712                 if (chainmask & (1 << i)) {
 713                         val = REG_READ(ah, ar5416_cca_regs[i]);
 714                         val &= 0xFFFFFE00;
 715                         val |= (((uint32_t)(-50) << 1) & 0x1ff);
 716                         REG_WRITE(ah, ar5416_cca_regs[i], val);
 717                 }
 718         }
 719 }
 720 
 721 int16_t
 722 ath9k_hw_getnf(struct ath_hal *ah, struct ath9k_channel *chan)
 723 {
 724         int16_t nf, nfThresh;
 725         int16_t nfarray[NUM_NF_READINGS] = { 0 };
 726         struct ath9k_nfcal_hist *h;
 727         /* LINTED E_FUNC_SET_NOT_USED */
 728         uint8_t chainmask;
 729 
 730         if (AR_SREV_9280(ah))
 731                 chainmask = 0x1B;
 732         else
 733                 chainmask = 0x3F;
 734 
 735         chan->channelFlags &= (~CHANNEL_CW_INT);
 736         if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
 737                 ARN_DBG((ARN_DBG_CALIBRATE, "arn: "
 738                     "%s: NF did not complete in calibration window\n",
 739                     __func__));
 740                 nf = 0;
 741                 chan->rawNoiseFloor = nf;
 742                 return (chan->rawNoiseFloor);
 743         } else {
 744                 ath9k_hw_do_getnf(ah, nfarray);
 745                 nf = nfarray[0];
 746                 if (getNoiseFloorThresh(ah, chan, &nfThresh) &&
 747                     nf > nfThresh) {
 748                         ARN_DBG((ARN_DBG_CALIBRATE, "arn: "
 749                             "%s: noise floor failed detected; "
 750                             "detected %d, threshold %d\n", __func__,
 751                             nf, nfThresh));
 752                         chan->channelFlags |= CHANNEL_CW_INT;
 753                 }




 707                         break;
 708                 drv_usecwait(10);
 709         }
 710 
 711         for (i = 0; i < NUM_NF_READINGS; i++) {
 712                 if (chainmask & (1 << i)) {
 713                         val = REG_READ(ah, ar5416_cca_regs[i]);
 714                         val &= 0xFFFFFE00;
 715                         val |= (((uint32_t)(-50) << 1) & 0x1ff);
 716                         REG_WRITE(ah, ar5416_cca_regs[i], val);
 717                 }
 718         }
 719 }
 720 
 721 int16_t
 722 ath9k_hw_getnf(struct ath_hal *ah, struct ath9k_channel *chan)
 723 {
 724         int16_t nf, nfThresh;
 725         int16_t nfarray[NUM_NF_READINGS] = { 0 };
 726         struct ath9k_nfcal_hist *h;







 727 
 728         chan->channelFlags &= (~CHANNEL_CW_INT);
 729         if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
 730                 ARN_DBG((ARN_DBG_CALIBRATE, "arn: "
 731                     "%s: NF did not complete in calibration window\n",
 732                     __func__));
 733                 nf = 0;
 734                 chan->rawNoiseFloor = nf;
 735                 return (chan->rawNoiseFloor);
 736         } else {
 737                 ath9k_hw_do_getnf(ah, nfarray);
 738                 nf = nfarray[0];
 739                 if (getNoiseFloorThresh(ah, chan, &nfThresh) &&
 740                     nf > nfThresh) {
 741                         ARN_DBG((ARN_DBG_CALIBRATE, "arn: "
 742                             "%s: noise floor failed detected; "
 743                             "detected %d, threshold %d\n", __func__,
 744                             nf, nfThresh));
 745                         chan->channelFlags |= CHANNEL_CW_INT;
 746                 }