Changeset 573b4cd6 in rtems-libbsd for rtemsbsd/sys
- Timestamp:
- 10/08/14 06:04:59 (9 years ago)
- Branches:
- 4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
- Children:
- 403d0b8
- Parents:
- 70fa95a
- git-author:
- Sebastian Huber <sebastian.huber@…> (10/08/14 06:04:59)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (10/08/14 13:03:29)
- Location:
- rtemsbsd/sys/net
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
rtemsbsd/sys/net/if_ppp.c
r70fa95a r573b4cd6 1 #include <machine/rtems-bsd-kernel-space.h> 2 1 3 /* 2 4 * if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver. … … 80 82 #endif 81 83 82 #include "opt_inet.h"83 #include "opt_ipx.h"84 #include "opt_mac.h"85 #include "opt_ppp.h"84 #include <rtems/bsd/local/opt_inet.h> 85 #include <rtems/bsd/local/opt_ipx.h> 86 #include <rtems/bsd/local/opt_mac.h> 87 #include <rtems/bsd/local/opt_ppp.h> 86 88 87 89 #if NPPP > 0 … … 91 93 #include <rtems/rtems_bsdnet.h> 92 94 #include <rtems/rtemspppd.h> 93 #include < sys/param.h>95 #include <rtems/bsd/sys/param.h> 94 96 #include <sys/systm.h> 95 97 #include <sys/proc.h> … … 100 102 #include <sys/time.h> 101 103 #include <sys/malloc.h> 104 #include <sys/module.h> 105 106 #include <sys/bus.h> 107 #include <machine/bus.h> 102 108 103 109 #include <net/if.h> … … 189 195 #endif /* PPP_COMPRESS */ 190 196 191 extern struct ifqueue ipintrq;192 197 static struct timeval ppp_time; 193 198 … … 199 204 ppp_unit(struct ppp_softc *sc) 200 205 { 201 return sc->sc_if.if_unit;206 return device_get_unit(sc->sc_dev); 202 207 } 203 208 … … 205 210 { 206 211 rtems_event_set events; 207 rtems_interrupt_level level;208 212 struct ppp_softc *sc = (struct ppp_softc *)arg; 209 213 struct mbuf *mp = (struct mbuf *)0; … … 220 224 221 225 if ( events ) { 222 /* get the network semaphore */223 rtems_bsdnet_semaphore_obtain();224 225 226 /* check to see if new packet was received */ 226 227 if ( events & RX_PACKET ) { 227 228 /* get received packet mbuf chain */ 228 rtems_interrupt_disable(level); 229 IF_DEQUEUE(&sc->sc_rawq, m); 230 rtems_interrupt_enable(level); 229 m = if_ppp_dequeue(&sc->sc_rawq); 231 230 232 231 /* ensure packet was retrieved */ … … 243 242 244 243 /* place mbuf on freeq */ 245 rtems_interrupt_disable(level); 246 IF_ENQUEUE(&sc->sc_freeq, mp); 247 rtems_interrupt_enable(level); 244 if_ppp_enqueue(&sc->sc_freeq, mp); 248 245 mp = (struct mbuf *)0; 249 250 /* release the network semaphore */251 rtems_bsdnet_semaphore_release();252 246 253 247 /* check to see if queue is empty */ … … 280 274 if ( events & TX_TRANSMIT ) { 281 275 /* received event from interrupt handler - free current mbuf */ 282 rtems_bsdnet_semaphore_obtain();283 284 276 m_freem(sc->sc_outm); 285 286 rtems_bsdnet_semaphore_release();287 277 288 278 /* chain is done - clear the values */ … … 304 294 /* clear output flags */ 305 295 sc->sc_outflag = 0; 306 sc->sc_if .if_flags &= ~IFF_OACTIVE;296 sc->sc_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; 307 297 } 308 298 else { … … 310 300 iprocess = 1; 311 301 sc->sc_outflag = SC_TX_BUSY; 312 sc->sc_if .if_flags |= IFF_OACTIVE;302 sc->sc_ifp->if_drv_flags |= IFF_DRV_OACTIVE; 313 303 } 314 304 } … … 390 380 sc->sc_outfcsbuf[sc->sc_outfcslen++] = ~sc->sc_outfcs & 0xff; 391 381 sc->sc_outfcsbuf[sc->sc_outfcslen++] = (~sc->sc_outfcs >> 8) & 0xff; 392 microtime(&sc->sc_if .if_lastchange);382 microtime(&sc->sc_ifp->if_lastchange); 393 383 394 384 /* write out frame byte to start the transmission */ … … 400 390 if ( mf != (struct mbuf *)0 ) { 401 391 /* free empty mbufs */ 402 rtems_bsdnet_semaphore_obtain();403 392 m_freem(mf); 404 rtems_bsdnet_semaphore_release();405 393 } 406 394 } … … 412 400 rtems_status_code status; 413 401 uint32_t priority = 100; 414 415 /* determine priority value */416 if ( rtems_bsdnet_config.network_task_priority ) {417 priority = rtems_bsdnet_config.network_task_priority;418 }419 402 420 403 /* check to see if we need to start up daemons */ … … 453 436 /* mark driver running and output inactive */ 454 437 /* ilya: IFF_RUNNING flag will be marked after the IPCP goes up */ 455 /* sc->sc_if .if_flags |= IFF_RUNNING; */438 /* sc->sc_ifp->if_flags |= IFF_RUNNING; */ 456 439 } 457 440 … … 459 442 * Called from boot code to establish ppp interfaces. 460 443 */ 461 int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)444 static int ppp_attach(device_t dev) 462 445 { 463 /* int i = (int)0; */ 464 struct ppp_softc *sc; 465 char *name; 466 int number; 467 468 469 number = rtems_bsdnet_parse_driver_name (config, &name); 470 471 if (!attaching || (number >= NPPP)) 472 return 0; 473 474 sc = &ppp_softc[number]; 475 476 if (sc->sc_if.if_name != NULL) 477 return 0; /* interface is already attached */ 478 479 /* for (sc = ppp_softc; i < NPPP; sc++) { */ 480 sc->sc_if.if_name = name /*"ppp"*/; 481 sc->sc_if.if_unit = number /*i++*/; 482 sc->sc_if.if_mtu = PPP_MTU; 483 sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST; 484 sc->sc_if.if_type = IFT_PPP; 485 sc->sc_if.if_hdrlen = PPP_HDRLEN; 486 sc->sc_if.if_ioctl = pppsioctl; 487 sc->sc_if.if_output = pppoutput; 488 sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN; 489 sc->sc_inq.ifq_maxlen = IFQ_MAXLEN; 490 sc->sc_fastq.ifq_maxlen = IFQ_MAXLEN; 491 sc->sc_rawq.ifq_maxlen = IFQ_MAXLEN; 492 sc->sc_freeq.ifq_maxlen = NUM_MBUFQ; 493 494 /* initialize and attach */ 495 ppp_init(sc); 496 if_attach(&sc->sc_if); 497 #if NBPFILTER > 0 498 bpfattach(&sc->sc_bpf, &sc->sc_if, DLT_PPP, PPP_HDRLEN); 499 #endif 500 /* } */ 501 502 return ( 1 ); 446 int unit = device_get_unit(dev); 447 struct ppp_softc *sc; 448 struct ifnet *ifp; 449 450 if (unit >= NPPP) 451 return (ENXIO); 452 453 sc = &ppp_softc[unit]; 454 device_set_softc(dev, sc); 455 456 sc->sc_ifp = ifp = if_alloc(IFT_PPP); 457 if (sc->sc_ifp == NULL) 458 return (ENOMEM); 459 460 sc->sc_dev = dev; 461 sc->sc_inq.ifq_maxlen = IFQ_MAXLEN; 462 sc->sc_rawq.ifq_maxlen = IFQ_MAXLEN; 463 sc->sc_freeq.ifq_maxlen = NUM_MBUFQ; 464 465 ifq_init(&sc->sc_fastq, ifp); 466 467 if_initname(ifp, device_get_name(dev), device_get_unit(dev)); 468 ifp->if_softc = sc; 469 ifp->if_mtu = PPP_MTU; 470 ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; 471 ifp->if_type = IFT_PPP; 472 ifp->if_hdrlen = PPP_HDRLEN; 473 ifp->if_ioctl = pppsioctl; 474 ifp->if_output = pppoutput; 475 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; 476 477 /* initialize and attach */ 478 ppp_init(sc); 479 if_attach(ifp); 480 481 return 0; 503 482 } 504 483 … … 554 533 { 555 534 struct mbuf *m; 556 rtems_interrupt_level level; 557 558 if_down(&sc->sc_if);559 sc->sc_if .if_flags &= ~(IFF_UP|IFF_RUNNING);535 536 if_down(sc->sc_ifp); 537 sc->sc_ifp->if_flags &= ~IFF_UP; 538 sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; 560 539 sc->sc_devp = NULL; 561 540 sc->sc_xfer = 0; 562 541 563 rtems_interrupt_disable(level);564 542 if ( sc->sc_m != NULL ) { 565 543 m_freem(sc->sc_m); … … 573 551 } 574 552 do { 575 IF_DEQUEUE(&sc->sc_freeq, m);553 m = if_ppp_dequeue(&sc->sc_freeq); 576 554 if (m != NULL) { 577 555 m_freem(m); … … 579 557 } while ( m != NULL ); 580 558 do { 581 IF_DEQUEUE(&sc->sc_rawq, m);559 m = if_ppp_dequeue(&sc->sc_rawq); 582 560 if (m != NULL) { 583 561 m_freem(m); 584 562 } 585 563 } while ( m != NULL ); 586 rtems_interrupt_enable(level);587 564 588 565 for (;;) { … … 851 828 { 852 829 /*struct proc *p = curproc;*/ /* XXX */ 853 register struct ppp_softc *sc = &ppp_softc[ifp->if_unit];830 register struct ppp_softc *sc = ifp->if_softc; 854 831 register struct ifaddr *ifa = (struct ifaddr *)data; 855 832 register struct ifreq *ifr = (struct ifreq *)data; … … 862 839 switch (cmd) { 863 840 case SIOCSIFFLAGS: 864 if ((ifp->if_ flags & IFF_RUNNING) == 0)841 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) 865 842 ifp->if_flags &= ~IFF_UP; 866 843 break; … … 877 854 878 855 case SIOCSIFMTU: 879 sc->sc_if .if_mtu = ifr->ifr_mtu;856 sc->sc_ifp->if_mtu = ifr->ifr_mtu; 880 857 break; 881 858 882 859 case SIOCGIFMTU: 883 ifr->ifr_mtu = sc->sc_if .if_mtu;860 ifr->ifr_mtu = sc->sc_ifp->if_mtu; 884 861 break; 885 862 … … 899 876 break; 900 877 } 901 break;902 903 case SIO_RTEMS_SHOW_STATS:904 printf(" MRU:%-8u", sc->sc_mru);905 printf(" Bytes received:%-8u", sc->sc_stats.ppp_ibytes);906 printf(" Packets received:%-8u", sc->sc_stats.ppp_ipackets);907 printf(" Receive errors:%-8u\n", sc->sc_stats.ppp_ierrors);908 printf(" Bytes sent:%-8u", sc->sc_stats.ppp_obytes);909 printf(" Packets sent:%-8u", sc->sc_stats.ppp_opackets);910 printf(" Transmit errors:%-8u\n", sc->sc_stats.ppp_oerrors);911 878 break; 912 879 … … 953 920 int 954 921 pppoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, 955 struct r tentry*rtp)922 struct route *rtp) 956 923 { 957 register struct ppp_softc *sc = &ppp_softc[ifp->if_unit];924 register struct ppp_softc *sc = ifp->if_softc; 958 925 int protocol, address, control; 959 926 u_char *cp; 960 927 int s, error; 961 928 struct ip *ip; 962 struct if queue*ifq;929 struct ifaltq *ifq; 963 930 enum NPmode mode; 964 931 int len; 965 932 struct mbuf *m; 966 933 967 if (sc->sc_devp == NULL || (ifp->if_ flags & IFF_RUNNING) == 0934 if (sc->sc_devp == NULL || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 968 935 || ((ifp->if_flags & IFF_UP) == 0 && dst->sa_family != AF_UNSPEC)) { 969 936 error = ENETDOWN; /* sort of */ … … 1096 1063 } else { 1097 1064 ifq = (m0->m_flags & M_HIGHPRI)? &sc->sc_fastq: &ifp->if_snd; 1098 if ( IF_QFULL(ifq) && dst->sa_family != AF_UNSPEC) {1099 IF _DROP(ifq);1065 if (_IF_QFULL(ifq) && dst->sa_family != AF_UNSPEC) { 1066 IFQ_INC_DROPS(ifq); 1100 1067 splx(s); 1101 sc->sc_if .if_oerrors++;1068 sc->sc_ifp->if_oerrors++; 1102 1069 sc->sc_stats.ppp_oerrors++; 1103 1070 error = ENOBUFS; … … 1128 1095 { 1129 1096 struct mbuf *m, **mpp; 1130 struct if queue*ifq;1097 struct ifaltq *ifq; 1131 1098 enum NPmode mode; 1132 1099 … … 1147 1114 *mpp = m->m_nextpkt; 1148 1115 m->m_nextpkt = NULL; 1149 ifq = (m->m_flags & M_HIGHPRI)? &sc->sc_fastq: &sc->sc_if .if_snd;1150 if ( IF_QFULL(ifq)) {1151 IF _DROP(ifq);1152 sc->sc_if .if_oerrors++;1116 ifq = (m->m_flags & M_HIGHPRI)? &sc->sc_fastq: &sc->sc_ifp->if_snd; 1117 if (_IF_QFULL(ifq)) { 1118 IFQ_INC_DROPS(ifq); 1119 sc->sc_ifp->if_oerrors++; 1153 1120 sc->sc_stats.ppp_oerrors++; 1154 1121 } else … … 1190 1157 * normal queue. 1191 1158 */ 1192 rtems_bsdnet_semaphore_obtain();1193 1159 IF_DEQUEUE(&sc->sc_fastq, m); 1194 1160 if (m == NULL) 1195 IF_DEQUEUE(&sc->sc_if.if_snd, m); 1196 rtems_bsdnet_semaphore_release(); 1161 IF_DEQUEUE(&sc->sc_ifp->if_snd, m); 1197 1162 1198 1163 if (m == NULL) … … 1267 1232 slen += mp->m_len; 1268 1233 clen = (*sc->sc_xcomp->compress) 1269 (sc->sc_xc_state, &mcomp, m, slen, sc->sc_if .if_mtu + PPP_HDRLEN);1234 (sc->sc_xc_state, &mcomp, m, slen, sc->sc_ifp->if_mtu + PPP_HDRLEN); 1270 1235 if (mcomp != NULL) { 1271 1236 if (sc->sc_flags & SC_CCP_UP) { … … 1430 1395 { 1431 1396 struct mbuf *mf = (struct mbuf *)0; 1432 struct ifnet *ifp = &sc->sc_if;1397 struct ifnet *ifp = sc->sc_ifp; 1433 1398 struct ifqueue *inq; 1434 1399 int s, ilen, proto, rv; … … 1681 1646 m->m_data += PPP_HDRLEN; 1682 1647 m->m_len -= PPP_HDRLEN; 1683 schednetisr(NETISR_IP); 1684 inq = &ipintrq; 1648 netisr_dispatch(NETISR_IP, m); 1685 1649 break; 1686 1650 #endif … … 1692 1656 inq = &sc->sc_inq; 1693 1657 rv = 1; 1694 break; 1695 } 1696 1697 /* 1698 * Put the packet on the appropriate input queue. 1699 */ 1700 s = splimp(); 1701 if (IF_QFULL(inq)) { 1702 IF_DROP(inq); 1658 1659 /* 1660 * Put the packet on the appropriate input queue. 1661 */ 1662 s = splimp(); 1663 if (_IF_QFULL(inq)) { 1664 IFQ_INC_DROPS(inq); 1665 splx(s); 1666 if (sc->sc_flags & SC_DEBUG) 1667 printf("ppp%d: input queue full\n", ppp_unit(sc)); 1668 ifp->if_iqdrops++; 1669 goto bad; 1670 } 1671 IF_ENQUEUE(inq, m); 1703 1672 splx(s); 1704 if (sc->sc_flags & SC_DEBUG) 1705 printf("ppp%d: input queue full\n", ppp_unit(sc)); 1706 ifp->if_iqdrops++; 1707 goto bad; 1708 } 1709 IF_ENQUEUE(inq, m); 1710 splx(s); 1673 1674 break; 1675 } 1711 1676 1712 1677 ifp->if_ipackets++; … … 1723 1688 bad: 1724 1689 m_freem(m); 1725 sc->sc_if .if_ierrors++;1690 sc->sc_ifp->if_ierrors++; 1726 1691 sc->sc_stats.ppp_ierrors++; 1727 1692 return mf; … … 1763 1728 } 1764 1729 1730 static int ppp_probe(device_t dev) 1731 { 1732 int unit = device_get_unit(dev); 1733 int error; 1734 1735 if (unit < NPPP) { 1736 error = BUS_PROBE_DEFAULT; 1737 } else { 1738 error = ENXIO; 1739 } 1740 1741 return error; 1742 } 1743 1744 static device_method_t ppp_methods[] = { 1745 /* Device interface */ 1746 DEVMETHOD(device_probe, ppp_probe), 1747 DEVMETHOD(device_attach, ppp_attach), 1748 1749 DEVMETHOD_END 1750 }; 1751 1752 static driver_t ppp_nexus_driver = { 1753 "ppp", 1754 ppp_methods, 1755 0, 1756 NULL, 1757 0, 1758 NULL 1759 }; 1760 1761 static devclass_t ppp_devclass; 1762 1763 DRIVER_MODULE(ppp, nexus, ppp_nexus_driver, ppp_devclass, 0, 0); 1764 MODULE_DEPEND(ppp, nexus, 1, 1, 1); 1765 1765 1766 #endif /* NPPP > 0 */ -
rtemsbsd/sys/net/if_pppvar.h
r70fa95a r573b4cd6 70 70 */ 71 71 struct ppp_softc { 72 struct ifnet sc_if; /* network-visible interface */ 72 device_t sc_dev; 73 struct mtx sc_mtx; 74 struct ifnet *sc_ifp; /* network-visible interface */ 73 75 u_int sc_flags; /* control/status bits; see if_ppp.h */ 74 76 void *sc_devp; /* pointer to device-dep structure */ … … 78 80 short sc_mru; /* max receive unit */ 79 81 pid_t sc_xfer; /* used in transferring unit */ 80 struct ifqueue sc_rawq; /* received packets */82 struct ifqueue sc_rawq; /* received packets */ 81 83 struct ifqueue sc_inq; /* queue of input packets for daemon */ 82 struct if queuesc_fastq; /* interactive output packet q */84 struct ifaltq sc_fastq; /* interactive output packet q */ 83 85 struct mbuf *sc_npqueue; /* output packets not to be sent yet */ 84 86 struct mbuf **sc_npqtail; /* ptr to last next ptr in npqueue */ … … 131 133 void pppdealloc(struct ppp_softc *sc); 132 134 int pppoutput(struct ifnet *, struct mbuf *, 133 struct sockaddr *, struct r tentry*);135 struct sockaddr *, struct route *); 134 136 int pppioctl(struct ppp_softc *sc, ioctl_command_t cmd, caddr_t data, 135 137 int flag, struct proc *p); … … 154 156 #define SC_TX_PENDING 0x0010 155 157 158 /* 159 * Special interface queue functions to exchange mbufs between task and 160 * interrupt context via pppinput() and pppstart(). 161 */ 162 163 static inline void 164 if_ppp_enqueue(struct ifqueue *ifq, struct mbuf *m) 165 { 166 rtems_interrupt_level level; 167 168 rtems_interrupt_disable(level); 169 _IF_ENQUEUE(ifq, m); 170 rtems_interrupt_enable(level); 171 } 172 173 static inline struct mbuf * 174 if_ppp_dequeue(struct ifqueue *ifq) 175 { 176 struct mbuf *m; 177 rtems_interrupt_level level; 178 179 rtems_interrupt_disable(level); 180 _IF_DEQUEUE(ifq, m); 181 rtems_interrupt_enable(level); 182 183 return m; 184 } 185 156 186 #ifdef __cplusplus 157 187 } -
rtemsbsd/sys/net/ppp_tty.c
r70fa95a r573b4cd6 1 #include <machine/rtems-bsd-kernel-space.h> 2 1 3 /* 2 4 * ppp_tty.c - Point-to-Point Protocol (PPP) driver for asynchronous … … 79 81 #endif 80 82 81 #include "opt_ppp.h"/* XXX for ppp_defs.h */83 #include <rtems/bsd/local/opt_ppp.h> /* XXX for ppp_defs.h */ 82 84 83 85 #if NPPP > 0 84 86 85 #include < sys/param.h>87 #include <rtems/bsd/sys/param.h> 86 88 #include <sys/systm.h> 87 89 #include <sys/proc.h> … … 227 229 228 230 /* preallocate mbufs for free queue */ 229 rtems_bsdnet_semaphore_obtain();230 231 for (i=0; i<NUM_MBUFQ; i++) { 231 232 pppallocmbuf(sc, &m); … … 236 237 else { 237 238 /* enqueue mbuf for later use */ 238 IF_ENQUEUE(&sc->sc_freeq, m);239 if_ppp_enqueue(&sc->sc_freeq, m); 239 240 } 240 241 m = (struct mbuf *)0; 241 242 } 242 rtems_bsdnet_semaphore_release();243 243 244 244 /* initialize values */ 245 sc->sc_if .if_flags |= IFF_RUNNING;246 sc->sc_if .if_baudrate =245 sc->sc_ifp->if_drv_flags |= IFF_DRV_RUNNING; 246 sc->sc_ifp->if_baudrate = 247 247 rtems_termios_baud_to_number(tty->termios.c_cflag & CBAUD); 248 248 … … 268 268 tty->t_sc = NULL; 269 269 if (tty == (struct rtems_termios_tty *)sc->sc_devp) { 270 rtems_bsdnet_semaphore_obtain();271 270 pppasyncrelinq(sc); 272 271 pppdealloc(sc); 273 rtems_bsdnet_semaphore_release();274 272 } 275 273 } … … 329 327 330 328 /* Get the packet from the input queue */ 331 rtems_bsdnet_semaphore_obtain();332 329 IF_DEQUEUE(&sc->sc_inq, m0); 333 330 … … 348 345 /* free mbuf chain */ 349 346 m_freem(m0); 350 rtems_bsdnet_semaphore_release();351 347 352 348 /* update return values */ … … 381 377 struct mbuf **mp; 382 378 383 rtems_bsdnet_semaphore_obtain();384 379 for (mp = &m0; maximum; mp = &m->m_next) { 385 380 MGET(m, M_WAIT, MT_DATA); … … 411 406 m0->m_len -= PPP_HDRLEN; 412 407 413 n = pppoutput(&sc->sc_if, m0, &dst, (struct rtentry *)0); 414 rtems_bsdnet_semaphore_release(); 408 n = pppoutput(sc->sc_ifp, m0, &dst, NULL); 415 409 416 410 return ( n ); … … 471 465 472 466 default: 473 rtems_bsdnet_semaphore_obtain();474 467 error = pppioctl(sc, cmd, data, 0, NULL); 475 rtems_bsdnet_semaphore_release();476 468 } 477 469 return error; … … 747 739 if (sc->sc_m == NULL) { 748 740 rtems_event_send(sc->sc_rxtask, RX_EMPTY); 749 IF_DEQUEUE(&sc->sc_freeq, sc->sc_m);741 sc->sc_m = if_ppp_dequeue(&sc->sc_freeq); 750 742 if ( sc->sc_m == NULL ) { 751 743 return 0; … … 778 770 if ((sc->sc_flags & (SC_FLUSH | SC_ESCAPED)) == 0){ 779 771 /* bad fcs error */ 780 sc->sc_if .if_ierrors++;772 sc->sc_ifp->if_ierrors++; 781 773 sc->sc_stats.ppp_ierrors++; 782 774 } else … … 788 780 if (ilen) { 789 781 /* too short error */ 790 sc->sc_if .if_ierrors++;782 sc->sc_ifp->if_ierrors++; 791 783 sc->sc_stats.ppp_ierrors++; 792 784 sc->sc_flags |= SC_PKTLOST; … … 809 801 sc->sc_flags &= ~SC_PKTLOST; 810 802 } 811 IF_ENQUEUE(&sc->sc_rawq, m);803 if_ppp_enqueue(&sc->sc_rawq, m); 812 804 813 805 /* setup next mbuf chain */ 814 IF_DEQUEUE(&sc->sc_freeq, sc->sc_m);806 sc->sc_m = if_ppp_dequeue(&sc->sc_freeq); 815 807 816 808 /* send rx packet event */ … … 883 875 if (m->m_next == NULL) { 884 876 /* get next available mbuf for the chain */ 885 IF_DEQUEUE(&sc->sc_freeq, m->m_next);877 m->m_next = if_ppp_dequeue(&sc->sc_freeq); 886 878 if (m->m_next == NULL) { 887 879 /* too few mbufs */ … … 907 899 flush: 908 900 if (!(sc->sc_flags & SC_FLUSH)) { 909 sc->sc_if .if_ierrors++;901 sc->sc_ifp->if_ierrors++; 910 902 sc->sc_stats.ppp_ierrors++; 911 903 sc->sc_flags |= SC_FLUSH;
Note: See TracChangeset
for help on using the changeset viewer.