diff options
| author | Andriy Voskoboinyk <avos@FreeBSD.org> | 2016-10-08 20:41:08 +0000 |
|---|---|---|
| committer | Andriy Voskoboinyk <avos@FreeBSD.org> | 2016-10-08 20:41:08 +0000 |
| commit | 3f3d4d61003f2fcfaa507462afba15362e1b5b9b (patch) | |
| tree | 5ad07e7e172377f69188405e468ee592d7be26fe /sys/dev/wpi | |
| parent | 3f4a7d9c24f1cddad9d09232aa5fc0acf739b5e1 (diff) | |
Notes
Diffstat (limited to 'sys/dev/wpi')
| -rw-r--r-- | sys/dev/wpi/if_wpi.c | 10 | ||||
| -rw-r--r-- | sys/dev/wpi/if_wpivar.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 61034a6f0e0a..b6f69a5aa6ed 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -527,7 +527,8 @@ wpi_attach(device_t dev) wpi_radiotap_attach(sc); /* Setup Tx status flags (constant). */ - sc->sc_txs.flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | + sc->sc_txs.flags = IEEE80211_RATECTL_STATUS_PKTLEN | + IEEE80211_RATECTL_STATUS_SHORT_RETRY | IEEE80211_RATECTL_STATUS_LONG_RETRY; callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); @@ -2079,9 +2080,15 @@ wpi_tx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) m = data->m, data->m = NULL; ni = data->ni, data->ni = NULL; + /* Restore frame header. */ + KASSERT(M_LEADINGSPACE(m) >= data->hdrlen, ("no frame header!")); + M_PREPEND(m, data->hdrlen, M_NOWAIT); + KASSERT(m != NULL, ("%s: m is NULL\n", __func__)); + /* * Update rate control statistics for the node. */ + txs->pktlen = m->m_pkthdr.len; txs->short_retries = stat->rtsfailcnt; txs->long_retries = stat->ackfailcnt / WPI_NTRIES_DEFAULT; if (!(status & WPI_TX_STATUS_FAIL)) @@ -2721,6 +2728,7 @@ wpi_cmd2(struct wpi_softc *sc, struct wpi_buf *buf) data->m = buf->m; data->ni = buf->ni; + data->hdrlen = hdrlen; DPRINTF(sc, WPI_DEBUG_XMIT, "%s: qid %d idx %d len %d nsegs %d\n", __func__, ring->qid, cur, totlen, nsegs); diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h index f8b92e2be672..8c45a9c85066 100644 --- a/sys/dev/wpi/if_wpivar.h +++ b/sys/dev/wpi/if_wpivar.h @@ -63,6 +63,7 @@ struct wpi_tx_data { bus_addr_t cmd_paddr; struct mbuf *m; struct ieee80211_node *ni; + int hdrlen; }; struct wpi_tx_ring { |
