diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 580b5e3dd780..0c666f51747b 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -6197,7 +6197,7 @@ iwx_send_cmd(struct iwx_softc *sc, struct iwx_host_cmd *hcmd) goto out; } MCLAIM(m, &sc->sc_ec.ec_tx_mowner); - MEXTMALLOC(m, totlen, M_DONTWAIT); + MEXTMALLOC(m, totlen + 64, M_DONTWAIT); if (!(m->m_flags & M_EXT)) { printf("%s: could not get fw cmd mbuf (%zd bytes)\n", DEVNAME(sc), totlen); @@ -6205,6 +6205,8 @@ iwx_send_cmd(struct iwx_softc *sc, struct iwx_host_cmd *hcmd) goto out; } cmd = mtod(m, struct iwx_device_cmd *); + printf("%s:%d: m=%p dataptr=%p\n", __func__, __LINE__, m, cmd); + memset(cmd, 0, totlen + 64); err = bus_dmamap_load(sc->sc_dmat, txdata->map, cmd, totlen, NULL, BUS_DMA_NOWAIT | BUS_DMA_WRITE); if (err) { @@ -6397,6 +6399,12 @@ iwx_cmd_done(struct iwx_softc *sc, int qid, int idx, int code) data = &ring->data[idx]; if (data->m != NULL) { + const void *ptr = mtod(m, void *); + printf("%s:%d: m=%p dataptr=%p\n", __func__, __LINE__, m, ptr); + if (m->m_flags & M_EXT) + hexdump(printf, "ext", ptr, m->m_ext.ext_size); + else + hexdump(printf, "no ext", ptr, m->m_len); bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->sc_dmat, data->map);