view cdg-hybrid/cdginc/p_grlc.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_grlc.val                                                     |
| SOURCE  : "sap\grlc.pdf"                                                 |
| LastModified : "2003-06-06"                                              |
| IdAndVersion : "8010.126.02.009"                                         |
| SrcFileTime  : "Thu Nov 29 09:42:56 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                 : GRLC
 * COMPATIBILITY_DEFINES  : NO
 * ALWAYS_ENUM_IN_VAL_FILE: NO
 * ENABLE_GROUP: NO
 * CAPITALIZE_TYPENAME: NO
 */


#ifndef P_GRLC_VAL
#define P_GRLC_VAL


#define CDG_ENTER__P_GRLC_VAL

#define CDG_ENTER__FILENAME _P_GRLC_VAL
#define CDG_ENTER__P_GRLC_VAL__FILE_TYPE CDGINC
#define CDG_ENTER__P_GRLC_VAL__LAST_MODIFIED _2003_06_06
#define CDG_ENTER__P_GRLC_VAL__ID_AND_VERSION _8010_126_02_009

#define CDG_ENTER__P_GRLC_VAL__SRC_FILE_TIME _Thu_Nov_29_09_42_56_2007

#include "CDG_ENTER.h"

#undef CDG_ENTER__P_GRLC_VAL

#undef CDG_ENTER__FILENAME


/*
 * Value constants for VAL_sapi
 */
#define GRLC_SAPI_1                    (0x1)      /* SAP for GMM                    */
#define GRLC_SAPI_3                    (0x3)      /* SAP 1 for SNDCP                */
#define GRLC_SAPI_5                    (0x5)      /* SAP 2 for SNDCP                */
#define GRLC_SAPI_7                    (0x7)      /* SAP for SMS                    */
#define GRLC_SAPI_9                    (0x9)      /* SAP 3 for SNDCP                */
#define GRLC_SAPI_11                   (0xb)      /* SAP 4 for SNDCP                */
#define GRLC_SAPI_TEST_MODE            (0xff)     /* This signs a primitive as GRLC-self generated for test purposes */

/*
 * Value constants for VAL_peak
 */
#define GRLC_PEAK_SUB                  (0x0)      /* Subscribed peak throughput     */
#define GRLC_PEAK_1K                   (0x1)      /* Up to 1 000 octet/s            */
#define GRLC_PEAK_2K                   (0x2)      /* Up to 2 000 octet/s            */
#define GRLC_PEAK_4K                   (0x3)      /* Up to 4 000 octet/s            */
#define GRLC_PEAK_8K                   (0x4)      /* Up to 8 000 octet/s            */
#define GRLC_PEAK_16K                  (0x5)      /* Up to 16 000 octet/s           */
#define GRLC_PEAK_32K                  (0x6)      /* Up to 32 000 octet/s           */
#define GRLC_PEAK_64K                  (0x7)      /* Up to 64 000 octet/s           */
#define GRLC_PEAK_128K                 (0x8)      /* Up to 128 000 octet/s          */
#define GRLC_PEAK_256K                 (0x9)      /* Up to 256 000 octet/s          */

/*
 * Value constants for VAL_relclass
 */
#define GRLC_RELCLASS_SUB              (0x0)      /* Subscribed reliability class   */
#define GRLC_GTP_LLC_RLC_PROT          (0x1)      /* Acknowledged GTP, LLC, and RLC; Protected data */
#define GRLC_LLC_RLC_PROT              (0x2)      /* Unacknowledged GTP; Acknowledged LLC and RLC, Protected data */
#define GRLC_RLC_PROT                  (0x3)      /* Unacknowledged GTP and LLC; Acknowledged RLC, Protected data */
#define GRLC_PROT                      (0x4)      /* Unacknowledged GTP, LLC, and RLC, Protected data */
#define GRLC_NO_REL                    (0x5)      /* Unacknowledged GTP, LLC, and RLC, Unprotected data */

/*
 * Value constants for VAL_delay
 */
#define GRLC_DELAY_SUB                 (0x0)      /* Subscribed delay class         */
#define GRLC_DELAY_1                   (0x1)      /* Delay class 1                  */
#define GRLC_DELAY_2                   (0x2)      /* Delay class 2                  */
#define GRLC_DELAY_3                   (0x3)      /* Delay class 3                  */
#define GRLC_DELAY_4                   (0x4)      /* Delay class 4 (best effort)    */

/*
 * Value constants for VAL_mean
 */
#define GRLC_MEAN_SUB                  (0x0)      /* Subscribed mean throughput     */
#define GRLC_MEAN_100                  (0x1)      /* 100 octet/h                    */
#define GRLC_MEAN_200                  (0x2)      /* 200 octet/h                    */
#define GRLC_MEAN_500                  (0x3)      /* 500 octet/h                    */
#define GRLC_MEAN_1K                   (0x4)      /* 1 000 octet/h                  */
#define GRLC_MEAN_2K                   (0x5)      /* 2 000 octet/h                  */
#define GRLC_MEAN_5K                   (0x6)      /* 5 000 octet/h                  */
#define GRLC_MEAN_10K                  (0x7)      /* 10 000 octet/h                 */
#define GRLC_MEAN_20K                  (0x8)      /* 20 000 octet/h                 */
#define GRLC_MEAN_50K                  (0x9)      /* 50 000 octet/h                 */
#define GRLC_MEAN_100K                 (0xa)      /* 100 000 octet/h                */
#define GRLC_MEAN_200K                 (0xb)      /* 200 000 octet/h                */
#define GRLC_MEAN_500K                 (0xc)      /* 500 000 octet/h                */
#define GRLC_MEAN_1M                   (0xd)      /* 1 000 000 octet/h              */
#define GRLC_MEAN_2M                   (0xe)      /* 2 000 000 octet/h              */
#define GRLC_MEAN_5M                   (0xf)      /* 5 000 000 octet/h              */
#define GRLC_MEAN_10M                  (0x10)     /* 10 000 000 octet/h             */
#define GRLC_MEAN_20M                  (0x11)     /* 20 000 000 octet/h             */
#define GRLC_MEAN_50M                  (0x12)     /* 50 000 000 octet/h             */
#define GRLC_MEAN_BEST                 (0x1f)     /* Best effort                    */

/*
 * Value constants for VAL_preced
 */
#define GRLC_PRECED_SUB                (0x0)      /* Subscribed precedence          */
#define GRLC_PRIO_HIGH                 (0x1)      /* High priority                  */
#define GRLC_PRIO_NORM                 (0x2)      /* Normal priority                */
#define GRLC_PRIO_LOW                  (0x3)      /* Low priority                   */

/*
 * Value constants for VAL_radio_prio
 */
#define GRLC_RADIO_PRIO_1              (0x0)      /* Radio Priority Level 1 (highest) */
#define GRLC_RADIO_PRIO_2              (0x1)      /* Radio Priority Level 2         */
#define GRLC_RADIO_PRIO_3              (0x2)      /* Radio Priority Level 3         */
#define GRLC_RADIO_PRIO_4              (0x3)      /* Radio Priority Level 4 (lowest) */

/*
 * Value constants for VAL_cause
 */
#define GRLC_DTACS_DEF                 (0x0)      /* any other reason               */
#define GRLC_DTACS_PAGE_RESPONSE       (0x1)      /* data is sent due to a page response */
#define GRLC_DTACS_MOBILITY_MANAGEMENT (0x2)      /* mobility management data is sent */
#define GRLC_DTACS_EMPTY_FRAME         (0x3)      /* data is sent due to a cell update */
#define GRLC_DTACS_CELL_NOTIFI_NULL_FRAME (0x4)   /* data is send due to cell notification using LLC unnumbered NULL command. */

// VALTAB-FF: REL99 
// 
// Value constants for VAL_pkt_flow_id
// 
// VAL-FF: REL99  
// #define GRLC_GRLC_PFI_BEST_EFFORT      (0x0)   /* best effort                    */
// VAL-FF: REL99  
// #define GRLC_GRLC_PFI_SIGNALING        (0x1)   /* signalling                     */
// VAL-FF: REL99  
// #define GRLC_GRLC_PFI_SMS              (0x2)   /* SMS                            */
// VAL-FF: REL99  
// #define GRLC_GRLC_PKT_FLOW_ID_NOT_PRES (0xff)  /* value FF is used to indicate when packet flow identifier is not present */

#include "CDG_LEAVE.h"


#endif