diff options
Diffstat (limited to 'rtemsbsd/sys')
-rw-r--r-- | rtemsbsd/sys/dev/ffec/if_ffec_mcf548x.c | 3 | ||||
-rw-r--r-- | rtemsbsd/sys/dev/tsec/if_tsec_nexus.c | 1 | ||||
-rw-r--r-- | rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c | 2 | ||||
-rwxr-xr-x | rtemsbsd/sys/fs/devfs/devfs_devs.c | 16 | ||||
-rw-r--r-- | rtemsbsd/sys/net/if_ppp.c | 32 | ||||
-rw-r--r-- | rtemsbsd/sys/net/if_pppvar.h | 4 | ||||
-rw-r--r-- | rtemsbsd/sys/net/ppp_tty.c | 18 |
7 files changed, 35 insertions, 41 deletions
diff --git a/rtemsbsd/sys/dev/ffec/if_ffec_mcf548x.c b/rtemsbsd/sys/dev/ffec/if_ffec_mcf548x.c index 875fae57..a6d55b19 100644 --- a/rtemsbsd/sys/dev/ffec/if_ffec_mcf548x.c +++ b/rtemsbsd/sys/dev/ffec/if_ffec_mcf548x.c @@ -1145,7 +1145,7 @@ static MCD_bufDescFec *fec_init_rx_dma( for (bdIndex = 0; bdIndex < bdCount; ++bdIndex) { bool bdIsLast = bdIndex == bdCount - 1; - mbufs[bdIndex] = fec_add_mbuf(M_WAIT, ifp, &bdRing[bdIndex], bdIsLast); + mbufs[bdIndex] = fec_add_mbuf(M_WAITOK, ifp, &bdRing[bdIndex], bdIsLast); } return bdRing; @@ -1539,7 +1539,6 @@ static int fec_attach(device_t dev) IFQ_SET_MAXLEN(&ifp->if_snd, TX_BUF_COUNT - 1); ifp->if_snd.ifq_drv_maxlen = TX_BUF_COUNT - 1; IFQ_SET_READY(&ifp->if_snd); - ifp->if_data.ifi_hdrlen = sizeof(struct ether_header); /* * Attach the interface diff --git a/rtemsbsd/sys/dev/tsec/if_tsec_nexus.c b/rtemsbsd/sys/dev/tsec/if_tsec_nexus.c index 72dfafa1..b56a598d 100644 --- a/rtemsbsd/sys/dev/tsec/if_tsec_nexus.c +++ b/rtemsbsd/sys/dev/tsec/if_tsec_nexus.c @@ -152,7 +152,6 @@ tsec_fdt_attach(device_t dev) sc->dev = dev; /* FIXME */ - sc->phy_sc = sc; sc->phyaddr = -1; /* Init timer */ diff --git a/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c b/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c index 00fbaef0..906fc742 100644 --- a/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c +++ b/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c @@ -254,7 +254,7 @@ ehci_mpc83xx_attach(device_t self) ); BSD_ASSERT_SC(sc); - e->sc_flags |= EHCI_SCFLG_SETMODE | EHCI_SCFLG_NORESTERM | EHCI_SCFLG_TT; + e->sc_flags |= EHCI_SCFLG_NORESTERM | EHCI_SCFLG_TT; /* EHCI intitialization */ ue = ehci_init(e); diff --git a/rtemsbsd/sys/fs/devfs/devfs_devs.c b/rtemsbsd/sys/fs/devfs/devfs_devs.c index 75c9e270..85929e81 100755 --- a/rtemsbsd/sys/fs/devfs/devfs_devs.c +++ b/rtemsbsd/sys/fs/devfs/devfs_devs.c @@ -98,7 +98,7 @@ devfs_imfs_readv(rtems_libio_t *iop, const struct iovec *iov, int iovcnt, struct cdev *cdev = devfs_imfs_get_context_by_iop(iop); struct thread *td = rtems_bsd_get_curthread_or_null(); struct uio uio = { - .uio_iov = iov, + .uio_iov = __DECONST(struct iovec *, iov), .uio_iovcnt = iovcnt, .uio_offset = 0, .uio_resid = total, @@ -140,7 +140,7 @@ devfs_imfs_writev(rtems_libio_t *iop, const struct iovec *iov, int iovcnt, struct cdev *cdev = devfs_imfs_get_context_by_iop(iop); struct thread *td = rtems_bsd_get_curthread_or_null(); struct uio uio = { - .uio_iov = iov, + .uio_iov = __DECONST(struct iovec *, iov), .uio_iovcnt = iovcnt, .uio_offset = 0, .uio_resid = total, @@ -168,7 +168,7 @@ static ssize_t devfs_imfs_write(rtems_libio_t *iop, const void *buffer, size_t count) { struct iovec iov = { - .iov_base = buffer, + .iov_base = __DECONST(void *, buffer), .iov_len = count }; @@ -237,15 +237,11 @@ devfs_alloc(int flags) { struct cdev *cdev; - cdev = malloc(sizeof *cdev, M_TEMP, 0); - if (cdev == NULL) + cdev = malloc(sizeof *cdev, M_TEMP, M_ZERO); + if (cdev != NULL) return (NULL); - memset(cdev, 0, sizeof *cdev); - cdev->si_name = cdev->__si_namebuf; - memcpy(cdev->__si_pathstruct.__si_dir, rtems_cdev_directory, - sizeof(rtems_cdev_directory) - 1); - + memcpy(cdev->si_path, rtems_cdev_directory, sizeof(cdev->si_path)); return (cdev); } diff --git a/rtemsbsd/sys/net/if_ppp.c b/rtemsbsd/sys/net/if_ppp.c index b93dc0db..8f8d29c6 100644 --- a/rtemsbsd/sys/net/if_ppp.c +++ b/rtemsbsd/sys/net/if_ppp.c @@ -107,6 +107,7 @@ #include <machine/bus.h> #include <net/if.h> +#include <net/if_var.h> #include <net/if_types.h> #include <net/netisr.h> #include <net/route.h> @@ -918,7 +919,7 @@ pppsioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data) * Packet is placed in Information field of PPP frame. */ int -pppoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, +pppoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, struct route *rtp) { register struct ppp_softc *sc = ifp->if_softc; @@ -987,7 +988,7 @@ pppoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, * (This assumes M_LEADINGSPACE is always 0 for a cluster mbuf.) */ if (M_LEADINGSPACE(m0) < PPP_HDRLEN) { - m0 = m_prepend(m0, PPP_HDRLEN, M_DONTWAIT); + m0 = m_prepend(m0, PPP_HDRLEN, M_NOWAIT); if (m0 == 0) { error = ENOBUFS; goto bad; @@ -1063,9 +1064,9 @@ pppoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, } else { ifq = (m0->m_flags & M_HIGHPRI)? &sc->sc_fastq: &ifp->if_snd; if (_IF_QFULL(ifq) && dst->sa_family != AF_UNSPEC) { - IFQ_INC_DROPS(ifq); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); splx(s); - sc->sc_ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->sc_stats.ppp_oerrors++; error = ENOBUFS; goto bad; @@ -1074,8 +1075,8 @@ pppoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, (*sc->sc_start)(sc); } ifp->if_lastchange = ppp_time; - ifp->if_opackets++; - ifp->if_obytes += len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); splx(s); return (0); @@ -1115,8 +1116,8 @@ ppp_requeue(struct ppp_softc *sc) m->m_nextpkt = NULL; ifq = (m->m_flags & M_HIGHPRI)? &sc->sc_fastq: &sc->sc_ifp->if_snd; if (_IF_QFULL(ifq)) { - IFQ_INC_DROPS(ifq); - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OQDROPS, 1); + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); sc->sc_stats.ppp_oerrors++; } else IF_ENQUEUE(ifq, m); @@ -1517,13 +1518,13 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m) } /* Copy the PPP and IP headers into a new mbuf. */ - MGETHDR(mp, M_DONTWAIT, MT_DATA); + MGETHDR(mp, M_NOWAIT, MT_DATA); if (mp == NULL) goto bad; mp->m_len = 0; mp->m_next = NULL; if (hlen + PPP_HDRLEN > MHLEN) { - MCLGET(mp, M_DONTWAIT); + MCLGET(mp, M_NOWAIT); if (M_TRAILINGSPACE(mp) < hlen + PPP_HDRLEN) { m_freem(mp); goto bad; /* lose if big headers and no clusters */ @@ -1581,7 +1582,7 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m) * whole cluster on it. */ if (ilen <= MHLEN && M_IS_CLUSTER(m)) { - MGETHDR(mp, M_DONTWAIT, MT_DATA); + MGETHDR(mp, M_NOWAIT, MT_DATA); if (mp != NULL) { m_copydata(m, 0, ilen, mtod(mp, caddr_t)); /* instead of freeing - return cluster mbuf so it can be reused */ @@ -1661,11 +1662,10 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m) */ s = splimp(); if (_IF_QFULL(inq)) { - IFQ_INC_DROPS(inq); splx(s); if (sc->sc_flags & SC_DEBUG) printf("ppp%d: input queue full\n", ppp_unit(sc)); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto bad; } IF_ENQUEUE(inq, m); @@ -1674,8 +1674,8 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m) break; } - ifp->if_ipackets++; - ifp->if_ibytes += ilen; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, ilen); microtime(&ppp_time); ifp->if_lastchange = ppp_time; @@ -1687,7 +1687,7 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m) bad: m_freem(m); - sc->sc_ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->sc_stats.ppp_ierrors++; return mf; } diff --git a/rtemsbsd/sys/net/if_pppvar.h b/rtemsbsd/sys/net/if_pppvar.h index b0a5ba91..fdfb56df 100644 --- a/rtemsbsd/sys/net/if_pppvar.h +++ b/rtemsbsd/sys/net/if_pppvar.h @@ -131,8 +131,8 @@ struct ppp_softc { struct ppp_softc *pppalloc(pid_t pid); void pppdealloc(struct ppp_softc *sc); -int pppoutput(struct ifnet *, struct mbuf *, - struct sockaddr *, struct route *); +int pppoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, + struct route *); int pppioctl(struct ppp_softc *sc, ioctl_command_t cmd, caddr_t data, int flag, struct proc *p); struct mbuf *ppp_dequeue(struct ppp_softc *sc); diff --git a/rtemsbsd/sys/net/ppp_tty.c b/rtemsbsd/sys/net/ppp_tty.c index d1945941..71105c94 100644 --- a/rtemsbsd/sys/net/ppp_tty.c +++ b/rtemsbsd/sys/net/ppp_tty.c @@ -377,14 +377,14 @@ pppwrite(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args) struct mbuf **mp; for (mp = &m0; maximum; mp = &m->m_next) { - MGET(m, M_WAIT, MT_DATA); + MGET(m, M_WAITOK, MT_DATA); if ((*mp = m) == NULL) { m_freem(m0); return (ENOBUFS); } m->m_len = 0; if (maximum >= MCLBYTES / 2) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); } len = M_TRAILINGSPACE(m); if (len > maximum) { @@ -683,11 +683,11 @@ pppgetm(struct ppp_softc *sc) mp = &sc->sc_m; for (len = sc->sc_mru + PPP_HDRLEN + PPP_FCSLEN; len > 0; ){ if ((m = *mp) == NULL) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) break; *mp = m; - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); } len -= M_DATASIZE(m); mp = &m->m_next; @@ -708,8 +708,8 @@ pppallocmbuf(struct ppp_softc *sc, struct mbuf **mp) m = *mp; if ( m == NULL ) { /* get mbuf header */ - MGETHDR(m, M_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGETHDR(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); *mp = m; } @@ -769,7 +769,7 @@ pppinput(int c, struct rtems_termios_tty *tp) sc->sc_flags |= SC_PKTLOST; /* note the dropped packet */ if ((sc->sc_flags & (SC_FLUSH | SC_ESCAPED)) == 0){ /* bad fcs error */ - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); sc->sc_stats.ppp_ierrors++; } else sc->sc_flags &= ~(SC_FLUSH | SC_ESCAPED); @@ -779,7 +779,7 @@ pppinput(int c, struct rtems_termios_tty *tp) if (ilen < PPP_HDRLEN + PPP_FCSLEN) { if (ilen) { /* too short error */ - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); sc->sc_stats.ppp_ierrors++; sc->sc_flags |= SC_PKTLOST; } @@ -898,7 +898,7 @@ pppinput(int c, struct rtems_termios_tty *tp) flush: if (!(sc->sc_flags & SC_FLUSH)) { - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); sc->sc_stats.ppp_ierrors++; sc->sc_flags |= SC_FLUSH; } |