From: patrick Date: Thu, 25 Feb 2021 23:26:05 +0000 (+0000) Subject: Support for version 7 of the bwfm(4) PCIe interface. The size of the items X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=095b0c44dbac494c409f092969484f1c9cb71507;p=openbsd Support for version 7 of the bwfm(4) PCIe interface. The size of the items on the rx/tx complete rings has increased slightly to accomodate possible new features. --- diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index 4198390e687..7bf723428e1 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.40 2021/02/25 02:48:20 dlg Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.41 2021/02/25 23:26:05 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -617,11 +617,13 @@ bwfm_pci_preinit(struct bwfm_softc *bwfm) d2h_w_idx_ptr, d2h_r_idx_ptr, 0, idx_offset, &ring_mem_ptr)) goto cleanup; - if (bwfm_pci_setup_ring(sc, &sc->sc_tx_complete, 1024, 16, + if (bwfm_pci_setup_ring(sc, &sc->sc_tx_complete, 1024, + sc->sc_shared_version >= 7 ? 24 : 16, d2h_w_idx_ptr, d2h_r_idx_ptr, 1, idx_offset, &ring_mem_ptr)) goto cleanup; - if (bwfm_pci_setup_ring(sc, &sc->sc_rx_complete, 512, 32, + if (bwfm_pci_setup_ring(sc, &sc->sc_rx_complete, 512, + sc->sc_shared_version >= 7 ? 40 : 32, d2h_w_idx_ptr, d2h_r_idx_ptr, 2, idx_offset, &ring_mem_ptr)) goto cleanup; diff --git a/sys/dev/pci/if_bwfm_pci.h b/sys/dev/pci/if_bwfm_pci.h index 4c5da6fb2ed..081a9556bae 100644 --- a/sys/dev/pci/if_bwfm_pci.h +++ b/sys/dev/pci/if_bwfm_pci.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_pci.h,v 1.2 2018/01/05 23:30:16 patrick Exp $ */ +/* $OpenBSD: if_bwfm_pci.h,v 1.3 2021/02/25 23:26:05 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -69,7 +69,7 @@ #define BWFM_SHARED_INFO 0x000 #define BWFM_SHARED_INFO_MIN_VERSION 5 -#define BWFM_SHARED_INFO_MAX_VERSION 6 +#define BWFM_SHARED_INFO_MAX_VERSION 7 #define BWFM_SHARED_INFO_VERSION_MASK 0x00FF #define BWFM_SHARED_INFO_DMA_INDEX 0x10000 #define BWFM_SHARED_INFO_DMA_2B_IDX 0x100000