Changeset 0286b9f in rtems for cpukit/pppd


Ignore:
Timestamp:
Jan 31, 2002, 9:42:11 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
5ec6f09
Parents:
d8a78f4f
Message:

2001-01-31 Mike Siers <mikes@…>

  • Nice Update of PPPD support which eliminates the requiremetn that drivers be in the termios TASK_DRIVEN mode. Mike did significant testing and reports that it seems to be more stable and handle larger packets better. This patch replaces the termios tasks with more general pppd network driver tasks. The functions pppinput() and pppstart() get called from the interrupt service routine.
  • Makefile.am, configure.ac, net/Makefile.am, net/bpf.h, net/ethernet.h, net/if.c, net/if.h, net/if_arp.h, net/if_dl.h, net/if_ethersubr.c, net/if_llc.h, net/if_loop.c, net/if_ppp.h, net/if_pppvar.h, net/if_types.h, net/netisr.h, net/ppp-comp.h, net/ppp_defs.h, net/pppcompress.h, net/radix.c, net/radix.h, net/raw_cb.c, net/raw_cb.h, net/raw_usrreq.c, net/route.c, net/route.h, net/rtsock.c, pppd/Makefile.am, pppd/README, pppd/STATUS, pppd/auth.c, pppd/cbcp.c, pppd/ccp.c, pppd/ccp.h, pppd/chap.c, pppd/chap.h, pppd/chap_ms.c, pppd/chap_ms.h, pppd/chat.c, pppd/demand.c, pppd/fsm.c, pppd/fsm.h, pppd/ipcp.c, pppd/ipcp.h, pppd/ipxcp.c, pppd/ipxcp.h, pppd/lcp.c, pppd/lcp.h, pppd/magic.c, pppd/magic.h, pppd/options.c, pppd/patchlevel.h, pppd/pathnames.h, pppd/pppd.8, pppd/pppd.h, pppd/rtemsmain.c, pppd/rtemspppd.c, pppd/rtemspppd.h, pppd/sys-rtems.c, pppd/upap.c, pppd/upap.h, pppd/utils.c, pppd/example/README, pppd/example/netconfig.h, wrapup/Makefile.am: Modified.
  • net/bsd-comp.c, net/if_ppp.c, net/ppp-deflate.c, net/ppp.h, net/ppp_tty.c, net/pppcompress.c, net/zlib.c, net/zlib.h: New file.
  • modem/, modem/.cvsignore, modem/Makefile.am, modem/ppp.c, modem/ppp.h, modem/ppp_tty.c, modem/pppcompress.c: Subdirectory removed.
Location:
cpukit/pppd
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • cpukit/pppd/Makefile.am

    rd8a78f4f r0286b9f  
    1111LIB = $(ARCH)/$(LIBNAME)
    1212
    13 C_FILES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c ipcp.c lcp.c magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c rtemsmain.c rtemspppd.c
     13C_FILES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c ipcp.c lcp.c \
     14    magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c rtemsmain.c \
     15    rtemspppd.c
    1416C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1517
     
    3436chat.c demand.c fsm.c fsm.h ipcp.c ipcp.h ipxcp.c ipxcp.h \
    3537lcp.c lcp.h magic.c magic.h md4.c md4.h md5.c md5.h options.c \
    36 patchlevel.h pathnames.h pppd.h rtemsmain.c rtemspppd.c rtemspppd.h \
    37 sys-rtems.c upap.c upap.h utils.c
     38patchlevel.h pathnames.h pppd.h rtemsdialer.h rtemsmain.c rtemspppd.c \
     39rtemspppd.h sys-rtems.c upap.c upap.h utils.c
    3840
    39 include_HEADERS = rtemspppd.h
     41include_HEADERS = rtemspppd.h rtemsdialer.h
    4042
    4143
  • cpukit/pppd/README

    rd8a78f4f r0286b9f  
    2121the ABORT commands.  Removed some dead code and did a lot of
    2222testing on a new Coldfire BSP.  Version seems to be very stable.
     23
     24Update code to use RTEMS pppd network drivers.  Now the pppd
     25software is not dependent on using task driven mode.  This
     26change improved stablity and performance.  This was updated
     27by Mike Siers <mikes@poliac.com>.
    2328=================================================================
    2429
  • cpukit/pppd/STATUS

    rd8a78f4f r0286b9f  
    1717with this function call.
    1818
    19 The pppd application requires the BSP termios driver support task
    20 driven I/O.  Below is a list of known issues that need to be resolved:
    21 
    22   - pppd locks up when it receives large packet pings (> 1500 bytes)
    23   - pppd occasionaly locks up with mbuf allocation error
    24     (problem is rare and may be BSP related)
     19The pppd code had now been updated to use it's own RTEMS network
     20drivers.  This removes the requirement for the task driven termios
     21support.  This update has fixed the large packet ping problem.
     22Currently, I do not know of any problems with the port.
    2523
    2624If you find any other problems or fix some problems, please post your
  • cpukit/pppd/chap.h

    rd8a78f4f r0286b9f  
    111111 * Timeouts.
    112112 */
    113 #define CHAP_DEFTIMEOUT         3       /* Timeout time in seconds */
     113#define CHAP_DEFTIMEOUT         5       /* Timeout time in seconds */
    114114#define CHAP_DEFTRANSMITS       10      /* max # times to send challenge */
    115115
  • cpukit/pppd/chat.c

    rd8a78f4f r0286b9f  
    157157char *phone_num      = (char *) 0;
    158158char *phone_num2     = (char *) 0;
     159static int ttyfd;
    159160static int timeout   = DEFAULT_CHAT_TIMEOUT;
    160161
     
    193194char *clean __P((register char *s, int sending));
    194195char *expect_strtok __P((char *, char *));
    195 int chatmain __P((char *));
     196int chatmain __P((int, int, char *));
    196197
    197198
     
    225226}
    226227
    227 int chatmain(argv)
    228 char *argv;
     228int chatmain(int fd, int mode, char *pScript)
    229229{
    230230  char    *arg;
     
    232232  /* initialize exit code */
    233233  exit_code = 0;
     234  ttyfd     = fd;
    234235
    235236  if ( debug ) {
    236     dbglog("chat_main: %s\n", argv);
     237    dbglog("chat_main: %s\n", pScript);
    237238  }
    238239
    239240  /* get first expect string */
    240   arg = getnextcommand(&argv);
     241  arg = getnextcommand(&pScript);
    241242  while (( arg != NULL ) && ( exit_code == 0 )) {
    242243    /* process the expect string */
     
    244245    if ( exit_code == 0 ) {
    245246      /* get the next send string */
    246       arg = getnextcommand(&argv);
     247      arg = getnextcommand(&pScript);
    247248      if ( arg != NULL ) {
    248249        /* process the send string */
     
    250251
    251252        /* get the next expect string */
    252         arg = getnextcommand(&argv);
     253        arg = getnextcommand(&pScript);
    253254      }
    254255    }
    255256  }
    256 
    257   if ( exit_code ) {
    258    exit_code = -exit_code;
    259   }
     257  ttyfd = (int)-1;
    260258
    261259  return ( exit_code );
  • cpukit/pppd/example/netconfig.h

    rd8a78f4f r0286b9f  
    66
    77/* external function prototypes */
    8 extern int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config,
    9                                    int attaching);
     8extern int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
    109
    1110/* Default network interface */
     
    1413  rtems_ppp_driver_attach,   /* attach function */
    1514  NULL,                      /* No more interfaces */
    16   "192.168.2.123",           /* IP address */
    17   "255.255.255.0",           /* IP net mask */
     15  NULL,                      /* IP address */
     16  NULL,                      /* IP net mask */
    1817  NULL,                      /* Driver supplies hardware address */
    1918  0                          /* Use default driver parameters */
     
    2423  &netdriver_config,
    2524  NULL,
    26   0,                  /* Default network task priority */
    27   0,                  /* Default mbuf capacity */
    28   0,                  /* Default mbuf cluster capacity */
    29   "rtems",            /* Host name */
    30   "xxxyyy.com",       /* Domain name */
     25  30,                 /* Default network task priority */
     26  (256*1024),         /* Default mbuf capacity */
     27  (512*1024),         /* Default mbuf cluster capacity */
     28  0,                  /* Host name */
     29  0,                  /* Domain name */
    3130  0,                  /* Gateway */
    3231  0,                  /* Log host */
  • cpukit/pppd/fsm.c

    rd8a78f4f r0286b9f  
    6060    f->state = INITIAL;
    6161    f->flags = 0;
    62     f->id = 0;                          /* XXX Start with random id? */
     62    f->id = 100;                /* XXX Start with random id? */
    6363    f->timeouttime = DEFTIMEOUT;
    6464    f->maxconfreqtransmits = DEFMAXCONFREQS;
     
    414414            if (f->callbacks->up)
    415415                (*f->callbacks->up)(f); /* Inform upper layers */
    416         } else
     416        } else {
    417417            f->state = ACKSENT;
     418            ppp_delay();
     419        }
    418420        f->nakloops = 0;
    419421
  • cpukit/pppd/fsm.h

    rd8a78f4f r0286b9f  
    120120 * Timeouts.
    121121 */
    122 #define DEFTIMEOUT      3       /* Timeout time in seconds */
     122#define DEFTIMEOUT      5       /* Timeout time in seconds */
    123123#define DEFMAXTERMREQS  2       /* Maximum Terminate-Request transmissions */
    124124#define DEFMAXCONFREQS  10      /* Maximum Configure-Request transmissions */
  • cpukit/pppd/ipcp.c

    rd8a78f4f r0286b9f  
    15711571    u_int32_t peerdns1, peerdns2;
    15721572{
    1573     FILE *f;
    1574 
    1575     f = fopen(_PATH_RESOLV, "w");
    1576     if (f == NULL) {
    1577         error("Failed to create %s: %m", _PATH_RESOLV);
    1578         return;
    1579     }
    1580 
    1581     if (peerdns1)
    1582         fprintf(f, "nameserver %s\n", ip_ntoa(peerdns1));
    1583 
    1584     if (peerdns2)
    1585         fprintf(f, "nameserver %s\n", ip_ntoa(peerdns2));
    1586 
    1587     if (ferror(f))
    1588         error("Write failed to %s: %m", _PATH_RESOLV);
    1589 
    1590     fclose(f);
     1573  extern int              rtems_bsdnet_nameserver_count;
     1574  extern struct in_addr   rtems_bsdnet_nameserver[];
     1575
     1576  /* initialize values */
     1577  rtems_bsdnet_nameserver_count = (int)0;
     1578
     1579  /* check to see if primary was specified */
     1580  if ( peerdns1 ) {
     1581    rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count].s_addr = peerdns1;
     1582    rtems_bsdnet_nameserver_count++;
     1583  }
     1584
     1585  /* check to see if secondary was specified */
     1586  if ( peerdns2 ) {
     1587    rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count].s_addr = peerdns2;
     1588    rtems_bsdnet_nameserver_count++;
     1589  }
     1590
     1591  /* initialize resolver */
     1592  __res_init();
    15911593}
    15921594
  • cpukit/pppd/options.c

    rd8a78f4f r0286b9f  
    716716            if (sv == NULL)
    717717                novm("option argument");
     718            if ( *(char **)(opt->addr) != NULL ) {
     719                free((void *)*(char **)(opt->addr));
     720                *(char **)(opt->addr) = NULL;
     721            }
    718722            *(char **)(opt->addr) = sv;
    719723        }
  • cpukit/pppd/pppd.h

    rd8a78f4f r0286b9f  
    2020 */
    2121
    22 /*
    23  * TODO:
    24  */
    25 
    2622#ifndef __PPPD_H__
    2723#define __PPPD_H__
     
    3329#include <sys/time.h>           /* for struct timeval */
    3430#include <net/ppp_defs.h>
     31#include "rtemsdialer.h"
    3532
    3633#if defined(__STDC__)
     
    168165extern int      do_callback;    /* set if we want to do callback next */
    169166extern int      doing_callback; /* set if this is a callback */
     167extern dialerfp pppd_dialer;    /* script dialer function callback */
    170168
    171169/* Values for do_callback and doing_callback */
     
    379377void setdtr __P((int, int));    /* Raise or lower port's DTR line */
    380378void output __P((int, u_char *, int)); /* Output a PPP packet */
    381 void wait_input __P((struct timeval *));
    382                                 /* Wait for input, with timeout */
     379void wait_input __P((struct timeval *)); /* Wait for input, with timeout */
     380
     381void ppp_delay __P((void));       /* delay task for a little while */
    383382int  read_packet __P((u_char *)); /* Read PPP packet */
    384383int  get_loop_output __P((void)); /* Read pkts from loopback */
  • cpukit/pppd/rtemsmain.c

    rd8a78f4f r0286b9f  
    4242#include <rtems.h>
    4343#include <rtems/rtems_bsdnet.h>
    44 extern void rtems_bsdnet_semaphore_obtain(void);
    45 extern void rtems_bsdnet_semaphore_release(void);
    46 extern int  chatmain(char *argv);
    4744
    4845#include "pppd.h"
     
    5956#include "pathnames.h"
    6057#include "patchlevel.h"
     58#include "rtemsdialer.h"
    6159
    6260#ifdef CBCP_SUPPORT
     
    9593int doing_callback;             /* != 0 if we are doing callback */
    9694char *callback_script;          /* script for doing callback */
     95dialerfp pppd_dialer;
    9796
    9897int (*holdoff_hook) __P((void)) = NULL;
     
    130129static struct timeval *timeleft __P((struct timeval *));
    131130static void holdoff_end __P((void *));
    132 static int device_script __P((char *, int, int, int));
     131static int device_script __P((int, int, char *));
    133132
    134133extern  char    *ttyname __P((int));
     
    313312
    314313            if (initializer && initializer[0]) {
    315                 if (device_script(initializer, ttyfd, ttyfd, 0) < 0) {
     314                if (device_script(ttyfd, DIALER_INIT, initializer) < 0) {
    316315                    error("Initializer script failed");
    317316                    status = EXIT_INIT_FAILED;
     
    325324
    326325            if (connector && connector[0]) {
    327                 if (device_script(connector, ttyfd, ttyfd, 0) < 0) {
     326                if (device_script(ttyfd, DIALER_CONNECT, connector) < 0) {
    328327                    error("Connect script failed");
    329328                    status = EXIT_CONNECT_FAILED;
     
    365364        /* run welcome script, if any */
    366365        if (welcomer && welcomer[0]) {
    367             if (device_script(welcomer, ttyfd, ttyfd, 0) < 0)
     366            if (device_script(ttyfd, DIALER_WELCOME, welcomer) < 0)
    368367                warn("Welcome script failed");
    369368        }
     
    388387        gettimeofday(&start_time, NULL);
    389388
    390         rtems_bsdnet_semaphore_obtain();
    391389        lcp_lowerup(0);
    392390        lcp_open(0);            /* Start protocol */
    393         rtems_bsdnet_semaphore_release();
    394391
    395392        open_ccp_flag = 0;
     
    399396            wait_input(timeleft(&timo));
    400397            calltimeout();
    401             get_input();
     398            get_input();
    402399
    403400            if (kill_link) {
     
    436433            if (real_ttyfd >= 0)
    437434                set_up_tty(real_ttyfd, 1);
    438             if (device_script(disconnect_script, ttyfd, ttyfd, 0) < 0) {
     435            if (device_script(ttyfd, DIALER_DISCONNECT, disconnect_script) < 0) {
    439436                warn("disconnect script failed");
    440437            } else {
     
    478475
    479476    die(status);
    480     return 0;
     477    return status;
    481478}
    482479
     
    579576 */
    580577static void
    581 get_input()
     578get_input(void)
    582579{
    583580    int len, i;
     
    609606    }
    610607
    611     rtems_bsdnet_semaphore_obtain();
    612608    p += 2;                             /* Skip address and control */
    613609    GETSHORT(protocol, p);
     
    619615    if (protocol != PPP_LCP && lcp_fsm[0].state != OPENED) {
    620616        MAINDEBUG(("get_input: Received non-LCP packet when LCP not open."));
    621         rtems_bsdnet_semaphore_release();
    622617        return;
    623618    }
     
    632627        MAINDEBUG(("get_input: discarding proto 0x%x in phase %d",
    633628                   protocol, phase));
    634         rtems_bsdnet_semaphore_release();
    635629        return;
    636630    }
     
    642636        if (protp->protocol == protocol && protp->enabled_flag) {
    643637            (*protp->input)(0, p, len);
    644             rtems_bsdnet_semaphore_release();
    645638            return;
    646639        }
     
    648641            && protp->datainput != NULL) {
    649642            (*protp->datainput)(0, p, len);
    650             rtems_bsdnet_semaphore_release();
    651643            return;
    652644        }
     
    661653    }
    662654    lcp_sprotrej(0, p - PPP_HDRLEN, len + PPP_HDRLEN);
    663     rtems_bsdnet_semaphore_release();
     655
     656    return;
    664657}
    665658
     
    873866 * (e.g. to run the connector or disconnector script).
    874867 */
    875 static int
    876 device_script(program, in, out, dont_wait)
    877     char *program;
    878     int in, out;
    879     int dont_wait;
    880 {
    881     char   pScript[256];
    882 
     868static int device_script(int fd, int mode, char *program)
     869{
     870    int    iReturn = -1;
     871    char   pScript[128];
     872
     873    /* copyt script into temporary location */
    883874    strcpy(pScript, program);
    884     return chatmain(pScript);
     875
     876    /* check to see if dialer was initialized */
     877    if ( !pppd_dialer ) {
     878      /* set default dialer to chatmain */
     879      pppd_dialer = chatmain;
     880    }
     881
     882    /* check to see if dialer is set */
     883    if ( pppd_dialer ) {
     884      /* call the dialer */
     885      iReturn = (*pppd_dialer)(fd, mode, program);
     886    }
     887
     888    return ( -iReturn );
    885889}
    886890
  • cpukit/pppd/rtemspppd.c

    rd8a78f4f r0286b9f  
    11
    22#include <rtems.h>
     3#include <rtems/rtems_bsdnet.h>
    34#include "pppd.h"
    45#include "rtemspppd.h"
     
    78/* define pppd function prototypes */
    89extern void pppasyncattach(void);
    9 extern int pppdmain(int, char **);
     10extern int  pppdmain(int, char **);
    1011
    1112/* define global variables */
    12 rtems_id rtems_pppd_taskid;
     13rtems_id                   rtems_pppd_taskid;
     14rtems_pppd_hookfunction    rtems_pppd_errorfp;
     15rtems_pppd_hookfunction    rtems_pppd_exitfp;
    1316
    1417
     
    1922  rtems_event_set     in;
    2023  rtems_event_set     out;
     24  int                 iStatus;
    2125
    2226  /* call function to setup ppp line discipline */
     
    3943        /* connect request */
    4044        /* execute the pppd main code */
    41         pppdmain(0, NULL);
     45        iStatus = pppdmain(0, NULL);
     46        if ( iStatus == EXIT_OK ) {
     47          /* check exit callback */
     48          if ( rtems_pppd_exitfp ) {
     49            (*rtems_pppd_exitfp)();
     50          }
     51        }
     52        else {
     53          /* check error callback */
     54          if ( rtems_pppd_errorfp ) {
     55            (*rtems_pppd_errorfp)();
     56          }
     57        }
    4258      }
    4359    }
     
    4561
    4662  /* terminate myself */
     63  rtems_pppd_taskid = 0;
    4764  rtems_task_delete(RTEMS_SELF);
    4865}
     
    5067int rtems_pppd_initialize(void)
    5168{
    52   int                 iReturn = (int)-1;
     69  int                 iReturn  = (int)-1;
     70  rtems_unsigned32    priority = 100;
    5371  rtems_status_code   status;
    5472  rtems_name          taskName;
    5573
     74  /* determine priority value */
     75  if ( rtems_bsdnet_config.network_task_priority ) {
     76    priority = rtems_bsdnet_config.network_task_priority;
     77  }
     78
     79  /* initialize the exit hook */
     80  rtems_pppd_exitfp = (rtems_pppd_hookfunction)0;
     81
     82  /* create the rtems task */
    5683  taskName = rtems_build_name( 'p', 'p', 'p', 'd' );
    57   status   = rtems_task_create(taskName,
    58                                RTEMS_PPPD_TASK_PRIORITY,
    59                                RTEMS_PPPD_TASK_STACK_SIZE,
    60                                RTEMS_PPPD_TASK_INITIAL_MODES,
    61                                RTEMS_DEFAULT_ATTRIBUTES,
     84  status   = rtems_task_create(taskName, priority, 8192,
     85                               (RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0)),
     86                               RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
    6287                               &rtems_pppd_taskid);
    6388  if ( status == RTEMS_SUCCESSFUL ) {
     
    115140    ip_down_hook = hookfp;
    116141    break;
     142  case RTEMS_PPPD_ERROR_HOOK:
     143    rtems_pppd_errorfp = hookfp;
     144    break;
     145  case RTEMS_PPPD_EXIT_HOOK:
     146    rtems_pppd_exitfp = hookfp;
     147    break;
    117148  default:
    118149    iReturn = (int)-1;
     
    121152
    122153  return ( iReturn );
     154}
     155
     156int rtems_pppd_set_dialer(rtems_pppd_dialerfunction dialerfp)
     157{
     158  pppd_dialer = dialerfp;
     159  return ( (int)0 );
    123160}
    124161
  • cpukit/pppd/rtemspppd.h

    rd8a78f4f r0286b9f  
    33#define RTEMSPPPD_H
    44
    5 /* check to see if pppd task values are set */
    6 #ifndef RTEMS_PPPD_TASK_PRIORITY
    7 #define RTEMS_PPPD_TASK_PRIORITY        120
    8 #endif
    9 #ifndef RTEMS_PPPD_TASK_STACK_SIZE
    10 #define RTEMS_PPPD_TASK_STACK_SIZE      (10*1024)
    11 #endif
    12 #ifndef RTEMS_PPPD_TASK_INITIAL_MODES
    13 #define RTEMS_PPPD_TASK_INITIAL_MODES   (RTEMS_PREEMPT | \
    14                                          RTEMS_NO_TIMESLICE | \
    15                                          RTEMS_NO_ASR | \
    16                                          RTEMS_INTERRUPT_LEVEL(0))
    17 #endif
    185
    196/* define hook function identifiers */
     
    229#define RTEMS_PPPD_IPUP_HOOK        3
    2310#define RTEMS_PPPD_IPDOWN_HOOK      4
     11#define RTEMS_PPPD_ERROR_HOOK       5
     12#define RTEMS_PPPD_EXIT_HOOK        6
    2413
    2514/* define hook function pointer prototype */
    2615typedef void (*rtems_pppd_hookfunction)(void);
     16typedef int  (*rtems_pppd_dialerfunction)(int tty, int mode, char *pScript);
    2717
    2818
     
    3222int rtems_pppd_reset_options(void);
    3323int rtems_pppd_set_hook(int id, rtems_pppd_hookfunction hookfp);
     24int rtems_pppd_set_dialer(rtems_pppd_dialerfunction dialerfp);
    3425int rtems_pppd_set_option(const char *pOption, const char *pValue);
    3526int rtems_pppd_connect(void);
  • cpukit/pppd/sys-rtems.c

    rd8a78f4f r0286b9f  
    9696
    9797
    98 void
    99 sys_serialcallback(struct termios *tty, void *arg)
    100 {
    101   rtems_event_send(rtems_pppd_taskid, RTEMS_EVENT_31);
    102 }
    103 
    10498/*
    10599 * sys_init - System-dependent initialization.
     
    188182    int fd;
    189183{
     184    int taskid  = (int)rtems_pppd_taskid;
    190185    int pppdisc = PPPDISC;
    191186    int x;
     
    206201    if (ioctl(fd, TIOCSETD, &pppdisc) < 0)
    207202        fatal("ioctl(TIOCSETD): %m");
     203
     204    /* set pppd taskid into the driver */
     205    ioctl(fd, PPPIOCSTASK, &taskid);
    208206
    209207    if (!demand) {
     
    287285    int fd;
    288286{
     287    int taskid = (int)0;
     288
     289    /* clear pppd taskid from the driver */
     290    ioctl(fd, PPPIOCSTASK, &taskid);
     291
    289292    /* Reset non-blocking mode on fd. */
    290293    if (initfdflags != -1 && fcntl(fd, F_SETFL, initfdflags) < 0)
     
    345348{
    346349    struct termios     tios;
    347     struct ttywakeup   wakeup;
    348350
    349351    if (tcgetattr(fd, &tios) < 0)
     
    403405        fatal("tcsetattr: %m");
    404406    }
    405 
    406     /* set up callback function */
    407     wakeup.sw_pfn = sys_serialcallback;
    408     wakeup.sw_arg = (void *)fd;
    409     ioctl(fd, RTEMS_IO_RCVWAKEUP, &wakeup);
    410407
    411408    restore_term = 1;
     
    490487    if (debug);
    491488        dbglog("sent %P", p, len);
     489/*    printf("sent packet [%d]\n", len); */
    492490
    493491    if (write(ttyfd, p, len) < 0) {
     
    497495}
    498496
     497void
     498ppp_delay(void)
     499{
     500  rtems_interval     ticks;
     501
     502  /* recommended delay to help negotiation */
     503  ticks = 300000/rtems_bsdnet_microseconds_per_tick;
     504  rtems_task_wake_after(ticks);
     505}
    499506
    500507/*
     
    526533
    527534    if ((len = read(ttyfd, buf, PPP_MTU + PPP_HDRLEN)) < 0) {
    528         if (errno == EWOULDBLOCK || errno == EINTR)
    529             return -1;
     535        if (errno == EWOULDBLOCK || errno == EINTR) len = -1;
    530536        /*fatal("read: %m"); */
    531537    }
     538
     539/*    printf("read packet [%d]\n", len); */
    532540    return len;
    533541}
     
    948956    int cmd;
    949957{
     958    int    status;
    950959    struct sockaddr_in address;
    951960    struct sockaddr_in netmask;
  • cpukit/pppd/upap.h

    rd8a78f4f r0286b9f  
    7777 * Timeouts.
    7878 */
    79 #define UPAP_DEFTIMEOUT 3       /* Timeout (seconds) for retransmitting req */
     79#define UPAP_DEFTIMEOUT 5       /* Timeout (seconds) for retransmitting req */
    8080#define UPAP_DEFREQTIME 30      /* Time to wait for auth-req from peer */
    8181
Note: See TracChangeset for help on using the changeset viewer.