-/* $OpenBSD: if_bwfm_pci.c,v 1.45 2021/02/26 00:07:41 patrick Exp $ */
+/* $OpenBSD: if_bwfm_pci.c,v 1.46 2021/02/26 00:14:28 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
int bwfm_pci_intr(void *);
void bwfm_pci_intr_enable(struct bwfm_pci_softc *);
void bwfm_pci_intr_disable(struct bwfm_pci_softc *);
+void bwfm_pci_hostready(struct bwfm_pci_softc *);
int bwfm_pci_load_microcode(struct bwfm_pci_softc *, const u_char *,
size_t, const u_char *, size_t);
void bwfm_pci_select_core(struct bwfm_pci_softc *, int );
bwfm_pci_select_core(sc, BWFM_AGENT_CORE_PCIE2);
bwfm_pci_intr_enable(sc);
+ bwfm_pci_hostready(sc);
/* Maps RX mbufs to a packet id and back. */
sc->sc_rx_pkts.npkt = BWFM_NUM_RX_PKTIDS;
struct bwfm_pci_msgring *ring)
{
bus_space_write_4(sc->sc_reg_iot, sc->sc_reg_ioh,
- BWFM_PCI_PCIE2REG_H2D_MAILBOX, 1);
+ BWFM_PCI_PCIE2REG_H2D_MAILBOX_0, 1);
}
void
BWFM_PCI_PCIE2REG_MAILBOXMASK, 0);
}
+void
+bwfm_pci_hostready(struct bwfm_pci_softc *sc)
+{
+ if ((sc->sc_shared_flags & BWFM_SHARED_INFO_HOSTRDY_DB1) == 0)
+ return;
+
+ bus_space_write_4(sc->sc_reg_iot, sc->sc_reg_ioh,
+ BWFM_PCI_PCIE2REG_H2D_MAILBOX_1, 1);
+}
+
/* Msgbuf protocol implementation */
int
bwfm_pci_msgbuf_query_dcmd(struct bwfm_softc *bwfm, int ifidx,
-/* $OpenBSD: if_bwfm_pci.h,v 1.3 2021/02/25 23:26:05 patrick Exp $ */
+/* $OpenBSD: if_bwfm_pci.h,v 1.4 2021/02/26 00:14:28 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
#define BWFM_PCI_PCIE2REG_CONFIGADDR 0x120
#define BWFM_PCI_PCIE2REG_CONFIGDATA 0x124
-#define BWFM_PCI_PCIE2REG_H2D_MAILBOX 0x140
+#define BWFM_PCI_PCIE2REG_H2D_MAILBOX_0 0x140
+#define BWFM_PCI_PCIE2REG_H2D_MAILBOX_1 0x144
#define BWFM_PCI_CFGREG_STATUS_CMD 0x004
#define BWFM_PCI_CFGREG_PM_CSR 0x04C
#define BWFM_SHARED_INFO_VERSION_MASK 0x00FF
#define BWFM_SHARED_INFO_DMA_INDEX 0x10000
#define BWFM_SHARED_INFO_DMA_2B_IDX 0x100000
+#define BWFM_SHARED_INFO_HOSTRDY_DB1 0x10000000
#define BWFM_SHARED_CONSOLE_ADDR 0x14
#define BWFM_SHARED_MAX_RXBUFPOST 0x22
#define BWFM_SHARED_MAX_RXBUFPOST_DEFAULT 255