CVSROOT:        /cvs
Module name:    src
Changes by:     s...@cvs.openbsd.org    2020/07/20 02:19:59

Modified files:
        sys/dev/pci    : if_iwn.c 

Log message:
Fix gain calibration for some iwn(4) devices (5000 and up).

IWN_LSB() returns an index starting with 1, however the arrays used
later on (noise and gain in iwn5000_set_gains()) start with 0. The
previous code accounted for this difference when setting the antenna
gain by accessing cmd.gain[i - 1]. However the noise array was accessed
with noise[i], the chainmask was checked against i, and more importantly
the overall for() loop iterated wrongly over the antennas by always
starting with i=2 (the third antenna). One consequence is that gain
calibration never happened in case of only two antennas.

Patch by Holger Mikolon.

Reply via email to