2009/4/1 bitbucket <bitbuc...@yandex.ru>: > Hello ! > > I have found bug in I/Q calibration procedure. Because of this bug > calibration goes wrong, and card receive frames with CRC errors. > In phy.c/ath5k_hw_rf511x_calibrate() > i_coff = ((-iq_corr) / i_coffd) & 0x3f; > but, i_coff is signed 32bit value, but when masking it with 0x3f it becomes > signed positive value 0..63, > but later, at boundary check it compared with (s32)-32 or (s32)31, and all > correct negative values of i_coff always be > greater than 31, and in card will be written not correct value (31 instead of > -5, for example). > > Proposed patch fix this bug, and some small differences between ath5k and > Sam's HAL. >
Thanks, fixing calibration etc was in my todo list for some time but it got delayed. > --- phy.c.old 2009-04-01 13:57:01.000000000 +0400 > +++ phy.c 2009-04-01 14:04:17.000000000 +0400 > @@ -1291,16 +1291,17 @@ > iq_corr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_CORR); > i_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_I); > q_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_Q); > + if (i_pwr && q_pwr) break; > } That's already on my local branch ;-) > > i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7; > q_coffd = q_pwr >> 7; > > /* No correction */ > - if (i_coffd == 0 || q_coffd == 0) > + if (i_coffd == 0 || q_coffd < 2) > goto done; > Are you sure that < 2 is ok ? > After applying this patch 48M and 54M data rases work more stable without > lots of CRC errors. Cool ;-) Give me some time to look this through, i think i have one more fix for i/q calibration that adds some more accuracy... -- GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick _______________________________________________ ath5k-devel mailing list ath5k-devel@lists.ath5k.org https://lists.ath5k.org/mailman/listinfo/ath5k-devel