Changeset fd55b7d in rtems


Ignore:
Timestamp:
03/21/02 15:01:32 (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
90f30c8
Parents:
df6348bb
Message:

2002-03-21 Ilya Alexeev <ilya@…>

  • net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple PPPD connections.
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libblock/ChangeLog

    rdf6348bb rfd55b7d  
     12002-03-21      Ilya Alexeev <ilya@continuum.ru>
     2
     3        * net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple
     4        PPPD connections.
     5
    162002-03-21      Alexander Kukuta <kam@oktet.ru>
    27
  • c/src/exec/libnetworking/ChangeLog

    rdf6348bb rfd55b7d  
     12002-03-21      Ilya Alexeev <ilya@continuum.ru>
     2
     3        * net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple
     4        PPPD connections.
     5
    162001-03-20      Till Straumann <strauman@SLAC.Stanford.EDU>
    27
  • c/src/exec/libnetworking/net/if_ppp.c

    rdf6348bb rfd55b7d  
    379379  if ( sc->sc_rxtask == 0 ) {
    380380    /* start rx daemon task */
    381     status = rtems_task_create(rtems_build_name('R','x','P','0'), priority, 2048,
     381    status = rtems_task_create(rtems_build_name('R','x','P','0'+sc->sc_if.if_unit), priority, 2048,
    382382                               RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
    383383                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
     
    394394
    395395    /* start tx daemon task */
    396     status = rtems_task_create(rtems_build_name('T','x','P','0'), priority, 2048,
     396    status = rtems_task_create(rtems_build_name('T','x','P','0'+sc->sc_if.if_unit), priority, 2048,
    397397                               RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
    398398                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
     
    410410
    411411  /* mark driver running and output inactive */
    412   sc->sc_if.if_flags |= IFF_RUNNING;
     412  /* ilya: IFF_RUNNING flag will be marked after the IPCP goes up */
     413/*  sc->sc_if.if_flags |= IFF_RUNNING;  */
    413414}
    414415
     
    418419int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
    419420{
    420     int                 i = (int)0;
     421/*    int                 i = (int)0;   */
    421422    struct ppp_softc   *sc;
    422 
    423     for (sc = ppp_softc; i < NPPP; sc++) {
    424         sc->sc_if.if_name = "ppp";
    425         sc->sc_if.if_unit = i++;
     423    char               *name;
     424    int                 number;
     425   
     426   
     427    number = rtems_bsdnet_parse_driver_name (config, &name);
     428   
     429    if (!attaching || (number >= NPPP))
     430        return 0;
     431       
     432    sc = &ppp_softc[number];
     433   
     434    if (sc->sc_if.if_name != NULL)
     435        return 0;       /* interface is already attached */
     436   
     437/*    for (sc = ppp_softc; i < NPPP; sc++) {    */
     438        sc->sc_if.if_name = name /*"ppp"*/;
     439        sc->sc_if.if_unit = number /*i++*/;
    426440        sc->sc_if.if_mtu = PPP_MTU;
    427441        sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
     
    442456        bpfattach(&sc->sc_bpf, &sc->sc_if, DLT_PPP, PPP_HDRLEN);
    443457#endif
    444     }
     458/*    } */
    445459
    446460    return ( 1 );
  • c/src/exec/libnetworking/net/ppp_tty.c

    rdf6348bb rfd55b7d  
    193193    register struct ppp_softc *sc;
    194194    struct mbuf *m = (struct mbuf *)0;
     195    extern int termios_baud_to_number(int);
    195196
    196197    if (tty->t_line == PPPDISC) {
     
    239240    /* initialize values */
    240241    sc->sc_if.if_flags |= IFF_RUNNING;
    241     sc->sc_if.if_baudrate = 57600; /* FIX: get line speed from termios */
     242    sc->sc_if.if_baudrate =
     243        termios_baud_to_number(tty->termios.c_cflag & CBAUD);
    242244
    243245    tty->t_sc = (void *)sc;
     
    422424ppptioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args)
    423425{
    424     int                 i;
     426/*    int                 i;    */
    425427    int                 error = RTEMS_SUCCESSFUL;
    426428    int                 cmd   = args->command;
     
    562564{
    563565  char                c;
     566  char               *sendBegin;
    564567  char                cFrame  = (char         )PPP_FLAG;
    565568  u_char              ioffset = (u_char       )0;
     
    619622          sc->sc_outflag |= SC_TX_ESCAPE;
    620623        }
     624        sendBegin = &c;
    621625      }
    622626      else {
    623         /* escape not needed - increment the offset */
    624         ioffset++;
     627        /* escape not needed - increment the offset as much as possible */
     628        while ((!ESCAPE_P(c)) && ((sc->sc_outoff + ioffset) < sc->sc_outlen)) {
     629            ioffset++;
     630            c = sc->sc_outbuf[sc->sc_outoff + ioffset];
     631        }
     632        sendBegin = &sc->sc_outbuf[sc->sc_outoff];
    625633      }
    626634
    627       /* write out the character and update the stats */
    628       (*tp->device.write)(tp->minor, &c, 1);
    629       sc->sc_stats.ppp_obytes++;
     635      /* write out the character(s) and update the stats */
     636      (*tp->device.write)(tp->minor, sendBegin, (ioffset > 0) ? ioffset : 1);
     637      sc->sc_stats.ppp_obytes += (ioffset > 0) ? ioffset : 1;
    630638      sc->sc_outoff += ioffset;
    631639    }
  • c/src/libblock/ChangeLog

    rdf6348bb rfd55b7d  
     12002-03-21      Ilya Alexeev <ilya@continuum.ru>
     2
     3        * net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple
     4        PPPD connections.
     5
    162002-03-21      Alexander Kukuta <kam@oktet.ru>
    27
  • c/src/libnetworking/ChangeLog

    rdf6348bb rfd55b7d  
     12002-03-21      Ilya Alexeev <ilya@continuum.ru>
     2
     3        * net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple
     4        PPPD connections.
     5
    162001-03-20      Till Straumann <strauman@SLAC.Stanford.EDU>
    27
  • c/src/libnetworking/net/if_ppp.c

    rdf6348bb rfd55b7d  
    379379  if ( sc->sc_rxtask == 0 ) {
    380380    /* start rx daemon task */
    381     status = rtems_task_create(rtems_build_name('R','x','P','0'), priority, 2048,
     381    status = rtems_task_create(rtems_build_name('R','x','P','0'+sc->sc_if.if_unit), priority, 2048,
    382382                               RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
    383383                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
     
    394394
    395395    /* start tx daemon task */
    396     status = rtems_task_create(rtems_build_name('T','x','P','0'), priority, 2048,
     396    status = rtems_task_create(rtems_build_name('T','x','P','0'+sc->sc_if.if_unit), priority, 2048,
    397397                               RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
    398398                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
     
    410410
    411411  /* mark driver running and output inactive */
    412   sc->sc_if.if_flags |= IFF_RUNNING;
     412  /* ilya: IFF_RUNNING flag will be marked after the IPCP goes up */
     413/*  sc->sc_if.if_flags |= IFF_RUNNING;  */
    413414}
    414415
     
    418419int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
    419420{
    420     int                 i = (int)0;
     421/*    int                 i = (int)0;   */
    421422    struct ppp_softc   *sc;
    422 
    423     for (sc = ppp_softc; i < NPPP; sc++) {
    424         sc->sc_if.if_name = "ppp";
    425         sc->sc_if.if_unit = i++;
     423    char               *name;
     424    int                 number;
     425   
     426   
     427    number = rtems_bsdnet_parse_driver_name (config, &name);
     428   
     429    if (!attaching || (number >= NPPP))
     430        return 0;
     431       
     432    sc = &ppp_softc[number];
     433   
     434    if (sc->sc_if.if_name != NULL)
     435        return 0;       /* interface is already attached */
     436   
     437/*    for (sc = ppp_softc; i < NPPP; sc++) {    */
     438        sc->sc_if.if_name = name /*"ppp"*/;
     439        sc->sc_if.if_unit = number /*i++*/;
    426440        sc->sc_if.if_mtu = PPP_MTU;
    427441        sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
     
    442456        bpfattach(&sc->sc_bpf, &sc->sc_if, DLT_PPP, PPP_HDRLEN);
    443457#endif
    444     }
     458/*    } */
    445459
    446460    return ( 1 );
  • c/src/libnetworking/net/ppp_tty.c

    rdf6348bb rfd55b7d  
    193193    register struct ppp_softc *sc;
    194194    struct mbuf *m = (struct mbuf *)0;
     195    extern int termios_baud_to_number(int);
    195196
    196197    if (tty->t_line == PPPDISC) {
     
    239240    /* initialize values */
    240241    sc->sc_if.if_flags |= IFF_RUNNING;
    241     sc->sc_if.if_baudrate = 57600; /* FIX: get line speed from termios */
     242    sc->sc_if.if_baudrate =
     243        termios_baud_to_number(tty->termios.c_cflag & CBAUD);
    242244
    243245    tty->t_sc = (void *)sc;
     
    422424ppptioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args)
    423425{
    424     int                 i;
     426/*    int                 i;    */
    425427    int                 error = RTEMS_SUCCESSFUL;
    426428    int                 cmd   = args->command;
     
    562564{
    563565  char                c;
     566  char               *sendBegin;
    564567  char                cFrame  = (char         )PPP_FLAG;
    565568  u_char              ioffset = (u_char       )0;
     
    619622          sc->sc_outflag |= SC_TX_ESCAPE;
    620623        }
     624        sendBegin = &c;
    621625      }
    622626      else {
    623         /* escape not needed - increment the offset */
    624         ioffset++;
     627        /* escape not needed - increment the offset as much as possible */
     628        while ((!ESCAPE_P(c)) && ((sc->sc_outoff + ioffset) < sc->sc_outlen)) {
     629            ioffset++;
     630            c = sc->sc_outbuf[sc->sc_outoff + ioffset];
     631        }
     632        sendBegin = &sc->sc_outbuf[sc->sc_outoff];
    625633      }
    626634
    627       /* write out the character and update the stats */
    628       (*tp->device.write)(tp->minor, &c, 1);
    629       sc->sc_stats.ppp_obytes++;
     635      /* write out the character(s) and update the stats */
     636      (*tp->device.write)(tp->minor, sendBegin, (ioffset > 0) ? ioffset : 1);
     637      sc->sc_stats.ppp_obytes += (ioffset > 0) ? ioffset : 1;
    630638      sc->sc_outoff += ioffset;
    631639    }
  • cpukit/libblock/ChangeLog

    rdf6348bb rfd55b7d  
     12002-03-21      Ilya Alexeev <ilya@continuum.ru>
     2
     3        * net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple
     4        PPPD connections.
     5
    162002-03-21      Alexander Kukuta <kam@oktet.ru>
    27
  • cpukit/libnetworking/ChangeLog

    rdf6348bb rfd55b7d  
     12002-03-21      Ilya Alexeev <ilya@continuum.ru>
     2
     3        * net/if_ppp.c, net/ppp_tty.c: Initial preparations for multiple
     4        PPPD connections.
     5
    162001-03-20      Till Straumann <strauman@SLAC.Stanford.EDU>
    27
  • cpukit/libnetworking/net/if_ppp.c

    rdf6348bb rfd55b7d  
    379379  if ( sc->sc_rxtask == 0 ) {
    380380    /* start rx daemon task */
    381     status = rtems_task_create(rtems_build_name('R','x','P','0'), priority, 2048,
     381    status = rtems_task_create(rtems_build_name('R','x','P','0'+sc->sc_if.if_unit), priority, 2048,
    382382                               RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
    383383                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
     
    394394
    395395    /* start tx daemon task */
    396     status = rtems_task_create(rtems_build_name('T','x','P','0'), priority, 2048,
     396    status = rtems_task_create(rtems_build_name('T','x','P','0'+sc->sc_if.if_unit), priority, 2048,
    397397                               RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
    398398                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
     
    410410
    411411  /* mark driver running and output inactive */
    412   sc->sc_if.if_flags |= IFF_RUNNING;
     412  /* ilya: IFF_RUNNING flag will be marked after the IPCP goes up */
     413/*  sc->sc_if.if_flags |= IFF_RUNNING;  */
    413414}
    414415
     
    418419int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
    419420{
    420     int                 i = (int)0;
     421/*    int                 i = (int)0;   */
    421422    struct ppp_softc   *sc;
    422 
    423     for (sc = ppp_softc; i < NPPP; sc++) {
    424         sc->sc_if.if_name = "ppp";
    425         sc->sc_if.if_unit = i++;
     423    char               *name;
     424    int                 number;
     425   
     426   
     427    number = rtems_bsdnet_parse_driver_name (config, &name);
     428   
     429    if (!attaching || (number >= NPPP))
     430        return 0;
     431       
     432    sc = &ppp_softc[number];
     433   
     434    if (sc->sc_if.if_name != NULL)
     435        return 0;       /* interface is already attached */
     436   
     437/*    for (sc = ppp_softc; i < NPPP; sc++) {    */
     438        sc->sc_if.if_name = name /*"ppp"*/;
     439        sc->sc_if.if_unit = number /*i++*/;
    426440        sc->sc_if.if_mtu = PPP_MTU;
    427441        sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
     
    442456        bpfattach(&sc->sc_bpf, &sc->sc_if, DLT_PPP, PPP_HDRLEN);
    443457#endif
    444     }
     458/*    } */
    445459
    446460    return ( 1 );
  • cpukit/libnetworking/net/ppp_tty.c

    rdf6348bb rfd55b7d  
    193193    register struct ppp_softc *sc;
    194194    struct mbuf *m = (struct mbuf *)0;
     195    extern int termios_baud_to_number(int);
    195196
    196197    if (tty->t_line == PPPDISC) {
     
    239240    /* initialize values */
    240241    sc->sc_if.if_flags |= IFF_RUNNING;
    241     sc->sc_if.if_baudrate = 57600; /* FIX: get line speed from termios */
     242    sc->sc_if.if_baudrate =
     243        termios_baud_to_number(tty->termios.c_cflag & CBAUD);
    242244
    243245    tty->t_sc = (void *)sc;
     
    422424ppptioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args)
    423425{
    424     int                 i;
     426/*    int                 i;    */
    425427    int                 error = RTEMS_SUCCESSFUL;
    426428    int                 cmd   = args->command;
     
    562564{
    563565  char                c;
     566  char               *sendBegin;
    564567  char                cFrame  = (char         )PPP_FLAG;
    565568  u_char              ioffset = (u_char       )0;
     
    619622          sc->sc_outflag |= SC_TX_ESCAPE;
    620623        }
     624        sendBegin = &c;
    621625      }
    622626      else {
    623         /* escape not needed - increment the offset */
    624         ioffset++;
     627        /* escape not needed - increment the offset as much as possible */
     628        while ((!ESCAPE_P(c)) && ((sc->sc_outoff + ioffset) < sc->sc_outlen)) {
     629            ioffset++;
     630            c = sc->sc_outbuf[sc->sc_outoff + ioffset];
     631        }
     632        sendBegin = &sc->sc_outbuf[sc->sc_outoff];
    625633      }
    626634
    627       /* write out the character and update the stats */
    628       (*tp->device.write)(tp->minor, &c, 1);
    629       sc->sc_stats.ppp_obytes++;
     635      /* write out the character(s) and update the stats */
     636      (*tp->device.write)(tp->minor, sendBegin, (ioffset > 0) ? ioffset : 1);
     637      sc->sc_stats.ppp_obytes += (ioffset > 0) ? ioffset : 1;
    630638      sc->sc_outoff += ioffset;
    631639    }
Note: See TracChangeset for help on using the changeset viewer.