diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-01-03 21:01:17 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-01-03 21:01:17 +0000 |
commit | 050dc7bf0f38acd812e081a11a1a0ba12e8a5dae (patch) | |
tree | 4329d03cdd13713e891fcafe4ad2cf0040b4989f /sys/dev/pci/if_bwfm_pci.c | |
parent | f40c19909df2a3e78ff4a8cdd95f6250cc6d3789 (diff) |
Since the PCI attachment code already uses mbufs for RX packets, we can
push the mbuf allocation down into the USB attachment code and now pass
an mbuf to the bwfm(4) receive function.
Diffstat (limited to 'sys/dev/pci/if_bwfm_pci.c')
-rw-r--r-- | sys/dev/pci/if_bwfm_pci.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index a36aba4d8e5..7cb65dde130 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.4 2018/01/03 08:43:10 patrick Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.5 2018/01/03 21:01:16 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se> @@ -1165,8 +1165,8 @@ bwfm_pci_msg_rx(struct bwfm_pci_softc *sc, void *buf) if (m == NULL) break; m_adj(m, sc->sc_rx_dataoffset); - bwfm_rx(&sc->sc_sc, mtod(m, char *), letoh16(event->event_data_len)); - m_freem(m); + m->m_len = m->m_pkthdr.len = letoh16(event->event_data_len); + bwfm_rx(&sc->sc_sc, m); if_rxr_put(&sc->sc_event_ring, 1); bwfm_pci_fill_rx_rings(sc); break; @@ -1180,8 +1180,8 @@ bwfm_pci_msg_rx(struct bwfm_pci_softc *sc, void *buf) m_adj(m, letoh16(rx->data_offset)); else if (sc->sc_rx_dataoffset) m_adj(m, sc->sc_rx_dataoffset); - bwfm_rx(&sc->sc_sc, mtod(m, char *), letoh16(rx->data_len)); - m_freem(m); + m->m_len = m->m_pkthdr.len = letoh16(rx->data_len); + bwfm_rx(&sc->sc_sc, m); if_rxr_put(&sc->sc_rxbuf_ring, 1); bwfm_pci_fill_rx_rings(sc); break; |