Support for version 7 of the bwfm(4) PCIe interface. The size of the items
authorpatrick <patrick@openbsd.org>
Thu, 25 Feb 2021 23:26:05 +0000 (23:26 +0000)
committerpatrick <patrick@openbsd.org>
Thu, 25 Feb 2021 23:26:05 +0000 (23:26 +0000)
on the rx/tx complete rings has increased slightly to accomodate possible
new features.

sys/dev/pci/if_bwfm_pci.c
sys/dev/pci/if_bwfm_pci.h

index 4198390..7bf7234 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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;
index 4c5da6f..081a955 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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