Changeset c07aa0c5 in rtems


Ignore:
Timestamp:
Jan 30, 2004, 2:50:20 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
3f5232a
Parents:
8a4ab4d5
Message:

2004-01-30 Wilfried Busalski <w.busalski@…>

PR pppd/564

  • libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h, libnetworking/net/ppp_tty.c: ppp0 Interface lose packets if the system use a slow baudrate for the modem or the tcp/ip-packet is fragmented.
Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r8a4ab4d5 rc07aa0c5  
     12004-01-30      Wilfried Busalski <w.busalski@lancier-monitoring.de>
     2
     3        PR pppd/564
     4        * libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h,
     5        libnetworking/net/ppp_tty.c: ppp0 Interface lose packets if the
     6        system use a slow baudrate for the modem or the tcp/ip-packet is
     7        fragmented.
     8
    192004-01-30      Joel Sherrill <joel@OARcorp.com>
    210
  • cpukit/libnetworking/net/if_ppp.c

    r8a4ab4d5 rc07aa0c5  
    251251  struct mbuf                *m;
    252252  struct rtems_termios_tty   *tp;
     253 
     254  int frag;
    253255
    254256  /* enter processing loop */
     
    259261      /* received event from interrupt handler - free current mbuf */
    260262      rtems_bsdnet_semaphore_obtain();
     263
    261264      m_freem(sc->sc_outm);
     265     
    262266      rtems_bsdnet_semaphore_release();
    263267
     
    295299      /* clear process flag */
    296300      iprocess = (int)0;
     301      frag=0;
    297302
    298303      /* initialize output values */
     
    303308      sc->sc_outfcslen = (short   )0;
    304309
     310/*        printf("Start Transmit Packet..\n"); */
     311
    305312      /* loop over all mbufs in chain */
    306313      mf     = NULL;
    307314      mp     = NULL;
    308315      m      = sc->sc_outm;
     316
     317      sc->sc_outmc  = m;
     318      sc->sc_outlen = m->m_len;
     319      sc->sc_outbuf = mtod(m, u_char *);
     320
    309321      while (( m != (struct mbuf *)0 ) && ( m->m_len > 0 )) {
    310         /* check to see if first mbuf value has been set */
    311         if ( sc->sc_outmc == (struct mbuf *)0 ) {
    312           /* set values to start with this mbuf */
    313           sc->sc_outmc  = m;
    314           sc->sc_outlen = m->m_len;
    315           sc->sc_outbuf = mtod(m, u_char *);
    316         }
     322        frag++;
    317323
    318324        /* update the FCS value and then check next packet length */
    319         sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len);
    320 
     325        if(m->m_len){
     326         sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len);
     327        }
     328
     329        if(( m->m_next != NULL ) && ( m->m_next->m_len == 0 )) {
     330                        if(mf){
     331                                printf(" if_ppp.c : MBUF Error !!!!\n");
     332                        }
     333                        else{
     334                mf = m->m_next;
     335                        m->m_next = NULL;
     336                        }
     337                }
     338
     339#ifdef LALL_X
    321340        /* check next packet to see if it is empty */
    322341        while (( m->m_next != NULL ) && ( m->m_next->m_len == 0 )) {
     
    338357          mp->m_next = NULL;
    339358        }
    340 
     359#endif
    341360        /* move to next packet */
    342361        m = m->m_next;
     
    352371 
    353372        /* write out frame byte to start the transmission */
    354         sc->sc_outchar = (u_char)PPP_FLAG;
     373                sc->sc_outchar = (u_char)PPP_FLAG;
    355374        (*tp->device.write)(tp->minor, &sc->sc_outchar, 1);
    356375      }
  • cpukit/libnetworking/net/if_pppvar.h

    r8a4ab4d5 rc07aa0c5  
    1 /*      $Id$    */
     1/*  $Id$ */
    22/*
    33 * if_pppvar.h - private structures and declarations for PPP.
     
    138138#define SC_TX_FCS       0x0002
    139139#define SC_TX_ESCAPE    0x0004
     140#define SC_TX_LASTCHAR  0x0008
    140141#define SC_TX_PENDING   0x0010
  • cpukit/libnetworking/net/ppp_tty.c

    r8a4ab4d5 rc07aa0c5  
    571571  if (( sc != NULL ) && ( sc->sc_outflag & SC_TX_BUSY )) {
    572572    /* check to see if we need to get the next buffer */
     573
     574    /* Ready with PPP_FLAG Character ? */
     575    if(sc->sc_outflag & SC_TX_LASTCHAR){
     576        sc->sc_outflag &= ~(SC_TX_BUSY | SC_TX_FCS | SC_TX_LASTCHAR);
     577        rtems_event_send(sc->sc_txtask, TX_TRANSMIT);   /* Ready for the next Packet */
     578        return(0);
     579    }
     580
    573581    if ( sc->sc_outoff >= sc->sc_outlen ) {
    574582      /* loop to get next non-zero length buffer */
     
    594602      else {
    595603        /* done with this packet */
    596         sc->sc_outflag &= ~SC_TX_BUSY;
    597         sc->sc_outchar = (u_char)PPP_FLAG;
     604        sc->sc_outflag |= SC_TX_LASTCHAR;
     605        sc->sc_outflag &=~(SC_TX_FCS);
     606                sc->sc_outchar = (u_char)PPP_FLAG;
    598607        (*tp->device.write)(tp->minor, &sc->sc_outchar, 1);
    599         rtems_event_send(sc->sc_txtask, TX_TRANSMIT);
     608        return(0);
    600609      }
    601610    }
Note: See TracChangeset for help on using the changeset viewer.