summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2020-01-15 21:41:03 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2020-01-15 21:41:03 +0000
commita28e1298bf1f29fa7fa4e1312592b6903959185b (patch)
tree5ff0858edb5022c1a0c18a3421f25bc499d6f42a /sys
parentde0e953759035ca7477eacbc0f099f3cd7d8d497 (diff)
Some PCIe firmwares drop TX packets when the pktid is 0. Add
an offset to make sure they start from 1.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_bwfm_pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c
index ba9652b8a42..d9aaceac3e3 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.31 2020/01/15 20:17:08 patrick Exp $ */
+/* $OpenBSD: if_bwfm_pci.c,v 1.32 2020/01/15 21:41:02 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -1380,7 +1380,7 @@ bwfm_pci_msg_rx(struct bwfm_pci_softc *sc, void *buf)
case MSGBUF_TYPE_TX_STATUS:
tx = (struct msgbuf_tx_status *)buf;
m = bwfm_pci_pktid_free(sc, &sc->sc_tx_pkts,
- letoh32(tx->msg.request_id));
+ letoh32(tx->msg.request_id) - 1);
if (m == NULL)
break;
m_freem(m);
@@ -1837,7 +1837,7 @@ bwfm_pci_txdata(struct bwfm_softc *bwfm, struct mbuf *m)
}
paddr += ETHER_HDR_LEN;
- tx->msg.request_id = htole32(pktid);
+ tx->msg.request_id = htole32(pktid + 1);
tx->data_len = htole16(m->m_len - ETHER_HDR_LEN);
tx->data_buf_addr.high_addr = htole32((uint64_t)paddr >> 32);
tx->data_buf_addr.low_addr = htole32(paddr & 0xffffffff);