The branch main has been updated by jhibbits:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1510005c94b81671545128b9b6c3357df859dc54

commit 1510005c94b81671545128b9b6c3357df859dc54
Author:     Justin Hibbits <jhibb...@freebsd.org>
AuthorDate: 2023-03-07 20:41:38 +0000
Commit:     Justin Hibbits <jhibb...@freebsd.org>
CommitDate: 2023-03-11 16:34:42 +0000

    dtsec: Complete mechanical conversion to IfAPI
    
    Some changes were missed in 0083fc5c76.
    
    Sponsored by:   Juniper Networks, Inc.
---
 sys/dev/dpaa/if_dtsec.c    | 8 ++++----
 sys/dev/dpaa/if_dtsec_im.c | 8 ++++----
 sys/dev/dpaa/if_dtsec_rm.c | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sys/dev/dpaa/if_dtsec.c b/sys/dev/dpaa/if_dtsec.c
index cc34c2cbb416..877611c6cebe 100644
--- a/sys/dev/dpaa/if_dtsec.c
+++ b/sys/dev/dpaa/if_dtsec.c
@@ -359,7 +359,7 @@ dtsec_if_enable_locked(struct dtsec_softc *sc)
        if (error != E_OK)
                return (EIO);
 
-       sc->sc_ifnet->if_drv_flags |= IFF_DRV_RUNNING;
+       if_setdrvflagbits(sc->sc_ifnet, IFF_DRV_RUNNING, 0);
 
        /* Refresh link state */
        dtsec_miibus_statchg(sc->sc_dev);
@@ -386,7 +386,7 @@ dtsec_if_disable_locked(struct dtsec_softc *sc)
        if (error != E_OK)
                return (EIO);
 
-       sc->sc_ifnet->if_drv_flags &= ~IFF_DRV_RUNNING;
+       if_setdrvflagbits(sc->sc_ifnet, 0, IFF_DRV_RUNNING);
 
        return (0);
 }
@@ -415,7 +415,7 @@ dtsec_if_ioctl(if_t ifp, u_long command, caddr_t data)
        case SIOCSIFFLAGS:
                DTSEC_LOCK(sc);
 
-               if (sc->sc_ifnet->if_flags & IFF_UP)
+               if (if_getflags(sc->sc_ifnet) & IFF_UP)
                        error = dtsec_if_enable_locked(sc);
                else
                        error = dtsec_if_disable_locked(sc);
@@ -482,7 +482,7 @@ dtsec_if_init_locked(struct dtsec_softc *sc)
        if (sc->sc_mii)
                callout_reset(&sc->sc_tick_callout, hz, dtsec_if_tick, sc);
 
-       if (sc->sc_ifnet->if_flags & IFF_UP) {
+       if (if_getflags(sc->sc_ifnet) & IFF_UP) {
                error = dtsec_if_enable_locked(sc);
                if (error != 0)
                        goto err;
diff --git a/sys/dev/dpaa/if_dtsec_im.c b/sys/dev/dpaa/if_dtsec_im.c
index cae0499c282b..2b25b935b657 100644
--- a/sys/dev/dpaa/if_dtsec_im.c
+++ b/sys/dev/dpaa/if_dtsec_im.c
@@ -77,7 +77,7 @@ dtsec_im_fm_port_rx_callback(t_Handle app, uint8_t *data, 
uint16_t length,
 
        m = m_devget(data, length, 0, sc->sc_ifnet, NULL);
        if (m)
-               (*sc->sc_ifnet->if_input)(sc->sc_ifnet, m);
+               if_input(sc->sc_ifnet, m);
 
        XX_FreeSmart(data);
 
@@ -234,11 +234,11 @@ dtsec_im_if_start_locked(struct dtsec_softc *sc)
        if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) == 0)
                return;
 
-       if ((sc->sc_ifnet->if_drv_flags & IFF_DRV_RUNNING) != IFF_DRV_RUNNING)
+       if ((if_getdrvflags(sc->sc_ifnet) & IFF_DRV_RUNNING) != IFF_DRV_RUNNING)
                return;
 
-       while (!IFQ_DRV_IS_EMPTY(&sc->sc_ifnet->if_snd)) {
-               IFQ_DRV_DEQUEUE(&sc->sc_ifnet->if_snd, m);
+       while (!if_sendq_empty(sc->sc_ifnet)) {
+               m = if_dequeue(sc->sc_ifnet);
                if (m == NULL)
                        break;
 
diff --git a/sys/dev/dpaa/if_dtsec_rm.c b/sys/dev/dpaa/if_dtsec_rm.c
index d42973915b6b..73e75de65174 100644
--- a/sys/dev/dpaa/if_dtsec_rm.c
+++ b/sys/dev/dpaa/if_dtsec_rm.c
@@ -389,7 +389,7 @@ dtsec_rm_fqr_rx_callback(t_Handle app, t_Handle fqr, 
t_Handle portal,
        m->m_len = DPAA_FD_GET_LENGTH(frame);
        m_fixhdr(m);
 
-       (*sc->sc_ifnet->if_input)(sc->sc_ifnet, m);
+       if_input(sc->sc_ifnet, m);
 
        return (e_RX_STORE_RESPONSE_CONTINUE);
 
@@ -555,10 +555,10 @@ dtsec_rm_if_start_locked(struct dtsec_softc *sc)
        if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) == 0)
                return;
 
-       if ((sc->sc_ifnet->if_drv_flags & IFF_DRV_RUNNING) != IFF_DRV_RUNNING)
+       if ((if_getdrvflags(sc->sc_ifnet) & IFF_DRV_RUNNING) != IFF_DRV_RUNNING)
                return;
 
-       while (!IFQ_DRV_IS_EMPTY(&sc->sc_ifnet->if_snd)) {
+       while (!if_sendq_empty(sc->sc_ifnet)) {
                /* Check length of the TX queue */
                qlen = qman_fqr_get_counter(sc->sc_tx_fqr, 0,
                    e_QM_FQR_COUNTERS_FRAME);
@@ -572,7 +572,7 @@ dtsec_rm_if_start_locked(struct dtsec_softc *sc)
                if (fi == NULL)
                        return;
 
-               IFQ_DRV_DEQUEUE(&sc->sc_ifnet->if_snd, m0);
+               m0 = if_dequeue(sc->sc_ifnet);
                if (m0 == NULL) {
                        dtsec_rm_fi_free(sc, fi);
                        return;

Reply via email to