Tue Mar 3 09:34:40 2015 UTC ()
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.


(nonaka)
diff -r1.20 -r1.21 src/sys/dev/pci/if_iwm.c

cvs diff -r1.20 -r1.21 src/sys/dev/pci/if_iwm.c (expand / switch to context diff)
--- src/sys/dev/pci/if_iwm.c 2015/03/03 09:27:35 1.20
+++ src/sys/dev/pci/if_iwm.c 2015/03/03 09:34:40 1.21
@@ -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 @@
 
 	/* 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;