sync with OpenBSD -current

This commit is contained in:
purplerain 2024-01-16 01:36:31 +00:00
parent 25aa71bc5f
commit 34a3d7e18a
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
32 changed files with 640 additions and 460 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: virtio_mmio.c,v 1.11 2023/05/29 08:13:35 sf Exp $ */
/* $OpenBSD: virtio_mmio.c,v 1.12 2024/01/15 02:35:23 dv Exp $ */
/* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */
/*
@ -200,11 +200,19 @@ virtio_mmio_set_status(struct virtio_softc *vsc, int status)
struct virtio_mmio_softc *sc = (struct virtio_mmio_softc *)vsc;
int old = 0;
if (status != 0)
if (status == 0) {
bus_space_write_4(sc->sc_iot, sc->sc_ioh, VIRTIO_MMIO_STATUS,
0);
while (bus_space_read_4(sc->sc_iot, sc->sc_ioh,
VIRTIO_MMIO_STATUS) != 0) {
CPU_BUSY_CYCLE();
}
} else {
old = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
VIRTIO_MMIO_STATUS);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, VIRTIO_MMIO_STATUS,
status|old);
VIRTIO_MMIO_STATUS);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, VIRTIO_MMIO_STATUS,
status|old);
}
}
int

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_bnxt.c,v 1.43 2024/01/10 05:06:00 jmatthew Exp $ */
/* $OpenBSD: if_bnxt.c,v 1.44 2024/01/15 08:56:45 jmatthew Exp $ */
/*-
* Broadcom NetXtreme-C/E network driver.
*
@ -92,7 +92,7 @@
#define BNXT_CP_PAGES 4
#define BNXT_MAX_TX_SEGS 32 /* a bit much? */
#define BNXT_MAX_TX_SEGS 31
#define BNXT_TX_SLOTS(bs) (bs->bs_map->dm_nsegs + 1)
#define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input)
@ -1395,8 +1395,9 @@ bnxt_start(struct ifqueue *ifq)
else
txflags = TX_BD_LONG_FLAGS_LHINT_GTE2K;
txflags |= TX_BD_LONG_TYPE_TX_BD_LONG |
TX_BD_LONG_FLAGS_NO_CMPL |
(BNXT_TX_SLOTS(bs) << TX_BD_LONG_FLAGS_BD_CNT_SFT);
TX_BD_LONG_FLAGS_NO_CMPL;
txflags |= (BNXT_TX_SLOTS(bs) << TX_BD_LONG_FLAGS_BD_CNT_SFT) &
TX_BD_LONG_FLAGS_BD_CNT_MASK;
if (map->dm_nsegs == 1)
txflags |= TX_BD_SHORT_FLAGS_PACKET_END;
txring[idx].flags_type = htole16(txflags);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: virtio_pci.c,v 1.35 2023/07/07 10:23:39 patrick Exp $ */
/* $OpenBSD: virtio_pci.c,v 1.36 2024/01/15 02:35:23 dv Exp $ */
/* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */
/*
@ -282,15 +282,29 @@ virtio_pci_set_status(struct virtio_softc *vsc, int status)
int old = 0;
if (sc->sc_sc.sc_version_1) {
if (status != 0)
if (status == 0) {
CWRITE(sc, device_status, 0);
while (CREAD(sc, device_status) != 0) {
CPU_BUSY_CYCLE();
}
} else {
old = CREAD(sc, device_status);
CWRITE(sc, device_status, status|old);
CWRITE(sc, device_status, status|old);
}
} else {
if (status != 0)
if (status == 0) {
bus_space_write_1(sc->sc_iot, sc->sc_ioh,
VIRTIO_CONFIG_DEVICE_STATUS, status|old);
while (bus_space_read_1(sc->sc_iot, sc->sc_ioh,
VIRTIO_CONFIG_DEVICE_STATUS) != 0) {
CPU_BUSY_CYCLE();
}
} else {
old = bus_space_read_1(sc->sc_iot, sc->sc_ioh,
VIRTIO_CONFIG_DEVICE_STATUS);
bus_space_write_1(sc->sc_iot, sc->sc_ioh,
VIRTIO_CONFIG_DEVICE_STATUS, status|old);
bus_space_write_1(sc->sc_iot, sc->sc_ioh,
VIRTIO_CONFIG_DEVICE_STATUS, status|old);
}
}
}