diff options
author | Robert Mustacchi <rm@fingolfin.org> | 2020-07-25 10:47:36 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@fingolfin.org> | 2020-07-29 08:19:37 -0700 |
commit | 2590fb56d329661927485eb826679e9f44e9c3dc (patch) | |
tree | c07b244a51e34c9db8d8138cb6da8bc16e24609c | |
parent | 5c1597bcad8dabd41c0a919fb8acfabd8054e924 (diff) | |
download | illumos-joyent-2590fb56d329661927485eb826679e9f44e9c3dc.tar.gz |
12985 fix wpi ddi_dma_nextcookie misuse
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Paul Winder <paul@winder.uk.net>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/wpi/wpi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/uts/common/io/wpi/wpi.c b/usr/src/uts/common/io/wpi/wpi.c index 1913d7d980..4f0dd439e8 100644 --- a/usr/src/uts/common/io/wpi/wpi.c +++ b/usr/src/uts/common/io/wpi/wpi.c @@ -785,7 +785,7 @@ wpi_destroy_locks(wpi_sc_t *sc) */ static int wpi_alloc_dma_mem(wpi_sc_t *sc, size_t memsize, ddi_dma_attr_t *dma_attr_p, - ddi_device_acc_attr_t *acc_attr_p, uint_t dma_flags, wpi_dma_t *dma_p) + ddi_device_acc_attr_t *acc_attr_p, uint_t dma_flags, wpi_dma_t *dma_p) { caddr_t vaddr; int err; @@ -885,8 +885,9 @@ wpi_alloc_fw_dma(wpi_sc_t *sc) goto fail; } for (i = 0; i < dma_p->ncookies; i++) { - sc->sc_fw_text_cookie[i] = dma_p->cookie; - ddi_dma_nextcookie(dma_p->dma_hdl, &dma_p->cookie); + const ddi_dma_cookie_t *c; + c = ddi_dma_cookie_get(dma_p->dma_hdl, i); + sc->sc_fw_text_cookie[i] = *c; } err = wpi_alloc_dma_mem(sc, LE_32(sc->sc_hdr->datasz), &fw_buffer_dma_attr, &wpi_dma_accattr, @@ -902,8 +903,9 @@ wpi_alloc_fw_dma(wpi_sc_t *sc) goto fail; } for (i = 0; i < dma_p->ncookies; i++) { - sc->sc_fw_data_cookie[i] = dma_p->cookie; - ddi_dma_nextcookie(dma_p->dma_hdl, &dma_p->cookie); + const ddi_dma_cookie_t *c; + c = ddi_dma_cookie_get(dma_p->dma_hdl, i); + sc->sc_fw_data_cookie[i] = *c; } fail: return (err); |