From c794abf2cdb8157098bce14c3d8bf37092205f24 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 31 Aug 2021 21:02:09 +0000 Subject: [PATCH] Initialize some struct variables to make sure that upon reinit, caused by a suspend/resume cycle, the values are set to a sane default. --- sys/dev/pci/if_bwfm_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index 924d20b9baf..0b31b23f599 100644 --- a/sys/dev/pci/if_bwfm_pci.c +++ b/sys/dev/pci/if_bwfm_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_pci.c,v 1.53 2021/08/31 20:58:51 patrick Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.54 2021/08/31 21:02:09 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -493,6 +493,7 @@ bwfm_pci_preinit(struct bwfm_softc *bwfm) return 1; } + sc->sc_dma_idx_sz = 0; if (sc->sc_shared_flags & BWFM_SHARED_INFO_DMA_INDEX) { if (sc->sc_shared_flags & BWFM_SHARED_INFO_DMA_2B_IDX) sc->sc_dma_idx_sz = sizeof(uint16_t); @@ -684,6 +685,7 @@ bwfm_pci_preinit(struct bwfm_softc *bwfm) bus_dmamap_create(sc->sc_dmat, MSGBUF_MAX_PKT_SIZE, BWFM_NUM_TX_DESCS, MSGBUF_MAX_PKT_SIZE, 0, BUS_DMA_WAITOK, &sc->sc_tx_pkts.pkts[i].bb_map); + sc->sc_tx_pkts_full = 0; /* Maps IOCTL mbufs to a packet id and back. */ sc->sc_ioctl_pkts.npkt = BWFM_NUM_IOCTL_PKTIDS; -- 2.20.1