summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2006-08-19 14:57:38 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2006-08-19 14:57:38 +0000
commitcea5aa64c28458303952c034af314ceac2c12bd3 (patch)
tree3bc5ed18060c7a74ab9220f44a632a5cc42418e3
parenta88bd849e5d287c8a5a8dacff9f1fe89df3d0f92 (diff)
tweak dma sync ops
-rw-r--r--sys/dev/pci/if_ipw.c9
-rw-r--r--sys/dev/pci/if_iwi.c8
2 files changed, 7 insertions, 10 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index 45873fd863d..b6116cc0dc7 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ipw.c,v 1.61 2006/08/19 12:03:05 damien Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.62 2006/08/19 14:57:37 damien Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -1263,7 +1263,7 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni)
sbd->bd->len = htole32(sizeof (struct ipw_hdr));
sbd->bd->nfrag = 1 + sbuf->map->dm_nsegs;
sbd->bd->flags = IPW_BD_FLAG_TX_FRAME_802_3 |
- IPW_BD_FLAG_TX_NOT_LAST_FRAGMENT;
+ IPW_BD_FLAG_TX_NOT_LAST_FRAGMENT;
DPRINTFN(5, ("TX!HDR!%u!%u!%u!%u", shdr->hdr.type, shdr->hdr.subtype,
shdr->hdr.encrypted, shdr->hdr.encrypt));
@@ -1306,10 +1306,9 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni)
sc->txfree--;
}
- bus_dmamap_sync(sc->sc_dmat, shdr->map, 0, sizeof (struct ipw_hdr),
+ bus_dmamap_sync(sc->sc_dmat, sbuf->map, 0, sbuf->map->dm_mapsize,
BUS_DMASYNC_PREWRITE);
-
- bus_dmamap_sync(sc->sc_dmat, sbuf->map, 0, MCLBYTES,
+ bus_dmamap_sync(sc->sc_dmat, shdr->map, 0, sizeof (struct ipw_hdr),
BUS_DMASYNC_PREWRITE);
/* inform firmware about this new packet */
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 26b7106fda1..f9787fdc6dc 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwi.c,v 1.72 2006/08/19 12:03:05 damien Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.73 2006/08/19 14:57:37 damien Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -1411,13 +1411,12 @@ iwi_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni)
desc->seg_len[i] = htole16(data->map->dm_segs[i].ds_len);
}
+ bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize,
+ BUS_DMASYNC_PREWRITE);
bus_dmamap_sync(sc->sc_dmat, txq->map,
txq->cur * sizeof (struct iwi_tx_desc),
sizeof (struct iwi_tx_desc), BUS_DMASYNC_PREWRITE);
- bus_dmamap_sync(sc->sc_dmat, data->map, 0, MCLBYTES,
- BUS_DMASYNC_PREWRITE);
-
DPRINTFN(5, ("sending data frame idx=%u len=%u nseg=%u\n", txq->cur,
letoh16(desc->len), data->map->dm_nsegs));
@@ -2112,7 +2111,6 @@ iwi_auth_and_assoc(struct iwi_softc *sc)
else /* assume 802.11b/g */
assoc.mode = IWI_MODE_11G;
assoc.chan = ieee80211_chan2ieee(ic, ni->ni_chan);
-
#if 0
if (ni->ni_challenge != NULL) /* XXX */
assoc.auth = (ic->ic_wep_txkey << 4) | IWI_AUTH_SHARED;