sc_fixed_ridx is initialised to 0 but tested as it it were initialised

to -1.  The result of this is tx frames were always sent out at fixed
rate 0 instead of ni_txrate.

Match the iwn behaviour and test ic_fixed_rate for -1 instead.

From OpenBSD rev.1.29.
This commit is contained in:
nonaka 2015-03-03 09:34:40 +00:00
parent 99577c7378
commit b0ceebdce6
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_iwm.c,v 1.20 2015/03/03 09:27:35 nonaka Exp $ */
/* $NetBSD: if_iwm.c,v 1.21 2015/03/03 09:34:40 nonaka Exp $ */
/* OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp */
/*
@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.20 2015/03/03 09:27:35 nonaka Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.21 2015/03/03 09:34:40 nonaka Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -3817,7 +3817,7 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in,
/* for data frames, use RS table */
if (type == IEEE80211_FC0_TYPE_DATA) {
if (sc->sc_fixed_ridx != -1) {
if (sc->sc_ic.ic_fixed_rate != -1) {
tx->initial_rate_index = sc->sc_fixed_ridx;
} else {
tx->initial_rate_index = (nrates-1) - in->in_ni.ni_txrate;