FreeBSD Bugzilla – Attachment 153985 Details for
Bug 197143
[wpi] [patch]: sync with iwn / OpenBSD wpi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Revert changes related to IEEE80211_F_DATAPAD (there is no padding in RX path).
patch-wpi1.diff (text/plain), 3.59 KB, created by
Andriy Voskoboinyk
on 2015-03-08 01:17:53 UTC
(
hide
)
Description:
Revert changes related to IEEE80211_F_DATAPAD (there is no padding in RX path).
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-08 01:17:53 UTC
Size:
3.59 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 278764) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -447,8 +447,6 @@ > ic->ic_cryptocaps = > IEEE80211_CRYPTO_AES_CCM; > >- ic->ic_flags |= IEEE80211_F_DATAPAD; >- > /* > * Read in the eeprom and also setup the channels for > * net80211. We don't set the rates as net80211 does this for us >@@ -2224,8 +2222,6 @@ > static int > wpi_cmd2(struct wpi_softc *sc, struct wpi_buf *buf) > { >- struct ifnet *ifp = sc->sc_ifp; >- struct ieee80211com *ic = ifp->if_l2com; > struct ieee80211_frame *wh; > struct wpi_tx_cmd *cmd; > struct wpi_tx_data *data; >@@ -2233,7 +2229,7 @@ > struct wpi_tx_ring *ring; > struct mbuf *m1; > bus_dma_segment_t *seg, segs[WPI_MAX_SCATTER]; >- int error, i, hdrspace, nsegs, totlen; >+ int error, i, hdrlen, nsegs, totlen, pad; > > WPI_LOCK_ASSERT(sc); > >@@ -2240,9 +2236,15 @@ > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); > > wh = mtod(buf->m, struct ieee80211_frame *); >- hdrspace = ieee80211_anyhdrspace(ic, wh); >+ hdrlen = ieee80211_anyhdrsize(wh); > totlen = buf->m->m_pkthdr.len; > >+ if (hdrlen & 3) { >+ /* First segment length must be a multiple of 4. */ >+ pad = 4 - (hdrlen & 3); >+ } else >+ pad = 0; >+ > ring = &sc->txq[buf->ac]; > desc = &ring->desc[ring->cur]; > data = &ring->data[ring->cur]; >@@ -2257,8 +2259,8 @@ > memcpy(cmd->data, buf->data, buf->size); > > /* Save and trim IEEE802.11 header. */ >- memcpy((uint8_t *)(cmd->data + buf->size), wh, hdrspace); >- m_adj(buf->m, hdrspace); >+ memcpy((uint8_t *)(cmd->data + buf->size), wh, hdrlen); >+ m_adj(buf->m, hdrlen); > > error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, buf->m, > segs, &nsegs, BUS_DMA_NOWAIT); >@@ -2296,10 +2298,10 @@ > __func__, ring->qid, ring->cur, totlen, nsegs); > > /* Fill TX descriptor. */ >- desc->nsegs = WPI_PAD32(totlen) << 4 | (1 + nsegs); >+ desc->nsegs = WPI_PAD32(totlen + pad) << 4 | (1 + nsegs); > /* First DMA segment is used by the TX command. */ > desc->segs[0].addr = htole32(data->cmd_paddr); >- desc->segs[0].len = htole32(4 + buf->size + hdrspace); >+ desc->segs[0].len = htole32(4 + buf->size + hdrlen + pad); > /* Other DMA segments are for data payload. */ > seg = &segs[0]; > for (i = 1; i <= nsegs; i++) { >@@ -2345,10 +2347,9 @@ > uint32_t flags; > uint16_t qos; > uint8_t tid, type; >- int ac, error, rate, ismcast, hdrlen, totlen; >+ int ac, error, rate, ismcast, totlen; > > wh = mtod(m, struct ieee80211_frame *); >- hdrlen = ieee80211_anyhdrsize(wh); > type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; > ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); > >@@ -2392,12 +2393,12 @@ > /* 802.11 header may have moved. */ > wh = mtod(m, struct ieee80211_frame *); > } >- totlen = m->m_pkthdr.len - (hdrlen & 3); >+ totlen = m->m_pkthdr.len; > > if (ieee80211_radiotap_active_vap(vap)) { > struct wpi_tx_radiotap_header *tap = &sc->sc_txtap; > >- tap->wt_flags = IEEE80211_RADIOTAP_F_DATAPAD; >+ tap->wt_flags = 0; > tap->wt_rate = rate; > if (k != NULL) > tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; >@@ -2514,12 +2515,11 @@ > struct wpi_buf tx_data; > uint32_t flags; > uint8_t type; >- int ac, rate, hdrlen, totlen; >+ int ac, rate, totlen; > > wh = mtod(m, struct ieee80211_frame *); >- hdrlen = ieee80211_anyhdrsize(wh); > type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; >- totlen = m->m_pkthdr.len - (hdrlen & 3); >+ totlen = m->m_pkthdr.len; > > ac = params->ibp_pri & 3; > >@@ -2541,8 +2541,6 @@ > > tap->wt_flags = 0; > tap->wt_rate = rate; >- if (params->ibp_flags & IEEE80211_BPF_DATAPAD) >- tap->wt_flags |= IEEE80211_RADIOTAP_F_DATAPAD; > > ieee80211_radiotap_tx(vap, m); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197143
:
152282
|
152662
|
152977
|
153911
|
153977
|
153983
| 153985 |
153999
|
154000
|
154002
|
154006
|
154007
|
154009
|
154010
|
154011
|
154013
|
154015
|
154016
|
154017
|
154019
|
154020
|
154021
|
154022
|
154024
|
154026
|
154030
|
154032
|
154033
|
154328
|
154329
|
154330
|
154332
|
154334
|
154335
|
154336
|
154337
|
154338
|
154340
|
154341
|
154343
|
154346
|
154347
|
154348
|
154349
|
154350
|
154351
|
154352
|
154353
|
154354
|
154355
|
154356
|
154357
|
154358
|
154359
|
154360
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366
|
154368
|
154369
|
154370
|
154371
|
154372
|
154373
|
154374
|
154375
|
154378
|
154379
|
154380
|
154381
|
154382
|
154383
|
154384
|
155332
|
155333
|
156164
|
156165
|
156166
|
156167
|
156168
|
156169
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
|
156178
|
156179
|
156180
|
156181
|
156182
|
156183
|
156184
|
156185
|
156186
|
156187
|
156188
|
156189
|
156190
|
156191
|
156192
|
156193
|
156194
|
156195