view cdg-hybrid/cdginc/p_ppp.val @ 220:0ed36de51973

ABB semaphore protection overhaul The ABB semaphone protection logic that came with TCS211 from TI was broken in several ways: * Some semaphore-protected functions were called from Application_Initialize() context. NU_Obtain_Semaphore() called with NU_SUSPEND fails with NU_INVALID_SUSPEND in this context, but the return value wasn't checked, and NU_Release_Semaphore() would be called unconditionally at the end. The latter call would increment the semaphore count past 1, making the semaphore no longer binary and thus no longer effective for resource protection. The fix is to check the return value from NU_Obtain_Semaphore() and skip the NU_Release_Semaphore() call if the semaphore wasn't properly obtained. * Some SPI hardware manipulation was being done before entering the semaphore- protected critical section. The fix is to reorder the code: first obtain the semaphore, then do everything else. * In the corner case of L1/DSP recovery, l1_abb_power_on() would call some non-semaphore-protected ABB & SPI init functions. The fix is to skip those calls in the case of recovery. * A few additional corner cases existed, all of which are fixed by making ABB semaphore protection 100% consistent for all ABB functions and code paths. There is still one remaining problem of priority inversion: suppose a low- priority task calls an ABB function, and some medium-priority task just happens to preempt right in the middle of that semaphore-protected ABB operation. Then the high-priority SPI task is locked out for a non-deterministic time until that medium-priority task finishes its work and goes back to sleep. This priority inversion problem remains outstanding for now.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Apr 2021 20:55:25 +0000
parents 35f7a1dc9f7d
children
line wrap: on
line source

/*
+--------------------------------------------------------------------------+
| PROJECT : PROTOCOL STACK                                                 |
| FILE    : p_ppp.val                                                      |
| SOURCE  : "sap\ppp.pdf"                                                  |
| LastModified : "2002-10-21"                                              |
| IdAndVersion : "8441.116.99.016"                                         |
| SrcFileTime  : "Thu Nov 29 09:51:00 2007"                                |
| Generated by CCDGEN_2.5.5A on Fri Oct 14 21:41:52 2016                   |
|           !!DO NOT MODIFY!!DO NOT MODIFY!!DO NOT MODIFY!!                |
+--------------------------------------------------------------------------+
*/

/* PRAGMAS
 * PREFIX                 : NONE
 * COMPATIBILITY_DEFINES  : NO (require PREFIX)
 * ALWAYS_ENUM_IN_VAL_FILE: NO
 * ENABLE_GROUP: NO
 * CAPITALIZE_TYPENAME: NO
 */


#ifndef P_PPP_VAL
#define P_PPP_VAL


#define CDG_ENTER__P_PPP_VAL

#define CDG_ENTER__FILENAME _P_PPP_VAL
#define CDG_ENTER__P_PPP_VAL__FILE_TYPE CDGINC
#define CDG_ENTER__P_PPP_VAL__LAST_MODIFIED _2002_10_21
#define CDG_ENTER__P_PPP_VAL__ID_AND_VERSION _8441_116_99_016

#define CDG_ENTER__P_PPP_VAL__SRC_FILE_TIME _Thu_Nov_29_09_51_00_2007

#include "CDG_ENTER.h"

#undef CDG_ENTER__P_PPP_VAL

#undef CDG_ENTER__FILENAME


/*
 * Value constants for VAL_mru
 */
#define PPP_MRU_DEFAULT                (0x5dc)    /* default value for mru          */

/*
 * Value constants for VAL_ap
 */
#define PPP_AP_NO                      (0x0)      /* no authentication              */
#define PPP_AP_PAP                     (0x1)      /* password authentication protocol */
#define PPP_AP_CHAP                    (0x2)      /* challenge handshake authentication protocol */
#define PPP_AP_AUTO                    (0x3)      /* automatic authentication       */

/*
 * Value constants for VAL_accm
 */
#define PPP_ACCM_DEFAULT               (0xffffffff)/* default value for accm         */
#define PPP_ACCM_OFF                   (0x0)      /* disable control character mapping */

/*
 * Value constants for VAL_rt
 */
#define PPP_RT_DEFAULT                 (0x3)      /* default value for restart timer */

/*
 * Value constants for VAL_mc
 */
#define PPP_MC_DEFAULT                 (0xa)      /* default value for max configure */

/*
 * Value constants for VAL_mt
 */
#define PPP_MT_DEFAULT                 (0x2)      /* default value for max terminate */

/*
 * Value constants for VAL_mf
 */
#define PPP_MF_DEFAULT                 (0x5)      /* default value for max failure  */

/*
 * Value constants for VAL_ppp_cause
 */
#define PPP_TERM_OK_MMI                (0xcf01)   /* successful terminated (MMI initiated) */
#define PPP_TERM_OK_PEER               (0xcf02)   /* successful terminated (PPP peer initiated) */
#define PPP_TERM_NO_RESPONSE           (0xcf03)   /* no response from the PPP peer  */
#define PPP_TERM_LOOP_BACK             (0xcf04)   /* looped-back link detected      */
#define PPP_TERM_LCP_NOT_CONVERGE      (0xcf05)   /* LCP configuration is not converging */
#define PPP_TERM_IPCP_NOT_CONVERGE     (0xcf06)   /* IPCP configuration is not converging */
#define PPP_TERM_IPCP_NOT_STARTED      (0xcf07)   /* PPP peer did not start IPCP configuration */
#define PPP_TERM_NO_CHANNEL            (0xcf08)   /* can not open communication channels */
#define PPP_TERM_PROT_REJ_UNEXPECTED   (0xcf09)   /* unexpected Protocol Rejection from PPP peer */
#define PPP_TERM_USE_AUTHED_FAILED     (0xcf0a)   /* user authentication failed     */
#define PPP_TERM_PROT_ERROR_UNSPEC     (0xcf0b)   /* unspecified protocol error     */

/*
 * Value constants for VAL_ppp_hc
 */
#define PPP_HC_OFF                     (0x0)      /* no header compression          */
#define PPP_HC_VJ                      (0x1)      /* Van Jacobson header compression */

/*
 * Value constants for VAL_ip
 */
#define PPP_IP_DYNAMIC                 (0x0)      /* dynaminc IP address negotiation */

/*
 * Value constants for VAL_dns1
 */
#define PPP_DNS1_DYNAMIC               (0x0)      /* dynaminc primary DNS server address negotiation */

/*
 * Value constants for VAL_dns2
 */
#define PPP_DNS2_DYNAMIC               (0x0)      /* dynaminc secondary DNS server address negotiation */

/*
 * Value constants for VAL_mode
 */
#define PPP_CLIENT                     (0x0)      /* start PPP as client            */
#define PPP_SERVER                     (0x1)      /* start PPP as server            */
#define PPP_TRANSPARENT                (0x2)      /* start PPP in transparent mode  */

/*
 * Value constants for VAL_lower_layer
 */
#define PPP_LOWER_LAYER_DOWN           (0x0)      /* lower layer is not available   */
#define PPP_LOWER_LAYER_UP             (0x1)      /* lower layer is available       */

/*
 * Value constants for VAL_connected_direction
 */
#define PPP_DTI_CONN_PEER              (0x0)      /* DTI channel is connected to Peer Layer */
#define PPP_DTI_CONN_PROT              (0x1)      /* DTI channel is connected to Protocol Layer */

/*
 * user defined constants
 */
#define PPP_LOGIN_NAME_LENGTH          (0x21)     
#define PPP_PASSWORD_LENGTH            (0x19)     
#define PPP_ORIGINATING_ENTITY         (0xf)      

#include "CDG_LEAVE.h"


#endif