Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Fix radiotap and fixed rates. Radiotap was repo...



details:   https://anonhg.NetBSD.org/src/rev/aeb5d42572df
branches:  trunk
changeset: 336585:aeb5d42572df
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Sat Mar 07 13:54:57 2015 +0000

description:
Fix radiotap and fixed rates.  Radiotap was reporting the wrong rate for
data frames and fixed rates weren't really fixed and were converted into
the wrong hardware rate.

>From OpenBSD rev.1.36.

diffstat:

 sys/dev/pci/if_iwm.c |  36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (67 lines):

diff -r 9456347ab1ee -r aeb5d42572df sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Sat Mar 07 11:52:53 2015 +0000
+++ b/sys/dev/pci/if_iwm.c      Sat Mar 07 13:54:57 2015 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: if_iwm.c,v 1.27 2015/03/07 11:52:53 khorben Exp $      */
-/*     OpenBSD: if_iwm.c,v 1.35 2015/03/04 15:18:12 jsg Exp    */
+/*     $NetBSD: if_iwm.c,v 1.28 2015/03/07 13:54:57 nonaka Exp $       */
+/*     OpenBSD: if_iwm.c,v 1.36 2015/03/06 18:39:24 kettenis Exp       */
 
 /*
  * Copyright (c) 2014 genua mbh <info%genua.de@localhost>
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.27 2015/03/07 11:52:53 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.28 2015/03/07 13:54:57 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -3801,31 +3801,31 @@
        struct ieee80211_frame *wh, struct iwm_tx_cmd *tx)
 {
        struct ieee80211com *ic = &sc->sc_ic;
+       struct ieee80211_node *ni = &in->in_ni;
        const struct iwm_rate *rinfo;
        int type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
        int ridx, rate_flags;
-       int nrates = in->in_ni.ni_rates.rs_nrates;
+       int nrates = ni->ni_rates.rs_nrates;
 
        tx->rts_retry_limit = IWM_RTS_DFAULT_RETRY_LIMIT;
        tx->data_retry_limit = IWM_DEFAULT_TX_RETRY;
 
-       /* for data frames, use RS table */
-       if (type == IEEE80211_FC0_TYPE_DATA) {
-               if (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;
-               }
+       if (type != IEEE80211_FC0_TYPE_DATA) {
+               /* for non-data, use the lowest supported rate */
+               ridx = (ic->ic_curmode == IEEE80211_MODE_11A) ?
+                   IWM_RIDX_OFDM : IWM_RIDX_CCK;
+       } else if (ic->ic_fixed_rate != -1) {
+               ridx = sc->sc_fixed_ridx;
+       } else {
+               /* for data frames, use RS table */
+               tx->initial_rate_index = (nrates - 1) - ni->ni_txrate;
                tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE);
                DPRINTFN(12, ("start with txrate %d\n", tx->initial_rate_index));
-               return &iwm_rates[tx->initial_rate_index];
-       }
-
-       /* for non-data, use the lowest supported rate */
-       ridx = (ic->ic_curmode == IEEE80211_MODE_11A) ?
-           IWM_RIDX_OFDM : IWM_RIDX_CCK;
+               ridx = in->in_ridx[ni->ni_txrate];
+               return &iwm_rates[ridx];
+       }
+
        rinfo = &iwm_rates[ridx];
-
        rate_flags = 1 << IWM_RATE_MCS_ANT_POS;
        if (IWM_RIDX_IS_CCK(ridx))
                rate_flags |= IWM_RATE_MCS_CCK_MSK;



Home | Main Index | Thread Index | Old Index