#ifndef OEMSIMNV_H
#define OEMSIMNV_H

//#include "target.h"
#include "AEEcomdef.h"
#include "rex.h"
#include "queue.h"
#include "qw.h"
/*===========================================================================

                           DEFINE COMPILE SWITCH FOR NV

===========================================================================*/

/******************************************
 ADD 2001/05/22 ichikawa@MYTECS
 DEL 2001/08/21 Y.Miyaguni
     常にONとなるものはコメントアウト
 CHG 2001/11/09 Y.Miyaguni
     #undef  SONY_SYS_NV_EFSとする
     PTX-606では、SO追加分もNV→EFSへの格納は行わない為

     DUMMY_EFS_FILE_COUNT=NVIM_EFS_FILE_COUNTと
     することにより、ファイルへのアクセスを行わない

     尚、EFS格納を行う場合は、パフォーマンス面も考慮して
     FG/BGタスクからの読出しなど再検討する必要あり
*******************************************/
/*** ADD ***/
#define SONY_SYS_PTX606_NV
#undef  SONY_SYS_NV_EFS           /* #undefにすること。For EFS Support(SO追加用) */
#undef  SONY_SYS_NV_NONE_NVM      /* #undefにすること。For None NV-Memory(Only cache) */
#undef  SONY_SYS_NV_DEBUG_INIT    /* #undefにすること。For Debug Initialize */


/* 常にONとなるものはコメントアウト                 */
/* SONY_SYS_NV                                      */
/* SONY_SYS_NV_RTC_CTL   //For NV Control RTC       */
/* SONY_SYS_NV_ITEM      //For special item         */
/* SONY_SYS_NV_E2P       //For EEPROM Support       */
/* SONY_SYS_NV_CACHE     //For NV Cache             */
/* SONY_SYS_NV_INIT                                 */
/* SONY_SYS_NV_UPDATE_ACT                           */
/* SONY_SYS_NV_FORMAT                               */
/* SONY_SYS_NV_GET_INFO  //For Get item information */
/* SONY_SYS_NV_TEMP      //For Temporary            */

/*** END OF ADD ***/


/*===========================================================================

                           DATA DECLARATIONS

===========================================================================*/

/*  Signals declarations.                                                  */

#define  NV_RPT_TIMER_SIG     0x0001      /* Watchdog report signal */
#define  NV_WRITE_TIMER_SIG   0x0002      /* Write timer signal */
#define  NV_CMD_Q_SIG         0x0004      /* Command queue signal */
#define  NV_ERR_LOG_SIG       0x0008      /* error log buffer siganl */

#ifdef FEATURE_NV_RUIM
#define  NV_RUIM_ACCESS_SIG   0x0010      /* R-UIM Access Synchronization  */
#endif

#if 0
/*  Reserved signals.                                                      */

#define  NV_RSVD_0010_SIG     0x0010
#define  NV_RSVD_0020_SIG     0x0020
#define  NV_RSVD_0040_SIG     0x0040
#define  NV_RSVD_0080_SIG     0x0080
#define  NV_RSVD_0100_SIG     0x0100
#define  NV_RSVD_0200_SIG     0x0200
#define  NV_RSVD_0400_SIG     0x0400
#define  NV_RSVD_0800_SIG     0x0800

#else  /* 2002/02/20 Y.Miyaguni(メタテクノ) RTC用シグナルを追加 */

#define  NV_RTC_CLEAR_SIG     0x0010      /* Rtc Interrupt clear signal 07/16 takizawa */
#define  NV_RTC_IRQ_OPEN_SIG  0x0020      /* Rtc Interrupt open signal  07/18 takizawa */
#define  NV_RTC_READ_SIG      0x0040      /* Rtc Read signal  07/22 takizawa */
#define  NV_RTC_WRITE_SIG     0x0080      /* Rtc Write signal 07/26 takizawa */
#define  NV_RTC_ALARM_SET_SIG 0x0100      /* Rtc Alarm Write signal 08/03 takizawa */
#define  NV_RTC_IRQ_CLOSE_SIG 0x0200      /* Rtc Interrupt open signal  08/15 takizawa */
#endif

//@ichikawa
#define  CAM_CMD_Q_SIG        0x0400      /* カメラ用 Command queue signal */

/* 2002/11/25 Y.Miyaguni(メタテクノ) 追加 */
#define  CAM_WAIT_TIMER_SIG   0x0800      /* カメラがビジーの時にウェイトするためのシグナル */


/*  Signals 0x1000 thru 0x8000 are system wide and defined in task.h.      */

/* ↓追加 2001/10/25 Y.Miyaguni(メタテクノ) */
#define NV_ITEMNAME_MAXSIZE     48
#define NV_FILENAME_MAXSIZE     40  /* FS_FILENAME_MAX_LENGTHと合わせること */
/* ↑追加 2001/10/25 Y.Miyaguni(メタテクノ) */

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_TREX
#error code not present
#endif

#ifdef FEATURE_TREX
#error code not present
#endif

/*  Command codes when command is issued to the NV task.                   */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
/******************************************
 ADD 2001/06/14 ichikawa@MYTECS
     NV_GET_ITEM_INFO_F For EEPROM Support(SONY_SYS_NV_GET_INFO)
 ADD 2001/08/06 ichikawa@MYTECS
     NV_DEV_INIT_F      For NV device init(SONY_SYS_NV_FORMAT)
 ADD 2001/07/17 ichikawa@MYTECS
     NV_UPDATE_ACT_F    For Update Active_f(SONY_SYS_NV_UPDATE_ACT)
 ADD 2001/08/24 Y.Miyaguni
     NV_SO_PEEK_F       アドレス指定読込(E2P直読み)
     NV_SO_POKE_F       アドレス指定書込(E2P&)
     NV_READ_CACHE_DISABLE_F アイテム指定読込(E2P直読み)
*******************************************/
  typedef enum {
    NV_READ_F,          /* Read item */
    NV_WRITE_F,         /* Write item */
    NV_PEEK_F,          /* Peek at a location */
    NV_POKE_F,          /* Poke into a location */
    NV_FREE_F,          /* Free an nv item's memory allocation */
    NV_CHKPNT_DIS_F,    /* Disable cache checkpointing for glitch recovery */
    NV_CHKPNT_ENA_F,    /* Enable cache checkpointing for glitch recovery */
    NV_OTASP_COMMIT_F,  /* Commit (write) OTASP parameters to nv */
    NV_REPLACE_F,       /* Replace (overwrite) a dynamic pool item */
    NV_INCREMENT_F,     /* Increment the rental timer item */

    NV_GET_ITEM_INFO_F, /* Get item infomation */
    NV_DEV_INIT_F,      /* Proc Device Initialize */
    NV_UPDATE_ACT_F,    /* Active Flag ON/OFF(DEBUG)用 */
    NV_SO_PEEK_F,       /* アドレス指定で、キャッシュを使わずEEPROMから読み出す */
    NV_SO_POKE_F,       /* アドレス指定で、キャッシュとEEPROMの両方に書き込む */
    NV_READ_CACHE_DISABLE_F,      /* item指定で、キャッシュを使わずEEPROMから読み出す */

    NV_FUNC_ENUM_PAD = 0x7FFF     /* Pad to 16 bits on ARM */
  } nv_func_enum_type;
#endif


/*  Returned status codes for requested operation.                         */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
  typedef enum {
    NV_DONE_S,          /* Request completed okay */
    NV_BUSY_S,          /* Request is queued */
    NV_BADCMD_S,        /* Unrecognizable command field */
    NV_FULL_S,          /* The NVM is full */
    NV_FAIL_S,          /* Command failed, reason other than NVM was full */
    NV_NOTACTIVE_S,     /* Variable was not active */
    NV_BADPARM_S,       /* Bad parameter in command block */
    NV_READONLY_S,      /* Parameter is write-protected and thus read only */
    NV_BADTG_S,         /* Item not valid for Target */
    NV_NOMEM_S,         /* free memory exhausted */
    NV_NOTALLOC_S,      /* address is not a valid allocation */
    NV_STAT_ENUM_PAD = 0x7FFF     /* Pad to 16 bits on ARM */
  } nv_stat_enum_type;
#endif


/*  IO operation type.  */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
  typedef enum {
    NV_WRITE_IO,                  /* io write operation */
    NV_READ_IO,                   /* io read operation */
    NV_IO_ENUM_PAD = 0x7FFF       /* Pad to 16 bits on ARM */
  } nv_io_enum_type;
#endif

/*  Dynamic Pool Reservation return type.  */
typedef struct {
  word    amount_reserved;      /* number of bytes actually reserved */
  dword   confirmation_code;    /* confirmation code for the reservation */
} nv_reservation_type;

#define  NV_INVALID_CONF_CODE   0xFFFFFFFF
#define  NV_MAX_RSVD_AMOUNT     0x01C0       /* largest valid request  */


/*=========================================================================*/

/* Enumerators of items to access.  Each command to the NV task specifies  */
/* the command type with an emumerator from the list below.                */
/* Items for all targets must be specified here, to create a consistant    */
/* numbering of items for external tools such as the PST and DM            */
/*                                                                         */
/* Type "nv_items_enum_type" must be 16 bits in length to conform to       */
/* diagnostic messaging formats.  For compilers that treat enum types      */
/* as non-16-bit entities, FEATURE_NV_ENUMS_ARE_WORDS allows forcing       */
/* this type to the proper size.                                           */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else

typedef enum {

/*-------------------------------------------------------------------------*/

/* Electronic Serial Number.                                               */

  NV_ESN_I = 0,            /* Electronic Serial Number                     */
  NV_ESN_CHKSUM_I,         /* Electronic Serial Number checksum            */

/*-------------------------------------------------------------------------*/

/* NV version numbers.                                                     */

  NV_VERNO_MAJ_I,          /* NV Major version number                      */
  NV_VERNO_MIN_I,          /* NV Minor version number                      */

/*-------------------------------------------------------------------------*/

/* Permanent physical station configuration parameters.                    */

  NV_SCM_I,                /* SCMp                                         */
  NV_SLOT_CYCLE_INDEX_I,   /* Slot cycle index                             */
  NV_MOB_CAI_REV_I,        /* Mobile CAI revision number                   */
  NV_MOB_FIRM_REV_I,       /* Mobile firmware revision number              */
  NV_MOB_MODEL_I,          /* Mobile model                                 */
  NV_CONFIG_CHKSUM_I,      /* Checksum of physical configuration parameters*/

/*-------------------------------------------------------------------------*/

/* Permanent general NAM items.  Each of these is associated with a        */
/* particular NAM (there are up to four NAMs per unit).  The NAM id is     */
/* specified in the request.  Certain analog parameters are truly          */
/* associated with the MIN, but since there is only one MIN per NAM        */
/* in analog mode they are defined as a NAM item.                          */

  NV_PREF_MODE_I,          /* Digital/Analog mode preference        */ /*10*/
  NV_CDMA_PREF_SERV_I,     /* CDMA preferred serving system (A/B)          */
  NV_ANALOG_PREF_SERV_I,   /* Analog preferred serving system (A/B)        */

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* The NAM parameters in the block below are protected by the NAM          */
/* checksum and can only be programmed via service programming.            */
/* The NAM parameters in the block above are not protected by checksum     */
/* and may be changed by the user 'on the fly'.                            */

  NV_CDMA_SID_LOCK_I,      /* CDMA SID(s) to lockout                       */
  NV_CDMA_SID_ACQ_I,       /* CDMA SID to acquire                          */
  NV_ANALOG_SID_LOCK_I,    /* ANALOG SID(s) to lockout                     */
  NV_ANALOG_SID_ACQ_I,     /* ANALOG SID to acquire                        */
  NV_ANALOG_FIRSTCHP_I,    /* Analog FIRSTCHPp                             */
  NV_ANALOG_HOME_SID_I,    /* Analog HOME_SIDp                             */
  NV_ANALOG_REG_I,         /* Analog registration setting                  */
  NV_PCDMACH_I,            /* Primary CDMA channel   */                /*20*/
  NV_SCDMACH_I,            /* Secondary CDMA channel                       */
  NV_PPCNCH_I,             /* Primary PCN channel                          */
  NV_SPCNCH_I,             /* Secondary PCN channel                        */
  NV_NAM_CHKSUM_I,         /* NAM checksum                                 */

/*-------------------------------------------------------------------------*/

/* Authentication NAM items.  Each of these is associated with a NAM       */
/* authentication (there are up to four NAMs per unit).  The NAM id is     */
/* specified in the request.                                               */

  NV_A_KEY_I,              /* Authentication A key                         */
  NV_A_KEY_CHKSUM_I,       /* Authentication A key checksum                */
  NV_SSD_A_I,              /* SSD_Asp                                      */
  NV_SSD_A_CHKSUM_I,       /* SSD_Asp checksum                             */
  NV_SSD_B_I,              /* SSD_Bsp                                      */
  NV_SSD_B_CHKSUM_I,       /* SSD_Bsp checksum        */               /*30*/
  NV_COUNT_I,              /* COUNTsp                                      */

/*-------------------------------------------------------------------------*/

/* MIN items.  Each of these is associated with a particular MIN within    */
/* the NAM (there are up to 2 MINs per NAM).  The MIN id itself is         */
/* specified in the request.  When operating in analog mode the first MIN  */
/* is the one and only meaningfull one.                                    */

  NV_MIN1_I,               /* MIN1p                                        */
  NV_MIN2_I,               /* MIN2p                                        */
  NV_MOB_TERM_HOME_I,      /* CDMA MOB_TERM_HOMEp registration flag        */
  NV_MOB_TERM_FOR_SID_I,   /* CDMA MOB_TERM_FOR_SIDp registration flag     */
  NV_MOB_TERM_FOR_NID_I,   /* CDMA MOB_TERM_FOR_NIDp registration flag     */
  NV_ACCOLC_I,             /* ACCOLCp                                      */
  NV_SID_NID_I,            /* CDMA SID/NID pairs                           */
  NV_MIN_CHKSUM_I,         /* MIN checksum                                 */

/*-------------------------------------------------------------------------*/

/* Operational NAM settings.                                               */

  NV_CURR_NAM_I,           /* Current NAM     */                       /*40*/
  NV_ORIG_MIN_I,           /* Call origination MIN within NAM              */
  NV_AUTO_NAM_I,           /* Select NAM automatically on roaming          */
  NV_NAME_NAM_I,           /* A user selectable name for each NAM          */

/*-------------------------------------------------------------------------*/

/* Semi-permanent analog registration parameters.                          */

  NV_NXTREG_I,             /* NXTREGsp                                     */
  NV_LSTSID_I,             /* SIDsp (last SID registered)                  */
  NV_LOCAID_I,             /* LOCAIDsp                                     */
  NV_PUREG_I,              /* PUREGsp                                      */

/*-------------------------------------------------------------------------*/

/* Semi-permanent CDMA registration and channel parameters.                */

  NV_ZONE_LIST_I,          /* ZONE_LISTsp                                  */
  NV_SID_NID_LIST_I,       /* SID_NID_LISTsp                               */
  NV_DIST_REG_I,           /* Distance registration variables   */     /*50*/
  NV_LAST_CDMACH_I,        /* Last CDMA channel acquired                   */

/*-------------------------------------------------------------------------*/

/* Timers, each associated with a specific NAM.                            */

  NV_CALL_TIMER_I,      /* Last call time                                  */
  NV_AIR_TIMER_I,       /* Air time (resettable cummulative call timer)    */
  NV_ROAM_TIMER_I,      /* Roam time (resettable cummulative roam timer)   */
  NV_LIFE_TIMER_I,      /* Life time (non-resettable cumm. call timer)     */

/*-------------------------------------------------------------------------*/

/* Run timer, independent of NAM.                                          */

  NV_RUN_TIMER_I,       /* Run timer (time hardware has been running)      */

/*-------------------------------------------------------------------------*/

/* Memory (speed) dial numbers.                                            */

  NV_DIAL_I,            /* Speed dial number                               */
  NV_STACK_I,           /* Call stack number                               */
  NV_STACK_IDX_I,       /* Call stack last number index                    */

/*-------------------------------------------------------------------------*/

/* Telephone pages (obsolete).                                             */

  NV_PAGE_SET_I,        /* OBSOLETE Page setting     */                /*60*/
  NV_PAGE_MSG_I,        /* OBSOLETE Page message and time                  */

/*-------------------------------------------------------------------------*/

/* Volumes.                                                                */

  NV_EAR_LVL_I,         /* Handset ear piece volume level                  */
  NV_SPEAKER_LVL_I,     /* Handsfree speaker volume level                  */
  NV_RINGER_LVL_I,      /* Ringer volume level                             */
  NV_BEEP_LVL_I,        /* Key beep volume level                           */

/*-------------------------------------------------------------------------*/

/* Tones.                                                                  */

  NV_CALL_BEEP_I,       /* One minute call beeper select                   */
  NV_CONT_KEY_DTMF_I,   /* Continuous keypad DTMF tones select             */
  NV_CONT_STR_DTMF_I,   /* Continuous string (memory) DTMF tones select    */
  NV_SVC_AREA_ALERT_I,  /* Service area enter/exit alert select            */
  NV_CALL_FADE_ALERT_I, /* Call fade alert select     */               /*70*/

/*-------------------------------------------------------------------------*/

/* Various phone settings.                                                 */

  NV_BANNER_I,          /* Idle banner to display                          */
  NV_LCD_I,             /* Display brightness setting                      */
  NV_AUTO_POWER_I,      /* Auto power settings (power savings)             */
  NV_AUTO_ANSWER_I,     /* Auto answer setting                             */
  NV_AUTO_REDIAL_I,     /* Auto redial setting                             */
  NV_AUTO_HYPHEN_I,     /* Auto hyphen setting                             */
  NV_BACK_LIGHT_I,      /* Backlighting manual/auto mode                   */
  NV_AUTO_MUTE_I,       /* Auto radio mute setting                         */

/*-------------------------------------------------------------------------*/

/* Locks and restrictions values.                                          */

  NV_MAINTRSN_I,    /* Base station maintance required reason              */
  NV_LCKRSN_P_I,    /* Base station lock reason, until power cycled */ /*80*/
  NV_LOCK_I,        /* Indicator of whether user locked the phone          */
  NV_LOCK_CODE_I,   /* Lock code string                                    */
  NV_AUTO_LOCK_I,   /* Auto lock setting                                   */
  NV_CALL_RSTRC_I,  /* Call restrictions                                   */
  NV_SEC_CODE_I,    /* Security code                                       */
  NV_HORN_ALERT_I,  /* Horn alert setting                                  */

/*-------------------------------------------------------------------------*/

/* Error log.                                                              */

  NV_ERR_LOG_I,         /* Error log                                       */

/*-------------------------------------------------------------------------*/

/* Miscellaneous items.                                                    */

  NV_UNIT_ID_I,         /* Unit hardware id  (obsolete)                    */
  NV_FREQ_ADJ_I,        /* Frequency adjust values  (obsolete)             */

/*-------------------------------------------------------------------------*/

/* V Battery Min/Max.   (Portable Only Item)                               */

  NV_VBATT_I,           /* V battery regulator array for min/max */    /*90*/

/*-------------------------------------------------------------------------*/

/* Analog (FM) Transmit power levels                                       */

  NV_FM_TX_PWR_I,       /* Analog TX power level array                     */

/*-------------------------------------------------------------------------*/

/* Frequency/temperature offset table item                                 */

  NV_FR_TEMP_OFFSET_I,

/*-------------------------------------------------------------------------*/

/* DM Port Mode (Mobiles only) NOTE: Use to be NV_EXT_PORT_MODE_I          */

  NV_DM_IO_MODE_I,      /* External port (I/O) mode for DM service         */

/*-------------------------------------------------------------------------*/

/* Portable Turnaround Compensation Tables  (Portable Only)                */

  NV_CDMA_TX_LIMIT_I,   /* To limit TX_GAIN_ADJ when output exceeded       */
  NV_FM_RSSI_I,         /* Analog RSSI adjustment                          */
  NV_CDMA_RIPPLE_I,     /* CDMA UHF Ripple Compensation                    */
  NV_CDMA_RX_OFFSET_I,  /* CDMA RX Offset compensation                     */
  NV_CDMA_RX_POWER_I,   /* CDMA True RX Power Table                        */
  NV_CDMA_RX_ERROR_I,   /* CDMA RX Linear and Non-linear error table       */
  NV_CDMA_TX_SLOPE_1_I, /* CDMA TX Gain Comp Slope Compensation tbl*/ /*100*/
  NV_CDMA_TX_SLOPE_2_I, /* CDMA TX Gain Adjust Slope Compensation table    */
  NV_CDMA_TX_ERROR_I,   /* CDMA TX Non-linear Error Compensation table     */
  NV_PA_CURRENT_CTL_I,  /* PA Current Control table                        */
/*-------------------------------------------------------------------------*/

/* Audio Adjustment values                                                 */

  NV_SONY_ATTEN_1_I,
  NV_SONY_ATTEN_2_I,
  NV_VOC_GAIN_I,

/*-------------------------------------------------------------------------*/

/* Spare items (2) for developer                                           */

  NV_SPARE_1_I,
  NV_SPARE_2_I,

/*-------------------------------------------------------------------------*/

/* Data Services items                                                     */

  NV_DATA_SRVC_STATE_I,   /* Data Service(Task) Enabled/Disabled           */
  NV_DATA_IO_MODE_I,      /* External port (I/O) mode for Data svc */ /*110*/
  NV_IDLE_DATA_TIMEOUT_I, /* Data service idle time in seconds             */

/*-------------------------------------------------------------------------*/

/* Maximum TX adjustment                                                   */

  NV_MAX_TX_ADJ_I,

/*-------------------------------------------------------------------------*/

/* Initial Muting Modes                                                    */

  NV_INI_MUTE_I,

/*-------------------------------------------------------------------------*/

/* Factory free format test buffer                                         */

  NV_FACTORY_INFO_I,

/*-------------------------------------------------------------------------*/

/* Additional Sony Attenuation values                                      */

  NV_SONY_ATTEN_3_I,
  NV_SONY_ATTEN_4_I,
  NV_SONY_ATTEN_5_I,

/*-------------------------------------------------------------------------*/

/* DM address item (for multi-drop HDLC)                                   */

  NV_DM_ADDR_I,
  NV_CDMA_PN_MASK_I,
  NV_SEND_TIMEOUT_I,                                                  /*120*/

/*-------------------------------------------------------------------------*/
/* MSM2P and beyond NV items. */

  NV_FM_AGC_SET_VS_PWR_I,        /* FM TX_AGC_ADJ setting vs power         */
  NV_FM_AGC_SET_VS_FREQ_I,       /* FM TX_AGC_ADJ setting vs frequency     */
  NV_FM_AGC_SET_VS_TEMP_I,       /* FM TX_AGC_ADJ setting vs temperature   */

  NV_FM_EXP_HDET_VS_PWR_I,       /* FM expected HDET reading vs power      */
  NV_FM_ERR_SLP_VS_PWR_I,        /* FM HDET error slope vs power           */
  NV_FM_FREQ_SENSE_GAIN_I,       /* deviation adj. trim                    */

  NV_CDMA_RX_LIN_OFF_0_I,        /* CDMA Rx linearizer offset              */
  NV_CDMA_RX_LIN_SLP_I,          /* CDMA Rx linearizer slope               */

  NV_CDMA_RX_COMP_VS_FREQ_I,     /* CDMA Rx gain comp vs frequency         */
  NV_CDMA_TX_COMP_VS_FREQ_I,     /* CDMA Tx gain comp vs frequency */ /*130*/
  NV_CDMA_TX_COMP_VS_VOLT_I,     /* CDMA Tx gain comp vs voltage           */

  NV_CDMA_TX_LIN_MASTER_OFF_0_I, /* CDMA Tx linearizer master offset       */
  NV_CDMA_TX_LIN_MASTER_SLP_I,   /* CDMA Tx linearizer master slope        */
  NV_CDMA_TX_LIN_VS_TEMP_I,      /* CDMA Tx linearizer trim vs temp        */
  NV_CDMA_TX_LIN_VS_VOLT_I,      /* CDMA Tx linearizer trim vs voltage     */

  NV_CDMA_TX_LIM_VS_TEMP_I,      /* CDMA Tx power limit vs temperature     */
  NV_CDMA_TX_LIM_VS_VOLT_I,      /* CDMA Tx power limit vs voltage         */
  NV_CDMA_TX_LIM_VS_FREQ_I,      /* CDMA Tx power limit vs frequency       */
  NV_CDMA_EXP_HDET_VS_AGC_I,     /* CDMA expected HDET reading vs AGC PDM  */
  NV_CDMA_ERR_SLP_VS_HDET_I,  /*CDMA HDET err slope vs HDET reading*/ /*140*/

  NV_THERM_I,                    /* RF & LCD temp. based compensation      */
  NV_VBATT_PA_I,                 /* RF comp. based on voltage              */
  NV_HDET_OFF_I,                 /* ADC HDET reading offset                */
  NV_HDET_SPN_I,                 /* ADC HDET reading span                  */
  NV_ONETOUCH_DIAL_I,            /* ena/dis UI one touch dialing           */

  NV_FM_AGC_ADJ_VS_FREQ_I,
  NV_FM_AGC_ADJ_VS_TEMP_I,
  NV_RF_CONFIG_I,
  NV_R1_RISE_I,
  NV_R1_FALL_I,                                                       /*150*/
  NV_R2_RISE_I,
  NV_R2_FALL_I,
  NV_R3_RISE_I,
  NV_R3_FALL_I,

  NV_PA_RANGE_STEP_CAL_I,
  NV_LNA_RANGE_POL_I,
  NV_LNA_RANGE_RISE_I,
  NV_LNA_RANGE_FALL_I,
  NV_LNA_RANGE_OFFSET_I,

  NV_POWER_CYCLES_I,                                                  /*160*/
  NV_ALERTS_LVL_I,
  NV_ALERTS_LVL_SHADOW_I,
  NV_RINGER_LVL_SHADOW_I,
  NV_BEEP_LVL_SHADOW_I,
  NV_EAR_LVL_SHADOW_I,
  NV_TIME_SHOW_I,
  NV_MESSAGE_ALERT_I,
  NV_AIR_CNT_I,
  NV_ROAM_CNT_I,
  NV_LIFE_CNT_I,                                                      /*170*/
  NV_SEND_PIN_I,
  NV_AUTO_ANSWER_SHADOW_I,
  NV_AUTO_REDIAL_SHADOW_I,
  NV_SMS_I,
  NV_SMS_DM_I,
  NV_IMSI_MCC_I,
  NV_IMSI_11_12_I,
  NV_DIR_NUMBER_I,
  NV_VOICE_PRIV_I,
  NV_SPARE_B1_I,                                                      /*180*/
  NV_SPARE_B2_I,
  NV_SPARE_W1_I,
  NV_SPARE_W2_I,
  NV_FSC_I,
  NV_ALARMS_I,
  NV_STANDING_ALARM_I,
  NV_ISD_STD_PASSWD_I,
  NV_ISD_STD_RESTRICT_I,
  NV_DIALING_PLAN_I,
  NV_FM_LNA_CTL_I,                                                    /*190*/
  NV_LIFE_TIMER_G_I,
  NV_CALL_TIMER_G_I,
  NV_PWR_DWN_CNT_I,
  NV_FM_AGC_I,
  NV_FSC2_I,
  NV_FSC2_CHKSUM_I,
  NV_WDC_I,
  NV_HW_CONFIG_I,

/*-------------------------------------------------------------------------*/
/* MSM2P and beyond NV items. (continued)  */

  NV_CDMA_RX_LIN_VS_TEMP_I,            /* CDMA Rx linearizer vs temperature*/
  NV_CDMA_ADJ_FACTOR_I,                /* CDMA adjustment factor */   /*200*/
  NV_CDMA_TX_LIM_BOOSTER_OFF_I,
  NV_CDMA_RX_SLP_VS_TEMP_I,
  NV_CDMA_TX_SLP_VS_TEMP_I,
  NV_PA_RANGE_VS_TEMP_I,
  NV_LNA_SWITCH_VS_TEMP_I,
  NV_FM_EXP_HDET_VS_TEMP_I,
  NV_N1M_I,

/*-------------------------------------------------------------------------*/
/* TMSI NAM parameters and extensions.                                     */

  NV_IMSI_I,                        /* OBSOLETE InternationaMobileStationID*/
  NV_IMSI_ADDR_NUM_I,                  /* Length of IMSI                   */
  NV_ASSIGNING_TMSI_ZONE_LEN_I,        /* TMSI_ZONE_LENs-p  */        /*210*/
  NV_ASSIGNING_TMSI_ZONE_I,            /* TMSI_ZONEs-p                     */
  NV_TMSI_CODE_I,                      /* TMSI_CODEs-p                     */
  NV_TMSI_EXP_I,                       /* TMSI expiration time             */
  NV_HOME_PCS_FREQ_BLOCK_I,            /* Subscriber's home block          */
  NV_DIR_NUMBER_PCS_I,                 /* Directory number, PCS format     */

/*-------------------------------------------------------------------------*/
/* Roaming List and MRU Table.                                             */

  NV_ROAMING_LIST_I,                   /* The roaming list                 */
  NV_MRU_TABLE_I,                      /* Most recently used channels      */
                                       /*  NOTE: This item is obsolete     */

/*-------------------------------------------------------------------------*/

  NV_REDIAL_I,                 /* Last number redial                       */
  NV_OTKSL_I,                  /* One-time keypad subsidy lock             */
  NV_TIMED_PREF_MODE_I,        /* To allow analog-only operation */   /*220*/

/*-------------------------------------------------------------------------*/

  NV_RINGER_TYPE_I,            /* Ringer type setting                      */
  NV_ANY_KEY_ANSWER_I,         /* Answer call with any key                 */
  NV_BACK_LIGHT_HFK_I,         /* Hands Free Kit backlight setting         */
  NV_RESTRICT_GLOBAL_I,        /* Global phone book restriction            */
  NV_KEY_SOUND_I,              /* Type of keypress sound emitted           */
  NV_DIALS_SORTING_METHOD_I,   /* Phone book sorting method                */
  NV_LANGUAGE_SELECTION_I,     /* Language for user interface              */
  NV_MENU_FORMAT_I,            /* Type of user interface menus             */

/*-------------------------------------------------------------------------*/

  NV_RINGER_SPKR_LVL_I,        /* External speaker ringer volume           */
  NV_BEEP_SPKR_LVL_I,          /* External speaker key beep volume */ /*230*/

/*-------------------------------------------------------------------------*/

  NV_MRU2_TABLE_I,             /* New format, Most Recently Used channels  */
  NV_VIBRATOR_I,               /* Use vibrator instead of ringer           */
  NV_FLIP_ANSWERS_I,           /* Opening clamshell answers call           */

/*-------------------------------------------------------------------------*/

  NV_DIAL_RESTRICT_LVLS_I,     /* ISS2 dialing restriction levels          */
  NV_DIAL_STATE_TABLE_LEN_I,   /* Number elements in state table           */
  NV_DIAL_STATE_TABLE_I,       /* ISS2 dialing plan state table            */

/*-------------------------------------------------------------------------*/

  NV_VOICE_PRIV_ALERT_I,       /* Voice privacy alert for TGP              */

/*-------------------------------------------------------------------------*/

  NV_IP_ADDRESS_I,             /* IP/Port address  (obsolete)              */
  NV_CURR_GATEWAY_I,           /* Last active IP address (obsolete)        */

/*-------------------------------------------------------------------------*/

  NV_DATA_QNC_ENABLED_I,       /* QNC enabled flag                 */ /*240*/
  NV_DATA_SO_SET_I,            /* Which Service Option set is in effect    */

/*-------------------------------------------------------------------------*/

  NV_UP_LINK_INFO_I,           /* IP addresses and key data                */
  NV_UP_PARMS_I,               /* Current gateway, alert state, etc.       */
  NV_UP_CACHE_I,               /* The Unwired Planet cache                 */

/*-------------------------------------------------------------------------*/

  NV_ELAPSED_TIME_I,           /* Timer for formal test use                */

/*-------------------------------------------------------------------------*/

  NV_PDM2_I,                   /* For RF Cal use                           */
  NV_RX_AGC_MINMAX_I,          /* Receiver AGC min-max                     */
  NV_VBATT_AUX_I,              /* Auxillary VBATT min-max                  */

  NV_DTACO_CONTROL_I,            /* DTACO enabled/disabled control         */
  NV_DTACO_INTERDIGIT_TIMEOUT_I, /* DTACO interdigit timeout       */ /*250*/

  NV_PDM1_I,                   /* For RF Cal use                           */
  NV_BELL_MODEM_I,             /* Flag for ISS2                            */

  NV_PDM1_VS_TEMP_I,           /* For RF Cal use                           */
  NV_PDM2_VS_TEMP_I,           /* For RF Cal use                           */

/*-------------------------------------------------------------------------*/

  NV_SID_NID_LOCK_I,           /* CDMA SID(s) and NID(s) to lockout        */
  NV_PRL_ENABLED_I,            /* If the roaming list is enabled or not    */
  NV_ROAMING_LIST_683_I,       /* IS-683-A format roaming list             */
  NV_SYSTEM_PREF_I,            /* System Preference, per NAM               */
  NV_HOME_SID_NID_I,           /* "Home" SID/NID list                      */
  NV_OTAPA_ENABLED_I,          /* Whether OTAPA is enabled, per NAM*/ /*260*/
  NV_NAM_LOCK_I,               /* SPASM protection per NAM                 */
  NV_IMSI_T_S1_I,              /* True IMSI - MIN1                         */
  NV_IMSI_T_S2_I,              /* True IMSI - MIN2                         */
  NV_IMSI_T_MCC_I,             /* True IMSI - MCC                          */
  NV_IMSI_T_11_12_I,           /* True IMSI - 11th & 12th digits           */
  NV_IMSI_T_ADDR_NUM_I,        /* True IMSI - Addr num                     */

/*-------------------------------------------------------------------------*/

  NV_UP_ALERTS_I,              /* Unwired Planet alert records             */
  NV_UP_IDLE_TIMER_I,          /* Idle time timer                          */

  NV_SMS_UTC_I,                /* Specifies format of SMS time display     */
  NV_ROAM_RINGER_I,            /* Specifies roam ringer on or off  */ /*270*/
  NV_RENTAL_TIMER_I,           /* The rental timer item                    */
  NV_RENTAL_TIMER_INC_I,       /* The rental timer increment value         */
  NV_RENTAL_CNT_I,             /* The rental counter                       */
  NV_RENTAL_TIMER_ENABLED_I,   /* Enables/disables the rental timer        */
  NV_FULL_SYSTEM_PREF_I,       /* Controls system pref display options     */

/*-------------------------------------------------------------------------*/

  NV_BORSCHT_RINGER_FREQ_I,    /* Ringer freq used for BORSCHT port (RJ-11)*/
  NV_PAYPHONE_ENABLE_I,        /* Enable/disable payphone support          */
  NV_DSP_ANSWER_DET_ENABLE_I,  /* Enable/disable dsp answer detection      */
  NV_EVRC_PRI_I,               /* EVRC/13K priority: EVRC first, 13K first */
  NV_AFAX_CLASS_20_I,          /* Obsolete item                    */ /*280*/
  NV_V52_CONTROL_I,            /* V52 control option                       */
  NV_CARRIER_INFO_I,           /* Bitmap and ASCII name info for carrier   */
  NV_AFAX_I,                   /* Analog FAX type: end to end or class 2.0 */
  NV_SIO_PWRDWN_I,             /* Distinguishes old/new UART hardware      */

/*-------------------------------------------------------------------------*/

#ifdef FEATURE_EVRC_SO_MGMT
  NV_PREF_VOICE_SO_I,          /* EVRC voice service options               */
#else
  NV_RSVD_ITEM_1_I,            /* Reserved item                            */
#endif
  NV_VRHFK_ENABLED_I,          /* Voice recognition hands free kit enabled */
  NV_VRHFK_VOICE_ANSWER_I,     /* Voice recognition voice answer           */
  NV_PDM1_VS_FREQ_I,           /* For RF Cal use                           */
  NV_PDM2_VS_FREQ_I,           /* For RF Cal use                           */
  NV_SMS_AUTO_DELETE_I,        /* SMS auto-deletion enabled status */ /*290*/
  NV_SRDA_ENABLED_I,           /* Silent redial enabled status             */
  NV_OUTPUT_UI_KEYS_I,         /* Enable-disable sending UI keystrokes     */
  NV_POL_REV_TIMEOUT_I,        /* Timeout for polarity reversal            */

/*-------------------------------------------------------------------------*/

  NV_SI_TEST_DATA_1_I,         /* First stack-checker diagnostic buffer    */
  NV_SI_TEST_DATA_2_I,         /* Second stack-checker diagnostic buffer   */
  NV_SPC_CHANGE_ENABLED_I,     /* Enable-disable OTASP SPC change          */

  NV_DATA_MDR_MODE_I,          /* Select the MDR mode                      */
  NV_DATA_PKT_ORIG_STR_I,      /* Dial string for originating packet calls */

  NV_UP_KEY_I,                 /* Unwired Planet access key item           */
  NV_DATA_AUTO_PACKET_DETECTION_I, /* Packet data configuration item       */
  NV_AUTO_VOLUME_ENABLED_I,    /* Enable-disable auto volume               */
  NV_WILDCARD_SID_I,           /* Allow wildcard SID                       */
  NV_ROAM_MSG_I,               /* Downloadable roaming messages            */
  NV_OTKSL_FLAG_I,             /* OTKSL Flag                               */
  NV_BROWSER_TYPE_I,           /* Browser identifier                       */
  NV_SMS_REMINDER_TONE_I,      /* Reminder tone is on or off               */

/*-------------------------------------------------------------------------*/

  NV_UBROWSER_I,               /* Micro browser data                       */
  NV_BTF_ADJUST_I,             /* BTF adjustment value                     */
  NV_FULL_PREF_MODE_I,         /* Controls pref display options            */
  NV_UP_BROWSER_WARN_I,        /* Confirmation screen option       */ /*310*/
  NV_FM_HDET_ADC_RANGE_I,      /* ADC range for HDET sampling (analog)     */
  NV_CDMA_HDET_ADC_RANGE_I,    /* ADC range for HDET sampling (CDMA)       */
  NV_PN_ID_I,                  /* PN code selection                        */
  NV_USER_ZONE_ENABLED_I,      /* Enable-disable User Zone table           */
  NV_USER_ZONE_I,              /* User Zone table                          */
  NV_PAP_DATA_I,               /* Password Authentication Protocol data    */
  NV_DATA_DEFAULT_PROFILE_I,   /* Default user AT command profile          */
  NV_PAP_USER_ID_I,            /* User_ID for Password Auth. Protocol      */
  NV_PAP_PASSWORD_I,           /* Actual password for PAP                  */
  NV_STA_TBYE_I,               /* Num wakeup samples below thrshld */ /*320*/
  NV_STA_MIN_THR_I,            /* Threshold for Rx+Ec/Io (RSSI) trigger    */
  NV_STA_MIN_RX_I,             /* Threshold for Rx trigger                 */
  NV_STA_MIN_ECIO_I,           /* Threshold for Rx-Only idle trigger       */
  NV_STA_PRI_I,                /* Switch to AMPS PRI setting               */

/*-------------------------------------------------------------------------*/

  NV_PCS_RX_LIN_OFF_0_I,       /* PCS Rx linearizer offset                 */
  NV_PCS_RX_LIN_SLP_I,         /* PCS Rx linearizer slope                  */
  NV_PCS_RX_COMP_VS_FREQ_I,    /* PCS Rx gain comp vs frequency            */
  NV_PCS_TX_COMP_VS_FREQ_I,    /* PCS Tx gain comp vs frequency            */
  NV_PCS_TX_LIN_MASTER_OFF_0_I,/* PCS Tx linearizer master offset          */
  NV_PCS_TX_LIN_MASTER_SLP_I,  /* PCS Tx linearizer master slope   */ /*330*/
  NV_PCS_TX_LIN_VS_TEMP_I,     /* PCS Tx linearizer trim vs temp           */
  NV_PCS_TX_LIM_VS_TEMP_I,     /* PCS Tx power limit vs temperature        */
  NV_PCS_TX_LIM_VS_FREQ_I,     /* PCS Tx power limit vs frequency          */
  NV_PCS_EXP_HDET_VS_AGC_I,    /* PCS expected HDET reading vs AGC PDM     */
  NV_PCS_HDET_OFF_I,           /* ADC HDET reading offset                  */
  NV_PCS_HDET_SPN_I,           /* ADC HDET reading span                    */
  NV_PCS_R1_RISE_I,            /* TX pwr lvl at which PA is stepped up     */
  NV_PCS_R1_FALL_I,            /* TX pwr lvl at which PA is stepped down   */
  NV_PCS_R2_RISE_I,            /* TX pwr lvl at which PA is stepped up     */
  NV_PCS_R2_FALL_I,            /* TX pwr lvl at which PA stpd down */ /*340*/
  NV_PCS_R3_RISE_I,            /* TX pwr lvl at which PA is stepped up     */
  NV_PCS_R3_FALL_I,            /* TX pwr lvl at which PA is stepped down   */
  NV_PCS_PA_RANGE_STEP_CAL_I,  /* Calibrate PA Range gain step             */
  NV_PCS_PDM1_VS_FREQ_I,       /* PDM1 vs frequency compensation table     */
  NV_PCS_PDM2_VS_FREQ_I,       /* PDM2 vs frequency compensation table     */
  NV_PCS_LNA_RANGE_POL_I,      /* Polarity of LNA range control signal     */
  NV_PCS_LNA_RANGE_RISE_I,     /* Rx pwr lvl for: LNA bypass               */
  NV_PCS_LNA_RANGE_FALL_I,     /* Rx pwr lvl for: LNA turned on            */
  NV_PCS_LNA_RANGE_OFFSET_I,   /* Rx pwr lvl offset when LNA is bypassed   */
  NV_PCS_RX_LIN_VS_TEMP_I,     /* PCS Rx linearizer vs temperature */ /*350*/
  NV_PCS_ADJ_FACTOR_I,         /* PCS adjustment factor                    */
  NV_PCS_PA_RANGE_VS_TEMP_I,   /* Changes in PA_RANGE_STEP over temp       */
  NV_PCS_PDM1_VS_TEMP_I,       /* TX temperature compensation using PDM1   */
  NV_PCS_PDM2_VS_TEMP_I,       /* TX temperature compensation using PDM2   */
  NV_PCS_RX_SLP_VS_TEMP_I,     /* Slope of RX linearizer over temperature  */
  NV_PCS_TX_SLP_VS_TEMP_I,     /* Slope of TX linearizer over temperature  */
  NV_PCS_RX_AGC_MINMAX_I,      /* Receiver AGC min-max                     */

/*-------------------------------------------------------------------------*/

  NV_PA_OFFSETS_I,
  NV_CDMA_TX_LIN_MASTER_I,     /* Obsolete tx linearizer item              */

  NV_VEXT_I,                                                          /*360*/
  NV_VLCD_ADC_CNT_I,
  NV_VLCD_DRVR_CNT_I,
  NV_VREF_ADJ_PDM_CNT_I,
  NV_IBAT_PER_LSB_I,
  NV_IEXT_I,
  NV_IEXT_THR_I,

  NV_CDMA_TX_LIN_MASTER0_I,
  NV_CDMA_TX_LIN_MASTER1_I,
  NV_CDMA_TX_LIN_MASTER2_I,
  NV_CDMA_TX_LIN_MASTER3_I,                                           /*370*/
  NV_TIME_FMT_SELECTION_I,

/*-------------------------------------------------------------------------*/

  NV_SMS_BC_SERVICE_TABLE_SIZE_I,
  NV_SMS_BC_SERVICE_TABLE_I,
  NV_SMS_BC_CONFIG_I,
  NV_SMS_BC_USER_PREF_I,

/*-------------------------------------------------------------------------*/

/* RFR3100 items */
  NV_LNA_RANGE_2_RISE_I,
  NV_LNA_RANGE_2_FALL_I,
  NV_LNA_RANGE_12_OFFSET_I,
  NV_NONBYPASS_TIMER_I,
  NV_BYPASS_TIMER_I,                                                  /*380*/
  NV_IM_LEVEL1_I,
  NV_IM_LEVEL2_I,
  NV_CDMA_LNA_OFFSET_VS_FREQ_I,
  NV_CDMA_LNA_12_OFFSET_VS_FREQ_I,
  NV_AGC_PHASE_OFFSET_I,
  NV_RX_AGC_MIN_11_I,

/*-------------------------------------------------------------------------*/

/* Trimode - RFR3100 items */
  NV_PCS_LNA_RANGE_2_RISE_I,
  NV_PCS_LNA_RANGE_2_FALL_I,
  NV_PCS_LNA_RANGE_12_OFFSET_I,
  NV_PCS_NONBYPASS_TIMER_I,                                           /*390*/
  NV_PCS_BYPASS_TIMER_I,
  NV_PCS_IM_LEVEL1_I,
  NV_PCS_IM_LEVEL2_I,
  NV_PCS_CDMA_LNA_OFFSET_VS_FREQ_I,
  NV_PCS_CDMA_LNA_12_OFFSET_VS_FREQ_I,
  NV_PCS_AGC_PHASE_OFFSET_I,
  NV_PCS_RX_AGC_MIN_11_I,

  NV_RUIM_CHV_1_I,                 /* Card holder verification 1 for R-UIM */
  NV_RUIM_CHV_2_I,                 /* Card holder verification 2 for R-UIM */

  NV_GPS1_CAPABILITIES_I,                          /* GPS One Capabilities */
  NV_GPS1_PDE_ADDRESS_I,                        /* GPS One PDE TCP Address */
  NV_GPS1_ALLOWED_I,   /* GPS One Position Determination Services Lock-out */
  NV_GPS1_PDE_TRANSPORT_I,        /* GPS One Preferred transport mechanism */
  NV_GPS1_MOBILE_CALC_I,
                      /* GPS One Mobile vs PDE based Position Calculations */

  NV_PREF_FOR_RC_I,        /* IS2000 CAI radio configuration RC preference */
  NV_DS_DEFAULT_BAUD_I,             /* DATA SERVICES default SIO baud rate */
  NV_DIAG_DEFAULT_BAUD_I,                    /* DIAG default SIO baud rate */
  NV_SIO_DEV_MAP_MENU_ITEM_I,
               /* Serial Device Mapper configuration menu item information */

  NV_TTY_I,                /* Specifies whether TTY is enabled or disabled */
  NV_PA_RANGE_OFFSETS_I,
      /* Digitally compensate for PA gain steps in each of the 4 PA states */
  NV_TX_COMP0_I,  /* For temp. and freq. compensation of the Tx linearizer */

  NV_MM_SDAC_LVL_I,                  /* Stereo DAC Multimedia volume level */
  NV_BEEP_SDAC_LVL_I,                  /* Stereo DAC key beep volume level */
  NV_SDAC_LVL_I,                                /* Stereo DAC volume level */
  NV_MM_LVL_I,                          /* Handset Multimedia volume level */
  NV_MM_LVL_SHADOW_I,                   /* Headset Multimedia volume level */
  NV_MM_SPEAKER_LVL_I,                      /* HFK Multimedia volume level */
  NV_MM_PLAY_MODE_I,                               /* Multimedia play mode */
  NV_MM_REPEAT_MODE_I,                           /* Multimedia repeat mode */
  NV_TX_COMP1_I,  /* For temp. and freq. compensation of the Tx linearizer */
  NV_TX_COMP2_I,  /* For temp. and freq. compensation of the Tx linearizer */
  NV_TX_COMP3_I,  /* For temp. and freq. compensation of the Tx linearizer */
  NV_PRIMARY_DNS_I,           /* Contains the IP Address of the DNS Server */
  NV_SECONDARY_DNS_I,
                    /* Contains the IP Address of the Secondary DNS Server */
  NV_DIAG_PORT_SELECT_I,              /* Info for DIAG boot port selection */
  NV_GPS1_PDE_PORT_I,        /* Listening port associated with PDE address */
  NV_MM_RINGER_FILE_I,                       /* Multimedia ringer filename */
  NV_MM_STORAGE_DEVICE_I,                      /* Multimedia file location */

  NV_DATA_SCRM_ENABLED_I, /* Enables/disables the mobile's ability to SCRM */
  NV_RUIM_SMS_STATUS_I,
         /* For storing information required by R-UIM SMSS Elementary File */
  NV_PCS_TX_LIN_MASTER0_I,        /* PCS Tx linearizer with internal PA=00 */
  NV_PCS_TX_LIN_MASTER1_I,        /* PCS Tx linearizer with internal PA=01 */
  NV_PCS_TX_LIN_MASTER2_I,        /* PCS Tx linearizer with internal PA=10 */
  NV_PCS_TX_LIN_MASTER3_I,        /* PCS Tx linearizer with internal PA=11 */

  NV_PCS_PA_RANGE_OFFSETS_I,                       /* PCS PA range offsets */
  NV_PCS_TX_COMP0_I,        /* PCS transmit frequency compensation table 0 */
  NV_PCS_TX_COMP1_I,        /* PCS transmit frequency compensation table 1 */
  NV_PCS_TX_COMP2_I,        /* PCS transmit frequency compensation table 2 */
  NV_PCS_TX_COMP3_I,        /* PCS transmit frequency compensation table 3 */

  NV_DIAG_RESTART_CONFIG_I,
                       /* One-time startup configuration for DIAG services */

  NV_BAND_PREF_I,   /* Stores the band-class preference on a per NAM basis */
  NV_ROAM_PREF_I,      /* Stores the roaming preference on a per NAM basis */

  NV_GPS1_GPS_RF_DELAY_I,                           /* GPS RF Signal Delay */
  /* The len. of time taken for a GPS signal to pass through the RF chain  */

  NV_GPS1_CDMA_RF_DELAY_I,                         /* CDMA RF Signal Delay */
  /* The len. of time taken for a CDMA signal to pass through the RF chain */

  NV_PCS_ENC_BTF_I,
   /* CHIPX8 delay for SYNC80M via 1900mhz PCS path in RF card, biased +25 */
  NV_CDMA_ENC_BTF_I,
   /* CHIPX8 delay for SYNC80M via 800mhz CDMA path in RF card, biased +25 */
  NV_BD_ADDR_I,               /* Holds the Bluetooth address of the mobile */
  NV_SUBPCG_PA_WARMUP_DELAY_I,
                      /* Provides the less-than-one-PCG warm-up for the PA */
  NV_GPS1_GPS_RF_LOSS_I,        /* RF Loss in GPR RF Chain in 0.1 DB Units */
  NV_DATA_TRTL_ENABLED_I,
                        /* In IS2000, if mobile should self-throttle R-SCH */
  NV_AMPS_BACKSTOP_ENABLED_I,       /* AMPS backstop system enabled status */
  NV_GPS1_LOCK_I,                                   /* GPS One lock status */
  NV_FTM_MODE_I,    /* Determines boot up mode of a factory testmode phone */
  /* DATA SERVICES default SIO baud rate (obsoletes NV_DS_DEFAULT_BAUD_I)  */
  NV_DS_DEFAULT_BAUDRATE_I,
  /* DIAG default SIO baud rate     (obsoletes NV_DIAG_DEFAULT_BAUD_I)     */
  NV_DIAG_DEFAULT_BAUDRATE_I,
  NV_JCDMA_DS_F92_I,                  /* Stores JCDMA F92 option selected  */
  NV_IMEI_I,
  NV_IMEI_CHKSUM_I,
  NV_DS_QCMIP_I,                        /* The mode for Mobile IP behavior */
  NV_DS_MIP_RETRIES_I,
                 /* The number of Mobile IP Registration Retries attempted */
  NV_DS_MIP_RETRY_INT_I,
           /* The initial interval between mobile IP registration attempts */
  NV_DS_MIP_PRE_RE_RRQ_TIME_I,
  /* The time before Mobile IP reg. expiration to attempt re-registration. */
  NV_DS_MIP_NUM_PROF_I,        /* Number of Mobile IP user profiles stored */
  NV_DS_MIP_ACTIVE_PROF_I,  /* The currently active Mobile IP user profile */
  NV_DS_MIP_GEN_USER_PROF_I,
                     /* An instance of the Mobile IP general user profile. */
  NV_DS_MIP_SS_USER_PROF_I,
                /* An instance of the Mobile IP shared secret user profile */

  /* CON - advertised suspend time before sleep upon connection close */
  NV_HDR_CON_SUSPEND_I,
  /*  Preferred Control Channel Cycle Enabled   */
  NV_HDR_PRE_CC_CYC_ENABLED_I,
  /*  Preferred Control Channel Cycle                                      */
  NV_HDR_PRE_CC_CYC_I,
  /* HDR Search Parameters */
  NV_HDR_SRCH_PARAMS_I,
  /* SMP - Time at which keep alive timer was started */
  NV_HDRSMP_KEEP_ALIVE_START_I,
  /* SMP - Time at which keep alive message was last sent */
  NV_HDRSMP_KEEP_ALIVE_SENT_I,
  /* SMP - keep alive interval */
  NV_HDRSMP_KEEP_ALIVE_REQ_INT_I,
  /* AMP - all data related to addresses */
  NV_HDRAMP_ADDRESS_DATA_I,
  /* SCP - status of the session */
  NV_HDRSCP_SESSION_STATUS_I,
  /* SCP - session token (generated by AN) */
  NV_HDRSCP_TOKEN_I,
  /* SCP - list of all protocol subtypes */
  NV_HDRSCP_PROTOCOL_SUBTYPE_I,
   /* AMP - time at which the dual addresses expire */
  NV_HDRAMP_DUAL_EXPIRE_TIME_I,
  /* Configuration of current stream  */
  NV_HDRSTREAM_CURR_STREAM_CFG_I,
  /* HDR Set Management Same Channel Parameters */
  NV_HDR_SET_MNGMT_SAME_CHAN_I,
  /* HDR Set Management Different Channel Parameters */
  NV_HDR_SET_MNGMT_DIFF_CHAN_I,
  /* If we are configured to send unsolicited location updates */
  NV_HDRLUP_UNSOLICITED_ENABLED_I,
  /* HDR Access MAC InitialConfiguration Attribute */
  NV_HDRAMAC_INITIAL_CONFIG_I,
  /* HDR Access MAC PowerParameters Attribute */
  NV_HDRAMAC_POWER_PARAMS_I,
  /* Forward Traffic MAC DRC Gating Attribute */
  NV_HDRFMAC_DRC_GATING_I,
  /* Forward Traffic MAC HandoffDelays Attribute */
  NV_HDRFMAC_HANDOFF_DELAYS_I,
  /* Reverse Traffic MAC PowerParameters Attribute */
  NV_HDRRMAC_POWER_PARAMS_I,
  /* Reverse Traffic MAC RateParameters Attribute */
  NV_HDRRMAC_RATE_PARAMS_I,
  /* Next expected SLP ResetMsg Sequence Number (set to 0 at SessionBoot)  */
  NV_HDRSLP_RESET_SEQNO_I,
  /* The backoff values for the medium backoff calibration values          */
  NV_PWR_BACKOFF_VS_VOLT_MED_I,                                         /*490*/
  /* The backoff values for the low backoff calibration values             */
  NV_PWR_BACKOFF_VS_VOLT_LOW_I,
  /* Three voltages where PA Backoff was characterized                     */
  NV_PA_BACKOFF_VOLTS_I,
  /* High and low voltages for Vbatt ADC calib. counts                     */
  NV_VBATT_MIN_MAX_I,
  /* The timebase difference between the home agent and the mobile(in sec) */
  NV_DS_MIP_MN_HA_TIME_DELTA_I,
  /* Qualcomm PREV 6 MIP handoff optimization enable                       */
  NV_DS_MIP_QC_DRS_OPT_I,
  /* CDMA Rx linearizer offset for the second antenna                      */
  NV_ANT2_CDMA_RX_LIN_OFF_0_I,
  /* CDMA Rx linearizer slope for the second antenna                       */
  NV_ANT2_CDMA_RX_LIN_SLP_I,
  /* CDMA Rx gain comp vs frequency for the second antenna                 */
  NV_ANT2_CDMA_RX_COMP_VS_FREQ_I,
  /* CDMA Rx linearizer vs temperature for the second antenna              */
  NV_ANT2_CDMA_RX_LIN_VS_TEMP_I,
  /* PCS/CDMA RF Calibration items                                         */
  NV_ANT2_CDMA_RX_SLP_VS_TEMP_I,
  /* Value that is added to receive power reading when LNA is bypassed     */
  NV_ANT2_LNA_RANGE_OFFSET_I,
  /* Offset added to Rec. pwr when the 1st and 2nd LNAs are bypassed       */
  NV_ANT2_LNA_RANGE_12_OFFSET_I,
  /* NV_LNA_RANGE_OFFSET freq. compensation table, units of AGC value      */
  NV_ANT2_CDMA_LNA_OFFSET_VS_FREQ_I,
  /* NV_LNA_12_RANGE_OFFSET freq. compensation table, units of AGC value   */
  NV_ANT2_CDMA_LNA_12_OFFSET_VS_FREQ_I,
  /* PCS/CDMA mode Rx AGC linearization table                              */
  NV_ANT2_PCS_RX_LIN_OFF_0_I,
  /* PCS Rx linearizer slope for the second antenna                        */
  NV_ANT2_PCS_RX_LIN_SLP_I,
  /* PCS Rx gain comp vs frequency for the second antenna                  */
  NV_ANT2_PCS_RX_COMP_VS_FREQ_I,
  /* PCS Rx linearizer vs temperature for the second antenna               */
  NV_ANT2_PCS_RX_LIN_VS_TEMP_I,
  /* Slope variations of Master RX linearizer curve for the second antenna */
  NV_ANT2_PCS_RX_SLP_VS_TEMP_I,
  /* Value that is added to receive power reading when LNA is bypassed     */
  NV_ANT2_PCS_LNA_RANGE_OFFSET_I,
  /* Offset added to Rec. pwr when the 1st and 2nd LNAs are bypassed       */
  NV_ANT2_PCS_LNA_RANGE_12_OFFSET_I,
  /* NV_LNA_RANGE_OFFSET freq. compensation table, units of AGC value      */
  NV_ANT2_PCS_CDMA_LNA_OFFSET_VS_FREQ_I,
  /* NV_LNA_12_RANGE_OFFSET freq. compensation table, units of AGC value   */
  NV_ANT2_PCS_CDMA_LNA_12_OFFSET_VS_FREQ_I,
  /* WCDMA Rx AGC linearizer offset value                                  */
  NV_WCDMA_RX_LIN_I,
  /* WCDMA RX AGC PDM delta vs. Frequency                                  */
  NV_WCDMA_RX_COMP_VS_FREQ_I,
  /* WCDMA Rx AGC PDM delta vs. Temperature                                */
  NV_WCDMA_RX_LIN_VS_TEMP_I,
  /* WCDMA Rx AGC PDM delta vs. Temperature                                */
  NV_WCDMA_RX_SLP_VS_TEMP_I,
  /* WCDMA LNA range polarity                                              */
  NV_WCDMA_LNA_RANGE_POL_I,
  /* WCDMA Rx power level at which LNA should be bypassed                  */
  NV_WCDMA_LNA_RANGE_RISE_I,
  /* WCDMA Rx power level at which LNA should be turned on                 */
  NV_WCDMA_LNA_RANGE_FALL_I,
  /* LNA InterMod (high to low gain ) anti-jamming threshold power level   */
  NV_WCDMA_IM_LEVEL_I,
  /* Duration of non-bypass state in multiple of 66us (8-bits)             */
  NV_WCDMA_NONBYPASS_TIMER_I,
  /* Duration of bypass state in multiple of 6.6ms (11-bits)               */
  NV_WCDMA_BYPASS_TIMER_I,
  /* Value that is added to Rx power reading when LNA is bypassed          */
  NV_WCDMA_LNA_RANGE_OFFSET_I,
  /* WCDMA LNA range offset delta vs. frequency in unit of AGC value       */
  NV_WCDMA_LNA_OFFSET_VS_FREQ_I,
  /* WCDMA Receiver AGC min                                                */
  NV_WCDMA_RX_AGC_MIN_I,
  /* WCDMA Receiver AGC max                                                */
  NV_WCDMA_RX_AGC_MAX_I,
  /* WCDMA LNA Phase adjustment when LNA is bypassed                       */
  NV_WCDMA_AGC_PHASE_OFFSET_I,
  /* WCDMA Tx AGC linearizer master offset value for lowest PA gain state  */
  NV_WCDMA_TX_LIN_MASTER_0_I,
  /* WCDMA Tx AGC linearizer master offset value for highest PA gain state */
  NV_WCDMA_TX_LIN_MASTER_1_I,
  /* WCDMA Tx AGC delta vs. frequency for lowest PA gain state             */
  NV_WCDMA_TX_COMP_VS_FREQ_0_I,
  /* WCDMA Tx AGC delta vs. frequency for highest PA gain state            */
  NV_WCDMA_TX_COMP_VS_FREQ_1_I,
  /* WCDMA Tx AGC PDM delta vs. temp for lowest PA gain state              */
  NV_WCDMA_TX_LIN_VS_TEMP_0_I,
  /* WCDMA Tx AGC PDM delta vs. temp for highest PA gain state             */
  NV_WCDMA_TX_LIN_VS_TEMP_1_I,
  /* WCDMA Tx AGC PDM slope delta vs. temp for lowest PA gain state        */
  NV_WCDMA_TX_SLP_VS_TEMP_0_I,
  /* WCDMA Tx AGC PDM slope delta vs. temp for highest PA gain state       */
  NV_WCDMA_TX_SLP_VS_TEMP_1_I,
  /* WCDMA TX power level to switch PA from lowest to highest gain state   */
  NV_WCDMA_R1_RISE_I,
  /* WCDMA TX power level to switch PA from highest to lowest gain state   */
  NV_WCDMA_R1_FALL_I,
  /* WCDMA Tx power limit vs. temperature (absolute not delta)             */
  NV_WCDMA_TX_LIM_VS_TEMP_I,
  /* WCDMA Tx power limit vs. frequency (absolute not delta)               */
  NV_WCDMA_TX_LIM_VS_FREQ_I,
  /* WCDMA TX power limit gain step adjustment factor                      */
  NV_WCDMA_ADJ_FACTOR_I,
  /* WCDMA expected HDET reading vs Tx AGC                                 */
  NV_WCDMA_EXP_HDET_VS_AGC_I,
  /* WCDMA ADC HDET reading offset                                         */
  NV_WCDMA_HDET_OFF_I,
  /* WCDMA ADC HDET reading span                                           */
  NV_WCDMA_HDET_SPN_I,
  /* CHIPX8 delay for SYNC80M via 800mhz CDMA path in RF card, biased +25. */
  NV_WCDMA_ENC_BTF_I,
  /* RFC2002bis MN-HA authenticator calculation                            */
  NV_DS_MIP_2002BIS_MN_HA_AUTH_I,
  /* UE rat capability                                                     */
  NV_UE_RAT_CAPABILITY_I,
  /* GSM UE operating class                                                */
  NV_GSM_UE_OP_CLASS_I,
  /* UMTS UE operating class                                               */
  NV_UMTS_UE_OP_CLASS_I,
  /* International Mobile Equipment Identity                               */
  NV_UE_IMEI_I,
  /* MSRAC-SMS value                                                       */
  NV_MSRAC_SMS_VALUE_I,
  /* MSRAC-SM value                                                        */
  NV_MSRAC_SM_VALUE_I,
  /* GSM A5 Algorithm Support Bitmap                                       */
  NV_GSM_A5_ALGORITHMS_SUPPORTED_I,
  /* Configurable parameters for DRC Lock in HDR                           */
  NV_HDRFMAC_DRC_LOCK_I,
  /* LO Calibration offset                                                 */
  NV_GPS1_LO_CAL_I,
  /* GPS Antenna offset in DB                                              */
  NV_GPS1_ANT_OFF_DB_I,
  /* The len. of time taken for a PCS signal to pass through the RF chain  */
  NV_GPS1_PCS_RF_DELAY_I,
  /* Phone number of voice mail center for GSM/WCDMA system                */
  NV_SMS_VM_NUMBER_I,
  /* Storage for GSM/WCDMA template                                        */
  NV_SMS_GW_PARMS_I,
  /* Storage for GSM/WCDMA SMS routing configuration                       */
  NV_SMS_ROUTING_I,
  /* Storage for GSM/WCDMA SMS messages                                    */
  NV_SMS_GW_I,
  /* Preferred mode in hybrid operation                                    */
  NV_HYBRID_PREF_I,
  /* If Service Provider ECC is enabled                                    */
  NV_SP_ECC_ENABLED_I,
  /* Emergency Call Codes to be used for an emergency call without a SIM   */
  NV_ECC_LIST_I,
  /* Latitude value for the Bluetooth LPOS application                     */
  NV_BT_LPOS_LAT_I,
  /* Longitude value for the Bluetooth LPOS application                    */
  NV_BT_LPOS_LONG_I,
  /* Embedded Phone-t Version                                              */
  NV_TEST_CODE_VER_I,
  /* DMSS S/W Version                                                      */
  NV_SYS_SW_VER_I,
  /* RF CAL Program version                                                */
  NV_RF_CAL_VER_I,
  /* RF CAL configuration file version                                     */
  NV_RF_CONFIG_VER_I,
  /* Date RF calibration was done                                          */
  NV_RF_CAL_DATE_I,
  /* Date RF calibration data loaded                                       */
  NV_RF_NV_LOADED_DATE_I,
  /* Name of RFCAL .dat                                                    */
  NV_RF_CAL_DAT_FILE_I,
  /* Data Services domain name                                             */
  NV_DOMAIN_NAME_I,
  /* The preferred network selection mode, either manual or automatic.     */
  NV_NETWORK_SEL_MODE_I,
  /* The preferred service type, i.e. circuit switched, packet switched... */
  NV_SERVICE_TYPE_I,
  /* The Public Land Mobile Network preferred by the user                  */
  NV_PREF_PLMN_I,
  /* Obsolete item                                                         */
  NV_DS_MIP_USER_PROF_VALID_I,
  /* Stores the NAI for 1xEV(HDR) Access Netword CHAP Authentication       */
  NV_HDR_AN_AUTH_NAI_I,
  /* Stores the password for 1xEV(HDR) Access Network CHAP Authentication  */
  NV_HDR_AN_AUTH_PASSWORD_I,                                            /*580*/
  /* If the PUZL is enabled or not                                         */
  NV_PUZL_ENABLED_I,
  /* Obsolete item                                                         */
  NV_PUZL_I,
  /* Session configuration for HDR KEP                                     */
  NV_HDRKEP_CONFIG_I,
  /* Session configuration for HDR AUTH                                    */
  NV_HDRAUTH_CONFIG_I,
  /* IM anti-jamming threshold data for the 4th stage                      */
  NV_IM_LEVEL3_I,
  /* IM anti-jamming threshold data for the 5th stage                      */
  NV_IM_LEVEL4_I,
  /* Minimum power output from the AGC accumulator                         */
  NV_AGC_VALUE_3_MIN_I,
  /* Minimum power output from the AGC accumulator                         */
  NV_AGC_VALUE_4_MIN_I,
  /* Gain attenuation limit                                                */
  NV_TX_GAIN_ATTEN_LIMIT_I,
  /* Falling threshold data for the third stage                            */
  NV_CDMA_LNA_3_FALL_I,                                                 /*590*/
  /* Offset Value subtracted from IF VGA linearizer table                  */
  NV_CDMA_LNA_3_OFFSET_I,
  /* Rising threshold data                                                 */
  NV_CDMA_LNA_3_RISE_I,
  /* Gain variations of the LNA                                            */
  NV_CDMA_LNA_3_OFFSET_VS_FREQ_I,
  /* Falling threshold data                                                */
  NV_PCS_LNA_3_FALL_I,
  /* Offset Value subtracted from IF VGA linearizer table                  */
  NV_PCS_LNA_3_OFFSET_I,
  /* Rising threshold data                                                 */
  NV_PCS_LNA_3_RISE_I,
  /* Gain variations of the LNA                                            */
  NV_PCS_LNA_3_OFFSET_VS_FREQ_I,
  /* Falling threshold data                                                */
  NV_CDMA_LNA_4_FALL_I,
  /* Offset Value subtracted from IF VGA linearizer table                  */
  NV_CDMA_LNA_4_OFFSET_I,
  /* Rising threshold data                                                 */
  NV_CDMA_LNA_4_RISE_I,                                                 /*600*/
  /* Gain variations of the LNA                                            */
  NV_CDMA_LNA_4_OFFSET_VS_FREQ_I,
  /* Falling threshold data                                                */
  NV_PCS_LNA_4_FALL_I,
  /* Offset Value subtracted from IF VGA linearizer table                  */
  NV_PCS_LNA_4_OFFSET_I,
  /* Rising threshold data                                                 */
  NV_PCS_LNA_4_RISE_I,
  /* Gain variations of the LNA                                            */
  NV_PCS_LNA_4_OFFSET_VS_FREQ_I,
  /* 2nd stage LNA falling threshold                                       */
  NV_DFM_LNA_FALL_I,
  /* 2nd stage LNA rising threshold offset                                 */
  NV_DFM_LNA_OFFSET_I,
  /* 1st stage LNA rising threshold                                        */
  NV_DFM_LNA_RISE_I,
  /* Offset value when the two-stage LNA is in its 2nd stage               */
  NV_DFM_LNA_OFFSET_VS_FREQ_I,
  /* 2nd stage LNA minimum AGC accumulator output                          */
  NV_DFM_AGC_ACC_MIN_1_I,                                               /*610*/
  /* AGC filter gain                                                       */
  NV_DFM_AGC_IM_GAIN_I,
  /* AGC filter gain                                                       */
  NV_DFM_AGC_DC_GAIN_I,
  /* 2 stage threshold data                                                */
  NV_DFM_IM_LEVEL1_I,
  /* No. of shifts to the input value of the fine-grained DC offset loop   */
  NV_GPS_FG_TRK_OFFSET_SCALER_I,
  /* No. of shifts to the input value of the fine-grained DC offset loop   */
  NV_DIGITAL_FG_TRK_OFFSET_SCALER_I,
  /* No. of shifts to the input value of the fine-grained DC offset loop   */
  NV_FM_FG_TRK_OFFSET_SCALER_I,
  /* Static phase offset for LNA gain step 0                               */
  NV_DFM_LNA_S0_PHASE_OFFSET_I,
  /* Static phase offset for LNA gain step 1                               */
  NV_DFM_LNA_S1_PHASE_OFFSET_I,
  /* I accumulator in the coarse-grain DC offset cancellation loop         */
  NV_CDMA_RXF_CG_IOFFSET_I,
  /* I accumulator in the coarse-grain DC offset cancellation loop         */
  NV_PCS_RXF_CG_IOFFSET_I,                                              /*620*/
  /* I accumulator in the coarse-grain DC offset cancellation loop         */
  NV_FM_RXF_CG_IOFFSET_I,
  /* I accumulator in the coarse-grain DC offset cancellation loop         */
  NV_GPS_RXF_CG_IOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_CDMA_RXF_CG_QOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_PCS_RXF_CG_QOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_FM_RXF_CG_QOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_GPS_RXF_CG_QOFFSET_I,
  /* I accumulator in the fine-grain DC offset cancellation loop           */
  NV_CDMA_RXF_FG_IOFFSET_I,
  /* I accumulator in the fine-grain DC offset cancellation loop           */
  NV_PCS_RXF_FG_IOFFSET_I,
  /* I accumulator in the fine-grain DC offset cancellation loop           */
  NV_FM_RXF_FG_IOFFSET_I,
  /* I accumulator in the fine-grain DC offset cancellation loop           */
  NV_GPS_RXF_FG_IOFFSET_I,                                              /*630*/
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_CDMA_RXF_FG_QOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_PCS_RXF_FG_QOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_FM_RXF_FG_QOFFSET_I,
  /* Q accumulator in the coarse-grain DC offset cancellation loop         */
  NV_GPS_RXF_FG_QOFFSET_I,
  /* I accumulator in the estimator                                        */
  NV_CDMA_DACC_EST_IOFFSET_I,
  /* I accumulator in the estimator                                        */
  NV_PCS_DACC_EST_IOFFSET_I,
  /* I accumulator in the estimator                                        */
  NV_FM_DACC_EST_IOFFSET_I,
  /* I accumulator in the estimator                                        */
  NV_GPS_DACC_EST_IOFFSET_I,
  /* Q accumulator in the estimator                                        */
  NV_CDMA_DACC_EST_QOFFSET_I,
  /* Q accumulator in the estimator                                        */
  NV_PCS_DACC_EST_QOFFSET_I,                                            /*640*/
  /* Q accumulator in the estimator                                        */
  NV_FM_DACC_EST_QOFFSET_I,
  /* Q accumulator in the estimator                                        */
  NV_GPS_DACC_EST_QOFFSET_I,
  /* I accumulator associated with gain step 0 in the DAC Controller       */
  NV_CDMA_DACC_IACCUM0_I,
  /* I accumulator associated with gain step 0 in the DAC Controller       */
  NV_PCS_DACC_IACCUM0_I,
  /* I accumulator associated with gain step 0 in the DAC Controller       */
  NV_FM_DACC_IACCUM0_I,
  /* I accumulator associated with gain step 0 in the DAC Controller       */
  NV_GPS_DACC_IACCUM0_I,
  /* I accumulator associated with gain step 1 in the DAC Controller       */
  NV_CDMA_DACC_IACCUM1_I,
  /* I accumulator associated with gain step 1 in the DAC Controller       */
  NV_PCS_DACC_IACCUM1_I,
  /* I accumulator associated with gain step 1 in the DAC Controller       */
  NV_FM_DACC_IACCUM1_I,
  /* I accumulator associated with gain step 1 in the DAC Controller       */
  NV_GPS_DACC_IACCUM1_I,                                                /*650*/
  /* I accumulator associated with gain step 2 in the DAC Controller       */
  NV_CDMA_DACC_IACCUM2_I,
  /* I accumulator associated with gain step 2 in the DAC Controller       */
  NV_PCS_DACC_IACCUM2_I,
  /* I accumulator associated with gain step 2 in the DAC Controller       */
  NV_FM_DACC_IACCUM2_I,
  /* I accumulator associated with gain step 2 in the DAC Controller       */
  NV_GPS_DACC_IACCUM2_I,
  /* I accumulator associated with gain step 3 in the DAC Controller       */
  NV_CDMA_DACC_IACCUM3_I,
  /* I accumulator associated with gain step 3 in the DAC Controller       */
  NV_PCS_DACC_IACCUM3_I,
  /* I accumulator associated with gain step 3 in the DAC Controller       */
  NV_FM_DACC_IACCUM3_I,
  /* I accumulator associated with gain step 3 in the DAC Controller       */
  NV_GPS_DACC_IACCUM3_I,
  /* I accumulator associated with gain step 4 in the DAC Controller       */
  NV_CDMA_DACC_IACCUM4_I,
  /* I accumulator associated with gain step 4 in the DAC Controller       */
  NV_PCS_DACC_IACCUM4_I,                                                /*660*/
  /* I accumulator associated with gain step 4 in the DAC Controller       */
  NV_FM_DACC_IACCUM4_I,
  /* I accumulator associated with gain step 4 in the DAC Controller       */
  NV_GPS_DACC_IACCUM4_I,
  /* Q accumulator associated with gain step 0 in the DAC Controller       */
  NV_CDMA_DACC_QACCUM0_I,
  /* Q accumulator associated with gain step 0 in the DAC Controller       */
  NV_PCS_DACC_QACCUM0_I,
  /* Q accumulator associated with gain step 0 in the DAC Controller       */
  NV_FM_DACC_QACCUM0_I,
  /* Q accumulator associated with gain step 0 in the DAC Controller       */
  NV_GPS_DACC_QACCUM0_I,
  /* Q accumulator associated with gain step 1 in the DAC Controller       */
  NV_CDMA_DACC_QACCUM1_I,
  /* Q accumulator associated with gain step 1 in the DAC Controller       */
  NV_PCS_DACC_QACCUM1_I,
  /* Q accumulator associated with gain step 1 in the DAC Controller       */
  NV_FM_DACC_QACCUM1_I,
  /* Q accumulator associated with gain step 1 in the DAC Controller       */
  NV_GPS_DACC_QACCUM1_I,                                                /*670*/
  /* Q accumulator associated with gain step 2 in the DAC Controller       */
  NV_CDMA_DACC_QACCUM2_I,
  /* Q accumulator associated with gain step 2 in the DAC Controller       */
  NV_PCS_DACC_QACCUM2_I,
  /* Q accumulator associated with gain step 2 in the DAC Controller       */
  NV_FM_DACC_QACCUM2_I,
  /* Q accumulator associated with gain step 2 in the DAC Controller       */
  NV_GPS_DACC_QACCUM2_I,
  /* Q accumulator associated with gain step 3 in the DAC Controller       */
  NV_CDMA_DACC_QACCUM3_I,
  /* Q accumulator associated with gain step 3 in the DAC Controller       */
  NV_PCS_DACC_QACCUM3_I,
  /* Q accumulator associated with gain step 3 in the DAC Controller       */
  NV_FM_DACC_QACCUM3_I,
  /* Q accumulator associated with gain step 3 in the DAC Controller       */
  NV_GPS_DACC_QACCUM3_I,
  /* Q accumulator associated with gain step 4 in the DAC Controller       */
  NV_CDMA_DACC_QACCUM4_I,
  /* Q accumulator associated with gain step 4 in the DAC Controller       */
  NV_PCS_DACC_QACCUM4_I,                                                /*680*/
  /* Q accumulator associated with gain step 4 in the DAC Controller       */
  NV_FM_DACC_QACCUM4_I,
  /* Q accumulator associated with gain step 4 in the DAC Controller       */
  NV_GPS_DACC_QACCUM4_I,
  /* Gain value used to scale the estimator accumulator by before updating */
  NV_CDMA_DACC_GAIN_MULT_I,
  /* Gain value used to scale the estimator accumulator by before updating */
  NV_PCS_DACC_GAIN_MULT_I,
  /* Gain value used to scale the estimator accumulator by before updating */
  NV_FM_DACC_GAIN_MULT_I,
  /* Gain value used to scale the estimator accumulator by before updating */
  NV_GPS_DACC_GAIN_MULT_I,
  /* IM2 cal items generated during RF Cal to be loaded into RFR6000       */
  NV_CDMA_IM2_I_VALUE_I,
  /* IM2 cal items generated during RF Cal to be loaded into RFR6000       */
  NV_PCS_IM2_I_VALUE_I,
  /* IM2 cal items generated during RF Cal to be loaded into RFR6000       */
  NV_CDMA_IM2_Q_VALUE_I,
  /* IM2 cal items generated during RF Cal to be loaded into RFR6000       */
  NV_PCS_IM2_Q_VALUE_I,                                                 /*690*/
  /* To correct for the deviations in the 32,768Hz crystal oscillator freq */
  NV_RTC_TIME_ADJUST_I,
  /* 13-bit two's complement integer for FM VGA gain offset                */
  NV_FM_VGA_GAIN_OFFSET_I,
  /* 13-bit two's complement integer for CDMA VGA gain offset              */
  NV_CDMA_VGA_GAIN_OFFSET_I,
  /* 13-bit two's complement integer for PCS VGA gain offset               */
  NV_PCS_VGA_GAIN_OFFSET_I,
  /* FM VGA gain offset variations over the frequencies                    */
  NV_FM_VGA_GAIN_OFFSET_VS_FREQ_I,
  /* CDMA VGA gain offset variations over the frequencies                  */
  NV_CDMA_VGA_GAIN_OFFSET_VS_FREQ_I,
  /* PCS VGA gain offset variations over the frequencies                   */
  NV_PCS_VGA_GAIN_OFFSET_VS_FREQ_I,
  /* FM VGA gain offset variations over the temperatures                   */
  NV_FM_VGA_GAIN_OFFSET_VS_TEMP_I,
  /* CDMA VGA gain offset variations over the temperatures                 */
  NV_CDMA_VGA_GAIN_OFFSET_VS_TEMP_I,
  /* PCS VGA gain offset variations over the temperatures                  */
  NV_PCS_VGA_GAIN_OFFSET_VS_TEMP_I,                                     /*700*/
  /* In-phase coefficient for mismatch compensation                        */
  NV_FM_MIS_COMP_A_OFFSET_I,
  /* In-phase coefficient for mismatch compensation                        */
  NV_DIGITAL_MIS_COMP_A_OFFSET_I,
  /* In-phase coefficient for mismatch compensation                        */
  NV_GPS_MIS_COMP_A_OFFSET_I,
  /* In-phase coefficient for mismatch compensation                        */
  NV_FM_MIS_COMP_B_OFFSET_I,
  /* In-phase coefficient for mismatch compensation                        */
  NV_DIGITAL_MIS_COMP_B_OFFSET_I,
  /* In-phase coefficient for mismatch compensation                        */
  NV_GPS_MIS_COMP_B_OFFSET_I,
  /* Send RRQ only if there was traffic since previous RRQ                 */
  NV_DS_MIP_RRQ_IF_TFRK_I,
  /* Collocated HDR disallowed time                                        */
  NV_COLLOC_DISALLOWED_TIME_I,
  /* Hold HDR time                                                         */
  NV_HOLD_HDR_TIME_I,
  /* Number of times NV value updated via IIR filter                       */
  NV_LO_BIAS_UPDATE_CNT_I,                                              /*710*/
  /* Spare item for developer                                              */
  NV_SPARE_3_I,
  /* Stores HDR Access Network Authentication Status.                      */
  NV_HDRSCP_AN_AUTH_STATUS_I,
  /*Used to allow a user to Save an IMSI as an Index in NV */
  NV_IMSI_INDEX_I,
  /* Enable or disable a user profile. Each element can be 1 or 0 indicating
     whether the profile is enabled or disabled respectively..              */
  NV_DS_MIP_ENABLE_PROF_I,

  /*Contains 8-bit IM anti-jamming threshold data for the fourth
   stage in two 's complement format when the five-stage LNA is
   in its NONBYPASS_HOLD STATEs.*/
  NV_PCS_IM_LEVEL3_I,
  /* contains 8-bit IM anti-jamming threshold data for the fifth
   stage in two 's complement format when the five-stage LNA is
   in NONBYPASS_HOLD STATEs. */
  NV_PCS_IM_LEVEL4_I,
  /*provides the minimum power output from the AGC accumulator
   when AGC_VALUE_MIN_EN is enabled and the five-stage LNA is
   in its forth stage. */
  NV_PCS_AGC_VALUE_3_MIN_I,
  /*provides the minimum power output from the AGC accumulator
  when AGC_VALUE_MIN_EN is enabled and the five-stage LNA is in
  its fifth stage. */
  NV_PCS_AGC_VALUE_4_MIN_I,

  /* SMP - Time at which keep alive timer was started                      */
  NV_HDRSMPKA_START_TIME_I,

  /* SMP - Time at which keep alive message was last sent                  */
  NV_HDRSMPKA_SENT_TIME_I,                                              /*720*/

  /* Supplement item to the item NV_SMS_BC_SERVICE_TABLE_I */
  NV_SMS_BC_SERVICE_TABLE_OPTIONS_I,

  /* Acquisition database                                                  */
  NV_ACQ_DB_I,
  /* Acquisition List                                                      */
  NV_ACQ_LIST_1_I,
  /* E-GSM ARFCNs used for GSM radio Rx/Tx frequency compensation          */
  NV_GSM_CAL_ARFCN_I,
  /* E-GSM ARFCNs used for DCS radio Rx/Tx frequency compensation          */
  NV_DCS_CAL_ARFCN_I,
  /* E-GSM frequency compensated Rx gain values for gain range 1           */
  NV_GSM_RX_GAIN_RANGE_1_FREQ_COMP_I,
  /* E-GSM frequency compensated Rx gain values for gain range 2           */
  NV_GSM_RX_GAIN_RANGE_2_FREQ_COMP_I,
  /* E-GSM frequency compensated Rx gain values for gain range 3           */
  NV_GSM_RX_GAIN_RANGE_3_FREQ_COMP_I,
  /* E-GSM frequency compensated Rx gain values for gain range 4           */
  NV_GSM_RX_GAIN_RANGE_4_FREQ_COMP_I,
  /* DCS frequency compensated Rx gain values for gain range 1             */
  NV_DCS_RX_GAIN_RANGE_1_FREQ_COMP_I,                                   /*730*/
  /* DCS frequency compensated Rx gain values for gain range 2             */
  NV_DCS_RX_GAIN_RANGE_2_FREQ_COMP_I,
  /* DCS frequency compensated Rx gain values for gain range 3             */
  NV_DCS_RX_GAIN_RANGE_3_FREQ_COMP_I,
  /* DCS frequency compensated Rx gain values for gain range 4             */
  NV_DCS_RX_GAIN_RANGE_4_FREQ_COMP_I,
  /* Trial PDM value that results in 13MHz TCXO                            */
  NV_GSM_TRK_LO_ADJ_PDM_INIT_VAL_I,
  /* Gain Slope for TCXO device in ppm/pdm units                           */
  NV_GSM_TRK_LO_ADJ_PDM_GAIN_SLOPE_I,
  /* Calibrated standard deviation of this phone's doppler estimator in Hz */
  NV_GPS_DOPP_SDEV_I,


/************************************************/
/* nvim.cのnvim_fs_lookup_tableには存在するが、 */
/* ここ(nv_items_enum_type)には追加されていない */
/* Itemがある。  ここを修正する時は、nvim.cの   */
/* nvim_fs_lookup_tableと、SOで独自に追加した   */
/* item_info_tableとの整合性に注意すること。    */
/************************************************/

  /* Enables/Disables Cell Based Position Determination                    */
  NV_GPS1_CELLBASED_SMS_I = 825,
  /* Enables/Disables Cell Based Position Determination                    */
  NV_GPS1_TELESERVICE_ID_I =826,
  /* Data Burst Packet Size supported by this network                      */
  NV_GPS1_NET_DBM_SIZE_I = 831,


/******************************************
 ADD 2001/05/30 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV)
*******************************************/
/*-------------------------------------------------------------------------*/
/* SONY Adittional NV Item                                                 */
/*-------------------------------------------------------------------------*/

/* P-SMS items */
  NV_UP_PPP_RADIUS_ID_I,            /* パケットSMS用サーバの認証ID         */
  NV_UP_PPP_RADIUS_PASS_I,          /* パケットSMS用サーバの認証パスワード */

/*-------------------------------------------------------------------------*/

/* RF items */
  NV_CDMA_RX_LIN_OFF_I,             /* CDMA Rx linearizer offset           */
  NV_CDMA_TX_LIN_MASTER_OFF_I,      /* CDMA Tx linearizer master offset    */
  NV_CDMA_TX_LIN_MASTER_OFF_1_I,    /* CDMA Tx linearizer master offset    */
  NV_CDMA_TX_LIN_MASTER_SLP_1_I,    /* CDMA Tx linearizer master slope     */

  NV_PA_VREF_I,                     /* マイナス電源                        */
  NV_TX_AGC_COMP_I,                 /* PA SO offset                        */	/*520*/
  NV_TX_LIMITER_I,                  /* Tx Limiter                          */
  NV_TEMP_TABLES_I,                 /* Temperature tables                  */
  NV_TEMP_COMP_OFF_I,               /* Temperature offset                  */
  NV_TEMP_COMP_SLP_I,               /* Temperature slope                   */
  NV_TEMP_BLOCK_I,                  /* Temperature block                   */

  NV_MARKOV_TX_I,                   /* Markov Tx                           */

/*-------------------------------------------------------------------------*/

/* SONY Flag items */
  NV_F_IDWRITE_I,                   /* ID書込み済みフラグ                  */
  NV_F_RFADJ_I,                     /* RF調整済みフラグ                    */
  NV_F_BATTADJ_I,                   /* バッテリ調整済みフラグ              */	/*530*/
  NV_F_UP_I,                        /*  */

/* Additional ID items */
  NV_ID_OPERINFO_I,                 /* 事業者固有情報                      */
  NV_ID_SECUCODE_I,                 /* セキュリティコード                  */
  NV_ID_PHONENUM_I,                 /* 表示用電話番号                      */
  NV_ID_MANUFNUM_I,                 /* 製造番号                            */
  NV_X_KEY_I,                       /* 鍵 X                                */
  NV_Y_KEY_I,                       /* 鍵 Y                                */
  NV_Z_KEY_I,                       /* 鍵 Z                                */
  NV_ID_KEY_I,                      /* 鍵 ID                               */

/* BB  items */
  NV_BB_RXBATFULLTHRESH_I,          /* バッテリ調整値 Rx 3→2              */	/*540*/
  NV_BB_RXBATMIDTHRESH_I,           /* バッテリ調整値 Rx 2→1              */
  NV_BB_RXBATLITTLETHRESH_I,        /* バッテリ調整値 Rx シャットダウン    */
  NV_BB_TXBATFULLTHRESH_I,          /* バッテリ調整値 Tx 3→2              */
  NV_BB_TXBATMIDTHRESH_I,           /* バッテリ調整値 Tx 2→1              */
  NV_BB_TXBATLITTLETHRESH_I,        /* バッテリ調整値 Tx シャットダウン    */
  NV_BB_OVERCHARGED_I,              /* 過電圧                              */

  NV_BB_LCD_VOLUME_I,               /* LCD ボリューム                      */
  NV_BB_LCD_RED_I,                  /* LCD 赤色諧調                        */
  NV_BB_LCD_GREEN_I,                /* LCD 緑色諧調                        */
  NV_BB_LCD_BLUE_I,                 /*LCD 青色諧調                         */	/*550*/
  NV_BB_FLIGHT_ADJ_I,               /* LCD フロントライト調整値            */
  NV_BB_VMSMP_I,                    /* MSM電圧                             */
  NV_BB_VRFTX_I,                    /* RF Tx電圧                           */
  NV_BB_VRFRX_I,                    /* RF Rx電圧                           */
  NV_BB_VBT_I,                      /* バイブレータ電圧                    */
  NV_BB_VRES1_I,                    /*  */
  NV_BB_VRES2_I,                    /*  */
  NV_BB_VRES3_I,                    /*  */
  NV_BB_VRES4_I,                    /*  */

/*** END OF ADD ***/

/******************************************
 ADD 2001/07/13 ichikawa@MYTECS
     (SONY_SYS_NV)
*******************************************/
/*-------------------------------------------------------------------------*/

  NV_F_MANUF00_I,                   /* 製造調整工程フラグ00                */	/*560*/
  NV_F_MANUF01_I,                   /* 製造調整工程フラグ01                */
  NV_F_MANUF02_I,                   /* 製造調整工程フラグ02                */
  NV_F_MANUF03_I,                   /* 製造調整工程フラグ03                */
  NV_F_MANUF04_I,                   /* 製造調整工程フラグ04                */
  NV_F_MANUF05_I,                   /* 製造調整工程フラグ05                */
  NV_F_MANUF06_I,                   /* 製造調整工程フラグ06                */
  NV_F_MANUF07_I,                   /* 製造調整工程フラグ07                */
  NV_F_MANUF08_I,                   /* 製造調整工程フラグ08                */
  NV_F_MANUF09_I,                   /* 製造調整工程フラグ09                */
  NV_F_MANUF10_I,                   /* 製造調整工程フラグ10                */	/*570*/
  NV_F_MANUF11_I,                   /* 製造調整工程フラグ11                */
  NV_F_MANUF12_I,                   /* 製造調整工程フラグ12                */
  NV_F_MANUF13_I,                   /* 製造調整工程フラグ13                */
  NV_F_MANUF14_I,                   /* 製造調整工程フラグ14                */
  NV_F_MANUF15_I,                   /* 製造調整工程フラグ15                */
  NV_F_MANUF16_I,                   /* 製造調整工程フラグ16                */
  NV_F_MANUF17_I,                   /* 製造調整工程フラグ17                */

/* 2001/09/20 H.Sawada */
/* Add Item */
  NV_VC_TCXO_F_I,                   /* VCTCXOの周波数偏差値                */
  NV_TX_MAX_I,                      /* Max Power出力のためのPDM値          */
  NV_ERR_NAME_I,                    /* 工程不良名                          */
  NV_MAX_POW_I,                     /* Max Power値                         */
  NV_MIN_POW_I,                     /* Min Power値                         */
  NV_CURRENT_I,                     /* 電流値                              */
  NV_VC_TCXO_V_I,                   /* VCTCXOの電圧偏差値                  */

/* 2001/09/19 H.Sawada */
/* Add Item */
  NV_FA_PROXY_ADDRESS_I,            /* FaProxy用IPアドレス                 */
  NV_FA_PROXY_PORT_I,               /* FaProxy用ポート番号                 */ /* 変更 2001/10/18 Y.Miyaguni(メタテクノ) */
  NV_FA_PROXY_E2EPORT_I,            /* FaProxy用end to endポート番号       */   /*580*/
  NV_FA_PROXY_LXLPORT_I,            /* FaProxy用link to linkポート番号     */
  NV_FA_RADIUS_ID_I,                /* FaProxy用接続ID                     */
  NV_FA_RADIUS_PASSWORD_I,          /* FaProxy用接続パスワード             */

/* ↓Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */
  NV_EMAIL_USER_ADDRESS_I,          /* Email用Emailアドレス                */
  NV_EMAIL_USER_ID_I,               /* Email用ユーザID                     */
  NV_EMAIL_SERVER_ADDRESS_I,        /* Email用IPアドレス                   */
  NV_EMAIL_RADIUS_ID_I,             /* Email用接続ID                       */
  NV_EMAIL_RADIUS_PASSWORD_I,       /* Email用接続パスワード               */
  NV_EMAIL_UTILITY_URL_I,           /* Email用Utility Url                  */
  NV_LOCATION_ADDRESS_I,            /* Location用接続IPアドレス            */
  NV_LOCATION_RADIUS_ID_I,          /* Location用接続ID                    */
  NV_LOCATION_RADIUS_PASSWORD_I,    /* Location用接続パスワード            */ /* 変更 2001/10/18 Y.Miyaguni(メタテクノ) */
  NV_WAP_PROXY_DOMAIN_I,            /* Wap用接続ドメイン                   */
  NV_WAP_RADIUS_ID_I,               /* Wap用接続ID                         */
  NV_WAP_RADIUS_PASSWORD_I,         /* Wap用接続パスワード                 */
  NV_WAP_LOCAL_TIME_I,              /* Wap用LocalTime                      */
  NV_PROV_RESULT_FLAG_I,            /* サービス初期設定済み要否            */
  NV_F_GPSWRITE_I,                  /* gpsOne調整済みフラグ                */
/* ↑Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/10/16 Y.Miyaguni(メタテクノ) */
  NV_BB_SUBLCD_CONTRAST_ADJ_I,      /* サブ液晶コントラスト調整値          */
  NV_BB_SUBLCD_LIGHT_ADJ_I,         /* サブ液晶バックライト調整値          */
/* ↑Item追加 2001/10/16 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/11/27 Y.Miyaguni(メタテクノ) */
  NV_TX_VARATE_FULL_I,
  NV_TX_VARATE_HALF_I,
  NV_TX_VARATE_QUARTER_I,
  NV_TX_VARATE_EIGHTH_I,
  NV_SMS_CHAT_GW_ADDRESS_I,         /* ←Item追加 2001/12/04 Y.Miyaguni(メタテクノ) */
  NV_SMS_GAME_GW_ADDRESS_I,         /* ←Item追加 2001/12/04 Y.Miyaguni(メタテクノ) */
  NV_CP_CTRL1_I,                    /* プロトコル制御                      *//* 移動 */
  NV_CP_CTRL2_I,                    /* プロトコル制御                      *//* 移動 */
  NV_SRCH_QPCH_I,
/* ↑Item追加 2001/11/27 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2002/2/12 H.Sawada(メタテクノ) */
  NV_BB_RXBATFULLTHRESH_HYSTERESIS_I,
  NV_BB_RXBATMIDTHRESH_HYSTERESIS_I,
/* ↑Item追加 2002/2/12 H.Sawada(メタテクノ) */

/* ↓Item追加 2002/05/23 H.Sawada(メタテクノ) */
  NV_PA_R_TIMER_I,
  NV_TEMP_COMP_OFF_FRQ_I,
/* ↑Item追加 2002/05/23 H.Sawada(メタテクノ) */

/* ↓Item追加 2002/07/15 H.Sawada(メタテクノ) */
  NV_SO_LIN_OFFSET_I,
  NV_SO_IM_LEVEL1_I,
  NV_SO_NON_BYPASS_TIMER_I,
  NV_SO_BYPASS_TIMER_I,
  NV_SO_GAIN_CONST_IM_I,
  NV_SO_GAIN_CONST_I,
  NV_SO_PHASE_OFFSET_I,
/* ↑Item追加 2002/07/15 H.Sawada(メタテクノ) */

/*** END OF ADD ***/

/*-------------------------------------------------------------------------*/

  NV_MAX_I,                    /* Size of this enum, MUST be the last item */
                               /* (except for padding)                     */
/*-------------------------------------------------------------------------*/

  NV_ITEMS_ENUM_PAD = 0x7FFF   /* Pad to 16 bits on ARM                    */

} nv_items_enum_type;

#endif


/***************************************************************************/
/*                                                                         */
/* NV Features                                                             */
/* ----------------------------------------------------------------------- */
/*                                                                         */
/* FEATURE_NV_ONE_NAM_RL_LARGE   Specifies a single NAM with a large       */
/*                                 roaming list.                           */
/* FEATURE_NV_TWO_NAMS_RL_MEDIUM Specifies two NAMs with medium-sized      */
/*                                 roaming lists.                          */
/* FEATURE_NV_TWO_NAMS_RL_SMALL  Specifies two NAMs with small roaming     */
/*                                 lists.                                  */
/* FEATURE_NV_JSTD008            Enables J-STD-008 parameters(obsolete).   */
/* FEATURE_NV_TMSI               Enables TMSI parameters.                  */
/* NV_FEATURE_SSPR_ENHANCEMENTS  Enables SSPR-800 items and modifications. */
/* FEATURE_IS683A_PRL            Selects IS-683 format roaming list.       */
/* NV_FEATURE_ROAMING_LIST_683   Enables IS-683 format roaming list.       */
/* FEATURE_NV_1K_RL              Specifies a 1K roaming list regardless of */
/*                                 autosize results.                       */
/* NV_FEATURE_200_1K_RL          Specifies 200 byte roaming list(s) for 8K */
/*                                 phones, 1K roaming list(s) for 16K.     */
/* NV_FEATURE_PRL_ITEMS          Enables roaming list and related items.   */
/* NV_FEATURE_IMSI_T_ITEMS       Enables True IMSI item support.           */
/* NV_FEATURE_ANS_SHADOW_ITEMS   Enables AUTO_ANSWER_SHADOW item support.  */
/* NV_FEATURE_SIO_PWRDWN_ITEMS   Enables NV_SIO_PWRDWN item support.       */
/* FEATURE_NV_ANALOG             Enables analog calling parameters (number */
/*                                 of NAMs depends on target).             */
/* FEATURE_NV_OTASP              Enables OTASP parameters.                 */
/* FEATURE_NV_RF_CAL             Enables RF calibration parameters.        */
/* FEATURE_NV_DIAL_PLAN          Enables ISS2 dialing plan parameters.     */
/* FEATURE_NV_ALARMS             Enables ISS2 alarm parameters.            */
/* FEATURE_NV_FULL_DIAL_TYPE     Enables status and/or time stamp fields   */
/*                                 in dial type and stack dial type items. */
/* FEATURE_NV_EXTENDED_UI        Enables TGP-unique items and the duration */
/*                                 field in stack dial type items.         */
/* FEATURE_NV_REDIAL_ITEM        Enables "last number redial" item.        */
/* NV_FEATURE_RENTAL_ITEMS       Enables rental timer items.               */
/* NV_FEATURE_BORSCHT_ITEMS      Enables Borscht/payphone/afax, etc items. */
/* NV_FEATURE_TPR_ITEMS          Enables Timeout-for-Polarity-Reversal     */
/*                                 item for ISS2.                          */
/* FEATURE_NV_CARRIER_ITEMS      Enables Carrier Info items.               */
/* FEATURE_NV_ATTENUATION        Enables audio attenuation items.          */
/* FEATURE_NV_SI_DATA            Enables stack-checker diagnostic items    */
/* FEATURE_NV_FACTORY_INFO       Enables the factory info item (note: not  */
/*                                 the same as the free-form factory info  */
/*                                 data area).                             */
/* FEATURE_NV_DYNAMIC_ITEMS      Enables dynamic pool operations for       */
/*                                 certain non-SMS items.                  */
/* NV_FEATURE_WEB_ITEMS          Enables web browser items.                */
/* NV_FEATURE_BELL_MODEM         Enables the BELL_MODEM item for ISS2.     */
/* NV_FEATURE_PDM_TABLES         Enables the PDM1/2_VS_TEMP tables and     */
/*                                 disables PA_RANGE_VS_TEMP.              */
/* NV_FEATURE_I2C                Specifies use of I2C library routines for */
/*                                 accessing the EEPROM.                   */
/* FEATURE_NV_24LC32             Specifies model 24LC32 NV part in use.    */
/* FEATURE_NV_24LC65             Specifies model 24LC65 NV part in use.    */
/* FEATURE_NV_CHECKPOINT         Enables cache checkpointing for glitch    */
/*                                 recovery.                               */
/* FEATURE_NV_DEADCELL_RECOVERY  Enables deadcell recovery.                */
/* FEATURE_NV_UNIT_TEST          Enables unit test code.                   */
/*                                                                         */
/***************************************************************************/

#ifdef FEATURE_NV_TMSI
#error Cannot externally #define FEATURE_NV_TMSI
#endif
#ifdef NV_FEATURE_SSPR_ENHANCEMENTS
#error Cannot externally #define NV_FEATURE_SSPR_ENHANCEMENTS
#endif
#ifdef NV_FEATURE_ROAMING_LIST_683
#error Cannot externally #define NV_FEATURE_ROAMING_LIST_683
#endif
#ifdef FEATURE_NV_1K_RL
#error code not present
#endif
#ifdef NV_FEATURE_200_1K_RL
#error Cannot externally #define NV_FEATURE_200_1K_RL
#endif
#ifdef NV_FEATURE_PRL_ITEMS
#error Cannot externally #define NV_FEATURE_PRL_ITEMS
#endif
#ifdef NV_FEATURE_IMSI_T_ITEMS
#error Cannot externally #define NV_FEATURE_IMSI_T_ITEMS
#endif
#ifdef NV_FEATURE_ANS_SHADOW_ITEMS
#error code not present
#endif
#ifdef NV_FEATURE_SIO_PWRDWN_ITEMS
#error code not present
#endif
#ifdef FEATURE_NV_ANALOG
#error Cannot externally #define FEATURE_NV_ANALOG
#endif
#ifdef FEATURE_NV_OTASP
#error Cannot externally #define FEATURE_NV_OTASP
#endif
#ifdef FEATURE_NV_RF_CAL
#error Cannot externally #define FEATURE_NV_RF_CAL
#endif
#ifdef FEATURE_NV_DIAL_PLAN
#error code not present
#endif
#ifdef FEATURE_NV_ALARMS
#error code not present
#endif
#ifdef FEATURE_NV_FULL_DIAL_TYPE
#error Cannot externally #define FEATURE_NV_FULL_DIAL_TYPE
#endif
#ifdef FEATURE_NV_EXTENDED_UI
#error Cannot externally #define FEATURE_NV_EXTENDED_UI
#endif
#ifdef FEATURE_NV_REDIAL_ITEM
#error Cannot externally #define FEATURE_NV_REDIAL_ITEM
#endif
#ifdef NV_FEATURE_RENTAL_ITEMS
#error code not present
#endif
#ifdef NV_FEATURE_BORSCHT_ITEMS
#error code not present
#endif
#ifdef NV_FEATURE_TPR_ITEMS
#error code not present
#endif
#ifdef NV_FEATURE_CARRIER_ITEMS
#error code not present
#endif
#ifdef FEATURE_NV_ATTENUATION
#error Cannot externally #define FEATURE_NV_ATTENUATION
#endif
#ifdef NV_FEATURE_SI_DATA
#error code not present
#endif
#ifdef FEATURE_NV_FACTORY_INFO
#error Cannot externally #define FEATURE_NV_FACTORY_INFO
#endif
#ifdef FEATURE_NV_DYNAMIC_ITEMS
#error Cannot externally #define FEATURE_NV_DYNAMIC_ITEMS
#endif
#ifdef NV_FEATURE_WEB_ITEMS
#error code not present
#endif
#ifdef NV_FEATURE_BELL_MODEM
#error code not present
#endif
#ifdef NV_FEATURE_PDM_TABLES
#error Cannot externally #define NV_FEATURE_PDM_TABLES
#endif
#ifdef NV_FEATURE_I2C
#error code not present
#endif
#ifdef FEATURE_NV_24LC32
#error code not present
#endif
#ifdef FEATURE_NV_24LC65
#error Cannot externally #define FEATURE_NV_24LC65
#endif
#ifdef NV_FEATURE_DYNAMIC_NVDIV
#error code not present
#endif
#ifdef FEATURE_NV_CHECKPOINT
#error Cannot externally #define FEATURE_NV_CHECKPOINT
#endif
#ifdef FEATURE_NV_DEADCELL_RECOVERY
#error Cannot externally #define FEATURE_NV_DEADCELL_RECOVERY
#endif
#ifdef FEATURE_NV_UNIT_TEST
#error code not present
#endif

/* Set internal NV feature defines based on inputs:  */
/*   TG (the specified target),                      */
/*   FEATURE_NV_OTASP,                               */
/*   FEATURE_NV_ONE_NAM_RL_LARGE,                    */
/*   FEATURE_NV_TWO_NAMS_RL_MEDIUM,                  */
/*   FEATURE_NV_TWO_NAMS_RL_SMALL, and               */
/*   FEATURE_NV_WEB_ITEMS                            */

/*=========================================================================*/
/* Common defines for all Targets                                          */
/*=========================================================================*/

#ifdef FEATURE_NV_I2C
#error code not present
#endif

/* Until clients are ready to use the dynamic pool reservation system, */
/* this define will automatically handle reservations for the caller.  */
/* Once the clients are ready to use reservations, remove this define  */
/* and the associated code in file nvw.c.                              */
#ifndef FEATURE_UI_SMS_NV_RESERVATION
  #define NV_TEMP_AUTO_RESERVATIONS
#endif

/*=========================================================================*/
/* Target T_Q, T_G                                                         */
/*=========================================================================*/
#if ((TG==T_Q) || (TG==T_G) || (TG==T_O) || (TG==T_NT))

  #if (TG==T_O)
//#error code not present
  #endif

#ifdef FEATURE_OTASP
    #define FEATURE_NV_OTASP
#endif

#ifdef FEATURE_TRIMODE_ITEMS
    #define NV_FEATURE_TRIMODE_ITEMS
#endif

#ifdef T_MSM6000
#error code not present
#endif

#ifdef FEATURE_CDMA_1900
    #ifdef T_MSM5000
      #define NV_FEATURE_PDM_TABLES
    #else
#error code not present
    #endif
    #define NV_FEATURE_PRL_ITEMS        /* Enable roaming list support */
    #define FEATURE_NV_TMSI             /* Enable TMSI parameters */

    #ifdef FEATURE_NV_ONE_NAM_RL_LARGE
      #define  NV_MAX_NAMS     1        /* One NAM supported */

      /* One-NAM configuration uses a 4K PRL by default */
      #define FEATURE_NV_4K_RL

      #ifdef FEATURE_IS683A_PRL
        #define NV_FEATURE_ROAMING_LIST_683   /* Use IS-683A format PRL */

        #ifdef FEATURE_NV_WEB_ITEMS  /* Digby */
#error code not present
        #else
          #ifdef FEATURE_CDMA_800  /* Trimode */
            #define NV_FEATURE_TRIMODE_ITEMS
            #define FEATURE_NV_ANALOG
            #define NV_FEATURE_SSPR_ENHANCEMENTS
            /* Set NV version numbers for this feature configuration */
            #define NVI_KLT_REV      0x82
            #define NVI_VERNO_MIN    0x81
          #else
            #define NVI_KLT_REV      0x82
            #define NVI_VERNO_MIN    0x82
          #endif
        #endif

      #else
          #error This VU does not support this target/feature combination
      #endif
    #else

      #define FEATURE_NV_TWO_NAMS_RL_SMALL    /* Default */
      #define  NV_MAX_NAMS     2        /* Up to 2 NAMs allowed */

      #ifdef FEATURE_IS683A_PRL
        #define NV_FEATURE_ROAMING_LIST_683   /* Use IS-683A format PRL */
        /* The above was added for IS-95B True IMSI support. However, this
        ** also gives True IMSI OTASP download support for OTASP enabled
        ** PCS targets.
        */

        #ifdef FEATURE_ACP
          #define FEATURE_NV_ANALOG /* Define analog parameters for Dualband */
          /* Set NV version numbers for this feature configuration [??] */

          #ifdef FEATURE_NV_WEB_ITEMS  /* Digby */
#error code not present
          #else /* FEATURE_NV_WEB_ITEMS */
            #define NVI_KLT_REV      0x82
            #define NVI_VERNO_MIN    0x84
          #endif

        #else /* FEATURE_ACP */
          #ifdef FEATURE_NV_WEB_ITEMS
#error code not present
          #endif

          #define NVI_KLT_REV      0x82
          #define NVI_VERNO_MIN    0x85
        #endif /* FEATURE_ACP */

      #else /* FEATURE_IS683A_PRL */

        #ifdef FEATURE_NV_WEB_ITEMS
#error code not present
        #endif

        #ifdef FEATURE_SSPR_ENHANCEMENTS
          #error This VU does not support this target/feature combination
        #else
          #ifdef FEATURE_ACP
            #define FEATURE_NV_ANALOG
            /* Set NV version numbers for this feature configuration [??] */
            #define NVI_KLT_REV      0x82
            #define NVI_VERNO_MIN    0x86
          #else /* FEATURE_ACP */
            /* Set NV version numbers for this feature configuration [??] */
            #define NVI_KLT_REV      0x82
            #define NVI_VERNO_MIN    0x87
          #endif /* FEATURE_ACP */

        #endif /* FEATURE_SSPR_ENHANCEMENTS */

      #endif /* FEATURE_IS683A_PRL */
    #endif /* FEATURE_NV_ONE_NAM_RL_LARGE */

    #define  NV_MAX_SID_NID    1        /* For 1 SID+NID pair */

#else /* FEATURE_CDMA_1900 */

    #define FEATURE_NV_ANALOG       /* Enable analog parameters */
    #define FEATURE_NV_TMSI         /* Enable TMSI parameters hack */
    /* Note the above definition is for all P_REVs in the cellular
    ** band. This is not required, but doesn't hurt anything for now.
    ** Just ensure an NV rebuild, by changing to a unique NVI_VERNO_MIN
    ** below.
    */

    #ifdef FEATURE_SSPR_ENHANCEMENTS

      #ifdef FEATURE_NV_ONE_NAM_RL_LARGE

        #define  NV_MAX_NAMS     1
        #define  NV_MAX_SID_NID  1
        #define  NV_FEATURE_PRL_ITEMS     /* Enable roaming list support */

        #ifdef FEATURE_IS683A_PRL
          #ifdef FEATURE_NV_WEB_ITEMS
#error code not present
          #endif

          #define NV_FEATURE_ROAMING_LIST_683   /* Use IS-683A format PRL */
          #define NV_FEATURE_SSPR_ENHANCEMENTS

          #define NVI_KLT_REV    0x82
          #define NVI_VERNO_MIN  0x88

        #else /* FEATURE_IS683A_PRL */
          #error This VU does not support this target/feature combination
        #endif /* FEATURE_IS683A_PRL */

      #elif defined(FEATURE_NV_TWO_NAMS_RL_SMALL)

/******************************************
 CHG 2001/06/14 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
        #define  NV_MAX_NAMS     2        /* Up to 2 NAMs allowed */
#else  /*** CHG ***/
        #define  NV_MAX_NAMS     1
#endif  /*** END OF CHG ***/
        #define  NV_MAX_SID_NID  1        /* For 1 SID+NID pair */
        #define  NV_FEATURE_PRL_ITEMS     /* Enable roaming list support */

        #ifdef FEATURE_IS683A_PRL
          #ifdef FEATURE_NV_WEB_ITEMS
#error code not present
          #endif

          #define NV_FEATURE_ROAMING_LIST_683   /* Use IS-683A format PRL */
          #define NV_FEATURE_SSPR_ENHANCEMENTS

          #define NVI_KLT_REV    0x82
          #define NVI_VERNO_MIN  0x89

        #else /* FEATURE_IS683A_PRL */
          #error This VU does not support this target/feature combination
        #endif /* FEATURE_IS683A_PRL */

      #elif defined(FEATURE_NV_TWO_NAMS_RL_MEDIUM)
#error code not present
      #else
        #error No RL Type defined!!
      #endif

    #else /* FEATURE_SSPR_ENHANCEMENTS */
      /* NV Definitions to support Old Style System Determination with Cellular Targets */

      #define  NV_MAX_NAMS     4        /* Up to 4 NAMs allowed */
      #define  NV_MAX_SID_NID  4        /* Up to 4 SID+NID pairs */

      /* Set NV version numbers for this feature configuration [34] */
      #define NVI_KLT_REV      0x82
      #define NVI_VERNO_MIN    0x8A

    #endif /* FEATURE_SSPR_ENHANCEMENTS */

  #endif /* !FEATURE_CDMA_1900 */


  /* Standard features for target O/Q/Gemini */
  #define FEATURE_NV_RF_CAL
  #define FEATURE_NV_FULL_DIAL_TYPE
  #define FEATURE_NV_REDIAL_ITEM
#if (TG == T_Q)
//#error code not present
#endif
#if (TG == T_O)
//#error code not present
#endif
  #define FEATURE_NV_EXTENDED_UI
  #define FEATURE_NV_24LC65
  #define FEATURE_NV_CHECKPOINT
  #define FEATURE_NV_DEADCELL_RECOVERY
  #define NV_FEATURE_IMSI_T_ITEMS       /* IS683A implies IMSI_T */

  /* Target-specific constants for O/Q/Gemini */
  #define  NV_MAX_SPEED_DIALS  109      /* Maximum of 109 speed dials */
  #define  NV_MAX_LTRS         12       /* With up to 12-letter names */
  #define  NV_MAX_STACK_DIALS  10       /* Maximum 10 call stack numbers */


/*=========================================================================*/
/* Target T_PC                                                             */
/*=========================================================================*/
#elif (TG==T_PC)

  #ifdef FEATURE_CDMA_1900

    #define FEATURE_NV_TMSI             /* Enable TMSI parameters */

    #ifdef FEATURE_NV_ONE_NAM_RL_LARGE
      #define NV_MAX_NAMS      1        /* One NAM allowed */
      #define NVI_KLT_REV      0x41
      #define NVI_VERNO_MIN    0x01

    #else
      #define FEATURE_NV_TWO_NAMS_RL_SMALL    /* Default */
      #define NV_MAX_NAMS      2        /* Up to 2 NAMs allowed */
      #define NVI_KLT_REV      0x41
      #define NVI_VERNO_MIN    0x02

    #endif

    #define  NV_MAX_SID_NID    1        /* For 1 SID+NID pair */

  #else

    #define FEATURE_NV_ANALOG           /* Enable analog parameters */

    #ifdef FEATURE_NV_ONE_NAM_RL_LARGE
      #error Invalid feature mix: ~FEATURE_CDMA_1900 && FEATURE_NV_ONE_NAM...
    #endif

    #ifdef FEATURE_NV_TWO_NAMS_RL_SMALL
      #error Invalid feature mix: ~FEATURE_CDMA_1900 && FEATURE_NV_TWO_NAMS...
    #endif

    #define NV_MAX_NAMS        4        /* Up to 4 NAMs allowed */
    #define NV_MAX_SID_NID     4        /* Up to 4 SID+NID pairs */
    #define NVI_KLT_REV        0x41
    #define NVI_VERNO_MIN      0x03

  #endif  /* FEATURE_CDMA_1900 */

  /* Standard features for target PC */
  #define NV_FEATURE_RENTAL_ITEMS
  #define FEATURE_NV_RF_CAL
  #define FEATURE_NV_ALARMS
  #define FEATURE_NV_FULL_DIAL_TYPE
  #define FEATURE_NV_REDIAL_ITEM
  #define FEATURE_NV_24LC65
  #define FEATURE_NV_DEADCELL_RECOVERY
  #define FEATURE_NV_UNIT_TEST

  /* Target-specific constants for PC */
  #define  NV_MAX_SPEED_DIALS  102      /* Maximum of 102 speed dials */
  #define  NV_MAX_LTRS         12       /* With up to 12-letter names */
  #define  NV_MAX_STACK_DIALS  10       /* Maximum 10 call stack numbers */


/*=========================================================================*/
/* Target T_DM and T_SP                                                    */
/*=========================================================================*/
#elif ((TG==T_DM) || (TG==T_SP))

  #define FEATURE_NV_ANALOG             /* Enable analog parameters */

  /* Set NV version numbers for this feature configuration */
  #define NVI_KLT_REV          0x4D
  #define NVI_VERNO_MIN        0x00

  /* Standard features for targets DM and SP */
  #define FEATURE_NV_RF_CAL
  #define FEATURE_NV_ALARMS
  #define FEATURE_NV_FULL_DIAL_TYPE
  #define FEATURE_NV_REDIAL_ITEM
  #define FEATURE_NV_24LC65
  #define FEATURE_NV_DEADCELL_RECOVERY
  #define FEATURE_NV_UNIT_TEST

  /* Target-specific constants for DM and SP */
  #define  NV_MAX_SPEED_DIALS  109      /* Maximum of 109 speed dials */
  #define  NV_MAX_LTRS         12       /* With up to 12-letter names */
  #define  NV_MAX_STACK_DIALS  10       /* Maximum 10 call stack numbers */
  #define  NV_MAX_NAMS         4        /* Up to 4 NAMs allowed */
  #define  NV_MAX_SID_NID      4        /* Up to 4 SID+NID pairs */


/*=========================================================================*/
/* Target not recognized                                                   */
/*=========================================================================*/
#else
#error  TG must be defined to a known target
#endif

/* Generate values for nvi_verno_ext_type to track new feature definitions
   so that a rebuild will occur when feature selection changes */
/* This code will be obsoleted with the new NV meta compiler */

/* Length of variable sized part of extended version designator */
#define NVI_VERNO_LENGTH       NVI_VERNO_EXT_LENGTH
/* General revision number for feature bits assignment */
#define NVI_VERNO_GENERAL_REV  0x0002

/* Version designator feature bits - byte 0 */
#ifdef FEATURE_BROADCAST_SMS
  #define NV_FEATURE_BROADCAST_SMS_ENABLED 0x80
#else
  #define NV_FEATURE_BROADCAST_SMS_ENABLED 0
#endif
#ifdef FEATURE_RFR3100
  #define NV_FEATURE_RFR3100_ENABLED 0x40
#else
  #define NV_FEATURE_RFR3100_ENABLED 0
#endif
#ifdef FEATURE_OTASP_OTAPA
  #define NV_FEATURE_OTASP_OTAPA_ENABLED 0x20
#else
  #define NV_FEATURE_OTASP_OTAPA_ENABLED 0
#endif
#if (defined (FEATURE_DS_PAP) || defined (FEATURE_DS_CHAP) )
  #define NV_FEATURE_DS_PAP_ENABLED 0x10
#else
  #define NV_FEATURE_DS_PAP_ENABLED 0
#endif
#ifdef FEATURE_PA_RANGE_DIG_COMP
  #define NV_FEATURE_PA_RANGE_DIG_COMP_ENABLED 0x08
#else
  #define NV_FEATURE_PA_RANGE_DIG_COMP_ENABLED 0
#endif
#ifdef FEATURE_4PAGE_TX_LINEARIZER
  #define NV_FEATURE_4PAGE_TX_LINEARIZER_ENABLED 0x04
#else
  #define NV_FEATURE_4PAGE_TX_LINEARIZER_ENABLED 0
#endif
#ifdef FEATURE_RUIM_CHV_FROM_NV
  #define NV_FEATURE_RUIM_CHV_FROM_NV_ENABLED 0x02
#else
  #define NV_FEATURE_RUIM_CHV_FROM_NV_ENABLED 0
#endif
#ifdef FEATURE_IS2000
  #define NV_FEATURE_IS2000_ENABLED 0x01
#else
  #define NV_FEATURE_IS2000_ENABLED 0
#endif

#define  NVI_VERNO_EXT_BYTE_0                                    \
     (NV_FEATURE_BROADCAST_SMS_ENABLED | NV_FEATURE_RFR3100_ENABLED |  \
      NV_FEATURE_OTASP_OTAPA_ENABLED | NV_FEATURE_DS_PAP_ENABLED    |  \
      NV_FEATURE_PA_RANGE_DIG_COMP_ENABLED                       |  \
      NV_FEATURE_4PAGE_TX_LINEARIZER_ENABLED                     |  \
      NV_FEATURE_RUIM_CHV_FROM_NV_ENABLED                        |  \
      NV_FEATURE_IS2000_ENABLED)


/* Version designator feature bits - byte 1 */
#ifdef FEATURE_DS_DEFAULT_BITRATE_NV
  #define NV_FEATURE_DS_DEFAULT_BITRATE_NV_ENABLED 0x80
#else
  #define NV_FEATURE_DS_DEFAULT_BITRATE_NV_ENABLED 0
#endif
#ifdef FEATURE_DIAG_DEFAULT_BITRATE_NV
  #define NV_FEATURE_DIAG_DEFAULT_BITRATE_NV_ENABLED 0x40
#else
  #define NV_FEATURE_DIAG_DEFAULT_BITRATE_NV_ENABLED 0
#endif
#ifdef FEATURE_SDEVMAP_MENU_ITEM_NV
  #define NV_FEATURE_SDEVMAP_MENU_ITEM_NV_ENABLED 0x20
#else
  #define NV_FEATURE_SDEVMAP_MENU_ITEM_NV_ENABLED 0
#endif
#ifdef FEATURE_TTY
  #define NV_FEATURE_TTY_ENABLED 0x10
#else
  #define NV_FEATURE_TTY_ENABLED 0
#endif
#ifdef FEATURE_PA_RANGE_TEMP_FREQ_COMP
  #define NV_FEATURE_PA_RANGE_TEMP_FREQ_COMP_ENABLED 0x08
#else
  #define NV_FEATURE_PA_RANGE_TEMP_FREQ_COMP_ENABLED 0
#endif
#ifdef FEATURE_STEREO_DAC
  #define NV_FEATURE_STEREO_DAC_ENABLED 0X04
#else
  #define NV_FEATURE_STEREO_DAC_ENABLED 0
#endif
#ifdef FEATURE_MULTIMEDIA
  #define NV_FEATURE_MULTIMEDIA_ENABLED 0X02
#else
  #define NV_FEATURE_MULTIMEDIA_ENABLED 0
#endif
#ifdef FEATURE_DIAG_PORT_SELECT
#error code not present
#else
  #define NV_FEATURE_DIAG_PORT_SELECT_ENABLED 0
#endif

#define  NVI_VERNO_EXT_BYTE_1                                    \
     (NV_FEATURE_DS_DEFAULT_BITRATE_NV_ENABLED                   |  \
      NV_FEATURE_DIAG_DEFAULT_BITRATE_NV_ENABLED                 |  \
      NV_FEATURE_SDEVMAP_MENU_ITEM_NV_ENABLED                    |  \
      NV_FEATURE_TTY_ENABLED                                     |  \
      NV_FEATURE_PA_RANGE_TEMP_FREQ_COMP_ENABLED                 |  \
      NV_FEATURE_STEREO_DAC_ENABLED                              |  \
      NV_FEATURE_MULTIMEDIA_ENABLED                              |  \
      NV_FEATURE_DIAG_PORT_SELECT_ENABLED)

/* Version designator feature bits - byte 2 */
#ifdef FEATURE_GPSONE
  #define NV_FEATURE_GPSONE_ENABLED 0x80
#else
  #define NV_FEATURE_GPSONE_ENABLED 0
#endif
#ifdef FEATURE_MMC
  #define NV_FEATURE_MMC_ENABLED 0x40
#else
  #define NV_FEATURE_MMC_ENABLED 0
#endif
#ifdef FEATURE_UBROWSER
#error code not present
#else
  #define NV_FEATURE_UBROWSER_ENABLED 0
#endif
#ifdef FEATURE_RUIM_SMSS
  #define NV_FEATURE_RUIM_SMSS_ENABLED 0x10
#else
  #define NV_FEATURE_RUIM_SMSS_ENABLED 0
#endif
#ifdef FEATURE_DIAG_RESTART_CONFIG
  #define NV_FEATURE_DIAG_RESTART_CONFIG_ENABLED 0x08
#else
  #define NV_FEATURE_DIAG_RESTART_CONFIG_ENABLED 0
#endif
#ifdef FEATURE_ENC_BTF_IN_NV
  #define NV_FEATURE_ENC_BTF_IN_NV_ENABLED 0x04
#else
  #define NV_FEATURE_ENC_BTF_IN_NV_ENABLED 0
#endif
#ifdef FEATURE_IS2000_R_SCH
  #define NV_FEATURE_IS2000_R_SCH_ENABLED 0x02
#else
  #define NV_FEATURE_IS2000_R_SCH_ENABLED 0
#endif
#ifdef FEATURE_SD20
  #define NV_FEATURE_SD20_ENABLED 0x01
#else
  #define NV_FEATURE_SD20_ENABLED 0
#endif

#define NVI_VERNO_EXT_BYTE_2                                     \
     (NV_FEATURE_GPSONE_ENABLED                                  |  \
      NV_FEATURE_MMC_ENABLED                                     |  \
      NV_FEATURE_UBROWSER_ENABLED                                |  \
      NV_FEATURE_RUIM_SMSS_ENABLED                               |  \
      NV_FEATURE_DIAG_RESTART_CONFIG_ENABLED                     |  \
      NV_FEATURE_ENC_BTF_IN_NV_ENABLED                           |  \
      NV_FEATURE_IS2000_R_SCH_ENABLED                            |  \
      NV_FEATURE_SD20_ENABLED)

#ifdef FEATURE_SUBPCG_PA_WARMUP_DELAY
  #define NV_FEATURE_SUBPCG_PA_WARMUP_DELAY_ENABLED 0x80
#else
  #define NV_FEATURE_SUBPCG_PA_WARMUP_DELAY_ENABLED 0
#endif
#ifdef FEATURE_TRIMODE_ITEMS
  #define NV_FEATURE_TRIMODE_ITEMS_ENABLED 0x40
#else
  #define NV_FEATURE_TRIMODE_ITEMS_ENABLED 0
#endif
#ifdef FEATURE_NV_4K_RL
  #define NV_FEATURE_4K_RL_ENABLED 0x20
#else
  #define NV_FEATURE_4K_RL_ENABLED 0
#endif
#ifdef FEATURE_FACTORY_TESTMODE
  #define NV_FEATURE_FACTORY_TESTMODE_ENABLED 0x10
#else
  #define NV_FEATURE_FACTORY_TESTMODE_ENABLED 0
#endif
#ifdef FEATURE_JCDMA_DS
  #define NV_FEATURE_JCDMA_DS_ENABLED 0x08
#else
  #define NV_FEATURE_JCDMA_DS_ENABLED 0
#endif
#ifdef FEATURE_DS_MOBILE_IP
  #define NV_FEATURE_DS_MOBILE_IP_ENABLED 0x04
#else
  #define NV_FEATURE_DS_MOBILE_IP_ENABLED 0
#endif
#ifdef FEATURE_HDR
#error code not present
#else
  #define NV_FEATURE_HDR_ENABLED 0
#endif
#ifdef FEATURE_TX_POWER_BACK_OFF
  #define NV_FEATURE_TX_POWER_BACK_OFF_ENABLED 0x01
#else
  #define NV_FEATURE_TX_POWER_BACK_OFF_ENABLED 0
#endif

/* Version designator feature bits - byte 3 */
#define NVI_VERNO_EXT_BYTE_3                                     \
     (NV_FEATURE_SUBPCG_PA_WARMUP_DELAY_ENABLED                  |  \
      NV_FEATURE_TRIMODE_ITEMS_ENABLED                           |  \
      NV_FEATURE_4K_RL_ENABLED                                   |  \
      NV_FEATURE_FACTORY_TESTMODE_ENABLED                        |  \
      NV_FEATURE_JCDMA_DS_ENABLED                                |  \
      NV_FEATURE_DS_MOBILE_IP_ENABLED                            |  \
      NV_FEATURE_HDR_ENABLED                                     |  \
      NV_FEATURE_TX_POWER_BACK_OFF_ENABLED)

#ifdef FEATURE_DUAL_RX_CHAINS
#error code not present
#else
  #define NV_FEATURE_DUAL_RX_CHAINS_ENABLED 0
#endif
#ifdef FEATURE_BT_LPOS
#error code not present
#else
  #define NV_FEATURE_BT_LPOS_ENABLED 0
#endif
#ifdef FEATURE_RFCAL_VERSION
  #define NV_FEATURE_RFCAL_VERSION_ENABLED 0x20
#else
  #define NV_FEATURE_RFCAL_VERSION_ENABLED 0
#endif
#ifdef FEATURE_HDR_AN_AUTH
#error code not present
#else
  #define NV_FEATURE_HDR_AN_AUTH_ENABLED 0
#endif
#ifdef FEATURE_USERZONE
  #define NV_FEATURE_USERZONE_ENABLED 0x08
#else
  #define NV_FEATURE_USERZONE_ENABLED 0
#endif
#ifdef FEATURE_RADIO_ONE_RFNV
#error code not present
#else
  #define NV_FEATURE_RADIO_ONE_RFNV_ENABLED 0
#endif
#ifdef FEATURE_GPSONE_DBM
  #define NV_FEATURE_GPSONE_DBM_ENABLED 0x02
#else
  #define NV_FEATURE_GPSONE_DBM_ENABLED 0
#endif

/* Version designator feature bits - byte 4 */
#define NVI_VERNO_EXT_BYTE_4                                     \
     (NV_FEATURE_DUAL_RX_CHAINS_ENABLED                          |  \
      NV_FEATURE_BT_LPOS_ENABLED                                 |  \
      NV_FEATURE_RFCAL_VERSION_ENABLED                           |  \
      NV_FEATURE_HDR_AN_AUTH_ENABLED                             |  \
      NV_FEATURE_USERZONE_ENABLED                                |  \
      NV_FEATURE_RADIO_ONE_RFNV_ENABLED                          |  \
      NV_FEATURE_GPSONE_DBM_ENABLED)

/* Version designator feature bits - byte 5 */
#define NVI_VERNO_EXT_BYTE_5    0

/*=========================================================================*/
/* End of NV Feature Defines Section                                       */
/*=========================================================================*/


/*=========================================================================*/

/* Following are all the types to be used in message.  Unless otherwise    */
/* specified all fields are right justified.  All nv.h structures are      */
/* packed(1).  This is done so that external and internal NV storage       */
/* representation is as identical as possible and it minimizes storage     */
/* requirements.                                                           */

/*-------------------------------------------------------------------------*/

/* Various definitions to be used in subsequent types.                     */

#define     NV_DIR_NUMB_SIZ     10        /* num digits in dir_number */
#define     NV_DIR_NUMB_PCS_SIZ 15        /* num digits in dir_number_pcs */
#define     NV_WDC_LTRS          5        /* With up to 5 letters wdc */
#define     NV_FSC_SIZ           6        /*number digits in FSC */
#define     NV_MAX_PAGE_MSGS    20        /* Maximum 20 page messages */

/******************************************
 CHG 2001/05/30 ichikawa@MYTECS
     NV_MAX_DIAL_DIGITS(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
#define     NV_MAX_DIAL_DIGITS  32        /* Maximum 32 digit number */
#else  /*** CHG ***/
/* Copyed from "nv.h"(ptx600) */
#define     NV_MAX_DIAL_DIGITS  36
#endif  /*** END OF CHG ***/

#define     NV_SMS_DATA_SIZ    388        /* Max bytes in SMS data buffer */
/* DM uses a reduced data size to avoid *huge* packets for serial interface */
#define     NV_SMS_DM_DATA_SIZ 100        /* Max bytes in SMS DM data buffer */

#define     NV_MAX_MINS          2        /* Up to 2 MINs per NAM allowed */

/******************************************
 CHG 2001/05/30 ichikawa@MYTECS
     NV_MAX_HOME_SID_NID(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
#define     NV_MAX_HOME_SID_NID 20        /* Up to 20 "home" SID/NID pairs */
#else  /*** CHG ***/
/* Copyed from "nv.h"(ptx600) */
#define     NV_MAX_HOME_SID_NID  1
#endif  /*** END OF CHG ***/

#define     NV_MAX_SID_LOCK      6        /* Up to 6 SIDs to lock out */
#define     NV_MAX_SID_NID_LOCK 10        /* Up to 10 SID/NIDs to lock out */
#define     NV_MAX_SID_ACQ       6        /* Up to 6 SIDs to acquire */
#define     NV_MAX_ERR_LOG      20        /* Maximum 20 logs in error log */
#define     NV_ERR_FILE_NAME_LEN 8        /* 8 characters file name length */

/******************************************
 CHG 2001/05/30 ichikawa@MYTECS
     NV_CDMA_MIN_INDEX(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
#define     NV_CDMA_MIN_INDEX    1        /* CDMA MIN index */
#else  /*** CHG ***/
/* Copyed from "nv.h"(ptx600) */
#define     NV_CDMA_MIN_INDEX    0
#endif  /*** END OF CHG ***/

#define     NV_ANALOG_MIN_INDEX  0        /* Analog MIN index */
#define     NV_MAX_ALARMS        6        /* One time alarms for DOT */
#define     NV_ISD_STD_PASSWD_SIZ 4       /* Bytes in passwd */
#define     NV_DS_MIP_MAX_NUM_PROF 6      /* Up to 6 Mobile IP user profiles
                                             are allowed */
#define     NV_MAX_NAI_LENGTH   72        /* Maximum length of User NAI field */
#define     NV_MAX_MN_HA_SHARED_SECRET_LEN  16
                                          /* Maximum length of MN-HA shared secret */
#define     NV_MAX_MN_AAA_SHARED_SECRET_LEN 16
                                          /* Maximum length of MN-AAA shared secret */
#define     NV_SIZE_OF_VERSION  8         /* Size of a version number in bytes */
#define     NV_SIZE_OF_DATE     4         /* Size of a date value in long bytes */
#define     NV_QC_SERIAL_NUM_LEN 9        /* 9 character QCOM serial number */
#define     NV_DS_MIP_ENABLE_PROF 6

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* All items marked by a checksum, except the ESN take a simple checksum.  */
/* If set as defined below it denotes that the item has been programmed    */
/* to NV and is valid.  Any other value denotes that the item is invalid.  */
/* The ESN checksum is hidden from the user, and the flag returned, as     */
/* defined below, indicates if the ESN checksum is valid.                  */

#define     NV_VALID_GEN_CHKSUM     0xFFFF
#define     NV_VALID_ESN_CHKSUM     0xFFFFFFFFL

/*-------------------------------------------------------------------------*/

/* Type to hold ESN.  The ESN and its checksum are write-once protected    */
/* and the NV task will not write to NV an ESN or its checksum if the      */
/* stored ESN or its checksum are non-zero.                                */

typedef PACKED struct {
  dword     esn;
} nv_esn_type;

typedef PACKED struct {
  dword     fsc2;
} nv_fsc2_type;

/*-------------------------------------------------------------------------*/

/* Type to hold ESN checksum.  The checksum is 30 bit CRC with generator   */
/* polynomial as used for CDMA sync channel signaling, per CAI section     */
/* 7.7.1.2.2.  The ESN and its checksum are write-once protected and the   */
/* NV task will not write to NV an ESN or its checksum if the stored ESN,  */
/* or its checksum, or the internal valid flag are not valid.  This item   */
/* can be written only internally, by the NV task.  The status of this     */
/* item can be read externally by other tasks to verify that the ESN has   */
/* been correctly programmed to NV.  An NV_VALID_ESN_CHKSUM value returned */
/* indicates valid ESN checksum.                                           */

typedef PACKED struct {
  dword     chksum;
} nv_esn_chksum_type;

typedef PACKED struct {
  dword     fsc2_chksum;
} nv_fsc2_chksum_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold configuration checksum.  The checksum is a simple 0xFFFF   */
/* marker which indicates that configuration parameters have been          */
/* programmed and are valid.                                               */

typedef PACKED struct {
  word      chksum;
} nv_config_chksum_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SID and associated NAM.  The SID is 15 bits, per CAI       */
/* section 2.3.8.                                                          */

typedef PACKED struct {
  byte      nam;            /* NAM id 0-N */
  word      sid;            /* SID */
} nv_sid_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold analog/digital preferred mode, and the associated NAM.     */
/* The type is per CAI section 2.3.10.2.                                   */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_MODE_DIGITAL_PREF,     /* CDMA then Analog */
  NV_MODE_DIGITAL_ONLY,     /* CDMA only */
  NV_MODE_ANALOG_PREF,      /* Analog then CDMA */
  NV_MODE_ANALOG_ONLY,      /* Analog only */
  NV_MODE_AUTOMATIC,        /* Determine mode automatically */
  NV_MODE_E911,             /* Emergency mode */
  NV_MODE_HOME_ONLY,        /* Restrict to home only */
  NV_MODE_PCS_CDMA_ONLY,
  NV_MODE_CELL_CDMA_ONLY,
  NV_MODE_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
} nv_mode_enum_type;
#endif

typedef PACKED struct {
  byte               nam;        /* NAM id 0-N */
  nv_mode_enum_type  mode;       /* Preferred mode per enum above */
} nv_pref_mode_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold preferred serving system and the associated NAM.           */
/* Type is per CAI section 2.3.10.1.                                       */

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_SYS_A_ONLY=0,          /* A only */
  NV_SYS_A_PREF,            /* A then B */
  NV_SYS_B_ONLY,            /* B only */
  NV_SYS_B_PREF,            /* B then A */
  NV_SYS_HOME_ONLY,         /* Home SID only */
  NV_SYS_HOME_PREF,         /* Home SID preferred */
  NV_SYS_ENUM_PAD = 0x7FFF  /* Pad to 16 bits on ARM */
} nv_sys_enum_type;
#endif

typedef PACKED struct {
  byte               nam;   /* NAM id 0-N */
  nv_sys_enum_type   sys;   /* Preferred system per above enum */
} nv_pref_serv_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the system preference and the associated NAM. This item    */
/* replaces NV_CDMA_PREF_SERV_I and NV_ANALOG_PREF_SERV_I for SSPR 800.    */

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_SP_A_ONLY=0,          /* A only */
  NV_SP_B_ONLY,            /* B only */
  NV_SP_HOME_ONLY,         /* Home only */
  NV_SP_STANDARD,          /* Home preferred */
  NV_SYS_PREF_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
} nv_sys_pref_enum_type;
#endif

typedef PACKED struct {
  byte                    nam;   /* NAM id 0-N */
  nv_sys_pref_enum_type   sys;   /* Preferred system per above enum */
} nv_sys_pref_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SID(s) for lockout.  The phone will reject acquisition if  */
/* any of these SID(s) is acquired.                                        */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  word      sid[NV_MAX_SID_LOCK];   /* SID */
} nv_sid_lock_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SID(s) for acquisition.  The phone will allow acquisition  */
/* only on these SID(s).                                                   */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  word      sid[NV_MAX_SID_ACQ];    /* SID */
} nv_sid_acq_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold FIRSTCHPp and associated NAM.  Value is 11 bits, per       */
/* CAI section 2.3.7.                                                      */

typedef PACKED struct {
  byte      nam;            /* NAM id 0-N */
  word      channel;        /* FIRSTCHPp channel */
} nv_firstchp_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold analog registration type, along with associated NAM id.    */
/* Type includes enumeration for possible registration values.             */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_DISABLED,           /* Autonomous registration disabled               */
  NV_WHEREABOUTS_KNOWN,  /* Autonomuos registration enabled, tell location */
  NV_WHEREABOUTS_UNKNOWN,/* Autonomous registration enabled, hide location */
  NV_ANALOG_REG_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
} nv_analog_reg_enum_type;
#endif

typedef PACKED struct {
  byte                      nam;    /* NAM id 0-N */
  nv_analog_reg_enum_type   kind;   /* Registration kind per enum above */
} nv_analog_reg_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold CDMA channel and associated NAM.  Value is 11 bits for     */
/* Primary and Secondary channels, per CAI section 6.1.1.                  */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  word      channel_a;           /* A carrier channel number */
  word      channel_b;           /* B carrier channel number */
} nv_cdmach_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold NAM data checksum.  The checksum is a simple 0xFFFF marker */
/* which is set to indicate that NAM parameters have been programmed and   */
/* are valid.                                                              */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  word      chksum;              /* The checksum */
} nv_nam_chksum_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold authentication A key and the associated NAM id.  The       */
/* number is 64 bits, per IS-54 appendix A (CAI Appendix X).               */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  qword     key;                 /* A key array */
} nv_a_key_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold authentication A key 16 bit CRC checksum with generator    */
/* polynomial as used for CDMA reverse and forward traffic signaling       */
/* messages, per CAI sections 6.7.2.2.2 and 7.7.3.2.  Exact security       */
/* and protection of the A-Key is for now TBD.                             */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  word      chksum;              /* Checksum */
} nv_a_key_chksum_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SSD (A or B) variable and the associated NAM id.  Each     */
/* SSD is 64 bits, per CAI sections 2.3.12.1.1. and 6.3.12.1.1.            */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  qword     ssd;                 /* SSD array */
} nv_ssd_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SSD (A or B) 16 bit CRC checksum with generator polynomial */
/* as used for CDMA reverse and forward traffic signaling messages, per    */
/* CAI sections 6.7.2.2.2 and 7.7.3.2.                                     */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  word      chksum;              /* Checksum */
} nv_ssd_chksum_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the call history COUNT parameter and the associated NAM    */
/* id, per CAI section 2.3.12.1.3.                                         */

typedef PACKED struct {
  byte      nam;                 /* NAM id 0-N */
  byte      count;               /* COUNTsp */
} nv_count_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold MIN1p for 2 MINs, along with the associated NAM id.        */
/* The number is 24 bits, per CAI section 2.3.1.                           */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  dword     min1[NV_MAX_MINS];      /* MIN1 */
} nv_min1_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold MIN2p for 2 MINs, along with the associated NAM id.        */
/* The number is 10 bits, per CAI section 2.3.1.                           */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  word      min2[NV_MAX_MINS];      /* MIN2 */
} nv_min2_type;
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold IMSI MCC , along with the associated NAM id.               */
/* The number is 24 bits                                                   */

typedef PACKED struct {
  byte     nam;                    /* NAM id 0-N */
  word     imsi_mcc;
} nv_imsi_mcc_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold DIR_NUMBER  with the associated NAM id.                    */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      dir_number[NV_DIR_NUMB_SIZ];
} nv_dir_number_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold IMSI_11_12 for 4 MINs, along with the associated NAM id.   */
/* The number is 8 bits.                                                   */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      imsi_11_12;
} nv_imsi_11_12_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold CDMA mobile termination type, along with associated NAM,   */
/* to be used for the MOB_TERM_... variables for registration.             */

typedef PACKED struct {
  byte               nam;                    /* NAM id 0-N */
  boolean            enabled[NV_MAX_MINS];   /* Registration enabled */
} nv_mob_term_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold ACCOLCp, along with associated NAM id.  Value is 4 bits,   */
/* per CAI section 2.3.5.                                                  */

typedef PACKED struct {
  byte      nam;                             /* NAM id 0-N */
  #ifdef __cplusplus
#error code not present
  #else
    byte      class[NV_MAX_MINS];            /* ACCOLCp class */
  #endif
} nv_accolc_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SID+NID pairs.  The SID is 15 bits, per CAI 2.3.8, and the */
/* NID is 16 bits, per CAI section 2.3.10.3.                               */

typedef PACKED struct {
  word      sid;
  word      nid;
} nv_sid_nid_pair_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SID+NID pairs for CDMA acquisition, along with NAM id      */
/* NID is 16 bits, per CAI section 2.3.10.3.  There are up to 4 SID+NID    */
/* pairs, in descending preferrence (0=first, 3=last).                     */

typedef PACKED struct {
  byte                 nam;                               /* NAM id 0-N */
  nv_sid_nid_pair_type pair[NV_MAX_MINS][NV_MAX_SID_NID]; /* SID+NID Pair */
} nv_sid_nid_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold "home" SID+NID pairs for CDMA acquisition, along with NAM  */
/* id.  Note that this item is NOT "per-MIN."                              */

typedef PACKED struct {
  byte                 nam;                               /* NAM id 0-N */
  nv_sid_nid_pair_type pair[NV_MAX_HOME_SID_NID];         /* SID+NID Pair */
} nv_home_sid_nid_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold SID+NID pairs to be locked out from CDMA acquisition.      */

typedef PACKED struct {
  byte                 nam;                               /* NAM id 0-N */
  nv_sid_nid_pair_type pair[NV_MAX_SID_NID_LOCK];         /* SID+NID Pair */
} nv_sid_nid_lock_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Generic "enabled/disabled per NAM" type used to hold both the roaming   */
/* list enabled indicator and the OTAPA enabled indicator.                 */

typedef PACKED struct {
  byte                 nam;                               /* NAM id 0-N */
  boolean              enabled;
} nv_enabled_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold MIN data checksum.  The checksum is a simple 0xFFFF marker */
/* which specifies that MIN parameters have been programmed and are valid. */

typedef PACKED struct {
  byte      nam;                             /* NAM id 0-N */
  word      chksum[NV_MAX_MINS];             /* Checksum */
} nv_min_chksum_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold ORIG_MIN id, along with the associated NAM id.             */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      id;                     /* MIN id 0-N */
} nv_orig_min_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the name of each NAM, along with the associated NAM id.    */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      name[NV_MAX_LTRS];      /* NAM name string */
} nv_name_nam_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_PCS_BLOCK_A,
  NV_PCS_BLOCK_B,
  NV_PCS_BLOCK_C,
  NV_PCS_BLOCK_D,
  NV_PCS_BLOCK_E,
  NV_PCS_BLOCK_F,
  NV_CELLULAR_SYS_A,
  NV_CELLULAR_SYS_B,

  /* Block G and Block H are not defined in US PCS Band.
  ** For internal purpose, introduced Block G and Block H for Band Class 5.
  */
  NV_PCS_BLOCK_G,
  NV_PCS_BLOCK_H,

  NV_BLOCK_OR_SYS_INVALID,
  NV_BLOCK_OR_SYS_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
} nv_block_or_sys_enum_type;
#endif

/* Type to hold SID_NID_LIST, per IS-95A section 6.3.4.                    */

typedef PACKED struct {
  word                       sid;
  word                       nid;
  nv_block_or_sys_enum_type  block_or_sys;
  byte                       band_class;
} nv_sid_nid_list_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold ZONE_LIST, per CAI section 6.3.4.                          */

typedef PACKED struct {
  word                       reg_zone;            /* REG_ZONEsp */
  word                       sid;                 /* SIDsp */
  word                       nid;                 /* NIDsp */
  nv_block_or_sys_enum_type  block_or_sys;
  byte                       band_class;
} nv_zone_list_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold distance based registration paremeters, per CAI            */
/* section 6.3.4.                                                          */

typedef PACKED struct {
  dword     base_lat_reg;        /* BASE_LAT_REGsp */
  dword     base_long_reg;       /* BASE_LONG_REGsp */
  word      reg_dist_reg;        /* BASE_DIST_REGsp */
} nv_dist_reg_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold call timers and associated NAM id.  Each NAM has its own   */
/* set of these timers, with units as shown.   The range of these timers   */
/* is more then 100 years.                                                 */
/*                                                                         */
/*    Timer             units                                              */
/*    -----             -----                                              */
/*    Call Time         seconds                                            */
/*    Air Time          minutes                                            */
/*    Roam Time         minutes                                            */
/*    Life Time         minutes                                            */

typedef PACKED struct {
  byte      nam;            /* NAM id 0-N */
  dword     time;           /* Time */
} nv_call_time_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold run timer, with units as shown.  The range is a zillion    */
/* years.                                                                  */
/*                                                                         */
/*    Timer             units                                              */
/*    -----             -----                                              */
/*    Run Time          minutes                                            */

typedef PACKED struct
{
  dword     time;       /* Time */
} nv_run_time_type;

typedef PACKED struct {
  byte      nam;            /* NAM id 0-N */
  dword     cnt;            /* count */
} nv_call_cnt_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for rental timer.                                                  */

typedef PACKED struct {
  dword     ticks;            /* total number of "ticks" of the clock */
} nv_rental_timer_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold speed dial number.  'num_digits' and 'num_letters'         */
/* indicate the actual number of digits and letters, or zero if none.      */
/* The storage address is in the range 0-99 for speed dial numbers         */

typedef PACKED struct {
  byte      address;                      /* Storage address */
#ifdef FEATURE_NV_FULL_DIAL_TYPE
  byte      status;                       /* flag bits */
#endif
  byte      num_digits;                   /* Number of digits */
  byte      digits[NV_MAX_DIAL_DIGITS];   /* Array of digits */
  byte      letters[NV_MAX_LTRS];         /* Name associated with number */
} nv_dial_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold stack dial number.  'num_digits' and 'num_letters'         */
/* indicate the actual number of digits and letters, or zero if none.      */
/* The storage address is in the range 0-9 for a stack number              */

typedef PACKED struct {
  byte      address;                      /* Storage address */
#ifdef FEATURE_NV_FULL_DIAL_TYPE
  byte      status;                       /* flag bits */
  dword     time_stamp;                   /* years to seconds */
#endif
  byte      num_digits;                   /* Number of digits */
  byte      digits[NV_MAX_DIAL_DIGITS];   /* Array of digits */
  byte      letters[NV_MAX_LTRS];         /* Name associated with number */
#ifdef FEATURE_NV_EXTENDED_UI
  dword     duration;                     /* Duration of call in seconds */
#endif
} nv_stdial_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold call stack index.  The array of bytes allows sorting the   */
/* call stack by order of dialing and resorting as it is being used.  The  */
/* secret field indicates if a secret number is in that stack location.    */

typedef PACKED struct {
  byte      index[NV_MAX_STACK_DIALS];    /* Index array */
  boolean   secret[NV_MAX_STACK_DIALS];   /* TRUE if a secret number */
} nv_stack_idx_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for holding the dial string used for originating packet data calls */
#define     NV_MAX_PKT_ORIG_DIGITS  16    /* Maximum 16 digit number */

typedef PACKED struct {
  byte      num_digits;                     /* Number of digits */
  byte      digits[NV_MAX_PKT_ORIG_DIGITS]; /* The digit array */
} nv_data_pkt_orig_str_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify page answer rings and answer mode.                      */

#define NV_PAGE_DISABLE 0
#define NV_PAGE_SILENT  1
#define NV_PAGE_AUDIBLE 2

typedef PACKED struct {
  byte   enable;            /* paging mode */
  byte   rings;             /* Number of rings when to accept page */
} nv_page_set_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold page message.  The page characters are stored as ASCII     */
/* string.                                                                 */

#define  NV_MAX_PAGE_CHARS 20            /* Up to 20 characters in a page */

typedef PACKED struct {
  byte               address;                      /* Storage address 0-19 */
  dword              time_stamp;                   /* Time stamp */
#ifdef __cplusplus
#error code not present
#else
  boolean            new;                          /* New page status */
#endif
  byte               num_chars;                    /* Number of characters */
  byte               chars[NV_MAX_PAGE_CHARS];     /* Array of characters */
} nv_page_msg_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold display banner.  The banner is fixed length and is stored  */
/* as ASCII string.                                                        */

typedef PACKED struct {
  byte      letters[NV_MAX_LTRS];            /* Banner */
} nv_banner_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

typedef PACKED struct {
  byte      wdc[NV_WDC_LTRS];            /* Warranty date code */
  byte      extra[3];                    /* in case the wdc def. changes */
} nv_wdc_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold Field Service Code is fixed length and is stored           */
/* as ASCII string.                                                        */

typedef PACKED struct {
  byte      fsc[NV_FSC_SIZ];            /* Field Service Code */
} nv_fsc_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the standing alarms for India DOT                          */

typedef PACKED struct {
  byte       alarm_id;                  /* which standing alarm */
  dword      alarms;                    /* DOT alarms */
} nv_alarms_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the standing alarms for India DOT                          */

typedef PACKED struct {
  byte      isd_std_passwd[NV_ISD_STD_PASSWD_SIZ];
} nv_isd_std_passwd_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify auto answer rings and enable/disable.                   */

typedef PACKED struct {
  boolean   enable;            /* TRUE if auto answer enabled */
  byte      rings;             /* Number of rings when to answer call */
} nv_auto_answer_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify auto redial rings and enable/disable.                   */

typedef PACKED struct {
  boolean   enable;      /* TRUE if auto redial enabled */
  byte      rings;       /* Number of 10 seconds system busy before redial */
} nv_auto_redial_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold maintenance order and reason code.  Maintenance reason is  */
/* per IS-95 section 7.7.4.                                                */

typedef PACKED struct {
  boolean maint_order;   /* Set when maintenance order received            */
  byte    maint_reason;  /* Maintenance reason received in the order       */
} nv_maintrsn_type;
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold lock order and reason code.  Lock reason is per CAI        */
/* section 7.7.4.                                                          */

typedef PACKED struct {
  boolean lock_order;   /* Set when lock order received and until unlocked */
  byte    lock_reason;  /* Lock reason received in the order */
} nv_lckrsn_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold user lock code.  The lock code is fixed length and is      */
/* stored as ASCII string.                                                 */

#define  NV_LOCK_CODE_SIZE 4              /* 4 digit lock code */

typedef PACKED struct {
  byte      digits[NV_LOCK_CODE_SIZE];    /* Lock code array */
} nv_lock_code_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold security code.  The security code is fixed length and is   */
/* stored as ASCII string.                                                 */

#define  NV_SEC_CODE_SIZE 6               /* 6 digit security code */

typedef PACKED struct {
  byte      digits[NV_SEC_CODE_SIZE];     /* Security code array */
} nv_sec_code_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold error log.  Up to NV_MAX_ERR_LOG error codes are stored,   */
/* each with number of times detected, file name, and line number.         */

typedef PACKED struct {
  byte      address;                         /* Storage address 0 to       */
                                             /*  NV_MAX_ERR_LOG-1          */
  byte      err_count;                       /* Number of occurances       */
                                             /* (0=empty,FF=full)          */
  byte      file_name[NV_ERR_FILE_NAME_LEN]; /* File name string */
  word      line_num;                        /* Line number in file */
  boolean   fatal;                           /* TRUE if fatal error */
} nv_err_log_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for peek.  Can peek at up to 32 bytes in one request.              */

#define  NV_MAX_PEEK_SIZE  32

typedef PACKED struct {
  word      address;                   /* Where to start peek from */
  byte      length;                    /* How many bytes to peek */
  byte      mem[NV_MAX_PEEK_SIZE];     /* Returned peek data */
} nv_peek_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* アドレス指定で、EEPROMから読み出すため追加 2001/08/24 Y.Miyaguni */
typedef PACKED struct {
  byte      *p_peek_data;              /* peekしたデータを格納するバッファへのポインタ */
  dword     address;                   /* Where to start peek from */
  word      length;                    /* How many bytes to peek */
} nv_so_peek_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for poke.  Can poke up to 32 bytes in one request.                 */

#define  NV_MAX_POKE_SIZE  32

typedef PACKED struct {
  word      address;                   /* Where to start poke */
  byte      length;                    /* How many bytes to poke */
  byte      mem[NV_MAX_POKE_SIZE];     /* Poke data */
} nv_poke_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* アドレス指定で、EEPROMとキャッシュに書き込むため追加 2001/08/24 Y.Miyaguni */
typedef PACKED struct {
  byte      *p_poke_data;              /* poke用データを格納しているバッファへのポインタ */
  dword     address;                   /* Where to start poke */
  word      length;                    /* How many bytes to poke */
} nv_so_poke_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for real sms item                                                  */

typedef PACKED struct {
  dword       confirmation_code;       /* reservation confirmation code */
  dword       deletion_list;           /* sms msgs to delete prior to write */
  byte        address;                 /* sms entry [0..23] */
  byte        status;                  /* status mask */
  byte        user_data_length;
  byte        call_back_length;
  qword       param_mask;
  word        length;                  /* bytes in 'data', [8..388] */
  byte        data[NV_SMS_DATA_SIZ];   /* generic sms data, variable size  */
} nv_sms_type;

/* Total size of header fields within nvi_sms_type (i.e., excluding "data")*/
#define  NV_SMS_HEADER_SIZE  14

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for generic minimum/maximum type                                   */

typedef PACKED struct {
  byte        min;
  byte        max;
} nv_minmax_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for Analog (FM) TX power levels                                    */

typedef PACKED struct {
  byte        level_0;                               /* power level 0 (max)*/
  byte        level_1;                                    /* power level 1 */
  byte        level_2;                                    /* power level 2 */
  byte        level_3;                                    /* power level 3 */
  byte        level_4;                                    /* power level 4 */
  byte        level_5;                                    /* power level 5 */
  byte        level_6;                                    /* power level 6 */
  byte        level_7;                                    /* power level 7 */
} nv_fm_tx_pwr_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for Frequency/Temperature Offset Table                             */

#define NV_FR_TEMP_OFFSET_TABLE_SIZ 64

typedef PACKED struct {
  byte   item[NV_FR_TEMP_OFFSET_TABLE_SIZ];
} nv_fr_temp_offset_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for Frequency Adjustment Table                                     */

#define NV_FREQ_ADJ_TABLE_SIZ 32

typedef PACKED struct {
  byte item[ NV_FREQ_ADJ_TABLE_SIZ];
} nv_freq_adj_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold IMSI, along with the associated NAM id.                    */
/* The number is 51 bits, per J-STD-008 section 2.3.1.                     */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  qword     imsi;                   /* International Mobile Station ID */
} nv_imsi_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold IMSI length, along with the associated NAM id.             */
/* The number is 3 bits, per J-STD-008 section 2.3.1.                      */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      num;                    /* Length of the IMSI for this NAM */
} nv_imsi_addr_num_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold TMSI zone length, along with the associated NAM id.               */
/* The number is 4 bits, per J-STD-008 section 2.3.15.                    */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      length;                 /* The TMSI zone length */
} nv_tmsi_zone_length_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold TMSI zone, along with the associated NAM id.               */
/* The number is 64 bits, per J-STD-008 section 2.3.15.                    */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  qword     zone;                   /* The TMSI zone */
} nv_tmsi_zone_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold TMSI code, along with the associated NAM id.               */
/* The number is 32 bits, per J-STD-008 section 2.3.15.                    */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  dword     code;                   /* The TMSI code */
} nv_tmsi_code_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold TMSI expiration timer, along with the associated NAM id.   */
/* The number is 24 bits, per J-STD-008 section 2.3.15.                    */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  dword     time;                   /* The TMSI expiration timer */
} nv_tmsi_exp_time_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the subscriber's home block (3 bits), along with the       */
/* associated NAM id.                                                      */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  byte      block;                  /* Home block */
} nv_home_block_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the roaming list, along with the associated NAM id.        */
/* Roaming list is bit-packed.                                             */

#ifdef FEATURE_NV_4K_RL
  #define NV_ROAMING_LIST_MAX_16K_SIZE   4096   /* 4K PRL */
#else
  #define NV_ROAMING_LIST_MAX_16K_SIZE   3072   /* 3K PRL */
#endif
#define NV_ROAMING_LIST_1K_PRL_SIZE    1024   /* 1K PRL */

#ifdef FEATURE_NV_ONE_NAM_RL_LARGE
  #define  NV_ROAMING_LIST_MAX_8K_SIZE   625
#else
  #define  NV_ROAMING_LIST_MAX_8K_SIZE   200
#endif

#ifdef FEATURE_NV_1K_RL
  #define  NV_ROAMING_LIST_MAX_SIZE  NV_ROAMING_LIST_1K_PRL_SIZE
#else
  #ifdef FEATURE_NV_AUTOSIZE
#error code not present
  #else

/******************************************
 CHG 2001/05/30 ichikawa@MYTECS
     NV_ROAMING_LIST_MAX_SIZE(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
    #define  NV_ROAMING_LIST_MAX_SIZE  NV_ROAMING_LIST_MAX_16K_SIZE
#else  /*** CHG ***/
/* Copyed from "nv.h"(ptx600) */
    #define  NV_ROAMING_LIST_MAX_SIZE  NV_ROAMING_LIST_MAX_8K_SIZE
#endif  /*** END OF CHG ***/

  #endif
#endif

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  word      prl_version;
  word      size;
  boolean   valid;
  byte      roaming_list[NV_ROAMING_LIST_MAX_SIZE];
} nv_roaming_list_type;

/* Same structure as roaming_list_type but adding some buffer bytes
 * at the end of roaming_list for FASTPRL.
 * This structure is used in RAM
 */
#define NV_RAM_PRL_BUF_BYTES  6     /* buffer bytes to account for uneven
                                     * bit in PRL system table, ni_pr area,
                                     * ni2bit area, and word alignment in
                                     * geo_sid area.
                                     */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  word      prl_version;
  word      size;
  boolean   valid;
  byte      roaming_list[NV_ROAMING_LIST_MAX_SIZE + NV_RAM_PRL_BUF_BYTES];
} nv_ram_roaming_list_type;

/* Same structure as roaming_list_type but for use in union nv_item_type */
typedef PACKED struct {
  byte      nam;
  word      prl_version;
  word      size;
  boolean   valid;
  byte      roaming_list[1];
} nv_roaming_list_union_type;

/* Only the roaming_list_type header */
typedef PACKED struct {
  byte      nam;
  word      prl_version;
  word      size;
  boolean   valid;
} nv_roaming_list_header_type;

/* Total size of header fields within nv_roaming_list_type */
#define NV_ROAMING_LIST_HEADER_SIZE  (sizeof(nv_roaming_list_header_type))

/* An always-invalid prl version number */
#define NV_PRL_VERSION_INVALID   0xFFFF

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
#ifdef NV_FEATURE_PRL_ITEMS
/* Type to hold the downloadable roaming messages */

#define NV_ROAM_MSG_MAX_SIZE    12  /* Up to 12 characters of text allowed */
#define NV_ROAM_MSG_MAX_ENTRIES  6  /* Up to 6 entries in the table */

typedef PACKED struct {
  byte      index;                       /* Which table entry to reference */
  byte      text[NV_ROAM_MSG_MAX_SIZE];  /* The roaming message text */
} nv_roam_msg_type;
#endif
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the MRU table (old format), along with the associated NAM. */
/* This type is now obsolete -- use MRU2 format below instead.             */

#define  NV_MRU_TABLE_SIZE 12       /* Table consists of 12 words */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  word      table[NV_MRU_TABLE_SIZE];
} nv_mru_table_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to hold the MRU table (new format), along with the associated NAM. */

#define  NV_MRU2_TABLE_SIZE 12       /* Table consists of 12 words */

/* Specifies the mode: AMPS or CDMA */
#define  NV_MODE_INACTIVE  0
#define  NV_MODE_ANALOG    1
#define  NV_MODE_CDMA      2

/* Specifies the cellular system type */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_SYSTEM_A,
  NV_SYSTEM_B,
  NV_SYSTEM_PAD = 0x7FFF             /* Pad to 16 bits on ARM */
} nv_system_type;
#endif

/* Specifies either a channel or cellular system */
typedef PACKED union {
  word            cdma_channel;     /* The CDMA channel to acquire */
  nv_system_type  cellular_system;  /* The cellular system: A or B */
} nv_cs_union_type;

/* An MRU2 Table entry */
typedef PACKED struct {
  byte              mode;           /* The mode: AMPS or CDMA */
  byte              band_class;     /* The band class: cellular or PCS */
  nv_cs_union_type  cs;             /* The CDMA channel or cellular system */
} nv_mru2_table_entry_type;

/* The MRU2 Table */
typedef PACKED struct {
  byte                      nam;     /* NAM id 0-N */
  nv_mru2_table_entry_type  entry[NV_MRU2_TABLE_SIZE];
} nv_mru2_table_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* For OTASP "commit" operation -- type to hold the mobile directory       */
/* number (per IS-683 section 3.5.2.2).                                    */

typedef PACKED struct {
  byte      nam;                          /* NAM id 0-N       */
  byte      n_digits;                     /* Number of digits */
  byte      digitn[NV_DIR_NUMB_PCS_SIZ];  /* The digits       */
} nv_mob_dir_data_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* For OTASP "commit" operation -- type to hold the CDMA NAM information   */
/* for 800 or 1900 MHz.  Includes information from the Cellular and/or     */
/* PCS parameter blocks (IS-683 sections 4.5.2.1 and  4.5.2.3).            */

typedef PACKED struct {
  byte     imsi_addr_num;     /* Number of IMSI address digits             */
  word     mcc;               /* Mobile country code                       */
  byte     imsi_11_12;        /* 11th and 12th digits of IMSI              */
  dword    imsi_s1;           /* Corresponds to old min1                   */
  word     imsi_s2;           /* Corresponds to old min2                   */
  byte     accolc;            /* Access overload class                     */
  boolean  mob_term_home;     /* Termination indicator for the home system */
  boolean  mob_term_for_sid;  /* Termination indicator for SID roaming     */
  boolean  mob_term_for_nid;  /* Termination indicator for NID roaming     */
  PACKED struct {
    word   sid;               /* System identification                     */
    word   nid;               /* Network identification                    */
#ifdef NV_FEATURE_SSPR_ENHANCEMENTS
  } pair[NV_MAX_HOME_SID_NID];
#else
  } pair[NV_MAX_SID_NID];
#endif
} nv_cdma_data_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* For OTASP "commit" operation -- type to hold the AMPS NAM information   */
/* for 800 MHz cellular.  Includes information from the Cellular parameter */
/* block (IS-683 section 4.5.2.1).                                         */

typedef PACKED struct {
  word     firstchp;          /* First paging channel for the home system  */
  word     home_sid;          /* Analog home system identification         */
} nv_amps_data_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* For OTASP "commit" operation -- type to hold the IMSI-T parameters.     */

typedef PACKED struct {
  dword    s1;
  word     s2;
  byte     imsi_t_11_12;
  word     mcc;
  byte     addr_num;
} nv_imsi_t_data_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* For OTASP "commit" operation -- type to hold the consolidated data to   */
/* be committed, along with control flags.                                 */

typedef PACKED struct {
  byte nam;                      /* Which NAM the data is for              */
  boolean commit_mob_dir;        /* Commit mobile directory number if set  */
  boolean commit_ftc_cdma;       /* Commit CDMA NAM information if set     */
  boolean commit_ftc_amps;       /* Commit AMPS NAM information if set     */
  boolean commit_roam_list;      /* Commit roaming list if set             */
  boolean commit_spc;            /* Commit SPC if set                      */
  boolean commit_imsi_t;         /* Commit IMSI_T parms if set             */
  boolean commit_nam_lock;       /* Commit NAM_LOCK parms if set           */
  nv_mob_dir_data_type mob_dir;          /* The data to commit to nv       */
  nv_cdma_data_type ftc_cdma;            /* The data to commit to nv       */
  nv_amps_data_type ftc_amps;            /* The data to commit to nv       */
  nv_roaming_list_type *roam_list_ptr;   /* The data to commit to nv       */
  nv_sec_code_type spc;                  /* The data to commit to nv       */
  nv_imsi_t_data_type imsi_t;            /* The data to commit to nv       */
  nv_enabled_type nam_lock;              /* The data to commit to nv       */
} nv_otasp_commit_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify which type of keypress sound should be emitted.         */

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_KEY_SOUND_CLICK,          /* Emit clicks for key presses */
  NV_KEY_SOUND_TONES,          /* Emit tones for key presses  */
  NV_KEY_SOUND_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
 } nv_key_sound_enum_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify which phone book sorting method is to be used.          */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_SORT_ALPHABETICAL,        /* Sort entries alphabetically */
  NV_SORT_BY_LOCATION,         /* Sort entries by location    */
  NV_DIALS_SORT_ENUM_PAD = 0x7FFF    /* Pad to 16 bits on ARM */
} nv_dials_sort_enum_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify which language to use for the user interface.           */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_LANGUAGE_ENGLISH,         /* Use English language    */
  NV_LANGUAGE_SPANISH,         /* Use Spanish language    */
  NV_LANGUAGE_FRENCH,          /* Use French language     */
  NV_LANGUAGE_PORTUGUESE,      /* Use Portuguese language */
  NV_LANGUAGE_ENUM_PAD = 0x7FFF  /* Pad to 16 bits on ARM */
} nv_language_enum_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type to specify the user interface menu format.                         */

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_MENU_FULL,                /* Display full menus   */
  NV_MENU_SHORT,               /* Display short menus  */
  NV_MONU_FORMAT_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
} nv_menu_format_enum_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for ISS2 dialing plan restriction levels.                          */

#define NV_DIAL_RESTRICT_LVLS_SIZE  10         /* Ten entries in the table */

typedef PACKED struct {
  byte  restriction_level[NV_DIAL_RESTRICT_LVLS_SIZE];
} nv_dial_restrict_lvls_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Types for ISS2 dialing plan state table.                                */

#define  NV_DIAL_STATE_TABLE_NEXT_STATES 12    /* 12 bytes per table entry */
#define  NV_DIAL_STATE_TABLE_MAX_SIZE   125    /* Number entries in table */

/* Type of the elements within the table.                                  */
typedef PACKED struct {
  byte  address;                                          /* Storage index */
  char  next_state[NV_DIAL_STATE_TABLE_NEXT_STATES];
  byte  timeout;
  byte  restriction_level;
  byte  remaining_digits;
} nv_dial_state_table_elem_type;

/* Type for the number of entries in the table.                            */
typedef PACKED struct {
  word  length;          /* Number of "elem_type" entries currently stored */
} nv_dial_state_table_len_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type definitions for Unwired Planet                                     */

#define  NV_UP_LINK_INFO_TABLE_SIZE    2  /* For 2 link info table records */
#define  NV_IP_ADDRESS_TABLE_SIZE      2  /* For 2 IP address records      */
#define  NV_IP_ADDRESSES_PER_ENTRY     4  /* For 4 IP addresses per record */
#define  NV_UP_MAX_KEY_SIZE           16  /* Max size of key field         */

/******************************************
 CHG 2001/05/30 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     NV_UP_MAX_PERM_STORE_SIZE(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
#define  NV_UP_MAX_PERM_STORE_SIZE    10  /* Max size of perm_store field  */
#else  /*** CHG ***/
#define  NV_UP_MAX_PERM_STORE_SIZE     6  /* Max size of perm_store field  */
#endif  /*** END OF CHG ***/

#define  NV_UP_ALERT_NAME_SIZE        11  /* Max size of alert_name field  */
#define  NV_UP_MAX_ALERT_RECORDS       9  /* Number of alert records       */
#define  NV_UP_MAX_CACHE_SIZE          1  /* Max size of the UP cache      */

typedef PACKED struct {
  byte   ip[NV_IP_ADDRESSES_PER_ENTRY];   /* IP address table              */
  word   port;                            /* Port address                  */
} nv_ip_address_type;

/* Type for NV_UP_LINK_INFO_I                                              */
typedef PACKED struct {
  byte   index;                           /* UP link info table index      */
  word   numAddr;                         /* Number of valid ip address    */
  nv_ip_address_type  addr[NV_IP_ADDRESS_TABLE_SIZE];
  byte   key_length;                      /* Length of key field           */
  byte   obsolete[NV_UP_MAX_KEY_SIZE];    /* Obsolete key (actual key is   */
} nv_up_link_info_type;                   /* stored in NV_UP_KEY_I)        */

/* Type for NV_UP_KEY_I                                                    */
typedef PACKED struct {
  byte   index;                           /* UP link info table index      */
  byte   key[NV_UP_MAX_KEY_SIZE];         /* Access key                    */
} nv_up_key_type;

/* Type for NV_UP_PARMS_I                                                  */
typedef PACKED struct {
  byte   curr_gateway;                    /* Last active IP address        */
  byte   alert_state;                     /* Last alert state              */
  byte   disconnect_timer;                /* Disconnect time-out value     */
  byte   perm_storage[NV_UP_MAX_PERM_STORE_SIZE];  /* "permanent storage"  */
} nv_up_parms_type;

/* Type for NV_UP_ALERTS_I                                                 */
typedef PACKED struct {
  byte   index;             /* To specify which of the 9 records to access */
  byte   alert_name[NV_UP_ALERT_NAME_SIZE];
  byte   alert_status;
  word   alert_id;
} nv_up_alert_record_type;

/* Type for NV_UP_CACHE_I                                                  */
typedef PACKED struct {
  byte   cache[NV_UP_MAX_CACHE_SIZE];     /* The UP cache                  */
} nv_up_cache_type;

/* Same structure as nv_up_cache_type but for use in union nv_item_type    */
typedef PACKED struct {
  byte   cache[1];
} nv_up_cache_union_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type definitions for DTACO                                              */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_DTACO_DISABLED,                      /* DTACO disabled                */
  NV_DTACO_ENABLED,                       /* DTACO enabled                 */
  NV_DTACO_ENABLED_ON_FLIP,               /* DTACO enabled on flip         */
  NV_DTACO_ENUM_PAD = 0x7FFF              /* Pad to 16 bits on ARM */
} nv_dtaco_enum_type;
#endif

typedef PACKED struct {
  nv_dtaco_enum_type  dtaco_control;
} nv_dtaco_control_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type definitions for BORSCHT items.                                     */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_EVRC_1ST,                            /* Priority: EVRC first          */
  NV_EVRC_13K_1ST,                        /* Priority: 13K first           */
  NV_EVRC_PRI_ENUM_PAD = 0x7FFF           /* Pad to 16 bits on ARM */
} nv_evrc_pri_enum_type;
#endif


#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_V52_DISABLED = 0,    /* V5.2 support disabled, functionality bypassed */
  NV_V52_ENABLED,         /* V5.2 support enabled, with no local buffering */
  NV_V52_LOCAL_BUFFERING, /* V5.2 support enabled, with local buffering    */
  NV_V52_FUTURE_SUPPORT,  /* V5.2 support reserved field                   */
  NV_V52_CONTROL_ENUM_PAD = 0x7FFF /* Pad to 16 bits on ARM */
} nv_v52_control_enum_type;
#endif


#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_AFAX_ETE,                            /* Analog Fax end-to-end         */
  NV_AFAX_CLASS2,                         /* Analog Fax Class 2.0 Fax      */
  NV_AFAX_ENUM_PAD = 0x7FFF               /* Pad to 16 bits on ARM */
} nv_afax_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type definitions for Carrier Info items.                                */

#define  NV_CARRIER_INFO_ELEMENT_SIZE  100  /* 100 bytes per entry         */
#define  NV_CARRIER_INFO_MAX_ELEMENTS    3  /* Max of 3 entries allowed    */

typedef PACKED struct {
  byte   element;                           /* Element ID: 0, 1, or 2      */
  byte   data[NV_CARRIER_INFO_ELEMENT_SIZE];
} nv_carrier_info_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/


#ifdef FEATURE_EVRC_SO_MGMT
/* Type for EVRC preferred voice service options.                          */

typedef PACKED struct {
  byte      nam;                    /* NAM id 0-N */
  boolean   evrc_capability_enabled;
  word      home_page_voice_so;
  word      home_orig_voice_so;
  word      roam_orig_voice_so;
} nv_pref_voice_so_type;
#endif
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Definitions for Micro Browser data table item.                          */

#define NV_UBROWSER_ELEMENT_SIZE  64

/******************************************
 CHG 2001/05/30 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     NV_UBROWSER_TABLE_SIZE(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
#define NV_UBROWSER_TABLE_SIZE    30
#else  /*** CHG ***/
#define NV_UBROWSER_TABLE_SIZE    32
#endif  /*** END OF CHG ***/

typedef PACKED struct {
  byte            index;                            /* Which array element */
  byte            data[NV_UBROWSER_ELEMENT_SIZE];   /* The data */
} nv_ubrowser_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Definitions for PN ID table.                                            */

#define NV_PN_ID_TABLE_SIZE       2048

typedef PACKED struct {
  byte            data[NV_PN_ID_TABLE_SIZE];
} nv_pn_id_type;

/* Same structure as nv_pn_id_type but for use in union nv_item_type       */
typedef PACKED struct {
  byte            data[1];
} nv_pn_id_union_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_USER_ZONE
#error code not present
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Definitions for Password Authentication Protocol (PAP) items.           */

#define NV_MAX_PAP_USER_ID_LENGTH  64    /* Max of 64 chars in User ID */
#define NV_MAX_PAP_PASSWORD_LENGTH 14    /* Max of 14 chars in Password */

#if (defined (FEATURE_DS_PAP) || defined (FEATURE_DS_CHAP) )
typedef PACKED struct {
  byte      user_id_len;                           /* Length of user_id */
  byte      user_id[NV_MAX_PAP_USER_ID_LENGTH];    /* The user_id */
} nv_pap_user_id_type;

typedef PACKED struct {
  byte      password_len;                          /* Length of password */
  byte      password[NV_MAX_PAP_PASSWORD_LENGTH];  /* The password */
} nv_pap_password_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* Size of all tables based on frequency   */
#define NV_FREQ_TABLE_SIZ             16
/* Size of all tables based on temperature */
#define NV_TEMP_TABLE_SIZ              8
#define NV_TEMP_TABLE2_SIZ            16

#define NV_NUM_PA_RANGES 4

#if (defined FEATURE_PA_RANGE_DIG_COMP || defined FEATURE_PA_RANGE_TEMP_FREQ_COMP)
typedef PACKED struct {
  int2      offset;
  int1      temp_adj[NV_TEMP_TABLE_SIZ];
  int1      freq_adj[NV_FREQ_TABLE_SIZ];
} nv_pa_offset_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* CDMA Tx linearizer master offset size */
#define NV_CDMA_TX_LIN_MASTER_SIZ     36

#ifdef FEATURE_4PAGE_TX_LINEARIZER

/******************************************
 CHG 2001/06/28 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     NV_NUM_TX_LINEARIZERS(SONY_SYS_NV)
*******************************************/
#if 0  /*** CHG ***/
#define NV_NUM_TX_LINEARIZERS 4
#else  /*** CHG ***/
#define NV_NUM_TX_LINEARIZERS 2
#endif  /*** END OF CHG ***/

typedef PACKED struct
{
  int2      offset;
  byte      slope[NV_CDMA_TX_LIN_MASTER_SIZ];
} nv_tx_linearizer_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_BROADCAST_SMS
/* Definitions for Broadcast SMS items.                                    */
#define NV_SMS_MAX_SERVICES  32
/* Limit the table size with EEPROM */
  #ifdef FEATURE_NV_ITEM_MGR
     #define NV_SMS_MAX_LANGUAGES  4
  #else
     #define NV_SMS_MAX_LANGUAGES  1
  #endif
#define NV_SMS_BC_TABLE_SIZE  (NV_SMS_MAX_SERVICES*NV_SMS_MAX_LANGUAGES)
#define NV_SMS_BC_SRV_LABEL_SIZE 10

typedef PACKED struct
{
  byte     index;
  boolean  active_service; /* for delete operation */
  word     service;
  byte     language;
  boolean  selected;
  byte     priority;
  char     label[NV_SMS_BC_SRV_LABEL_SIZE]; /* a UI text label for each service/language pair */
} nv_sms_bc_service_table_type;

#endif
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_RUIM_CHV_FROM_NV

#define NV_RUIM_CHV_SIZE 8                /* Number of bytes in an R-UIM CHV */
typedef PACKED struct
{
  byte     digits[NV_RUIM_CHV_SIZE];
} nv_ruim_chv_type;

#endif
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_GPSONE

typedef enum {
  NV_IP_TRANSPORT,
  NV_DBM_TRANSPORT,
  NV_GPS1_TRANSPORT_RANGE = 0x10000000
} nv_gps1_transport_type;

#define NV_GPS1_TRANSPORT nv_gps1_transport_type

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_POSITION_CALC_MOBILE,
  NV_POSITION_CALC_PDE,
  NV_GPS1_POSITION_CALC_ENUM_PAD = 0x7FFF        /* Pad to 16 bits on ARM */
} nv_gps1_position_calc_type;
#endif

#define NV_GPS1_POSITION_CALC nv_gps1_position_calc_type

#endif

/*-------------------------------------------------------------------------*/
/* Type of IS2000 CAI radio configuration RC preference                    */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_CAI_RC_1 = 1,
  NV_CAI_RC_2,
  NV_CAI_RC_3,
  NV_CAI_RC_4,
  NV_CAI_RC_5,
  NV_RC_PREF_ENUM_PAD = 0x7FFF               /* Pad to 16 bits on ARM */
} nv_rc_pref_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_TX_COMP0_I, NV_TX_COMP1_I, NV_TX_COMP2_I, NV_TX_COMP3_I      */

typedef PACKED struct {
  int1      nv_cdma_tx_lin_vs_temp[NV_TEMP_TABLE_SIZ];
  int1      nv_cdma_tx_slp_vs_temp[NV_TEMP_TABLE_SIZ];
  int1      nv_cdma_tx_comp_vs_freq[NV_FREQ_TABLE_SIZ];
} nv_tx_comp_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_RUIM_SMS_STATUS_I                                            */

typedef PACKED struct {
  word msg_id;
  word wap_msg_id;
  boolean mem_avail;
} nv_ruim_sms_status_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_DIAG_RESTART_CONFIG_I                                        */

#define  NV_DIAG_RESTART_CONFIG_LOGMASK_SIZE  16
typedef PACKED struct {
  uint8 event_config;
  uint8 msg_level;
  uint8 logmask[NV_DIAG_RESTART_CONFIG_LOGMASK_SIZE];
  uint8 reserved[4];
} nv_diag_restart_config_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Enumeration of system selection band and sub-band preference            */
#ifdef FEATURE_SD20
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_BAND_PREF_BC0_A = 0x0001, /* Acquire band class 0, A-Side systems only */
  NV_BAND_PREF_BC0_B = 0x0002, /* Acquire band class 0, B-Side systems only */
  NV_BAND_PREF_BC0   = 0x0003, /* Acquire band class 0 systems only */
  NV_BAND_PREF_BC1   = 0x0004, /* Acquire band class 1 systems only */
  NV_BAND_PREF_BC3   = 0x0010, /* Acquire band class 3 systems only */
  NV_BAND_PREF_BC4   = 0x0020, /* Acquire band class 4 systems only */
  NV_BAND_PREF_BC5   = 0x0040, /* Acquire band class 5 systems only */
  NV_BAND_PREF_ANY   = 0xFFFF, /* Acquire any band class systems */
} nv_band_pref_enum_type;
#endif

/* Type to hold system selection band and sub-band preference,             */
/* along with the associated NAM id.                                       */

typedef PACKED struct {
  byte                    nam;                    /* NAM id 0-N */
  nv_band_pref_enum_type  band;                   /* prefered band */
} nv_band_pref_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Enumeration of system selection roam preferences            */

#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_ROAM_PREF_HOME  = 0x01, /* Acquire band class 0, A-Side systems only */
  NV_ROAM_PREF_AFFIL = 0x03, /* Acquire band class 0, B-Side systems only */
  NV_ROAM_PREF_ANY   = 0xFF, /* Acquire band class 0 systems only */
  NV_ROAM_PREF_ENUM_PAD = 0x7FFF               /* Pad to 16 bits on ARM */
} nv_roam_pref_enum_type;
#endif

/* Type to hold system selection roam preference,                          */
/* along with the associated NAM id.                                       */

typedef PACKED struct {
  byte                    nam;                    /* NAM id 0-N */
  nv_roam_pref_enum_type  roam;                   /* prefered roam */
} nv_roam_pref_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_BD_ADDR_I                                                    */

#define  NV_BD_ADDR_SIZE  6
typedef PACKED struct {
  uint8 bd_addr[NV_BD_ADDR_SIZE];
} nv_bd_addr_type;

/*-------------------------------------------------------------------------*/
/* Type of DATA SERVICES default SIO baud rate                             */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_SIO_BAUDRATE_AUTO = 0,
  NV_SIO_BAUDRATE_45,
  NV_SIO_BAUDRATE_50,
  NV_SIO_BAUDRATE_75,
  NV_SIO_BAUDRATE_110,
  NV_SIO_BAUDRATE_150,
  NV_SIO_BAUDRATE_300,
  NV_SIO_BAUDRATE_600,
  NV_SIO_BAUDRATE_1200,
  NV_SIO_BAUDRATE_2400,
  NV_SIO_BAUDRATE_4800,
  NV_SIO_BAUDRATE_9600,
  NV_SIO_BAUDRATE_14400,
  NV_SIO_BAUDRATE_19200,
  NV_SIO_BAUDRATE_38400,
  NV_SIO_BAUDRATE_57600,
  NV_SIO_BAUDRATE_76800,
  NV_SIO_BAUDRATE_115200,
  NV_SIO_BAUDRATE_230400,
  NV_SIO_BAUDRATE_BEST=0x7FFE,
  NV_SIO_BAUDRATE_MAX=0x7FFF
} nv_sio_baudrate_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_JCDMA_DS_F92_I                                               */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum {
  NV_JCDMA_DS_F92_ASYNC_FAX_96 = 0,       /* Async/Fax 9600bps */
  NV_JCDMA_DS_F92_ASYNC_FAX_144,          /* Async/Fax 14400bps */
  NV_JCDMA_DS_F92_PACKET_96,              /* Packet 9600bps */
  NV_JCDMA_DS_F92_PACKET_144,             /* Packet 14400bps */
  NV_JCDMA_DS_F92_PACKET_HIGH,            /* Packet 64kbps */
  NV_JCDMA_DS_F92_ENUM_PAD = 0x7fff       /* Pad to 16 bits on ARM */
} nv_jcdma_ds_f92_enum_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_DS_MIP_GEN_USER_PROF_I                                       */
typedef PACKED struct {
  byte      index;
  byte      nai_length;
  char      nai[NV_MAX_NAI_LENGTH];
  boolean   mn_ha_spi_set;
  dword     mn_ha_spi;
  boolean   mn_aaa_spi_set;
  dword     mn_aaa_spi;
  boolean   rev_tun_pref;
  dword     home_addr;
  dword     primary_ha_addr;
  dword     secondary_ha_addr;
} nv_ds_mip_gen_user_prof_type;

/* Type of NV_DS_MIP_SS_USER_PROF_I                                        */
typedef PACKED struct {
  byte      index;
  byte      mn_ha_shared_secret_length;
  byte      mn_ha_shared_secret[NV_MAX_MN_HA_SHARED_SECRET_LEN];
  byte      mn_aaa_shared_secret_length;
  byte      mn_aaa_shared_secret[NV_MAX_MN_AAA_SHARED_SECRET_LEN];
} nv_ds_mip_ss_user_prof_type;


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
#ifdef FEATURE_HDR
#error code not present
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_DS_MIP_MN_HA_TIME_DELTA_I                                           */
typedef PACKED struct {
  byte      index;
  uint32    time_delta;
} nv_ds_mip_mn_ha_time_delta_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_HDRFMAC_DRC_LOCK_I                                           */
typedef PACKED struct {
  uint8     drc_lock_length;
  uint8     drc_lock_period;
} nv_hdrfmac_drc_lock_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_TTY_I                                           */
#ifdef FEATURE_NV_ENUMS_ARE_WORDS
#error code not present
#else
typedef enum
{
    NV_TTY_FULL = 0,
    NV_TTY_TALK,
    NV_TTY_HEAR,
    NV_TTY_OFF,
    NV_TTY_ENUM_PAD = 0x7fff
} nv_tty_enum_type;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_HDR_AN_AUTH_NAI_I                                           */
#define NV_MAX_AN_AUTH_NAI_LENGTH   64

typedef PACKED struct {
  byte  nai_len;  /* length of NAI */
  byte  nai[NV_MAX_AN_AUTH_NAI_LENGTH];  /* the NAI */
} nv_hdr_an_auth_nai_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_HDR_AN_AUTH_PASSWORD_I                                           */
#define NV_MAX_AN_AUTH_PASSWORD_LENGTH   14

typedef PACKED struct {
  byte  password_len;  /* length of NAI */
  byte  password[NV_MAX_AN_AUTH_PASSWORD_LENGTH];  /* the password */
} nv_hdr_an_auth_password_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_PUZL_I                                                       */
#define NV_PUZL_MAX_SIZE    1024

typedef PACKED struct {
  byte    nam;
  word    size;
  boolean valid;
  byte    puzl[NV_PUZL_MAX_SIZE];
} nv_ram_puzl_list_type;

/* Same structure as ram_puzl_list_type but for use in union nv_item_type */
typedef PACKED struct {
  byte      nam;
  word      size;
  boolean   valid;
  byte      puzl[1];
} nv_ram_puzl_list_union_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_HDRKEP_CONFIG_I                                              */
#define NV_RPC_AUTH_KEY_MAX_LEN 20

typedef PACKED struct {
  uint16  key_len;
  boolean keys_are_valid;
  uint8   rpc_auth_key[NV_RPC_AUTH_KEY_MAX_LEN];
} nv_hdrkep_config_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type of NV_HDRAUTH_CONFIG_I                                             */

typedef PACKED struct {
  uint16  ac_auth_key_len;
} nv_hdrauth_config_type;


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* nv_rxFront1_spare_type: Sturcture to hold RxFront NV Items.
   Total space required: 120 bytes
*/
typedef PACKED struct {

    dword   rfnv_fm_b_amp_adj_coeff;
    dword   rfnv_digital_b_amp_adj_coeff;
    dword   rfnv_gps_b_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_a1_amp_adj_coeff;
    dword   rfnv_digital_a1_amp_adj_coeff;
    dword   rfnv_gps_a1_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_a2_amp_adj_coeff;
    dword   rfnv_digital_a2_amp_adj_coeff;
    dword   rfnv_gps_a2_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_a3_amp_adj_coeff;
    dword   rfnv_digital_a3_amp_adj_coeff;
    dword   rfnv_gps_a3_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_a4_amp_adj_coeff;
    dword   rfnv_digital_a4_amp_adj_coeff;
    dword   rfnv_gps_a4_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_c1_amp_adj_coeff;
    dword   rfnv_digital_c1_amp_adj_coeff;
    dword   rfnv_gps_c1_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_c2_amp_adj_coeff;
    dword   rfnv_digital_c2_amp_adj_coeff;
    dword   rfnv_gps_c2_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_d1_amp_adj_coeff;
    dword   rfnv_digital_d1_amp_adj_coeff;
    dword   rfnv_gps_d1_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_fm_d2_amp_adj_coeff;
    dword   rfnv_digital_d2_amp_adj_coeff;
    dword   rfnv_gps_d2_amp_adj_coeff;
    /*----------------------------------*/
    dword   rfnv_dc_offset_pdm_polarity;
    /*----------------------------------*/

} nv_rxFront1_spare_type;


/* nv_rxFront2_spare_type: Sturcture to hold RxFront NV Items.
   Total space required:  99 bytes
*/
typedef PACKED struct {

    /*----------------------------------*/
    dword   rfnv_fm_cg_acq_offset_scaler;
    dword   rfnv_digital_cg_acq_offset_scaler;
    dword   rfnv_gps_cg_acq_offset_scaler;
    /*----------------------------------*/
    dword   rfnv_fm_cg_trk_offset_scaler;
    dword   rfnv_digital_cg_trk_offset_scaler;
    dword   rfnv_gps_cg_trk_offset_scaler;
    /*----------------------------------*/
    dword   rfnv_fm_fg_acq_offset_scaler;
    dword   rfnv_digital_fg_acq_offset_scaler;
    dword   rfnv_gps_fg_acq_offset_scaler;
    /*----------------------------------*/
    dword   rfnv_dacc_dc_offset_polarity;
    /*----------------------------------*/
    dword   rfnv_fm_rxf_dc_ioffset_adj;
    dword   rfnv_digital_rxf_dc_ioffset_adj;
    dword   rfnv_gps_rxf_dc_ioffset_adj;
    /*----------------------------------*/
    dword   rfnv_fm_rxf_dc_qoffset_adj;
    dword   rfnv_digital_rxf_dc_qoffset_adj;
    dword   rfnv_gps_rxf_dc_qoffset_adj;
    /*----------------------------------*/
    dword   rfnv_fm_cg_lna_acq_time;
    dword   rfnv_digital_cg_lna_acq_time;
    dword   rfnv_gps_cg_lna_acq_time;
    /*----------------------------------*/
    dword   rfnv_fm_dacc_acq_time;
    dword   rfnv_digital_dacc_acq_time;
    dword   rfnv_gps_dacc_acq_time;
    /*----------------------------------*/
    byte    rfnv_fm_dacc_clr_timer;
    byte    rfnv_digital_dacc_clr_timer;
    byte    rfnv_gps_dacc_clr_timer;
    /*----------------------------------*/
    word    rfnv_cdma_phase_del;
    word    rfnv_pcs_phase_del;
    word    rfnv_dfm_phase_del;
    word    rfnv_gps_phase_del;
    /*----------------------------------*/

} nv_rxFront2_spare_type;

/* nv_rxFront3_spare_type: Sturcture to hold RxFront NV Items.
   Total space required: 65 bytes
*/
typedef PACKED struct {

    /*----------------------------------*/
    word    rfnv_cdma_lna_s0_phase_offset;
    word    rfnv_pcs_lna_s0_phase_offset;
    /*----------------------------------*/
    word    rfnv_cdma_lna_s1_phase_offset;
    word    rfnv_pcs_lna_s1_phase_offset;
    /*----------------------------------*/
    word    rfnv_cdma_lna_s2_phase_offset;
    word    rfnv_pcs_lna_s2_phase_offset;
    /*----------------------------------*/
    word    rfnv_cdma_lna_s3_phase_offset;
    word    rfnv_pcs_lna_s3_phase_offset;
    /*----------------------------------*/
    word    rfnv_cdma_lna_s4_phase_offset;
    word    rfnv_pcs_lna_s4_phase_offset;
    /*----------------------------------*/
    byte    rfnv_df2_dc_offset;
    /*----------------------------------*/
    dword   rfnv_cdma_est_acq_offset_scaler;
    dword   rfnv_pcs_est_acq_offset_scaler;
    dword   rfnv_dfm_est_acq_offset_scaler;
    dword   rfnv_gps_est_acq_offset_scaler;
    /*----------------------------------*/
    dword   rfnv_cdma_est_trc_offset_scaler;
    dword   rfnv_pcs_est_trc_offset_scaler;
    dword   rfnv_dfm_est_trc_offset_scaler;
    dword   rfnv_gps_est_trc_offset_scaler;
    /*----------------------------------*/
    dword   rfnv_fm_dacc_trc_time;
    dword   rfnv_digital_dacc_trc_time;
    dword   rfnv_gps_dacc_trc_time;
    /*----------------------------------*/

} nv_rxFront3_spare_type;

/* cagc_spare_type: Structure to hold CAGC NV Items.
   Total space required: 17 bytes
*/
typedef PACKED struct {

    byte    rfnv_mixer_polarity;
    word    rfnv_lna_bypass_timer_0;
    word    rfnv_lna_bypass_timer_1;
    word    rfnv_lna_bypass_timer_2;
    word    rfnv_lna_bypass_timer_3;
    word    rfnv_lna_non_bypass_timer_0;
    word    rfnv_lna_non_bypass_timer_1;
    word    rfnv_lna_non_bypass_timer_2;
    word    rfnv_lna_non_bypass_timer_3;

} nv_cagc_spare_type;

/* dfm_spare_type: Structure to hold DFM NV Items.
   Total spce required: 9 bytes
*/
typedef PACKED struct {

    word    rfnv_dfm_lna_bypass_timer;
    word    rfnv_dfm_lna_nonbypass_timer;
    byte    rfnv_dfm_lna_follower_delay;
    word    rfnv_dfm_lna_range_delay;
    byte    rfnv_dfm_lna_decision_delay;
    byte    rfnv_dfm_lna_polarity;

} nv_dfm_spare_type;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/******************************************
 ADD 2001/06/01 ichikawa@MYTECS
     For Temporary.
     Copyed from "ApiDBSize.h"(ptx600)
     (SONY_SYS_NV_TEMP)
*******************************************/
#define NUM_NETCONFID      8  /* ﾈｯﾄﾜｰｸ設定認証用ID番号 */
#define NUM_NETCONFPW      8  /* ﾈｯﾄﾜｰｸ設定認証用ﾊﾟｽﾜｰﾄﾞ  */

/* E-mail サーバー設定  */
#define EMAIL_MYADDRESS_MAX     50    /* IMAP4ｻｰﾊﾞ用Eﾒｰﾙｱﾄﾞﾚｽ */
#define EMAIL_RADIUS_ID_MAX     40    /* Radius Login ID    */
#define EMAIL_RADIUS_PASSWORD_MAX 16    /* Radius Password    */ // 2000.10.06 gon nvPasswd
#define EMAIL_IMAP4_ID_MAX      20    /* IMAP4 Login ID   */
#define EMAIL_DOMAIN_NAME_MAX   19    /* 接続先名称     */
#define EMAIL_SERVER_URL_MAX    50    /* ﾒｰﾙ設定用URL     */

/* Ez サーバー設定  */
#define EZ_DOMAIN_NAME_MAX      20    /* EZｻｰﾊﾞの属するﾄﾞﾒｲﾝ名  */
#define EZ_RADIUS_ID_MAX      40    /* EZｻｰﾊﾞ用の認証ID     */
#define EZ_RADIUS_PASSWORD_MAX    16    /* EZｻｰﾊﾞ用の認証ﾊﾟｽﾜｰﾄﾞ  */ // 2000.10.06 gon nvPasswd

/* P-SMS PPPサーバー設定 */
#define PPP_RADIUS_ID_MAX     40    /* P-SMS PPPｻｰﾊﾞ用の認証ID    */
#define PPP_RADIUS_PASSWORD_MAX   16    /* P-SMS PPPｻｰﾊﾞ用の認証ﾊﾟｽﾜｰﾄﾞ */ // 20
/*** END OF ADD ***/

/******************************************
 ADD 2001/05/30 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV)
*******************************************/
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_ID_PHONENUM_I                                               */
typedef PACKED struct {
  byte      data[12];
} nv_id_phonenum_type ;

/* Type for NV_ID_MANUFNUM_I                                               */
typedef PACKED struct {
  byte      data[8];
} nv_id_manufnum_type ;

/* Type for NV_X_KEY_I                                                     */
typedef PACKED struct {
  byte      data[8];
} nv_x_key_type ;

/* Type for NV_Y_KEY_I                                                     */
typedef PACKED struct {
  byte      data[8];
} nv_y_key_type ;

/* Type for NV_Z_KEY_I                                                     */
typedef PACKED struct {
  byte      data[8];
} nv_z_key_type ;

/* Type for NV_ID_KEY_I                                                    */
typedef PACKED struct {
  byte      data[10];
} nv_id_key_type ;

/* Type for NV_BB_LCD_RED_I, NV_BB_LCD_GREEN_I, NV_BB_LCD_BLUE_I           */
typedef PACKED struct {
  unsigned short     value[8];
} nv_color_step_type;

/*---------------------------------*/
/* P-SMS系 */

/* Type for NV_UP_PPP_RADIUS_ID_I                                          */
typedef PACKED struct {
  byte      value[PPP_RADIUS_ID_MAX+1];
} nv_ppp_radius_id_type;

/* Type for NV_UP_PPP_RADIUS_PASS_I                                        */
typedef PACKED struct {
  byte      value[PPP_RADIUS_PASSWORD_MAX+1];
} nv_ppp_radius_pass_type;

/*** END OF ADD ***/

/******************************************
 ADD 2001/07/13 ichikawa@MYTECS
     (SONY_SYS_NV)
*******************************************/
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* Type for NV_F_MANUF00_I 〜 NV_F_MANUF17_I                                                   */
typedef PACKED struct {
  byte      data[12];
} nv_f_manuf_type ;

/* 2001/09/20 H.Sawada */
/* Add Item Data Type */
/* Type for NV_VC_TCXO_F_I                                                  */
typedef PACKED struct {
  byte      data[5];
} nv_vc_tcxo_f_type ;

/* Type for NV_TX_MAX_I                                                    */
typedef PACKED struct {
  byte      data[8];
} nv_tx_max_type ;

/* Type for NV_MAX_POW_I                                                   */
typedef PACKED struct {
  byte      data[16];
} nv_max_power_type ;

/* Type for NV_MIN_POW_I                                                   */
typedef PACKED struct {
  byte      data[16];
} nv_min_power_type ;

/* Type for NV_CURRENT_I                                                   */
typedef PACKED struct {
  byte      data[16];
} nv_current_type ;

/* Type for NV_VC_TCXO_V_I                                                 */
typedef PACKED struct {
  byte      data[5];
} nv_vc_tcxo_v_type ;

/*** END OF ADD ***/

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/******************************************
 ADD 2001/09/10 ichikawa@MYTECS
     For Get item info
     (SONY_SYS_NV_GET_INFO)
*******************************************/
typedef PACKED struct {
  char      item_name[NV_ITEMNAME_MAXSIZE+1];        /* Item name */
  boolean   array_f;              /* Is array? */
  byte      array_cnt;            /* array count */
  char      fname[NV_FILENAME_MAXSIZE+1];            /* Storage file name */
  dword     pos_info;             /* Item offset in file */
  word      item_size;            /* Item size */
  boolean   active_f;             /* Has Item "Active flag"? */
} nv_get_item_info_type;
/*** END OF ADD ***/

/******************************************
 ADD 2001/08/06 ichikawa@MYTECS
     For NV device init
     (SONY_SYS_NV_FORMAT)
*******************************************/
typedef PACKED struct {
  boolean   e2p_init_f;           /* EEPROM device initial flag */
  boolean   efs_init_f;           /* NV EFS file initial flag */
} nv_dev_init_type;
/*** END OF ADD ***/

/******************************************
 ADD 2001/07/17 ichikawa@MYTECS
     For Update Active_f Feature
     (SONY_SYS_NV_UPDATE_ACT)
*******************************************/
typedef PACKED struct {
  byte      nam;                  /* NAM id */
  boolean   active_f;             /* active flag */
} nv_update_act_type;
/*** END OF ADD ***/

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* Values for NV_MAX_TX_ADJ_I                                              */

#define NV_MUTE_NORM 0
#define NV_MUTE_MUTE 1
#define NV_MUTE_SPKR 2

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Stack-checker diagnostic item sizes                                     */

#define NV_SI_TEST_DATA_SIZE  100  /* 100 bytes for each of two items */

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Array size for NV_FACTORY_INFO_I                                        */

#define NV_FACTORY_INFO_SIZ  100

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Definitions for Port mode                                               */

#define NV_PORT_SYNC_MODE     0      /* Sync (HDLC) mode for port */
#define NV_PORT_BAUD_96_MODE  1      /* 9600 Baud mode */
#define NV_PORT_BAUD_192_MODE 2      /* 19200 Baud mode */
#define NV_PORT_BAUD_384_MODE 3      /* 38400 Baud mode */

/*-------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------*/

/* Portable RF Turnaround Compensation Table Sizes                         */

#define NV_RIPPLE_COMP_TABLE_SIZ      32
#define NV_RX_OFFSET_TABLE_SIZ        32
#define NV_RX_POWER_TABLE_SIZ        128
#define NV_RX_ERROR_TABLE_SIZ        128
#define NV_TX_SLOPE_1_TABLE_SIZ      128
#define NV_TX_SLOPE_2_TABLE_SIZ      128
#define NV_TX_NON_LIN_ERR_TABLE_SIZ  128
#define NV_HDET_TABLE_SIZ             64

#define NV_PWR_TABLE_SIZ   16  /* size of all tables based on power level */
#define NV_VOLT_TABLE_SIZ   8  /* size of all tables based on battery voltage */

/* CDMA Rx linearizer offset size */
#define NV_CDMA_RX_LIN_SIZ            16
/* PCS Rx linearizer offset size  */
#define NV_PCS_RX_LIN_SIZ             16

/* CDMA Tx linearizer master offset size */
#define NV_CDMA_TX_LIN_MASTER_SIZ     36
/* PCS Tx linearizer master offset size  */
#define NV_PCS_TX_LIN_MASTER_SIZ      36

/* CDMA expected HDET reading vs AGC PDM size */
#define NV_CDMA_EXP_HDET_VS_AGC_SIZ   16
/* PCS expected HDET reading vs AGC PDM size */
#define NV_PCS_EXP_HDET_VS_AGC_SIZ    16
#define NV_CDMA_ERR_SLP_VS_HDET_SIZ  8 /* CDMA HDET error slope vs HDET reading size */
#define NV_ADJ_VS_FREQ_SIZ           16
#define NV_ADJ_VS_TEMP_SIZ            8

#ifdef FEATURE_MULTIMEDIA
  #define NV_FS_FILENAME_MAX_LENGTH  40
#endif

#define NV_TX_BACKOFF_TABLE_SIZE     20
#define NV_NUM_PA_BCKOFF_CAL_VOLT    3
#define NV_NUM_DS_MIP_MN_HA_TIME_DELTA  6

/******************************************
 ADD 2001/05/30 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV)
*******************************************/
#define NV_INIT_MIN1  0x565f15
#define NV_INIT_MIN2  0xc

#define NV_CDMA_TX_LIN_SIZ            16
#define NV_RX_LIN_OFF_SIZ             11
#define NV_TX_LIN_MASTER_OFF_SIZ       8
#define NV_TX_LIN_MASTER_SLP_SIZ      16
#define NV_LNA_RANGE_SIZ              11
#define NV_PA_R1_SIZ                   9
#define NV_TX_AGC_COMP_SIZ             8
#define NV_TX_LIMITER_SIZ              9
#define NV_TEMP_TABLES_SIZ            17
#define NV_TEMP_TABLES_X3_SIZ         51
#define NV_TEMP_BLOCK_SIZ              4
#define NV_MARKOV_TX_SIZ               8
#define NV_PA_VREF_SIZ                 2

#define FREQ_DIV_NUM                5
#define NV_BASE                     0
#define NV_RX_TL                    8
#define NV_RX_TH                    9
#define NV_RX_IDLE                 10
#define NV_TX_VH                    8

/* 2001/09/19 H.Sawada */
/* Add define */
#define FA_PRO_ADDRESS_SIZ             15
#define FA_PRO_PORT_MAX                 8
#define FA_PRO_E2EPORT_SIZ              8
#define FA_PRO_LXLPORT_SIZ              8
#define FA_PRO_USERID_SIZ              11
#define FA_RAD_ID_SIZ                  40
#define FA_RAD_PASSWORD_SIZ            16
#define FA_PRO_DOMAIN_SIZ             128 /* 変更 2001/10/18 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */
#define EMAIL_USER_ADDRESS_SIZ        129
#define EMAIL_USER_ID_SIZ              64
#define EMAIL_SERVER_ADDRESS_SIZ        8
#define EMAIL_RADIUS_ID_SIZ            40
#define EMAIL_RADIUS_PASSWORD_SIZ       8
#define EMAIL_UTILITY_URL_SIZ          50
#define LOCATION_ADDRESS_SIZ            8
#define LOCATION_RADID_SIZ             40
#define LOCATION_RADIUS_PASSWORD_SIZ    8
#define WAP_PROXY_DOMAIN_SIZ           26
#define WAP_RADIUS_ID_SIZ              40
#define WAP_RADIUS_PASSWORD_SIZ         8
#define WAP_LOCAL_TIME_SIZ              4
/* ↑Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */
#define SRCH_QPCH_SIZ                 127
/* ↑Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/12/04 Y.Miyaguni(メタテクノ) */
#define SMS_CHAT_GW_ADDRESS_SIZ         8
#define SMS_GAME_GW_ADDRESS_SIZ         8
/* ↑Item追加 2001/12/04 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2002/05/23 H.Sawada(メタテクノ) */
#define NV_TEMP_COMP_OFF_FRQ_SIZ        119
/* ↑Item追加 2001/05/23 H.Sawada(メタテクノ) */


/*** END OF ADD ***/


/*=========================================================================*/

/* NVM items union type.  The union is ordered according to the            */
/* NV_xxx_I enum items ordering.  Note that when the caller defines        */
/* or allocates a buffer of this union type, the largest member of         */
/* this union defines the size, and caution should be then exercised.      */
/* The largest member is nv_sms_type                                       */

/*-------------------------------------------------------------------------*/

typedef PACKED union {

/*-------------------------------------------------------------------------*/

/* Physical NAM parameters.                                                */

/*-------------------------------------------------------------------------*/

/* Type for NV_ESN_I item.                                                 */
/* -----------------------                                                 */

  nv_esn_type        esn;

/* Type for NV_ESN_CHKSUM_I item.                                          */
/* ------------------------------                                          */

  nv_esn_chksum_type esn_chksum;

/* Type for NV_VERNO_MAJ_I item.                                           */
/* -----------------------------                                           */
/* This is the NV major version number.  Changing the major (or minor)     */
/* version number forces an NV rebuild.                                    */

  byte         verno_maj;

/* Type for NV_VERNO_MIN_I item.                                           */
/* -----------------------------                                           */
/* This is the NV minor version number.  Changing the minor (or major)     */
/* version number forces an NV rebuild.                                    */

  byte         verno_min;

/* Type for NV_SCM_I item.                                                 */
/* -----------------------                                                 */
/* The SCM is 8 bits, per CAI section 6.3.3.                               */

  byte         scm;

/* Type for NV_SLOT_CYCLE_INDEX_I item.                                    */
/* ------------------------------------                                    */
/* The slot cycle index is 3 bits, per CAI section 1.1.2.2.                */

  byte         slot_cycle_index;

/* Type for NV_MOB_CAI_REV_I item.                                         */
/* -------------------------------                                         */
/* The Mobile CAI revision is 8 bits, per CAI section 1.1.2.2. and as      */
/* specified for each CAI revision in the title section.                   */

  byte         mob_cai_rev;

/* Type for NV_MOB_FIRM_REV_I item.                                        */
/* --------------------------------                                        */
/* Software version number.  16 bits per CAI section 1.1.2.2.              */

  word         mob_firm_rev;

/* Type for NV_MOB_MODEL_I item.                                           */
/* -----------------------------                                           */
/* Mobile model.  8 bits per CAI section 1.1.2.2.                          */

  byte         mob_model;

/* Type for NV_CONFIG_CHKSUM_I item.                                       */
/* ---------------------------------                                       */

  nv_config_chksum_type       config_chksum;

/*-------------------------------------------------------------------------*/

/* NAM items.                                                              */

/* Type for NV_PREF_MODE_I item.                                           */
/* -----------------------------                                           */

  nv_pref_mode_type  pref_mode;

/* Type for NV_CDMA_PREF_SERV_I item.                                      */
/* -----------------------------                                           */

  nv_pref_serv_type   cdma_pref_serv;

/* Type for NV_ANALOG_PREF_SERV_I item.                                    */
/* ------------------------------------                                    */

  nv_pref_serv_type   analog_pref_serv;

/* Type for NV_CDMA_SID_LOCK_I item.                                       */
/* ---------------------------------                                       */

  nv_sid_lock_type      cdma_sid_lock;

/* Type for NV_CDMA_SID_ACQ_I item.                                        */
/* --------------------------------                                        */

  nv_sid_acq_type       cdma_sid_acq;

/* Type for NV_ANALOG_SID_LOCK_I item.                                     */
/* -----------------------------------                                     */

  nv_sid_lock_type      analog_sid_lock;

/* Type for NV_ANALOG_SID_ACQ_I item.                                      */
/* ----------------------------------                                      */

  nv_sid_acq_type       analog_sid_acq;

/* Type for NV_ANALOG_FIRSTCHP_I item.                                     */
/* -----------------------------------                                     */

  nv_firstchp_type      analog_firstchp;

/* Type for NV_ANALOG_HOME_SID_I item.                                     */
/* -----------------------------------                                     */

  nv_sid_type           analog_home_sid;

/* Type for NV_ANALOG_REG_I item.                                          */
/* ------------------------------                                          */

  nv_analog_reg_type       analog_reg;

/* Type for NV_PCDMACH_I item.                                             */
/* ---------------------------                                             */

  nv_cdmach_type           pcdmach;

/* Type for NV_SCDMACH_I item.                                             */
/* ---------------------------                                             */

  nv_cdmach_type           scdmach;

/* Type for NV_NAM_CHKSUM_I item.                                          */
/* ------------------------------                                          */

  nv_nam_chksum_type       nam_chksum;

/* Type for NV_A_KEY_I item.                                               */
/* -------------------------                                               */

  nv_a_key_type   a_key;

/* Type for NV_A_KEY_CHKSUM_I item.                                        */
/* --------------------------------                                        */

  nv_a_key_chksum_type   a_key_chksum;

/* Type for NV_SSD_A_I item.                                               */
/* -------------------------                                               */

  nv_ssd_type     ssd_a;

/* Type for NV_SSD_A_CHKSUM_I item.                                        */
/* --------------------------------                                        */

  nv_ssd_chksum_type     ssd_a_chksum;

/* Type for NV_SSD_B_I item.                                               */
/* -------------------------                                               */

  nv_ssd_type     ssd_b;

/* Type for NV_SSD_B_CHKSUM_I item.                                        */
/* --------------------------------                                        */

  nv_ssd_chksum_type     ssd_b_chksum;

/* Type for NV_COUNT_I item.                                               */
/* -------------------------                                               */

  nv_count_type   count;

/*-------------------------------------------------------------------------*/

/* MIN items.                                                              */

/*-------------------------------------------------------------------------*/

/* Type for NV_MIN1_I item.                                                */
/* ------------------------                                                */

  nv_min1_type       min1;

/* Type for NV_MIN2_I item.                                                */
/* ------------------------                                                */

  nv_min2_type       min2;

/* Type for NV_IMSI_T_S1_I item.                                           */
/* -----------------------------                                           */

  nv_min1_type       imsi_t_s1;

/* Type for NV_IMSI_T_S2_I item.                                           */
/* -----------------------------                                           */

  nv_min2_type       imsi_t_s2;


/* Type for NV_MOB_TERM_HOME_I item.                                       */
/* ---------------------------------                                       */

  nv_mob_term_type    mob_term_home;

/* Type for NV_MOB_TERM_FOR_SID_I item.                                    */
/* ------------------------------------                                    */

  nv_mob_term_type       mob_term_for_sid;

/* Type for NV_MOB_TERM_FOR_NID_I item.                                    */
/* ------------------------------------                                    */

  nv_mob_term_type       mob_term_for_nid;

/* Type for NV_ACCOLC_I item.                                              */
/* --------------------------                                              */

  nv_accolc_type     accolc;

/* Type for NV_SID_NID_I item.                                             */
/* ---------------------------                                             */

  nv_sid_nid_type sid_nid;

/* Type for NV_MIN_CHKSUM_I item.                                          */
/* ------------------------------                                          */

  nv_min_chksum_type    min_chksum;

/*-------------------------------------------------------------------------*/

/* Operational NAM settings.                                               */

/*-------------------------------------------------------------------------*/

/* Type for NV_CURR_NAM_I item.                                            */
/* ----------------------------                                            */
/* This type holds the id of the current NAM (0-3) and is then used to     */
/* identify or index into any parameter which is NAM specific.             */

  byte          curr_nam;

/* Type for NV_ORIG_MIN_I item.                                            */
/* -----------------------------                                           */
/* This type holds the id of the MIN (0-1) within the current NAM (0-3)    */
/* which specifies the MIN used for call origination.  This id may be      */
/* changed by the user and is retained during powerdown.                   */

  nv_orig_min_type  orig_min;

/* Type for NV_AUTO_NAM_I item.                                            */
/* ----------------------------                                            */
/* If auto nam is set then the phone will automatically switch to the      */
/* the new NAM if it is defined as one of the four NAMs and if the phone   */
/* has matched the SID of this new NAM as it roamed into a new SID.        */

  boolean      auto_nam;

/* Type for NV_NAME_NAM_I item.                                            */
/* -----------------------------                                           */
/* This type holds the name of each NAM.                                   */

  nv_name_nam_type  name_nam;

/*-------------------------------------------------------------------------*/

/* Semi-permanent analog registration parameters.                          */

/*-------------------------------------------------------------------------*/

/* Type for NV_NXTREG_I item.                                              */
/* ----------------------------                                            */
/* Holds the registration count per CAI section 2.3.4.1.                   */

  dword        nxtreg;

/* Type for NV_LSTSID_I item.                                              */
/* --------------------------                                              */
/* Holds the last SID registered to, per CAI section 2.3.4.1.              */

  word         lstsid;

/* Type for NV_LOCAID_I item.                                              */
/* --------------------------                                              */
/* Holds the location area ID, per CAI section 2.3.4.2.                    */

  word         locaid;

/* Type for NV_PUREG_I item.                                               */
/* -------------------------                                               */
/* Holds the powerup registration identifier, per CAI section 2.3.4.2.     */

  boolean      pureg;

/*-------------------------------------------------------------------------*/

/* Semi-permanent CDMA registration parameters.                            */

/*-------------------------------------------------------------------------*/

/* Type for NV_ZONE_LIST_I item.                                           */
/* -----------------------------                                           */

  nv_zone_list_type        zone_list;

/* Type for NV_SID_NID_LIST_I item.                                        */
/* --------------------------------                                        */
/* Holds the SID+NID list, per CAI section 6.3.4.                          */

  nv_sid_nid_list_type     sid_nid_list;

/* Type for NV_DIST_REG_I item.                                            */
/* ----------------------------                                            */

  nv_dist_reg_type         dist_reg;

/* Type for NV_LAST_CDMACH_I item.                                         */
/* -------------------------------                                         */

  nv_cdmach_type           last_cdmach;

/*-------------------------------------------------------------------------*/

/* Timers.                                                                 */

/*-------------------------------------------------------------------------*/

/* Type for NV_CALL_TIMER_G_I item.                                          */
/* ------------------------------                                          */

  nv_run_time_type   call_timer_g;

/* Type for NV_AIR_TIMER_I item.                                           */
/* ------------------------------                                          */

  nv_call_time_type   air_timer;

/* Type for NV_ROAM_TIMER_I item.                                          */
/* ------------------------------                                          */

  nv_call_time_type   roam_timer;

/* Type for NV_LIFE_TIMER_G_I item.                                          */
/* ------------------------------                                          */

  nv_run_time_type   life_timer_g;

/* Type for NV_RUN_TIMER_I item.                                           */
/* ------------------------------                                          */

  nv_run_time_type    run_timer;

/*-------------------------------------------------------------------------*/

/* Speed dial numbers.                                                     */

/*-------------------------------------------------------------------------*/

/* Type for NV_DIAL_I item.                                                */
/* ------------------------                                                */

  nv_dial_type       dial;

/* Type for NV_STACK_I item.                                               */
/* -------------------------                                               */

  nv_stdial_type       stack;

/* Type for NV_STACK_IDX_I item.                                           */
/* -----------------------------                                           */

  nv_stack_idx_type  stack_idx;


/* Type for NV_REDIAL_I item.                                              */
/* -------------------------                                               */

  nv_dial_type       redial;

/*-------------------------------------------------------------------------*/

/* Type for NV_PAGE_SET_I item.                                            */
/* ----------------------------                                            */

  nv_page_set_type   page_set;

/*-------------------------------------------------------------------------*/

/* Type for NV_PAGE_MSG_I item.                                            */
/* ----------------------------                                            */

  nv_page_msg_type   page_msg;

/*-------------------------------------------------------------------------*/

/* Volumes.                                                                */

/*-------------------------------------------------------------------------*/

/* Type for NV_EAR_LEVEL_I item.                                           */
/* -----------------------------                                           */
/* Volume is from 1 (min) to 255 (max) and 0 means OFF (or SILENCE).       */

  byte         ear_level;

/* Type for NV_SPEAKER_LEVEL_I item.                                       */
/* ---------------------------------                                       */
/* Volume is from 1 (min) to 255 (max) and 0 means OFF (or SILENCE).       */

  byte         speaker_level;

/* Type for NV_RINGER_LEVEL_I item.                                        */
/* --------------------------------                                        */
/* Volume is from 1 (min) to 255 (max) and 0 means OFF (or SILENCE).       */

  byte         ringer_level;

/* Type for NV_BEEP_LEVEL_I item.                                          */
/* -----------------------------                                           */
/* Volume is from 1 (min) to 255 (max) and 0 means OFF (or SILENCE).       */

  byte         beep_level;

/*-------------------------------------------------------------------------*/

/* Tones.                                                                  */

/*-------------------------------------------------------------------------*/

/* Type for NV_CALL_BEEP_I item.                                           */
/* -----------------------------                                           */
/* When set the user is beeped during a call once a minute on the          */
/* 50 seconds mark.                                                        */

  boolean      call_beep;

/* Type for NV_CONT_KEY_DTMF_I item.                                       */
/* ---------------------------------                                       */
/* When set this means that manual DTMF tones should be sent as continuous */
/* instead of as burst tones.                                              */

  boolean      cont_key_dtmf;

/* Type for NV_CONT_STR_DTMF_I item.                                       */
/* ---------------------------------                                       */
/* When set this means that string DTMF tones should be sent as continuous */
/* instead of as burst tones.                                              */

  boolean      cont_str_dtmf;

/* Type for NV_SVC_AREA_ALERT_I item.                                      */
/* ----------------------------------                                      */
/* When set this means that the phone beeps whenever it leaves a service   */
/* area and whenever it enters a service area.                             */

  boolean      svc_area_alert;

/* Type for NV_CALL_FADE_ALERT_I item.                                     */
/* -----------------------------------                                     */
/* When set this means that the phone beeps whenever a call fades.         */

  boolean      call_fade_alert;

/*-------------------------------------------------------------------------*/

/* Various phone settings.                                                 */

/*-------------------------------------------------------------------------*/

/* Type for NV_BANNER_I item.                                              */
/* --------------------------                                              */

  nv_banner_type  banner;

/* Type for NV_LCD_I item.                                                 */
/* --------------------------                                              */
/* Specifies handset brightness, with 1 lowest, 255 highest, and 0 means   */
/* blank (lights out).                                                     */

  byte         lcd;

/* Type for NV_AUTO_ANSWER_I item.                                         */
/* -------------------------------                                         */

  nv_auto_answer_type   auto_answer;

/* Type for NV_AUTO_REDIAL_I item.                                         */
/* -------------------------------                                         */

  nv_auto_redial_type   auto_redial;

/* Type for NV_AUTO_HYPHEN_I item.                                         */
/* -------------------------------                                         */
/* When set the phone inserts hyphens automatically after 4, 7, 10, and 11 */
/* digits (i.e. 1-619-587-1121).  When cleared no hyphens are entered.     */

  boolean         auto_hyphen;

/* Type for NV_BACK_LIGHT_I item.                                          */
/* ------------------------------                                          */
/* This values specifies how many seconds should pass before the           */
/* backlighting is turned off, starting from the last moment when any      */
/* key was touched:                                                        */
/*                                                                         */
/* 0        - backlight never on                                           */
/* 1-10     - number of seconds before turning off                         */
/* 11-254   - illegal value                                                */
/* 255      - backlight never off                                          */

  byte      back_light;

/* Type for NV_AUTO_MUTE_I item.                                           */
/* -----------------------------                                           */
/* When set this causes the phone to mute the car stereo when a call is    */
/* started and unmute the car stereo when the call is ended.               */

  boolean      auto_mute;

/*-------------------------------------------------------------------------*/

/* Locks and restrictions.                                                 */

/*-------------------------------------------------------------------------*/

/* Type for NV_MAINTRSN_I item.                                            */
/* ---------------------------                                             */

  nv_maintrsn_type     maintrsn;

/* Type for NV_LCKRSN_P_I item.                                            */
/* -----------------------------                                           */

  nv_lckrsn_type     lckrsn_p;

/* Type for NV_LOCK_I item.                                                */
/* ------------------------                                                */
/* Set when the phone is locked (from the keypad), cleared when unlocked   */
/* (from the keypad).                                                      */

  byte       lock;

/* Type for NV_LOCK_CODE_I item.                                           */
/* -----------------------------                                           */

  nv_lock_code_type lock_code;

/* Type for NV_AUTO_LOCK_I item.                                           */
/* ---------------------------------                                       */
/* When set this means that everytime the phone is powered down it is      */
/* electronically locked and must be unlocked via the lock code.           */

  boolean      auto_lock;

/* Type for NV_CALL_RSTRC_I item.                                          */
/* ------------------------------                                          */
/* Word holding call restrictions bit map.  If the word is cleared         */
/* (all zeros) then no call restrictions are in place.                     */

  word         call_rstrc;

/* Type for NV_SEC_CODE_I item.                                            */
/* ----------------------------                                            */

  nv_sec_code_type   sec_code;

/* Type for NV_HORN_ALERT_I item.                                          */
/* ------------------------------                                          */
/* When set the horn sounds if the phone rings while ignition is off.      */

  boolean      horn_alert;

/*-------------------------------------------------------------------------*/

/* Error log.                                                              */

/*-------------------------------------------------------------------------*/

/* Type for NV_ERR_LOG_I item.                                             */
/* ---------------------------                                             */

  nv_err_log_type    err_log;

/*-------------------------------------------------------------------------*/


/* Miscellaneous items.                                                    */

/* Type for NV_UNIT_ID_I item.                                             */
/* ---------------------------                                             */

  dword             unit_id;

/* Type for NV_FREQ_ADJ_I item (table).                                    */
/* ------------------------------------                                    */

  nv_freq_adj_type  freq_adj;


/*-------------------------------------------------------------------------*/

/* Type for peek operation.                                                */
/* ------------------------                                                */

  nv_peek_type     peek;


/*-------------------------------------------------------------------------*/

/* Type for poke operation.                                                */
/* ------------------------                                                */

  nv_poke_type     poke;


/*-------------------------------------------------------------------------*/

/* Type for NV_VBATT_I item.                                               */
/* -----------------------------                                           */

   nv_minmax_type     vbatt;


/*-------------------------------------------------------------------------*/

/* Type for NV_FM_TX_PWR_I item.                                           */
/* -------------------------------                                         */

  nv_fm_tx_pwr_type   fm_tx_pwr;


/*-------------------------------------------------------------------------*/

/* Type for NV_FR_TEMP_OFFSET_I item.                                      */
/* -------------------------------                                         */

  nv_fr_temp_offset_type  fr_temp_offset;


/*-------------------------------------------------------------------------*/

/* Type for   NV_FM_RSSI_I  item.                                          */
/* ---------------------------------                                       */

  nv_minmax_type    fm_rssi;


/*-------------------------------------------------------------------------*/

/* Type for   NV_PA_CURENT_CTL_I item.                                     */
/* ---------------------------------                                       */

  byte    pa_cur_ctl[ NV_HDET_TABLE_SIZ];


/*-------------------------------------------------------------------------*/

/* Type for   NV_SPARE_1_I                                                 */
/* ---------------------------------                                       */

  word    spare_1;

/*-------------------------------------------------------------------------*/

/* Type for   NV_SPARE_2_I                                                 */
/* ---------------------------------                                       */

  word    spare_2;

/*-------------------------------------------------------------------------*/

/* Type for NV_DATA_IO_MODE_I item.                                        */
/* -------------------------------                                         */

  byte    data_io_mode;


/*-------------------------------------------------------------------------*/

/* Type for NV_DATA_MODE_ENABLED_I item.                                   */
/* -------------------------------                                         */

  byte    dm_io_mode;


/*-------------------------------------------------------------------------*/

/* Type for NV_DATA_MODE_ENABLED_I item.                                   */
/* -------------------------------                                         */

  boolean    data_srvc_enabled;

/*-------------------------------------------------------------------------*/

/* Type for NV_IDLE_DATA_TIMEOUT_I item.                                   */
/* -------------------------------                                         */

  word      idle_data_timeout;

/*-------------------------------------------------------------------------*/

/* Type for NV_MAX_TX_ADJ_I item.                                          */
/* -------------------------------                                         */

  byte      max_tx_adj;

/*-------------------------------------------------------------------------*/

/* Type for NV_INI_MUTE_I item.                                            */
/* -------------------------------                                         */

  byte      init_mute;

/*-------------------------------------------------------------------------*/

/* Type for NV_FACTORY_INFO_I item.                                        */
/* -------------------------------                                         */

  byte      fact_info[ NV_FACTORY_INFO_SIZ];

/*-------------------------------------------------------------------------*/

/* Type for   NV_SONY_ATTEN_3_I                                            */
/* ---------------------------------                                       */

  byte    sony_atten_3;

/*-------------------------------------------------------------------------*/

/* Type for   NV_SONY_ATTEN_4_I                                            */
/* ---------------------------------                                       */

  byte    sony_atten_4;

/*-------------------------------------------------------------------------*/

/* Type for   NV_SONY_ATTEN_5_I                                            */
/* ---------------------------------                                       */

  byte    sony_atten_5;

/* Type for  NV_DM_ADDR_I                                                  */
/* ---------------------------------                                       */

  byte    dm_addr;
/* Type for  NV_CDMA_PN_MASK_I                                             */
/* ---------------------------------                                       */

  byte    cdma_pn_mask;

/* Type for  NV_SEND_TIMEOUT_I                                             */
/* ---------------------------------                                       */

  byte    send_timeout;
/*-------------------------------------------------------------------------*/

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  FM mode TX_AGC_ADJ initial setting vs power, frequency, and temperature
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  byte fm_agc_set_vs_pwr[NV_PWR_TABLE_SIZ];
  int1 fm_agc_set_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 fm_agc_set_vs_temp[NV_TEMP_TABLE_SIZ];

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  FM mode TX_AGC_ADJ adjustments vs frequency, temperature, and power
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  byte fm_exp_hdet_vs_pwr[NV_PWR_TABLE_SIZ];
  byte fm_err_slp_vs_pwr[NV_PWR_TABLE_SIZ];

  byte fm_freq_sense_gain;
  nv_minmax_type     fm_lna_ctl;
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PCS/CDMA mode Rx AGC linearization table (to be loaded into MSM2P)
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  byte cdma_rx_lin_off_0;
  byte pcs_rx_lin_off_0;
  byte cdma_rx_lin_slp[NV_CDMA_RX_LIN_SIZ];
  byte pcs_rx_lin_slp[NV_PCS_RX_LIN_SIZ];

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PCS/CDMA mode RX/TX_GAIN_COMP values vs frequency and battery voltage
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  int1 cdma_rx_comp_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 pcs_rx_comp_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 cdma_tx_comp_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 pcs_tx_comp_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 cdma_tx_comp_vs_volt[NV_VOLT_TABLE_SIZ];

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PCS/CDMA mode Tx AGC linearization (MSM2P data is derived from these tables)
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  word cdma_tx_lin_master_off_0;
  word pcs_tx_lin_master_off_0;

/******************************************
 CHG 2001/06/07 ichikawa@MYTECS
     For special item
     (SONY_SYS_NV_ITEM)
*******************************************/
#if 0  /*** CHG ***/
  byte cdma_tx_lin_master_slp[NV_CDMA_TX_LIN_MASTER_SIZ];
#else  /*** CHG ***/
  byte cdma_tx_lin_master_slp[NV_TX_LIN_MASTER_SLP_SIZ];
#endif  /*** END OF CHG ***/

  byte pcs_tx_lin_master_slp[NV_PCS_TX_LIN_MASTER_SIZ];
  byte cdma_tx_lin_vs_temp[NV_TEMP_TABLE_SIZ];
  byte pcs_tx_lin_vs_temp[NV_TEMP_TABLE_SIZ];
  byte cdma_tx_lin_vs_volt[NV_VOLT_TABLE_SIZ];

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PCS/CDMA mode Tx power limit data vs temperature, battery voltage,
  frequency, TX_AGC_ADJ PDM setting, and HDET reading
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  byte cdma_tx_lim_vs_temp[NV_TEMP_TABLE_SIZ];
  byte pcs_tx_lim_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 cdma_tx_lim_vs_volt[NV_VOLT_TABLE_SIZ];
  int1 cdma_tx_lim_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 pcs_tx_lim_vs_freq[NV_FREQ_TABLE_SIZ];
  byte cdma_exp_hdet_vs_agc[NV_CDMA_EXP_HDET_VS_AGC_SIZ];
  byte pcs_exp_hdet_vs_agc[NV_PCS_EXP_HDET_VS_AGC_SIZ];
  byte cdma_err_slp_vs_hdet[NV_CDMA_ERR_SLP_VS_HDET_SIZ];

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PCS/CDMA RF Calibration items
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  int1 cdma_rx_lin_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pcs_rx_lin_vs_temp[NV_TEMP_TABLE_SIZ];
  byte cdma_adj_factor;
  byte pcs_adj_factor;
  byte cdma_tx_lim_booster_off;
  int1 cdma_rx_slp_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pcs_rx_slp_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 cdma_tx_slp_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pcs_tx_slp_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pa_range_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pcs_pa_range_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pdm1_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pcs_pdm1_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pdm2_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pcs_pdm2_vs_temp[NV_TEMP_TABLE_SIZ];
  int1 pdm1_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 pcs_pdm1_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 pdm2_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 pcs_pdm2_vs_freq[NV_FREQ_TABLE_SIZ];
  int1 lna_switch_vs_temp[NV_TEMP_TABLE_SIZ];
  byte fm_exp_hdet_vs_temp[NV_TEMP_TABLE_SIZ];

  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ADC offset and gain values for calculating indecies to the above tables
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Type for NV_THERM_I item.                                               */
/* -----------------------------                                           */

  nv_minmax_type     therm; /* RF & LCD calibration */
  nv_minmax_type     vbatt_pa; /*  */

  byte hdet_off;     /* ADC HDET reading offset */
  byte pcs_hdet_off; /* ADC HDET reading offset */
  byte hdet_spn;     /* ADC HDET reading span */
  byte pcs_hdet_spn; /* ADC HDET reading span */
  boolean onetouch_dial;  /* ena/dis UI one touch dialing */
  byte fm_agc_adj_vs_freq[NV_ADJ_VS_FREQ_SIZ];
  byte fm_agc_adj_vs_temp[NV_ADJ_VS_TEMP_SIZ];
  byte rf_config;

/******************************************
 CHG 2001/06/07 ichikawa@MYTECS
     For special item, Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV_ITEM)
*******************************************/
#if 0  /*** CHG ***/
  byte r1_rise;
#else  /*** CHG ***/
  byte r1_rise[NV_PA_R1_SIZ];
#endif  /*** END OF CHG ***/

  byte pcs_r1_rise;

/******************************************
 CHG 2001/06/07 ichikawa@MYTECS
     For special item, Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV_ITEM)
*******************************************/
#if 0  /*** CHG ***/
  byte r1_fall;
#else  /*** CHG ***/
  byte r1_fall[NV_PA_R1_SIZ];
#endif  /*** END OF CHG ***/

  byte pcs_r1_fall;
  byte r2_rise;
  byte pcs_r2_rise;
  byte r2_fall;
  byte pcs_r2_fall;
  byte r3_rise;
  byte pcs_r3_rise;
  byte r3_fall;
  byte pcs_r3_fall;

/* Type for  NV_PA_RANGE_STEP_CAL_I                                      */
/* -----------------------------                                         */
  byte   pa_range_step_cal;

/* Type for  NV_PCS_PA_RANGE_STEP_CAL_I                                  */
/* -----------------------------                                         */
  byte   pcs_pa_range_step_cal;

/* Type for  NV_LNA_RANGE_POL_I                                          */
/* -----------------------------                                         */
  byte   lna_range_pol;

/* Type for  NV_PCS_LNA_RANGE_POL_I                                      */
/* --------------------------------                                      */
  byte   pcs_lna_range_pol;

/* Type for  NV_LNA_RANGE_RISE_I                                         */
/* -----------------------------                                         */
/******************************************
 CHG 2001/06/07 ichikawa@MYTECS
     For special item, Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV_ITEM)
*******************************************/
#if 0  /*** CHG ***/
  int1   lna_range_rise;
#else  /*** CHG ***/
  int1   lna_range_rise[NV_LNA_RANGE_SIZ];
#endif  /*** END OF CHG ***/

/* Type for  NV_PCS_LNA_RANGE_RISE_I                                     */
/* ---------------------------------                                     */
  int1   pcs_lna_range_rise;

/* Type for  NV_LNA_RANGE_FALL_I                                         */
/* -----------------------------                                         */
/******************************************
 CHG 2001/06/07 ichikawa@MYTECS
     For special item, Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV_ITEM)
*******************************************/
#if 0  /*** CHG ***/
  int1   lna_range_fall;
#else  /*** CHG ***/
  int1   lna_range_fall[NV_LNA_RANGE_SIZ];
#endif  /*** END OF CHG ***/

/* Type for  NV_PCS_LNA_RANGE_FALL_I                                     */
/* ---------------------------------                                     */
  int1   pcs_lna_range_fall;

/* Type for  NV_LNA_RANGE_OFFSET_I                                       */
/* -------------------------------                                       */
/******************************************
 CHG 2001/06/07 ichikawa@MYTECS
     For special item, Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV_ITEM)
*******************************************/
#if 0  /*** CHG ***/
  word   lna_range_offset;
#else  /*** CHG ***/
  word   lna_range_offset[NV_LNA_RANGE_SIZ];
#endif  /*** END OF CHG ***/

/* Type for  NV_PCS_LNA_RANGE_OFFSET_I                                   */
/* -----------------------------------                                   */
  word   pcs_lna_range_offset;

/* Type for  NV_ALERTS_LVL_I                                             */
/* -----------------------------                                         */
  byte   alerts_lvl;

/* Type for  NV_ALERTS_LVL_SHADOW_I                                      */
/* -----------------------------                                         */
  byte   alerts_lvl_shadow;

/* Type for  NV_RINGER_LVL_SHADOW_I                                      */
/* -----------------------------                                         */
  byte   ringer_lvl_shadow;

/* Type for  NV_BEEP_LVL_SHADOW_I                                        */
/* -----------------------------                                         */
  byte   beep_lvl_shadow;

/* Type for  NV_EAR_LVL_SHADOW_I                                         */
/* -----------------------------                                         */
  byte   ear_lvl_shadow;

/* Type for  NV_TIME_SHOW_I                                              */
/* -----------------------------                                         */
  boolean time_show;

/* Type for  NV_AIR_CNT_I                                                */
/* -----------------------------                                         */
  nv_call_cnt_type   air_cnt;

/* Type for  NV_ROAM_CNT_I                                               */
/* -----------------------------                                         */
  nv_call_cnt_type   roam_cnt;

/* Type for  NV_LIFE_CNT_I                                               */
/* -----------------------------                                         */
  dword   life_cnt;

/* Type for  NV_DWNR_UP_CNT_I                                             */
/* -----------------------------                                         */
  dword   pwr_dwn_cnt;

/* Type for  NV_SEND_PIN_I                                               */
/* -----------------------------                                         */
  boolean   send_pin;

/* Type for  NV_AUTO_ANSWER_SHADOW_I                                     */
/* -----------------------------                                         */
  byte      auto_answer_shadow;

/* Type for  NV_SMS_I                                                    */
/* -----------------------------                                         */
  nv_sms_type   sms;

/* Type for  NV_IMSI_11_12_I                                             */
/* -------------------------                                             */
  nv_imsi_11_12_type  imsi_11_12;

/* Type for  NV_IMSI_T_11_12_I                                           */
/* -----------------------------                                         */
  nv_imsi_11_12_type  imsi_t_11_12;

/* Type for  NV_IMSI_MCC_I                                               */
/* -----------------------                                               */
  nv_imsi_mcc_type    imsi_mcc;

/* Type for  NV_IMSI_T_MCC_I                                             */
/* -----------------------------                                         */
  nv_imsi_mcc_type    imsi_t_mcc;

/* Type for  NV_DIR_NUMBER_I                                             */
/* -------------------------                                             */
  nv_dir_number_type    dir_number;

/* Type for  NV_DIR_NUMBER_PCS_I                                         */
/* -----------------------------                                         */
  nv_mob_dir_data_type  mob_dir_number;

/* Type for  NV_VOICE_PRIV_I                                             */
/* -----------------------------                                         */
  byte    voice_priv;

#ifdef FEATURE_RADIO_ONE_RFNV
#error code not present
#endif

/* Type for NV_FSC_I item.                                               */
/* --------------------------                                            */
  nv_fsc_type  fsc;

/* Type for  NV_N1M_I                                                    */
/* -----------------------------                                         */
  byte    n1m;

/**********The following items are country specific for ISS2 ***************/
/* Type for NV_ALARMS_I item.                                              */
/* --------------------------                                              */
  nv_alarms_type  alarms;

/* Type for NV_STANDING_ALARM_I item.                                      */
/* --------------------------                                              */
  word  standing_alarm;

/* Type for NV_DIALING_PLAN_I item.                                        */
/* --------------------------                                              */
  word  dialing_plan;

/* Type for NV_ISD_STD_PASSWD_I item.                                      */
/* --------------------------                                              */
  nv_isd_std_passwd_type  isd_std_passwd;

/* Type for NV_ISD_STD_RESTRICT_I item.                                    */
/* --------------------------                                              */
  byte  isd_std_restrict;

/* Type for NV_FM_AGC_I item.                                              */
/* -----------------------                                                 */
  nv_minmax_type     fm_agc;

/* Type for NV_FSC2_I item.                                                */
/* -----------------------                                                 */
  nv_fsc2_type        fsc2;

/* Type for NV_FSC2_CHKSUM_I item.                                         */
/* ------------------------------                                          */
  nv_fsc2_chksum_type fsc2_chksum;

/* Type for NV_WDC_I item.                                                 */
/* -----------------------                                                 */
  nv_wdc_type        wdc;

/* Type for NV_HW_CONFIG_I item.                                           */
/* -----------------------                                                 */
  dword              hw_config;

/* Type for NV_IMSI_ADDR_NUM_I item.                                       */
/* -----------------------                                                 */
  nv_imsi_addr_num_type imsi_addr_num;

/* Type for NV_IMSI_T_ADDR_NUM_I item.                                     */
/* -----------------------                                                 */
  nv_imsi_addr_num_type imsi_t_addr_num;

/* Type for NV_ASSIGNING_TMSI_ZONE_LEN_I item.                             */
/* -----------------------                                                 */
  nv_tmsi_zone_length_type  assigning_tmsi_zone_length;

/* Type for NV_ASSIGNING_TMSI_ZONE_I item.                                 */
/* -----------------------                                                 */
  nv_tmsi_zone_type  assigning_tmsi_zone;

/* Type for NV_TMSI_CODE_I item.                                           */
/* -----------------------                                                 */
  nv_tmsi_code_type  tmsi_code;

/* Type for NV_TMSI_EXP_I item.                                            */
/* -----------------------                                                 */
  nv_tmsi_exp_time_type tmsi_exp_timer;

/* Type for NV_HOME_PCS_FREQ_BLOCK_I item.                                 */
/* -----------------------                                                 */
  nv_home_block_type home_block;

/* Type for NV_ROAMING_LIST_(683)_I item.                                  */
/* --------------------------------------                                  */
  nv_roaming_list_union_type roaming_list;

/* Type for (now obsolete) NV_MRU_TABLE_I item.                            */
/* -----------------------                                                 */
  nv_mru_table_type mru_table;

/* Type for NV_MRU2_TABLE_I item.                                          */
/* -----------------------                                                 */
  nv_mru2_table_type mru2_table;

/* Type for OTASP "commit" operation (writes several nv items).            */
/* -----------------------                                                 */
  nv_otasp_commit_type * otasp_commit;

/* Type for NV_OTKSL_I item.                                               */
/* -----------------------                                                 */
  nv_sec_code_type   otksl;

/* Type for NV_TIMED_PREF_MODE_I item.                                     */
/* -----------------------                                                 */
  boolean      timed_pref_mode;

/* Type for NV_RINGER_TYPE_I item.                                         */
/* -----------------------                                                 */
  byte    ringer_type;

/* Type for NV_ANY_KEY_ANSWER_I item.                                      */
/* -----------------------                                                 */
  boolean   any_key_answer;

/* Type for NV_BACK_LIGHT_HFK_I item.                                      */
/* ------------------------------                                          */
/* This values specifies how many seconds should pass before the           */
/* backlighting is turned off, starting from the last moment when any      */
/* key was touched:                                                        */
/*                                                                         */
/* 0        - backlight never on                                           */
/* 1-15     - number of seconds before turning off                         */
/* 16-254   - illegal value                                                */
/* 255      - backlight never off                                          */

  byte      back_light_hfk;

/* Type for NV_KEY_SOUND_I item.                                           */
/* -----------------------------                                           */
  nv_key_sound_enum_type     key_sound;

/* Type for NV_DIALS_SORTING_METHOD_I item.                                */
/* ----------------------------------------                                */
  nv_dials_sort_enum_type   sorting_method;

/* Type for NV_LANGUAGE_SELECTION_I item.                                  */
/* --------------------------------------                                  */
  nv_language_enum_type  language_selection;

/* Type for NV_MENU_FORMAT_I item.                                         */
/* -------------------------------                                         */
  nv_menu_format_enum_type  menu_format;

/* Type for NV_RINGER_SPKR_LVL_I item.                                     */
/* -----------------------------------                                     */
  byte    ringer_spkr_lvl;

/* Type for NV_BEEP_SPKR_LVL_I item.                                       */
/* ---------------------------------                                       */
  byte    beep_spkr_lvl;

/* Type for NV_VIBRATOR_I item.                                            */
/* ----------------------------                                            */
  boolean vibrator;

/* Type for NV_FLIP_ANSWERS_I item.                                        */
/* --------------------------------                                        */
  boolean flip_answers;

/* Type for NV_DIAL_RESTRICT_LVLS_I item.                                  */
/* --------------------------------------                                  */
  nv_dial_restrict_lvls_type dial_restrict_lvls;

/* Type for NV_DIAL_STATE_TABLE_LEN_I item.                                */
/* ----------------------------------------                                */
  nv_dial_state_table_len_type dial_state_table_len;

/* Type for NV_DIAL_STATE_TABLE_I item.                                    */
/* ------------------------------------                                    */
  nv_dial_state_table_elem_type dial_state_table;

/* Type for NV_VOICE_PRIV_ALERT_I item.                                    */
/* ------------------------------------                                    */
  byte    voice_priv_alert;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_DATA_QNC_ENABLED_I item.                                    */
/* ------------------------------------                                    */
  boolean             data_qnc_enabled;

/* Type for NV_DATA_SO_SET_I item.                                         */
/* -------------------------------                                         */
  byte                data_so_set;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_UP_LINK_INFO_I item.                                        */
/* --------------------------------                                        */
  nv_up_link_info_type    up_link_info;

/* Type for NV_UP_KEY_I item.                                              */
  nv_up_key_type          up_key;

/* Type for NV_UP_PARMS_I item.                                            */
/* ----------------------------                                            */
  nv_up_parms_type        up_parms;

/* Type for NV_UP_CACHE_I item.                                            */
/* ----------------------------                                            */
  nv_up_cache_union_type  up_cache;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_ELAPSED_TIME_I item.                                        */
/* --------------------------------                                        */
  word    elapsed_time;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_PDM2_I item.                                                */
/* ------------------------                                                */
  byte    pdm2;

/* Type for NV_RX_AGC_MINMAX_I item.                                       */
/* ---------------------------------                                       */
  nv_minmax_type    rx_agc_minmax;

/* Type for NV_PCS_RX_AGC_MINMAX_I item.                                   */
/* -------------------------------------                                   */
  nv_minmax_type    pcs_rx_agc_minmax;

/* Type for NV_VBATT_AUX_I item.                                           */
/* -----------------------------                                           */
  nv_minmax_type    vbatt_aux;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_DTACO_CONTROL_I item.                                       */
/* ---------------------------------                                       */
  nv_dtaco_control_type    dtaco_control;

/* Type for NV_DTACO_INTERDIGIT_TIMEOUT_I item.                            */
/* --------------------------------------------                            */
  byte    dtaco_interdigit_timeout;

/* Type for NV_PDM1_I item.                                                */
/* ------------------------                                                */
  byte    pdm1;

/* Type for NV_BELL_MODEM_I item.                                          */
/* ------------------------------                                          */
  boolean bell_modem;

/* Type for NV_SID_NID_LOCK_I item.                                        */
/* --------------------------------                                        */
  nv_sid_nid_lock_type     sid_nid_lock;

/* Type for NV_PRL_ENABLED_I item.                                         */
/* -------------------------------                                         */
  nv_enabled_type          prl_enabled;

/* Type for NV_SYSTEM_PREF_I item.                                         */
/* -------------------------------                                         */
  nv_sys_pref_type         system_pref;

/* Type for NV_HOME_SID_NID_I item.                                        */
/* --------------------------------                                        */
  nv_home_sid_nid_type     home_sid_nid;

/* Type for NV_OTAPA_ENABLED_I item.                                       */
/* ---------------------------------                                       */
#ifdef FEATURE_OTASP_OTAPA
  nv_enabled_type          otapa_enabled;
#endif

/* Type for NV_NAM_LOCK_I item.                                            */
/* ----------------------------                                            */
#ifdef FEATURE_OTASP_OTAPA
  nv_enabled_type          nam_lock;
#endif

/* Type for NV_UP_ALERTS_I item.                                           */
/* -----------------------------                                           */
  nv_up_alert_record_type  up_alert_record;

/* Type for NV_UP_IDLE_TIMER_I item.                                       */
/* ---------------------------------                                       */
  word                     up_idle_timer;

/* Type for NV_SMS_UTC_I item.                                             */
/* ---------------------------                                             */
  boolean                  sms_utc;

/* Type for NV_ROAM_RINGER_I item.                                         */
/* -------------------------------                                         */
  boolean                  roam_ringer;

/* Type for NV_RENTAL_TIMER_I item.                                        */
/* --------------------------------                                        */
  nv_rental_timer_type     rental_timer;

/* Type for NV_RENTAL_TIMER_INC_I item.                                    */
/* ------------------------------------                                    */
  byte                     rental_timer_inc;

/* Type for NV_RENTAL_CNT_I item.                                          */
/* ------------------------------                                          */
  dword                    rental_cnt;

/* Type for NV_RENTAL_TIMER_ENABLED_I item.                                */
/* ----------------------------------------                                */
  boolean                  rental_timer_enabled;

/* Type for NV_FULL_SYSTEM_PREF_I item.                                    */
/* ------------------------------------                                    */
  boolean                  full_system_pref;

/* Type for NV_BORSCHT_RINGER_FREQ_I item.                                 */
/* ---------------------------------------                                 */
  byte                     borscht_ringer_freq;

/* Type for NV_PAYPHONE_ENABLE_I item.                                     */
/* -----------------------------------                                     */
  boolean                  payphone_enable;

/* Type for NV_DSP_ANSWER_DET_ENABLE_I item.                               */
/* -----------------------------------------                               */
  boolean                  dsp_answer_det_enable;

/* Type for NV_EVRC_PRI_I item.                                            */
/* ----------------------------                                            */
  nv_evrc_pri_enum_type    evrc_pri;

/* Type for NV_AFAX_CLASS_20_I item.                                       */
/* ---------------------------------                                       */
  boolean                  afax_class_20;

/* Type for NV_V52_CONTROL_I item.                                         */
/* -------------------------------                                         */
  nv_v52_control_enum_type v52_control;

/* Type for NV_CARRIER_INFO_I item.                                        */
/* --------------------------------                                        */
  nv_carrier_info_type     carrier_info;

/* Type for NV_AFAX_I item.                                                */
/* ------------------------                                                */
  nv_afax_type             afax;

#ifdef FEATURE_EVRC_SO_MGMT
/* Type for NV_PREF_VOICE_SO_I item.                                       */
/* ---------------------------------                                       */
  nv_pref_voice_so_type    pref_voice_so;
#endif

/* Type for NV_VRHFK_ENABLED_I item.                                       */
/* ---------------------------------                                       */
  boolean                  vrhfk_enabled;

/* Type for NV_VRHRK_VOICE_ANSWER_I item.                                  */
/* --------------------------------------                                  */
  boolean                  vrhfk_voice_answer;

/* Type for NV_SMS_AUTO_DELETE_I item.                                     */
/* -----------------------------------                                     */
  boolean                  sms_auto_delete;

/* Type for NV_SRDA_ENABLED_I item.                                        */
/* --------------------------------                                        */
  boolean                  srda_enabled;

/* Type for NV_OUTPUT_UI_KEYS_I item.                                      */
/* ----------------------------------                                      */
  boolean                  output_ui_keys;

/* Type for NV_POL_REV_TIMEOUT_I item.                                     */
/* -----------------------------------                                     */
  byte                     pol_rev_timeout;

/* Type for NV_SI_TEST_DATA_1_I item.                                      */
/* ----------------------------------                                      */
  byte                     si_test_data_1[NV_SI_TEST_DATA_SIZE];

/* Type for NV_SI_TEST_DATA_2_I item.                                      */
/* ----------------------------------                                      */
  byte                     si_test_data_2[NV_SI_TEST_DATA_SIZE];

/* Type for NV_SPC_CHANGE_ENABLED_I item.                                  */
/* --------------------------------------                                  */
  boolean                  spc_change_enabled;

/* Type for NV_DATA_MDR_MODE_I item.                                       */
/* ---------------------------------                                       */
  byte                     data_mdr_mode;

/* Type for NV_DATA_PKT_ORIG_STR_I item.                                   */
/* -------------------------------------                                   */
  nv_data_pkt_orig_str_type data_pkt_orig_str;

/* Type for NV_DATA_AUTO_PACKET_DETECTION_I item.                          */
/* -------------------------------------                                   */
  byte                     data_auto_packet_detection;

#ifdef FEATURE_AUDIO_AGC
/* Type for NV_AUTO_VOLUME_ENABLED_I item.                                 */
/* ---------------------------------------                                 */
  boolean                  auto_volume_enabled;
#endif

#ifdef FEATURE_UI_NEW_OTKSL
#error code not present
#endif

#ifdef FEATURE_UI_SMS
/* Type for NV_SMS_REMINDER_TONE_I item.                                   */
/* -------------------------------------                                   */
  byte                     sms_reminder_tone;
#endif

/* Type for NV_BTF_ADJUST_I item.                                          */
/* ------------------------------                                          */
  int2                     btf_adjust;

#ifdef FEATURE_UBROWSER
#error code not present
#endif

#ifdef FEATURE_UI_MINIBROWSER
#error code not present
#endif

#ifdef FEATURE_USER_ZONE
#error code not present
#endif

#ifdef FEATURE_USER_ZONE
#error code not present
#endif

#if (defined (FEATURE_DS_PAP) || defined (FEATURE_DS_CHAP) )
/* Type for NV_PAP_USER_ID_I item.                                         */
/* -------------------------------                                         */
  nv_pap_user_id_type      pap_user_id;

/* Type for NV_PAP_PASSWORD_I item.                                        */
/* --------------------------------                                        */
  nv_pap_password_type     pap_password;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#if (defined FEATURE_PA_RANGE_DIG_COMP || defined FEATURE_PA_RANGE_TEMP_FREQ_COMP)
/* Type for  NV_PA_OFFSETS_I item.                                         */
/* -------------------------------                                         */
  nv_pa_offset_type        pa_offsets[NV_NUM_PA_RANGES];
#endif

#ifdef FEATURE_4PAGE_TX_LINEARIZER
/* Type for  NV_CDMA_TX_LIN_MASTER0_I item.                                */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    cdma_tx_lin_master0;

/* Type for  NV_CDMA_TX_LIN_MASTER1_I item.                                */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    cdma_tx_lin_master1;

/* Type for  NV_CDMA_TX_LIN_MASTER2_I item.                                */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    cdma_tx_lin_master2;

/* Type for  NV_CDMA_TX_LIN_MASTER3_I item.                                */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    cdma_tx_lin_master3;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_BROADCAST_SMS
/* Type for NV_SMS_BC_SERVICE_TABLE_SIZE_I item.                                          */
/* ------------------------------------                                    */
  word                     sms_bc_service_table_size;

/* Type for NV_SMS_BC_SERVICE_TABLE_I item.                                          */
/* ------------------------------------                                    */
  nv_sms_bc_service_table_type sms_bc_service_table;

/* Type for NV_SMS_BC_CONFIG_I item.                                       */
/* ------------------------------------                                    */
  byte                     sms_bc_config;

/* Type for NV_SMS_BC_USER_PREF_I item.                                    */
/* ------------------------------------                                    */
  byte                     sms_bc_user_pref;
#endif

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

#ifdef FEATURE_RFR3100
/* Type for NV_LNA_RANGE_2_RISE_I item.                                    */
/* ------------------------------------                                    */
  int1                     lna_range_2_rise;

/* Type for NV_LNA_RANGE_2_FALL_I item.                                    */
/* ------------------------------------                                    */
  int1                     lna_range_2_fall;

/* Type for NV_LNA_RANGE_12_OFFSET_I item.                                 */
/* ------------------------------------                                    */
  int2                     lna_range_12_offset;

/* Type for NV_NONBYPASS_TIMER_I item.                                     */
/* ------------------------------------                                    */
  byte                     nonbypass_timer;

/* Type for NV_BYPASS_TIMER_I item.                                        */
/* ------------------------------------                                    */
  byte                     bypass_timer;

/* Type for NV_IM_LEVEL1_I item.                                           */
/* ------------------------------------                                    */
  int1                     im_level1;

/* Type for NV_IM_LEVEL2_I item.                                           */
/* ------------------------------------                                    */
  int1                     im_level2;

/* Type for NV_CDMA_LNA_OFFSET_VS_FREQ_I item.                             */
/* ------------------------------------                                    */
  int1                     cdma_lna_offset_vs_freq[NV_FREQ_TABLE_SIZ];

/* Type for NV_CDMA_LNA_12_OFFSET_VS_FREQ_I item.                          */
/* ------------------------------------                                    */
  int1                     cdma_lna_12_offset_vs_freq[NV_FREQ_TABLE_SIZ];

/* Type for NV_AGC_PHASE_OFFSET_I item.                                    */
/* ------------------------------------                                    */
  byte                     agc_phase_offset;

/* Type for NV_RX_AGC_MIN_11_I item.                                       */
/* ------------------------------------                                    */
  nv_minmax_type           rx_agc_min_11;
#endif

#if (defined(NV_FEATURE_TRIMODE_ITEMS) && defined(FEATURE_RFR3100))
/* Type for NV_PCS_LNA_RANGE_2_RISE_I item.                                */
/* ------------------------------------                                    */
  int1                     pcs_lna_range_2_rise;

/* Type for NV_PCS_LNA_RANGE_2_FALL_I item.                                */
/* ------------------------------------                                    */
  int1                     pcs_lna_range_2_fall;

/* Type for NV_PCS_LNA_RANGE_12_OFFSET_I item.                             */
/* ------------------------------------                                    */
  int2                     pcs_lna_range_12_offset;

/* Type for NV_PCS_NONBYPASS_TIMER_I item.                                 */
/* ------------------------------------                                    */
  byte                     pcs_nonbypass_timer;

/* Type for NV_PCS_BYPASS_TIMER_I item.                                    */
/* ------------------------------------                                    */
  byte                     pcs_bypass_timer;

/* Type for NV_PCS_IM_LEVEL1_I item.                                       */
/* ------------------------------------                                    */
  int1                     pcs_im_level1;

/* Type for NV_PCS_IM_LEVEL2_I item.                                       */
/* ------------------------------------                                    */
  int1                     pcs_im_level2;

/* Type for NV_PCS_CDMA_LNA_OFFSET_VS_FREQ_I item.                         */
/* ------------------------------------                                    */
  int1                     pcs_cdma_lna_offset_vs_freq[NV_FREQ_TABLE_SIZ];

/* Type for NV_PCS_CDMA_LNA_12_OFFSET_VS_FREQ_I item.                      */
/* ------------------------------------                                    */
  int1                     pcs_cdma_lna_12_offset_vs_freq[NV_FREQ_TABLE_SIZ];

/* Type for NV_PCS_AGC_PHASE_OFFSET_I item.                                */
/* ------------------------------------                                    */
  byte                     pcs_agc_phase_offset;

/* Type for NV_PCS_RX_AGC_MIN_11_I item.                                   */
/* ------------------------------------                                    */
  nv_minmax_type           pcs_rx_agc_min_11;
#endif

#ifdef FEATURE_RUIM_CHV_FROM_NV
/* Type for NV_RUIM_CHV_1_I item.                                         */
/* ------------------------------------                                   */
  nv_ruim_chv_type         ruim_chv_1;

/* Type for NV_RUIM_CHV_2_I item.                                         */
/* ------------------------------------                                   */
  nv_ruim_chv_type         ruim_chv_2;
#endif

#ifdef FEATURE_GPSONE
/* Type for NV_GPS1_CAPABILITIES_I item.                                  */
/* ------------------------------------                                   */
  byte                     gps1_capabilities;

/* Type for NV_GPS1_PDE_ADDRESS_I item.                                   */
/* ------------------------------------                                   */
  dword                    gps1_pde_address;

/* Type for NV_GPS1_ALLOWED_I item.                                       */
/* ------------------------------------                                   */
  boolean                  gps1_allowed;

/* Type for NV_GPS1_PDE_TRANSPORT_I item.                                 */
/* ------------------------------------                                   */
  nv_gps1_transport_type   gps1_pde_transport;

/* Type for NV_GPS1_MOBILE_CALC_I item.                                   */
/* ------------------------------------                                   */
  nv_gps1_position_calc_type gps1_mobile_calc;

/* Type for NV_GPS1_PDE_PORT_I item.                                      */
/* ------------------------------------                                   */
  dword                    gps1_pde_port;
#endif


#ifdef FEATURE_IS2000
/* Type for  NV_PREF_FOR_RC_I item.                                        */
/* -------------------------------                                         */
  nv_rc_pref_type          pref_for_rc;
#endif

#ifdef FEATURE_SDEVMAP_MENU_ITEM_NV
/* Type for  NV_SIO_DEV_MAP_MENU_ITEM_I item.                              */
/* -------------------------------                                         */
  int1                     sio_dev_map_menu_item;
#endif

#ifdef FEATURE_TTY
/* Type for  NV_TTY_I item.                                                */
/* -------------------------------                                         */
  nv_tty_enum_type         tty;
#endif

#ifdef FEATURE_PA_RANGE_TEMP_FREQ_COMP
/* Type for NV_PA_RANGE_OFFSETS_I item.                                    */
/* -------------------------------                                         */
  int2                     pa_range_offsets[NV_NUM_PA_RANGES];

/* Type for NV_TX_COMP0_I item.                                            */
/* -------------------------------                                         */
  nv_tx_comp_type          tx_comp0;
#endif

#ifdef FEATURE_STEREO_DAC
/* Type for NV_MM_SDAC_LVL_I item.                                         */
/* -------------------------------                                         */
  byte                     mm_sdac_lvl;

/* Type for NV_BEEP_SDAC_LVL_I item.                                       */
/* -------------------------------                                         */
  byte                     beep_sdac_lvl;

/* Type for NV_SDAC_LVL_I item.                                            */
/* -------------------------------                                         */
  byte                     sdac_lvl;
#endif

#ifdef FEATURE_MULTIMEDIA
/* Type for NV_MM_LVL_I item.                                              */
/* -------------------------------                                         */
  byte                     mm_lvl;

/* Type for NV_MM_LVL_SHADOW_I item.                                       */
/* -------------------------------                                         */
  byte                     mm_lvl_shadow;

/* Type for NV_MM_SPEAKER_LVL_I item.                                      */
/* -------------------------------                                         */
  byte                     mm_speaker_lvl;

/* Type for NV_MM_PLAY_MODE_I item.                                        */
/* -------------------------------                                         */
  byte                     mm_play_mode;

/* Type for NV_MM_REPEAT_MODE_I item.                                      */
/* -------------------------------                                         */
  byte                     mm_repeat_mode;
#endif

#ifdef FEATURE_PA_RANGE_TEMP_FREQ_COMP
/* Type for NV_TX_COMP1_I item.                                            */
/* -------------------------------                                         */
  nv_tx_comp_type          tx_comp1;

/* Type for NV_TX_COMP2_I item.                                            */
/* -------------------------------                                         */
  nv_tx_comp_type          tx_comp2;

/* Type for NV_TX_COMP3_I item.                                            */
/* -------------------------------                                         */
  nv_tx_comp_type          tx_comp3;
#endif

/* Type for NV_PRIMARY_DNS_I item.                                         */
/* -------------------------------                                         */
  dword                    primary_dns;

/* Type for NV_SECONDARY_DNS_I item.                                       */
/* -------------------------------                                         */
  dword                    secondary_dns;

#ifdef FEATURE_DIAG_PORT_SELECT
#error code not present
#endif

#ifdef FEATURE_MULTIMEDIA
/* Type for NV_MM_RINGER_FILE_I item.                                      */
/* -------------------------------                                         */
  char                     mm_ringer_file[NV_FS_FILENAME_MAX_LENGTH];

#ifdef FEATURE_MMC
/* Type for NV_MM_STORAGE_DEVICE_I item.                                   */
/* -------------------------------                                         */
  byte                     mm_storage_device;
#endif
#endif

#ifdef FEATURE_IS2000_R_SCH
/* Type for NV_DATA_SCRM_ENABLED_I item.                                   */
/* -------------------------------                                         */
  boolean                  data_scrm_enabled;
#endif

#ifdef FEATURE_RUIM_SMSS
/* Type for NV_RUIM_SMS_STATUS_I item.                                     */
/* -------------------------------                                         */
  nv_ruim_sms_status_type  ruim_sms_status;
#endif

#ifdef NV_FEATURE_TRIMODE_ITEMS
#ifdef FEATURE_4PAGE_TX_LINEARIZER
/* Type for  NV_PCS_TX_LIN_MASTER0_I item.                                 */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    pcs_tx_lin_master0;

/* Type for  NV_PCS_TX_LIN_MASTER1_I item.                                 */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    pcs_tx_lin_master1;

/* Type for  NV_PCS_TX_LIN_MASTER2_I item.                                 */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    pcs_tx_lin_master2;

/* Type for  NV_PCS_TX_LIN_MASTER3_I item.                                 */
/* ---------------------------------------                                 */
  nv_tx_linearizer_type    pcs_tx_lin_master3;
#endif

#ifdef FEATURE_PA_RANGE_TEMP_FREQ_COMP
/* Type for NV_PCS_PA_RANGE_OFFSETS_I item.                                */
/* -------------------------------                                         */
  int2                     pcs_pa_range_offsets[NV_NUM_PA_RANGES];

/* Type for NV_PCS_TX_COMP0_I item.                                        */
/* -------------------------------                                         */
  nv_tx_comp_type          pcs_tx_comp0;

/* Type for NV_PCS_TX_COMP1_I item.                                        */
/* -------------------------------                                         */
  nv_tx_comp_type          pcs_tx_comp1;

/* Type for NV_PCS_TX_COMP2_I item.                                        */
/* -------------------------------                                         */
  nv_tx_comp_type          pcs_tx_comp2;

/* Type for NV_PCS_TX_COMP3_I item.                                        */
/* -------------------------------                                         */
  nv_tx_comp_type          pcs_tx_comp3;
#endif
#endif

#ifdef FEATURE_DIAG_RESTART_CONFIG
/* Type for NV_DIAG_RESTART_CONFIG_I item.                                 */
/* -------------------------------                                         */
  nv_diag_restart_config_type diag_restart_config;
#endif

#ifdef FEATURE_SD20
/* Type for NV_BAND_PREF_I item.                                           */
/* -------------------------------                                         */
  nv_band_pref_type        band_pref;

/* Type for NV_ROAM_PREF_I item.                                           */
/* -------------------------------                                         */
  nv_roam_pref_type        roam_pref;
#endif

#ifdef FEATURE_GPSONE
/* Type for NV_GPS1_GPS_RF_DELAY_I item.                                   */
/* -------------------------------                                         */
  int16                    gps1_gps_rf_delay;

/* Type for NV_GPS1_CDMA_RF_DELAY_I item.                                  */
/* -------------------------------                                         */
  int16                    gps1_cdma_rf_delay;
#endif

#if (defined (FEATURE_ENC_BTF_IN_NV) || defined (T_MSM33))
#ifdef NV_FEATURE_TRIMODE_ITEMS
/* Type for NV_PCS_ENC_BTF_I item.                                         */
/* -------------------------------                                         */
  uint32                   pcs_enc_btf;
#endif

/* Type for NV_CDMA_ENC_BTF_I item.                                        */
/* -------------------------------                                         */
  uint32                   cdma_enc_btf;
#endif

#ifdef FEATURE_BT
/* Type for NV_BD_ADDR_I item.                                             */
/* -------------------------------                                         */
  nv_bd_addr_type          bd_addr;
#endif

#ifdef FEATURE_SUBPCG_PA_WARMUP_DELAY
/* Type for NV_SUBPCG_PA_WARMUP_DELAY_I item.                              */
/* -------------------------------                                         */
  word                     subpcg_pa_warmup_delay;
#endif

#ifdef FEATURE_GPSONE
/* Type for NV_GPS1_GPS_RF_LOSS_I item.                                    */
/* -------------------------------                                         */
  byte                     gps1_gps_rf_loss;
#endif

#ifdef FEATURE_IS2000_R_SCH
/* Type for NV_DATA_TRTL_ENABLED_I item.                                   */
/* -------------------------------                                         */
  boolean                  data_trtl_enabled;
#endif

#ifdef FEATURE_SD20
/* Type for NV_AMPS_BACKSTOP_ENABLED_I item.                               */
/* -------------------------------                                         */
  nv_enabled_type          amps_backstop_enabled;
#endif


#ifdef FEATURE_GPSONE
/* Type for NV_GPS1_LOCK_I item.                                           */
/* -------------------------------                                         */
  int32                    gps1_lock;
#endif

#ifdef FEATURE_FACTORY_TESTMODE
/* Type for NV_FTM_MODE_I item.                                            */
/* -------------------------------                                         */
  boolean                  ftm_mode;
#endif

#ifdef FEATURE_DS_DEFAULT_BITRATE_NV
/* Type for  NV_DS_DEFAULT_BAUDRATE_I item.                                */
/* -------------------------------                                         */
  nv_sio_baudrate_type     ds_default_baudrate;
#endif

#ifdef FEATURE_DIAG_DEFAULT_BITRATE_NV
/* Type for  NV_DIAG_DEFAULT_BAUDRATE_I item.                              */
/* -------------------------------                                         */
  nv_sio_baudrate_type     diag_default_baudrate;
#endif

#ifdef FEATURE_JCDMA_DS
/* Type for  NV_JCDMA_DS_F92_I item.                                       */
/* -------------------------------                                         */
  nv_jcdma_ds_f92_enum_type jcdma_ds_f92;
#endif

#ifdef FEATURE_DS_MOBILE_IP
/* Type for  NV_DS_QCMIP_I item.                                           */
/* -------------------------------                                         */
  byte                     ds_qcmip;

/* Type for  NV_DS_MIP_RETRIES_I item.                                     */
/* -------------------------------                                         */
  byte                     ds_mip_retries;

/* Type for  NV_DS_MIP_RETRY_INT_I item.                                   */
/* -------------------------------                                         */
  byte                     ds_mip_retry_int;

/* Type for  NV_DS_MIP_PRE_RE_RRQ_TIME_I item.                             */
/* -------------------------------                                         */
  byte                     ds_mip_pre_re_rrq_time;

/* Type for  NV_DS_MIP_NUM_PROF_I item.                                    */
/* -------------------------------                                         */
  byte                     ds_mip_num_prof;

/* Type for  NV_DS_MIP_ACTIVE_PROF_I item.                                 */
/* -------------------------------                                         */
  byte                     ds_mip_active_prof;

/* Type for  NV_DS_MIP_GEN_USER_PROF_I item.                               */
/* -------------------------------                                         */
  nv_ds_mip_gen_user_prof_type ds_mip_gen_user_prof;

/* Type for  NV_DS_MIP_SS_USER_PROF_I item.                                */
/* -------------------------------                                         */
  nv_ds_mip_ss_user_prof_type ds_mip_ss_user_prof;
#endif

#ifdef FEATURE_HDR
#error code not present
#endif

#ifdef FEATURE_TX_POWER_BACK_OFF
/* Type for  NV_PWR_BACKOFF_VS_VOLT_MED_I item.                            */
/* -------------------------------                                         */
  uint8                                 pwr_backoff_vs_volt_med[NV_TX_BACKOFF_TABLE_SIZE];

/* Type for  NV_PWR_BACKOFF_VS_VOLT_LOW_I item.                            */
/* -------------------------------                                         */
  uint8                                 pwr_backoff_vs_volt_low[NV_TX_BACKOFF_TABLE_SIZE];

/* Type for  NV_PA_BACKOFF_VOLTS_I item.                                   */
/* -------------------------------                                         */
  uint8                                 pa_backoff_volts[NV_NUM_PA_BCKOFF_CAL_VOLT];

/* Type for  NV_VBATT_MIN_MAX_I item.                                      */
/* -------------------------------                                         */
  nv_minmax_type                        vbatt_min_max;
#endif

#ifdef FEATURE_DS_MOBILE_IP
/* Type for  NV_DS_MIP_MN_HA_TIME_DELTA_I item.                            */
/* -------------------------------                                         */
  nv_ds_mip_mn_ha_time_delta_type       ds_mip_mn_ha_time_delta;

/* Type for  NV_DS_MIP_QC_DRS_OPT_I item.                                  */
/* -------------------------------                                         */
  boolean                               ds_mip_qc_drs_opt;
#endif

#ifdef FEATURE_DUAL_RX_CHAINS
#error code not present
#endif /* FEATURE_DUAL_RX_CHAINS */

#ifdef FEATURE_DS_MOBILE_IP
/* Type for  NV_DS_MIP_2002BIS_MN_HA_AUTH_I item.                          */
/* -------------------------------                                         */
  boolean                               ds_mip_2002bis_mn_ha_auth;
#endif

#ifdef FEATURE_HDR
#error code not present
#endif

#ifdef FEATURE_GPSONE
/* Type for  NV_GPS1_LO_CAL_I item.                                        */
/* -------------------------------                                         */
  int16                                 gps1_lo_cal;

/* Type for  NV_GPS1_ANT_OFF_DB_I item.                                    */
/* -------------------------------                                         */
  int16                                 gps1_ant_off_db;

/* Type for  NV_GPS1_PCS_RF_DELAY_I item.                                  */
/* -------------------------------                                         */
  int16                                 gps1_pcs_rf_delay;
#endif

#ifdef FEATURE_HDR
#error code not present
#endif

#ifdef FEATURE_BT_LPOS
#error code not present
#endif

#ifdef FEATURE_RFCAL_VERSION
/* Type for  NV_TEST_CODE_VER_I item.                                      */
/* -------------------------------                                         */
  byte                                   test_code_ver[NV_SIZE_OF_VERSION];

/* Type for  NV_SYS_SW_VER_I item.                                         */
/* -------------------------------                                         */
  byte                                   sys_sw_ver[NV_SIZE_OF_VERSION];

/* Type for  NV_RF_CAL_VER_I item.                                         */
/* -------------------------------                                         */
  byte                                   rf_cal_ver[NV_SIZE_OF_VERSION];

/* Type for  NV_RF_CONFIG_VER_I item.                                      */
/* -------------------------------                                         */
  byte                                   rf_config_ver[NV_SIZE_OF_VERSION];

/* Type for  NV_RF_CAL_DATE_I item.                                        */
/* -------------------------------                                         */
  dword                                  rf_cal_date;

/* Type for  NV_RF_NV_LOADED_DATE_I item.                                  */
/* -------------------------------                                         */
  dword                                  rf_nv_loaded_date;

/* Type for  NV_RF_CAL_DAT_FILE_I item.                                    */
/* -------------------------------                                         */
  byte                                   rf_cal_dat_file[NV_QC_SERIAL_NUM_LEN];
#endif

#ifdef FEATURE_HDR_AN_AUTH
#error code not present
#endif

#ifdef FEATURE_USERZONE
/* Type for  NV_PUZL_ENABLED_I item.                                       */
/* -------------------------------                                         */
  nv_enabled_type                        puzl_enabled;
#endif

#ifdef FEATURE_HDR
#error code not present
#endif

#ifdef FEATURE_RADIO_ONE_RFNV
#error code not present
#endif

#ifdef FEATURE_DS_MOBILE_IP
/* Type for NV_DS_MIP_RRQ_IF_TFRK_I item.                                  */
/* -------------------------------                                         */
  boolean                                ds_mip_rrq_if_tfrk;
#endif

#ifdef FEATURE_HDR
#error code not present
#endif

#ifdef FEATURE_GPSONE
/* Type for NV_LO_BIAS_UPDATE_CNT_I item.                                  */
/* -------------------------------                                         */
  byte                                   lo_bias_update_cnt;
#endif

#ifdef FEATURE_RADIO_ONE_RFNV
#error code not present
#endif

#ifdef FEATURE_DS_MOBILE_IP
 /* Type for NV_DS_MIP_ENABLE_PROF_I item.                                 */
 /* -------------------------------                                        */
   byte                                ds_mip_enable_prof[NV_DS_MIP_ENABLE_PROF];
#endif

#ifdef FEATURE_GPSONE
/* Type for NV_GPS_DOPP_SDEV_I item.                                       */
/* -------------------------------                                         */
  byte                                   gps_dopp_sdev;
  #endif

#ifdef FEATURE_GPSONE
/* Type for NV_GPS1_CELLBASED_SMS_I item.                                  */
/* -------------------------------                                         */
  boolean                                gps1_cellbased_sms;

/* Type for NV_GPS1_TELESERVICE_ID_I item.                                 */
/* -------------------------------                                         */
  word                                   gps1_teleservice_id;
#endif

#ifdef FEATURE_GPSONE_DBM
/* Type for NV_GPS1_NET_DBM_SIZE_I item.                                   */
/* -------------------------------                                         */
  byte                                   gps1_net_dbm_size;
#endif

#ifdef FEATURE_NV_UNIT_TEST
#error code not present
#endif

/******************************************
 ADD 2001/05/30 ichikawa@MYTECS
     SONY additional items.Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV)
*******************************************/

/* Type for NV_UP_PPP_RADIUS_ID_I item.                                    */
/* -----------------------------------                                     */
  nv_ppp_radius_id_type           up_ppp_radius_id;

/* Type for NV_UP_PPP_RADIUS_PASS_I item.                                  */
/* -------------------------------------                                   */
  nv_ppp_radius_pass_type         up_ppp_radius_pass;

/*-------------------------------------------------------------------------*/

/* Type for NV_CDMA_RX_LIN_OFF_I item.                                     */
/* ----------------------------------                                      */
  byte  cdma_rx_lin_off[NV_RX_LIN_OFF_SIZ];

/* Type for NV_CDMA_TX_LIN_MASTER_OFF_I item.                              */
/* -----------------------------------------                               */
  word  cdma_tx_lin_master_off[NV_TX_LIN_MASTER_OFF_SIZ];

/* Type for NV_CDMA_TX_LIN_MASTER_OFF_1_I item.                            */
/* -------------------------------------------                             */
  int2  cdma_tx_lin_master_off_1[NV_TX_LIN_MASTER_OFF_SIZ];

/* Type for NV_CDMA_TX_LIN_MASTER_SLP_1_I item.                            */
/* -------------------------------------------                             */
  byte  cdma_tx_lin_master_slp_1[NV_TX_LIN_MASTER_SLP_SIZ];

/*-------------------------------------------------------------------------*/

/* Type for NV_PA_VREF_I item.                                             */
/* --------------------------                                              */
  byte  pa_vref[NV_PA_VREF_SIZ];

/* Type for NV_TX_AGC_COMP_I item.                                         */
/* ------------------------------                                          */
  byte  tx_agc_comp[NV_TX_AGC_COMP_SIZ];

/* Type for NV_TX_LIMITER_I item.                                          */
/* -----------------------------                                           */
  int1  tx_limiter[NV_TX_LIMITER_SIZ];

/* Type for NV_TEMP_TABLES_I item.                                         */
/* ------------------------------                                          */
  byte  temp_tables[NV_TEMP_TABLES_SIZ];

/* Type for NV_TEMP_COMP_OFF_I item.                                       */
/* --------------------------------                                        */
  int1  temp_comp_off[NV_TEMP_TABLES_SIZ];

/* Type for NV_TEMP_COMP_SLP_I item.                                       */
/* --------------------------------                                        */
  int1  temp_comp_slp[NV_TEMP_TABLES_X3_SIZ];

/* Type for NV_TEMP_BLOCK_I item.                                          */
/* -----------------------------                                           */
  byte  temp_block[NV_TEMP_BLOCK_SIZ];

/* Type for NV_MARKOV_TX_I item.                                           */
/* ----------------------------                                            */
  byte  markov_tx[NV_MARKOV_TX_SIZ];

/*-------------------------------------------------------------------------*/

/* Type for NV_F_IDWRITE_I item.                                           */
/* ----------------------------                                            */
  byte                    f_idwrite;

/* Type for NV_F_RFADJ_I item.                                             */
/* --------------------------                                              */
  byte                    f_rfadj;

/* Type for NV_F_BATTADJ_I item.                                           */
/* ----------------------------                                            */
  byte                    f_battadj;

/* Type for NV_F_UP_I item.                                                */
/* -----------------------                                                 */
  byte                    f_up;

/* Type for NV_ID_OPERINFO_I item.                                         */
/* ------------------------------                                          */
  byte                    id_oprinfo;

/* Type for NV_ID_SECUCODE_I item.                                         */
/* ------------------------------                                          */
  word                    id_secucode;

/* Type for NV_ID_PHONENUM_I item.                                         */
/* ------------------------------                                          */
  nv_id_phonenum_type     id_phonenum;

/* Type for NV_ID_MANUFNUM_I item.                                         */
/* ------------------------------                                          */
  nv_id_manufnum_type     id_manufnum;

/* Type for NV_X_KEY_I item.                                               */
/* ------------------------                                                */
  nv_x_key_type           id_x_key;

/* Type for NV_Y_KEY_I item.                                               */
/* ------------------------                                                */
  nv_y_key_type           id_y_key;

/* Type for NV_Z_KEY_I item.                                               */
/* ------------------------                                                */
  nv_z_key_type           id_z_key;

/* Type for NV_ID_KEY_I item.                                              */
/* -------------------------                                               */
  nv_id_key_type          id_id_key;

/*-------------------------------------------------------------------------*/

/* Type for NV_BB_RXBATFULLTHRESH_I item.                                  */
/* -------------------------------------                                   */
  byte                    bb_rxbatfullthresh;

/* Type for NV_BB_RXBATMIDTHRESH_I item.                                   */
/* ------------------------------------                                    */
  byte                    bb_rxbatmidthresh;

/* Type for NV_BB_RXBATLITTLETHRESH_I item.                                */
/* ---------------------------------------                                 */
  byte                    bb_rxbatlittlethresh;

/* Type for NV_BB_TXBATFULLTHRESH_I item.                                  */
/* -------------------------------------                                   */
  byte                    bb_txbatfullthresh;

/* Type for NV_BB_TXBATMIDTHRESH_I item.                                   */
/* ------------------------------------                                    */
  byte                    bb_txbatmidthresh;

/* Type for NV_BB_TXBATLITTLETHRESH_I item.                                */
/* ---------------------------------------                                 */
  byte                    bb_txbatlittlethresh;

/* Type for NV_BB_OVERCHARGED_I item.                                      */
/* ---------------------------------                                       */
  byte                    bb_overcharged;

/* Type for NV_BB_LCD_VOLUME_I item.                                       */
/* --------------------------------                                        */
  byte                    bb_lcd_volume;

/* Type for NV_BB_LCD_RED_I item.                                          */
/* -----------------------------                                           */
  nv_color_step_type      bb_lcd_red;

/* Type for NV_BB_LCD_GREEN_I item.                                        */
/* -------------------------------                                         */
  nv_color_step_type      bb_lcd_green;

/* Type for NV_BB_LCD_BLUE_I item.                                         */
/* ------------------------------                                          */
  nv_color_step_type      bb_lcd_blue;

/* Type for NV_BB_FLIGHT_ADJ_I item.                                       */
/* --------------------------------                                        */
  byte                    bb_flight_adj;

/* Type for NV_BB_VMSMP_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vmsmp;

/* Type for NV_BB_VRFTX_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vrftx;

/* Type for NV_BB_VRFRX_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vrfrx;

/* Type for NV_BB_VBT_I item.                                              */
/* -------------------------                                               */
  byte                    bb_vbt;

/* Type for NV_BB_VRES1_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vres1;

/* Type for NV_BB_VRES2_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vres2;

/* Type for NV_BB_VRES3_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vres3;

/* Type for NV_BB_VRES4_I item.                                            */
/* ---------------------------                                             */
  byte                    bb_vres4;

/*** END OF ADD ***/

/******************************************
 ADD 2001/07/13 ichikawa@MYTECS
     (SONY_SYS_NV_ITEM)
*******************************************/
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/* Type for NV_F_MANUF00_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf00;

/* Type for NV_F_MANUF01_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf01;

/* Type for NV_F_MANUF02_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf02;

/* Type for NV_F_MANUF03_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf03;

/* Type for NV_F_MANUF04_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf04;

/* Type for NV_F_MANUF05_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf05;

/* Type for NV_F_MANUF06_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf06;

/* Type for NV_F_MANUF07_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf07;

/* Type for NV_F_MANUF08_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf08;

/* Type for NV_F_MANUF09_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf09;

/* Type for NV_F_MANUF10_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf10;

/* Type for NV_F_MANUF11_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf11;

/* Type for NV_F_MANUF12_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf12;

/* Type for NV_F_MANUF13_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf13;

/* Type for NV_F_MANUF14_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf14;

/* Type for NV_F_MANUF15_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf15;

/* Type for NV_F_MANUF16_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf16;

/* Type for NV_F_MANUF17_I item.                                           */
/* ----------------------------                                            */
  nv_f_manuf_type         f_manuf17;

/* ↓製造調整用Item追加 2001/10/09 Y.Miyaguni(メタテクノ) */
/* Type for NV_VC_TCXO_F_I item.                                           */
/* ----------------------------                                            */
  nv_vc_tcxo_f_type       VC_TCXO_F;

/* Type for NV_TX_MAX_I item.                                              */
/* ----------------------------                                            */
  nv_tx_max_type          TX_Max;

/* Type for NV_ERR_NAME_I  item.                                           */
/* ----------------------------                                            */
  char                    Err_Name[16];

/* Type for NV_MAX_POW_I item.                                             */
/* ----------------------------                                            */
  nv_max_power_type       Max_Pow;

/* Type for NV_MIN_POW_I   item.                                           */
/* ----------------------------                                            */
  nv_min_power_type       Min_Pow;

/* Type for NV_CURRENT_I item.                                             */
/* ----------------------------                                            */
  nv_current_type         Current;

/* Type for NV_VC_TCXO_V_I item.                                           */
/* ----------------------------                                            */
  nv_vc_tcxo_v_type       VC_TCXO_V;

/* 2001/09/19 H.Sawada */
/* Add Item */
/* Type for NV_FA_PROXY_ADDRESS_I item                                     */
/* ----------------------------                                            */
  char                    fa_proxy_address[FA_PRO_ADDRESS_SIZ];

/* Type for NV_FA_PROXY_PORT_I  変更 2001/10/18 Y.Miyaguni(メタテクノ)     */
/* ----------------------------                                            */
  char                    fa_proxy_port[FA_PRO_PORT_MAX];

/* Type for NV_FA_PROXY_E2EPORT_I                                          */
/* ----------------------------                                            */
  char                    fa_proxy_e2eport[FA_PRO_E2EPORT_SIZ];

/* Type for NV_FA_PROXY_LXLPORT_I                                          */
/* ----------------------------                                            */
  char                    fa_proxy_lxlport[FA_PRO_LXLPORT_SIZ];

/* Type for NV_FA_RADIUS_ID_I                                              */
/* ----------------------------                                            */
  char                    fa_radius_id[FA_RAD_ID_SIZ];

/* Type for NV_FA_RADIUS_PASSWORD_I                                        */
/* ----------------------------                                            */
  char                    fa_radius_password[FA_RAD_PASSWORD_SIZ];

/* ↓Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */
/* Type for NV_EMAIL_USER_ADDRESS_I                                        */
/* ----------------------------                                            */
  char                    email_user_address[EMAIL_USER_ADDRESS_SIZ];

/* Type for NV_EMAIL_USER_ID_I                                             */
/* ----------------------------                                            */
  char                    email_user_id[EMAIL_USER_ID_SIZ];

/* Type for NV_EMAIL_SERVER_ADDRESS_I                                      */
/* ----------------------------                                            */
  char                    email_server_address[EMAIL_SERVER_ADDRESS_SIZ];

/* Type for NV_EMAIL_RADIUS_ID_I                                           */
/* ----------------------------                                            */
  char                    email_radius_id[EMAIL_RADIUS_ID_SIZ];

/* Type for NV_EMAIL_RADIUS_PASSWORD_I                                      */
/* ----------------------------                                             */
  char                    email_radius_password[EMAIL_RADIUS_PASSWORD_SIZ];

/* Type for NV_EMAIL_UTILITY_URL_I                                          */
/* ----------------------------                                             */
  char                    email_utility_url[EMAIL_UTILITY_URL_SIZ];

/* Type for NV_LOCATION_ADDRESS_I                                           */
/* ----------------------------                                             */
  char                    location_address[LOCATION_ADDRESS_SIZ];

/* Type for NV_LOCATION_RADIUS_ID_I                                         */
/* ----------------------------                                             */
  char                    location_radius_id[LOCATION_RADID_SIZ];

/* Type for NV_LOCATION_RADIUS_PASSWORD_I 変更 2001/10/18 Y.Miyaguni(メタテクノ) */
/* ----------------------------                                             */
  char                    location_radius_password[LOCATION_RADIUS_PASSWORD_SIZ];

/* Type for NV_WAP_PROXY_DOMAIN_I                                           */
/* ----------------------------                                             */
  char                    wap_proxy_domain[WAP_PROXY_DOMAIN_SIZ];

/* Type for NV_WAP_RADIUS_ID_I                                              */
/* ----------------------------                                             */
  char                    wap_radius_id[WAP_RADIUS_ID_SIZ];

/* Type for NV_WAP_RADIUS_PASSWORD_I                                        */
/* ----------------------------                                             */
  char                    wap_radius_password[WAP_RADIUS_PASSWORD_SIZ];

/* Type for NV_WAP_LOCAL_TIME_I                                             */
/* ----------------------------                                             */
  char                    wap_local_time[WAP_LOCAL_TIME_SIZ];

/* Type for NV_PROV_RESULT_FLAG_I                                           */
/* ----------------------------                                             */
  byte                    prov_result_flag;

/* Type for NV_F_GPSWRITE_I                                                 */
/* ----------------------------                                             */
  byte                    f_gpswrite;
/* ↑Item追加 2001/10/12 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/10/16 Y.Miyaguni(メタテクノ) */
/* Type for NV_BB_SUBLCD_CONTRAST_ADJ_I                                     */
/* ----------------------------                                             */
  signed char             bb_sublcd_contrast_adj;  /* 2001/10/25 型変更 Y.Miyaguni(メタテクノ) */

/* Type for NV_BB_SUBLCD_LIGHT_ADJ_I                                        */
/* ----------------------------                                             */
  signed char             bb_sublcd_light_adj;  /* 2001/10/25 型変更 Y.Miyaguni(メタテクノ) */
/* ↑Item追加 2001/10/16 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2001/11/27 Y.Miyaguni(メタテクノ) */
/* Type for NV_TX_VARATE_FULL_I                                            */
/* ----------------------------                                            */
  word                    tx_varate_full;

/* Type for NV_TX_VARATE_HALF_I                                            */
/* ----------------------------                                            */
  word                    tx_varate_half;

/* Type for NV_TX_VARATE_QUARTER_I                                         */
/* ----------------------------                                            */
  word                    tx_varate_quarter;

/* Type for NV_TX_VARATE_EIGHTH_I                                          */
/* ----------------------------                                            */
  word                    tx_varate_eighth;

/* Type for NV_SMS_CHAT_GW_ADDRESS_I                                       */
/* ----------------------------                                            */
  char                    sms_chat_gw_address[SMS_CHAT_GW_ADDRESS_SIZ];

/* Type for NV_SMS_GAME_GW_ADDRESS_I                                       */
/* ----------------------------                                            */
  char                    sms_game_gw_address[SMS_GAME_GW_ADDRESS_SIZ];

/* Type for NV_CP_CTRL1_I                                                  */
/* ----------------------------                                            */
  byte                    cp_ctrl1;

/* Type for NV_CP_CTRL2_I                                                  */
/* ----------------------------                                            */
  byte                    cp_ctrl2;

/* Type for NV_SRCH_QPCH_I                                                 */
/* ----------------------------                                            */
  byte                    srch_qpch[SRCH_QPCH_SIZ];
/* ↑Item追加 2001/11/27 Y.Miyaguni(メタテクノ) */

/* ↓Item追加 2002/2/12 H.Sawada(メタテクノ) */
/* Type for NV_BB_RXBATFULLTHRESH_HYSTERESIS_I                             */
/* ----------------------------                                            */
  byte                    bb_rxbatfullthresh_hysteresis;

/* Type for NV_BB_RXBATMIDTHRESH_HYSTERESIS_I                              */
/* ----------------------------                                            */
  byte                    bb_rxbatmidthresh_hysteresis;
/* ↑Item追加 2002/2/12 H.Sawada(メタテクノ) */

/* ↓Item追加 2002/05/23 H.Sawada(メタテクノ) */
/* Type for NV_PA_R_TIMER_I                                                */
/* ----------------------------                                            */
  byte                    pa_r_timer;

/* Type for NV_TEMP_COMP_OFF_FRQ_I                                         */
/* ----------------------------                                            */
  int1                    temp_comp_off_frq[NV_TEMP_COMP_OFF_FRQ_SIZ];
/* ↑Item追加 2002/05/23 H.Sawada(メタテクノ) */

/* ↓Item追加 2002/07/15 H.Sawada(メタテクノ) */
/* Type for NV_SO_LIN_OFFSET_I                                             */
/* ----------------------------                                            */
  int1                    so_lin_offset;

/* Type for NV_SO_IM_LEVEL1_I                                              */
/* ----------------------------                                            */
  int1                    so_im_level1;

/* Type for NV_SO_NON_BYPASS_TIMER_I                                       */
/* ----------------------------                                            */
  byte                    so_non_bypass_timer;

/* Type for NV_SO_BYPASS_TIMER_I                                           */
/* ----------------------------                                            */
  byte                    so_bypass_timer;

/* Type for NV_SO_GAIN_CONST_IM_I                                          */
/* ----------------------------                                            */
  byte                    so_gain_const_im;

/* Type for NV_SO_GAIN_CONST_I                                             */
/* ----------------------------                                            */
  byte                    so_gain_const;

/* Type for NV_SO_PHASE_OFFSET_I                                           */
/* ----------------------------                                            */
  byte                    so_phase_offset;
/* ↑Item追加 2002/07/15 H.Sawada(メタテクノ) */

/*** END OF ADD ***/

/*-------------------------------------------------------------------------*/
/******************************************
 ADD 2001/09/10 ichikawa@MYTECS
     For Get item info            (SONY_SYS_NV_GET_INFO)
 ADD 2001/08/06 ichikawa@MYTECS
     For NV device init           (SONY_SYS_NV_FORMAT)
 ADD 2001/07/17 ichikawa@MYTECS
     For Update Active_f Feature  (SONY_SYS_NV_FORMAT)
 ADD 2001/08/24 Y.Miyaguni
     PEEK/POKE
*******************************************/
  nv_get_item_info_type get_item_info; /* Type for "NV_GET_ITEM_INFO_F" command operation. */
  nv_dev_init_type      dev_init;      /* Type for "NV_DEV_INIT_F"      command operation. */
  nv_update_act_type    update_act;    /* Type for "NV_UPDATE_ACT_F"    command operation. */
  nv_so_peek_type       so_peek;       /* Type for "NV_SO_PEEK_F"       command operation. */
  nv_so_poke_type       so_poke;       /* Type for "NV_SO_POKE_F"       command operation. */
/*** END OF ADD ***/

} nv_item_type;


/*-------------------------------------------------------------------------*/
/******************************************
 ADD 2001/05/23 ichikawa@MYTECS
     Copyed from "nv.h"(ptx600)
     (SONY_SYS_NV)
*******************************************/
typedef struct {
  byte *data_buf;
  word data_address;
  byte len;
} nv_direct_access;
/*** END OF ADD ***/


/* The command on the NVM queue */

typedef struct {
  q_link_type           link;           /* Queue field */
  nv_items_enum_type    item;           /* Item to access */
  nv_func_enum_type     cmd;            /* READ, WRITE, PEEK, POKE, etc. */
  nv_item_type          *data_ptr;      /* Pointer to read or write data */
  rex_tcb_type          *tcb_ptr;       /* Task to signal */
  rex_sigs_type         sigs;           /* Rex signals for task */
  q_type                *done_q_ptr;    /* Where to place done buffer */
  nv_stat_enum_type     status;         /* Status of request */
} nv_cmd_type;

/*-------------------------------------------------------------------------*/

/* Return to default packing of data structures.                        */
#ifdef FEATURE_TREX
#error code not present
#endif

/*===========================================================================

                              MACROS

===========================================================================*/


/* Macro to set specific bits of the SMS deletion_list (which specifies    */
/* which SMS messages are to be deleted prior to writing a new one).       */
/* Each call sets exactly one bit, but leaves all other bits unchanged.    */

#define NV_SET_SMS_DELETE_LIST( sms_index, delete_list )    \
          ( (dword)(0x80000000>>(sms_index))|(delete_list) )

/* Macro to allow reading specific bits of the SMS deletion_list by        */
/* simple indexing.  Output is a Boolean, TRUE if the corresponding        */
/* deletion bit is set, FALSE otherwise.                                   */

#define NV_READ_SMS_DELETE_LIST( sms_index, delete_list )   \
          ( (( (0x80000000>>(sms_index))&(delete_list) ) ? TRUE : FALSE) )



/*===========================================================================

                      FUNCTION DECLARATIONS

===========================================================================*/



/*===========================================================================

FUNCTION NV_TASK

DESCRIPTION
  The main control task calls this function with rex_def_task to start up
  the nv task.  This function then initializes NV timers and command queue.
  If the major revision number has changed then this function rebuilds the
  NV itself.  Once initialization is complete the function sets MC_ACK_SIG
  and it waits for NV_START_SIG.  When the start signal is received the
  function reads and processes any request it finds on its queue until
  there are no more requests.  Once the request queue is empty the task
  then starts normal operation by waiting for and processing any new commands
  when they arrrive on its command queue.  Throughout its operation the
  NV task wakes up periodically to kick the watchdog task.

DEPENDENCIES
  This function must be called with rex_def_task _once_.  It requires the
  NV_START_SIG before proceeding past the initialization stage.

RETURN VALUE
  Never returns.

SIDE EFFECTS
  Modifies NVM.

===========================================================================*/

extern void nv_task
(
  dword param      /* parameter from REX, unused */
);


#ifndef FEATURE_MSP
/*===========================================================================

FUNCTION NV_CMD

DESCRIPTION
  This is the outside world's interface to the non volatile memory task.
  This function takes an already filled out nv_cmd_type which it places
  on the nv command queue.  The function then returns to the caller.
  Return to the caller does not mean that the command has been executed
  yet, only that it is queued for execution.  When nv_cmd is done processing
  the request it returns the buffer to the specified queue if a return
  queue adress is provided.  Otherwise it does not move the buffer.

  An example NV READ request for MIN1 is as follows:

  static   nv_cmd_type       cmd_buf;        - Define command buffer
  static   nv_item_type      data_buf;       - Define data buffer

  data_buf.min1.nam  = current_nam;          - Specify which NAM
  cmd_buf.cmd        = NV_READ_F;            - Specify read operation
  cmd_buf.tcb_ptr    = rex_self();           - Own TCB
  cmd_buf.sigs       = XX_NV_CMD_SIG;        - Signal to set when done
  cmd_buf.done_q_ptr = NULL;                 - No buffer return required
  cmd_buf.item       = NV_MIN1_I;            - Specify the item to read
  cmd_buf.data_ptr   = &data_buf;            - Where to place read data

  rex_clr_sigs (rex_self(), XX_NV_CMD_SIG);  - Clear the signal
  nv_cmd (&cmd_buf);                         - And issue the command

DEPENDENCIES
  The NV task must have been started up already.  All of the items in
  the nv_cmd_type must be already set.

RETURN VALUE
  None directly.  The requested data is returned in the buffer pointed
  to inside the nv_cmd_type.  The status variable of the nv_cmd_type
  will be updated to reflect the current status of this command as it
  is processed.  In the above nv_cmd buffer nv_cmd.status is set to:

  NV_DONE_S,      -  Request completed okay
  NV_BUSY_S,      -  Request is queued
  NV_BADCMD_S,    -  Unrecognizable command field
  NV_FULL_S,      -  The NVM is full
  NV_FAIL_S,      -  Command failed, reason other than NVM was full
  NV_NOTACTIVE_S, -  Variable was not active
  NV_BADPARM_S,   -  Bad parameter in command block
  NV_READONLY_S,  -  Parameter is write-protected and thus read only
  NV_BADTG_S,     -  Item not valid for Target
  NV_NOMEM_S,     -  free memory exhausted
  NV_NOTALLOC_S   -  address is not a valid allocation

SIDE EFFECTS
  The nv_cmd_type is placed on the NV command queue.  It must not be
  modified until the command has been processed!

===========================================================================*/

extern void nv_cmd
(
  nv_cmd_type *cmd_ptr  /* pointer to the NV command block */
);
#endif /* nFEATURE_MSP */


#ifdef FEATURE_RPC
#error code not present
#endif /* FEATURE_RPC */



/*===========================================================================

FUNCTION NV_SMS_SIZEOF

DESCRIPTION
  When passed the number of SMS message bytes, this function returns
  the number of "raw" bytes of NVRAM that will be required to store
  the SMS message.

DEPENDENCIES
  None.

RETURN VALUE
  The number of "raw" bytes of NVRAM required to store the specified
  SMS message length.

SIDE EFFECTS
  None.

===========================================================================*/

word nv_sms_sizeof
(
  word sms_message_size       /* Size of sms message data in bytes */
);



/*===========================================================================

FUNCTION NV_MEMAVAIL

DESCRIPTION
  Return the number of bytes available in the long pool for allocation
  The number is calculated at each write or free operation, and stored
  globally. This function provides an interface to that global data.

DEPENDENCIES
  nva_memavail must have been called

RETURN VALUE
  The number of bytes available in the long pool for allocation

SIDE EFFECTS
  None.

===========================================================================*/

extern word nv_memavail (void);

/*===========================================================================

FUNCTION NV_READ_ERR_LOG

DESCRIPTION
  This function reads an error log from NVM.

DEPENDENCIES
  The function MUST NOT USE ANY TASK SERVICES, so that it can be
  called when tasks are not initialized.  The function MUST NOT
  USE ERROR SERVICES.  It returns status to the caller if there
  is a failure.

RETURN VALUE
  NV_DONE_S         if it worked
  NV_NOT_ACTIVE_S   if item was not active
  NV_FAIL_S         if item could not be read

SIDE EFFECTS
  None.

===========================================================================*/

nv_stat_enum_type nv_read_err_log
(
  nv_err_log_type  *nv_err_log_ptr    /* Pointer where to return read data */
);

/*===========================================================================

FUNCTION NV_WRITE_ERR_LOG

DESCRIPTION
  This function writes the boot error log to NVM.

DEPENDENCIES
  The function MUST NOT USE ANY TASK SERVICES, so that it can be
  called when tasks are not initialized.  The function MUST NOT
  USE ERROR SERVICES.  It returns status to the caller if there
  is a failure.

RETURN VALUE
  NV_DONE_S - if it worked
  NV_FAIL_S - if item could not be written

SIDE EFFECTS
  None.

===========================================================================*/

nv_stat_enum_type nv_write_err_log
(
  nv_err_log_type  *nv_err_log_ptr    /* Pointer where to get write data */
);


/*===========================================================================

FUNCTION NV_MAX_SIZE_OF_ROAMING_LIST

DESCRIPTION
  This function returns the maximum number of bytes available for
  storage of a roaming list (per NAM).  The value returned depends
  on the total amount of NVRAM installed in the phone and the total
  number of NAMs defined.

DEPENDENCIES
  The function cannot be called until NV is initialized.  A
  premature call will raise err_fatal.

RETURN VALUE
  The maximum number of bytes available for storage of a roaming list
  (per NAM).

SIDE EFFECTS
  None.

===========================================================================*/

word  nv_max_size_of_roaming_list (void);


/*===========================================================================

FUNCTION NV_MAX_SIZE_OF_WEB_CACHE

DESCRIPTION
  This function returns the maximum number of bytes currently available
  for storage of the Unwired Planet cache.  Currently, this item is not
  supported, so this function will always return zero.

DEPENDENCIES
  The function cannot be called until NV is initialized.  A
  premature call will raise err_fatal.

RETURN VALUE
  The maximum number of bytes currently available for storage of the
  Unwired Planet cache.

SIDE EFFECTS
  None.

===========================================================================*/

word  nv_max_size_of_web_cache (void);


/*===========================================================================

FUNCTION NV_DP_CAPACITY

DESCRIPTION
  This function returns the maximum capcity of the dynamic pool.

DEPENDENCIES
  The function cannot be called until NV is initialized.

RETURN VALUE
  The maximum capacity (in bytes) of the dynamic pool.

SIDE EFFECTS
  None.

===========================================================================*/

word  nv_dp_capacity( void );


/*===========================================================================

FUNCTION NV_RESERVE_MEM

DESCRIPTION
  This function reserves a specified quantity of dynamic pool memory
  for the caller.  All users of the dynamic pool must call this function
  prior to attempting a "write" operation.  (Note: currently, only SMS
  messages are stored in the dynamic pool).

  If there is not enough available memory to fulfill the request, the
  input "accept_partial_reservation" flag is checked.  If TRUE, then all
  remaining free memory will be reserved for the caller (even though it
  will be less than the amount requested); if FALSE, then no memory will
  be reserved.

  If a reservation is made, a confirmation code is returned to the caller.
  This confirmation code must be passed back to the NV task with the
  subsequent "write" command.

DEPENDENCIES
  None.

RETURN VALUE
  An "nv_reservation_type" object is returned which contains two items:
  1) the actual amount of dynamic pool memory reserved; and
  2) a confirmation code.

SIDE EFFECTS
  The "memory available" state data items may be changed.

===========================================================================*/

nv_reservation_type  nv_reserve_mem
(
  word     amount_requested,
  boolean  accept_partial_reservation
);


/*===========================================================================

FUNCTION NV_CANCEL_RESERVATION

DESCRIPTION
  This function cancels a previously-made reservation for a specified
  quantity of dynamic pool memory (see function "nv_reserve_mem").

  Note that this function only needs to be called if a reservation
  is made that will NOT be followed by a "write" command; that is,
  if the caller decides he will not be needing the reserved memory
  after all.  Normally, a reservation disappears automatically when
  the corresponding "write" command is processed by the NV task.

  The confirmation code received by the previous call to nv_reserve_mem
  must be passed in to allow identification of which reservation is
  being cancelled and how many bytes to return to "available" status.

DEPENDENCIES
  None.

RETURN VALUE
  NV_DONE_S     - if all worked properly.
  NV_BADPARM_S  - if an invalid confirmation code was provided.

SIDE EFFECTS
  The "memory available" state data items may be changed.

===========================================================================*/

nv_stat_enum_type  nv_cancel_reservation
(
  dword    confirmation_code
);


/*===========================================================================

FUNCTION NV_PRL_IS_VALID

DESCRIPTION
  This function returns the "valid" indicator from the specified NAM's
  roaming list.

DEPENDENCIES
  None.

RETURN VALUE
  TRUE         if the roaming list "valid" field is TRUE
  FALSE        if the roaming list "valid" field is FALSE or if the
                 specified NAM is invalid or if the roaming list
                 is currently NOT_ACTIVE

SIDE EFFECTS
  None.

===========================================================================*/

boolean  nv_prl_is_valid
(
  byte  nam
);


/*===========================================================================

FUNCTION NV_PRL_VERSION

DESCRIPTION
  This function returns the "prl_version" indicator from the specified NAM's
  roaming list.

DEPENDENCIES
  None.

RETURN VALUE
  prl_version             if the roaming list for the specified NAM is
                            currently ACTIVE
  NV_PRL_VERSION_INVALID  if the specified NAM is invalid or if the
                            roaming list for the specified NAM is
                            currently NOT_ACTIVE

SIDE EFFECTS
  None.

===========================================================================*/

word  nv_prl_version
(
  byte  nam
);


/*===========================================================================

FUNCTION NV_BUILT

DESCRIPTION
  This function checks the major version number of the the NV task
  as stored at edit time, against the major version number of the
  NV EEPROM as read from NVM.  If the numbers are different then the
  function returns FALSE, which indicates that the NV is not built
  and it may not be accessed from any external task.  If the numbers
  are the same then the function returns TRUE, which indicates that
  NV is built and it may be accessed.  This function lets other units
  issue direct NV read and write commands if the status returned is
  TRUE, thus allowing NV read and write before the NV task has been
  started.

DEPENDENCIES
  This is a special use function, normally called by error services
  to allow early access to NV, and before the NV task has been started.
  If NV_BUILT returns TRUE the NV may be accessed BUT ONLY USING DIRECT
  READ AND WRITES OF THE ERROR LOG (NV_READ_ERR_LOG and NV_WRITE_ERR_LOG).
  The NV task itself can not be counted upon to be started yet and normal
  NV requests must not be used.  As with all direct read and write
  operation, the data item (here it is the major version number) must
  be contained on a signle physical NV page.

RETURN VALUE
  TRUE      - The NV has been built and direct read/write is allowed
  FALSE     - The NV has not been built and access is not allowed

SIDE EFFECTS
  None.

===========================================================================*/

extern boolean nv_built (void);


/*===========================================================================

FUNCTION NV_DETERMINE_ESN_VALIDITY

DESCRIPTION
  This function is determines if the current ESN has been programmed with the
  status of this check returned.

DEPENDENCIES
  None.

RETURN VALUE
  TRUE if the current ESN is non-zero with proper checksums, else FALSE

SIDE EFFECTS

===========================================================================*/

boolean nv_determine_esn_validity( void);


/******************************************
 ADD 2001/06/15 ichikawa@MYTECS
     For Set Init data Feature
     (SONY_SYS_NV_INIT)
*******************************************/
/*===========================================================================

FUNCTION Snv_init

DESCRIPTION
  This function provides NV Item Initial process.

DEPENDENCIES
  None.

RETURN VALUE
  NV_DONE_S
  NV_FAIL_S

SIDE EFFECTS
  None.

===========================================================================*/
LOCAL nv_stat_enum_type Snv_init
(
  void
);

/*===========================================================================

FUNCTION Snv_item_init

DESCRIPTION
  This function sets default value to input item.

DEPENDENCIES
  None.

RETURN VALUE
  NV_DONE_S     if done
  NV_FAIL_S     if fail
  NV_BADPARM_S  if bad parameter input

SIDE EFFECTS
  None.

===========================================================================*/
nv_stat_enum_type Snv_item_init
(
  nv_items_enum_type  item,
  nv_item_type        *data_ptr,
  boolean             over_write_f
);


/*===========================================================================

FUNCTION Sbbnv_init

DESCRIPTION
  Set default value to BB nv item.

DEPENDENCIES
  None.

RETURN VALUE
  None.

SIDE EFFECTS
  None.

===========================================================================*/
LOCAL void Sbbnv_init
(
  void
);

/*** END OF ADD ***/


/******************************************
 ADD 2001/08/06 ichikawa@MYTECS
     For EEPROM device init
     (SONY_SYS_NV_FORMAT)
*******************************************/

#define SNV_RSP_OK   1
#define SNV_RSP_NG   0
/*===========================================================================

FUNCTION SnvChkFormatE2P

DESCRIPTION
  This function return if EEPROM device has been formatted.

DEPENDENCIES
  None.

RETURN VALUE
  SNV_RSP_OK    if EEPROM device has been formatted.
  SNV_RSP_NG    if EEPROM device has not been formatted.

SIDE EFFECTS
  None.

===========================================================================*/
/* 関数名とリターン値のdefineを変更する。2001/09/25 Y.Miyaguni */
int SnvChkFormatE2P(void);

/*** END OF ADD ***/



/*===========================================================================

FUNCTION SNV_PEEK_QTOOL

DESCRIPTION
  NVのデータを指定したアドレスから読み出す。
  読み出せるサイズは32byte。Q社Tool用Peek関数。

DEPENDENCIES
  None.

RETURN VALUE
  NV_DONE_S    読み出し成功。
  NV_BADPARM_S 読み出しサイズ不正。
  Others

SIDE EFFECTS
  None


  2001/10/02   新規作成                          Y.Miyaguni（メタテクノ）
===========================================================================*/
LOCAL nv_stat_enum_type Snv_peek_Qtool
(
  nv_cmd_type  *cmd_ptr               /* Command block */
);

/*===========================================================================

FUNCTION SNV_POKE_QTOOL

DESCRIPTION
  NVに指定したアドレス位置からデータを書き込む。
  書き込めるサイズは32byte。Q社Tool用Poke関数。

DEPENDENCIES
  None.

RETURN VALUE
  NV_DONE_S    書き込み成功。
  NV_BADPARM_S 書き込みサイズ不正。
  Others

SIDE EFFECTS


  2001/10/02   新規作成                          Y.Miyaguni（メタテクノ）
===========================================================================*/
LOCAL nv_stat_enum_type Snv_poke_Qtool
(
  nv_cmd_type  *cmd_ptr          /* Command block */
);

/*===========================================================================

FUNCTION SIDNV_INIT

DESCRIPTION
  Set default value to ID nv item.

DEPENDENCIES
  None.

RETURN VALUE
  None.

SIDE EFFECTS
  None.

  2001/10/11   新規作成                          Y.Miyaguni（メタテクノ）
===========================================================================*/
void Sidnv_init(void);

/*===========================================================================

FUNCTION Snv_read_BattThresh

DESCRIPTION
  バッテリー用の閾値をNVから読み出すための関数。

DEPENDENCIES


RETURN VALUE
  byte  data : 読み出したバッテリー用閾値

SIDE EFFECTS


===========================================================================*/
byte Snv_read_BattThresh( nv_items_enum_type  nv_id );


#endif	// OEMSIMNV_H
