mirror from https://www.codeaurora.org/git/projects/hisense-ts7008/repository/
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 27 Jan 2012 20:27:41 +0000 (21:27 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 27 Jan 2012 20:27:41 +0000 (21:27 +0100)
14 files changed:
AMSS/diagcmd.h [new file with mode: 0644]
AMSS/diagd3des.c [new file with mode: 0644]
AMSS/diagd3des.h [new file with mode: 0644]
AMSS/diagdiag.c [new file with mode: 0644]
AMSS/diagdiag_v.h [new file with mode: 0644]
AMSS/diagfwd.c [new file with mode: 0644]
AMSS/diagsec.c [new file with mode: 0644]
AMSS/diagsec.h [new file with mode: 0644]
AMSS/nv/nv_info_tab.c [new file with mode: 0644]
AMSS/nv/nvi_items.h [new file with mode: 0644]
AMSS/nv/nvim.c [new file with mode: 0644]
AMSS/nv/nvim_items.h [new file with mode: 0644]
AMSS/nv/nvio.c [new file with mode: 0644]
AMSS/tmc.c [new file with mode: 0644]

diff --git a/AMSS/diagcmd.h b/AMSS/diagcmd.h
new file mode 100644 (file)
index 0000000..eb4fb97
--- /dev/null
@@ -0,0 +1,640 @@
+#ifndef DIAGCMD_H
+#define DIAGCMD_H
+/*!
+@ingroup packet_service
+@file diagcmd.h
+
+@brief 
+
+ Diagnostic Services Packet Processing Command Code Defintions
+
+
+ @details
+  This file contains packet id definitions and enumeration constants for subsystem identifiers (diagpkt_subsys_cmd_enum_type) 
+  for the serial interface to the dmss.  All packets must have unique identifiers (command codes). Once published, an identifier cannot
+  be changed. Subsystem identifiers (SSIDs) allow each technology area to define, grow, and maintain a list of unique packet identifiers
+  without coordinating with each other. It is required that all clients of the diagnostic dispatching service use the subsystem commands.
+  Subsystem Identifiers 250 to 254 are reserved for OEMs use only .Please refer to the documentation of 80-V1294-1 for the packet request/response 
+  defintions of each packet id . 
+
+ @note
+  DO NOT MODIFY THIS FILE WITHOUT PRIOR APPROVAL
+  Diag commands, by design, are a tightly controlled set of values.  
+  Developers may not create command IDs at will.
+  Request new commands using the following process:
+
+  1. Send email to asw.diag.request requesting command ID assignments.
+  2. Identify the command needed by name.
+  3. Provide a brief description for the command.
+
+*/
+  
+/*
+Copyright (c) 1993-2010 by QUALCOMM, Incorporated.  All Rights Reserved.
+*/
+
+
+
+/*===========================================================================
+
+                            Edit History
+
+$Header: //source/qcom/qct/core/pkg/2H09/halcyon_modem/rel/LA2.0/AMSS/products/7x30/core/api/services/diagcmd.h#2 $
+
+when       who     what, where, why
+--------   ---     ----------------------------------------------------------
+02/25/11   hm      Added subsystem id for USCRIPT tool
+01/18/11   hm      Added subsystem id for Q5 CORE 
+09/22/10   vg      Added subsystem id for STRIDE
+07/15/10   sg      Added subsystem id for QNP
+05/21/10   sg      Doxygenated the file 
+05/16/10   as      Added cmd_codes 101,102,105&106 for backward comparibility
+04/21/10   sg      Added new SSID for Ulog Services
+04/20/10   is    Remove support for DIAG_GET_PROPERTY_F, DIAG_PUT_PROPERTY_F,
+                            DIAG_GET_PERM_PROPERTY_F, and DIAG_PUT_PERM_PROPERTY_F.
+06/10/02   lcl/jwh FEATURE_HWTC changes.
+05/23/02   sfh     Added DIAG_PROTOCOL_LOOPBACK_F  (123) command.
+06/27/01   lad     Assigned equipment ID 0 to be for OEMs to use.
+05/21/01   sfh     Added DIAG_TRACE_EVENT_REPORT_F for trace event support.
+04/17/01   lad     Moved subsystem dispatch IDs from diagpkt.h.
+04/06/01   lad     Changed the name of cmd code 111 from DUAG_TUNNEL_F to 
+                   DIAG_ROUTE_F.
+02/23/01   lad     Cosmetic changes.
+09/06/00   bgc     Added support for FEATURE_FACTORY_TESTMODE with
+                   DIAG_FTM_CMD_F (set to 59, which is also DIAG_TMOB_F).
+08/31/00   lad     Added command code for tunneling capability.
+06/23/00   lad     Removed obsolete command codes and marked them "reserved".
+06/19/00   lad     Added DIAG_PARM_RETRIEVE_F
+05/31/00   jal     Added GPS statistics, session control, and grid support.
+05/15/00   lad     Added streaming config support (nice).
+02/28/00   lad     Added codes for event reporting service.
+02/02/00   lad     Added commands used with FEATURE_DIAG_QCT_EXT.
+09/17/99   lcc     Merged in RPC support from PLT archive.
+08/17/99   tac     Merged in EFS changes from branch.
+07/19/99    sk     Replacing reset_sup_fer with walsh code.
+07/19/99    sk     Added walsh code display command.
+03/30/99   lad     Added support for FEATURE_IS95B_MDR and FEATURE_SPECIAL_MDR.
+11/04/98   lad     Added 1998/1999 copyright information.
+10/29/98   jmk     Merged Module command changes into the mainline.
+                   (Replaced MOD_GET_STATUS with MOD_EXTENDED_PKT cmd code 75)
+10/27/98   jmk     Added cmd IDs for CSS command, and SMS message read/write.
+09/11/98   grl     Added feature query command
+10/06/97   jjn     Added new commands for the Module Phase 1 interface.  These
+                   include Module Status Mask, AKEY and audio control packets.
+04/23/97   jjn     Added new packet pair to allow System Unit to access 
+                   service option and caller ID information
+03/25/97   jjn     Added new command (and packets) that allow writing to NV 
+                   without going offline (for the Module only)
+02/28/97   jjn     Enabled RSSI packets for the Module, added a packet for
+                   module status and sound reporting, and added a pcket for
+                   retrieving SMS messages
+06/25/96   jmk     Added cmd id for preferred roaming list read.
+06/24/96   jmk     Added cmd id for preferred roaming list write.
+04/09/96   jmk     Added cmd ids for sending security code, and return code 
+                   if phone is not unlocked for operations that require it.
+03/06/96   jmk     Added command id for serial mode change (to AT cmd mode)
+                   and command id for get rssi (for antenna aiming/WLL only)
+08/16/95   jmk     Added command id for parm_get2 (includes MUX2 parms)
+08/10/95   jmk     Added command id for Phone State, Pilot Sets and SPC reqs
+01/28/95   ptw     Added command id to obtain System Time from the mobile.
+12/07/94   jmk     Added command id for portable sleep on/off request.
+11/07/94   jmk     Added command to request that seq_nums be used in pkts.
+09/26/94   jmk     Put DIAG_ORIG_F and DIAG_END_F back in.
+07/23/93   twp     Added DIAG_TMOB_F
+01/14/93   twp     First release
+
+===========================================================================*/
+\f
+/*--------------------------------------------------------------------------
+
+  Command Codes between the Diagnostic Monitor and the mobile. Packets
+  travelling in each direction are defined here, while the packet templates
+  for requests and responses are distinct.  Note that the same packet id
+  value can be used for both a request and a response.  These values
+  are used to index a dispatch table in diag.c, so 
+
+  DON'T CHANGE THE NUMBERS ( REPLACE UNUSED IDS WITH FILLERS ). NEW IDs
+  MUST BE ASSIGNED AT THE END.
+  
+----------------------------------------------------------------------------*/
+
+/*!
+@cond DOXYGEN_BLOAT
+*/
+/* Version Number Request/Response            */
+#define DIAG_VERNO_F    0
+
+/* Mobile Station ESN Request/Response        */
+#define DIAG_ESN_F      1
+
+/* Peek byte Request/Response                 */
+#define DIAG_PEEKB_F    2
+  
+/* Peek word Request/Response                 */
+#define DIAG_PEEKW_F    3
+
+/* Peek dword Request/Response                */
+#define DIAG_PEEKD_F    4  
+
+/* Poke byte Request/Response                 */
+#define DIAG_POKEB_F    5  
+
+/* Poke word Request/Response                 */
+#define DIAG_POKEW_F    6  
+
+/* Poke dword Request/Response                */
+#define DIAG_POKED_F    7  
+
+/* Byte output Request/Response               */
+#define DIAG_OUTP_F     8
+
+/* Word output Request/Response               */
+#define DIAG_OUTPW_F    9  
+
+/* Byte input Request/Response                */
+#define DIAG_INP_F      10 
+
+/* Word input Request/Response                */
+#define DIAG_INPW_F     11 
+
+/* DMSS status Request/Response               */
+#define DIAG_STATUS_F   12 
+
+/* 13-14 Reserved */
+#ifdef FEATURE_TECHNICS_DIAG
+/* ÓÃÓÚ²âÊÔÈí¼þʶ±ðºÍËø¿¨*/
+#define DIAG_ENCRYPT_TEST_F  13  
+/* ÓÃÓÚÉú²ú¹¤ÒÕ²âÊÔ*/
+#define DIAG_MANUFACTURE_TEST_F  14  
+#endif
+
+/* Set logging mask Request/Response          */
+#define DIAG_LOGMASK_F  15 
+
+/* Log packet Request/Response                */
+#define DIAG_LOG_F      16 
+
+/* Peek at NV memory Request/Response         */
+#define DIAG_NV_PEEK_F  17 
+
+/* Poke at NV memory Request/Response         */
+#define DIAG_NV_POKE_F  18 
+
+/* Invalid Command Response                   */
+#define DIAG_BAD_CMD_F  19 
+
+/* Invalid parmaeter Response                 */
+#define DIAG_BAD_PARM_F 20 
+
+/* Invalid packet length Response             */
+#define DIAG_BAD_LEN_F  21 
+
+/* 22-23 Reserved */
+
+/* Packet not allowed in this mode 
+   ( online vs offline )                      */
+#define DIAG_BAD_MODE_F     24
+                            
+/* info for TA power and voice graphs         */
+#define DIAG_TAGRAPH_F      25 
+
+/* Markov statistics                          */
+#define DIAG_MARKOV_F       26 
+
+/* Reset of Markov statistics                 */
+#define DIAG_MARKOV_RESET_F 27 
+
+/* Return diag version for comparison to
+   detect incompatabilities                   */
+#define DIAG_DIAG_VER_F     28 
+                            
+/* Return a timestamp                         */
+#define DIAG_TS_F           29 
+
+/* Set TA parameters                          */
+#define DIAG_TA_PARM_F      30 
+
+/* Request for msg report                     */
+#define DIAG_MSG_F          31 
+
+/* Handset Emulation -- keypress              */
+#define DIAG_HS_KEY_F       32 
+
+/* Handset Emulation -- lock or unlock        */
+#define DIAG_HS_LOCK_F      33 
+
+/* Handset Emulation -- display request       */
+#define DIAG_HS_SCREEN_F    34 
+
+/* 35 Reserved */
+
+/* Parameter Download                         */
+#define DIAG_PARM_SET_F     36 
+
+/* 37 Reserved */
+
+/* Read NV item                               */
+#define DIAG_NV_READ_F  38 
+/* Write NV item                              */
+#define DIAG_NV_WRITE_F 39 
+/* 40 Reserved */
+
+/* Mode change request                        */
+#define DIAG_CONTROL_F    41 
+
+/* Error record retreival                     */
+#define DIAG_ERR_READ_F   42 
+
+/* Error record clear                         */
+#define DIAG_ERR_CLEAR_F  43 
+
+/* Symbol error rate counter reset            */
+#define DIAG_SER_RESET_F  44 
+
+/* Symbol error rate counter report           */
+#define DIAG_SER_REPORT_F 45 
+
+/* Run a specified test                       */
+#define DIAG_TEST_F       46 
+
+/* Retreive the current dip switch setting    */
+#define DIAG_GET_DIPSW_F  47 
+
+/* Write new dip switch setting               */
+#define DIAG_SET_DIPSW_F  48 
+
+/* Start/Stop Vocoder PCM loopback            */
+#define DIAG_VOC_PCM_LB_F 49 
+
+/* Start/Stop Vocoder PKT loopback            */
+#define DIAG_VOC_PKT_LB_F 50 
+
+/* 51-52 Reserved */
+
+/* Originate a call                           */
+#define DIAG_ORIG_F 53 
+/* End a call                                 */
+#define DIAG_END_F  54 
+/* 55-57 Reserved */
+
+/* Switch to downloader                       */
+#define DIAG_DLOAD_F 58 
+/* Test Mode Commands and FTM commands        */
+#define DIAG_TMOB_F  59 
+/* Test Mode Commands and FTM commands        */
+#define DIAG_FTM_CMD_F  59 
+/* 60-62 Reserved */
+
+/* Featurization Removal requested by CMI 
+#ifdef FEATURE_HWTC 
+*/
+
+#define DIAG_TEST_STATE_F 61
+/* 
+#endif 
+*/  
+
+/* Return the current state of the phone      */
+#define DIAG_STATE_F        63 
+
+/* Return all current sets of pilots          */
+#define DIAG_PILOT_SETS_F   64 
+
+/* Send the Service Prog. Code to allow SP    */
+#define DIAG_SPC_F          65 
+
+/* Invalid nv_read/write because SP is locked */
+#define DIAG_BAD_SPC_MODE_F 66 
+
+/* get parms obsoletes PARM_GET               */
+#define DIAG_PARM_GET2_F    67 
+
+/* Serial mode change Request/Response        */
+#define DIAG_SERIAL_CHG_F   68 
+
+/* 69 Reserved */
+
+/* Send password to unlock secure operations  
+   the phone to be in a security state that
+   is wasn't - like unlocked.                 */
+#define DIAG_PASSWORD_F     70 
+
+/* An operation was attempted which required  */
+#define DIAG_BAD_SEC_MODE_F 71 
+
+/* Write Preferred Roaming list to the phone. */
+#define DIAG_PR_LIST_WR_F   72 
+
+/* Read Preferred Roaming list from the phone.*/
+#define DIAG_PR_LIST_RD_F   73 
+
+/* 74 Reserved */
+
+/* Subssytem dispatcher (extended diag cmd)   */
+#define DIAG_SUBSYS_CMD_F   75 
+
+/* 76-80 Reserved */
+
+/* Asks the phone what it supports            */
+#define DIAG_FEATURE_QUERY_F   81 
+
+/* 82 Reserved */
+
+/* Read SMS message out of NV                 */
+#define DIAG_SMS_READ_F        83 
+
+/* Write SMS message into NV                  */
+#define DIAG_SMS_WRITE_F       84 
+
+/* info for Frame Error Rate          
+   on multiple channels                       */
+#define DIAG_SUP_FER_F         85 
+
+/* Supplemental channel walsh codes           */
+#define DIAG_SUP_WALSH_CODES_F 86 
+
+/* Sets the maximum # supplemental 
+   channels                                   */
+#define DIAG_SET_MAX_SUP_CH_F  87 
+
+/* get parms including SUPP and MUX2: 
+   obsoletes PARM_GET and PARM_GET_2          */
+#define DIAG_PARM_GET_IS95B_F  88 
+
+/* Performs an Embedded File System
+   (EFS) operation.                           */
+#define DIAG_FS_OP_F           89 
+
+/* AKEY Verification.                         */
+#define DIAG_AKEY_VERIFY_F     90 
+
+/* Handset emulation - Bitmap screen          */
+#define DIAG_BMP_HS_SCREEN_F   91 
+
+/* Configure communications                   */
+#define DIAG_CONFIG_COMM_F        92 
+
+/* Extended logmask for > 32 bits.            */
+#define DIAG_EXT_LOGMASK_F        93 
+
+/* 94-95 reserved */
+
+/* Static Event reporting.                    */
+#define DIAG_EVENT_REPORT_F       96 
+
+/* Load balancing and more!                   */
+#define DIAG_STREAMING_CONFIG_F   97 
+
+/* Parameter retrieval                        */
+#define DIAG_PARM_RETRIEVE_F      98 
+
+ /* A state/status snapshot of the DMSS.      */
+#define DIAG_STATUS_SNAPSHOT_F    99
+/* Used for RPC                               */
+#define DIAG_RPC_F               100 
+
+/* Get_property requests                      */
+#define DIAG_GET_PROPERTY_F      101 
+
+/* Put_property requests                      */
+#define DIAG_PUT_PROPERTY_F      102 
+
+/* Get_guid requests                          */
+#define DIAG_GET_GUID_F          103 
+
+/* Invocation of user callbacks               */
+#define DIAG_USER_CMD_F          104 
+
+/* Get permanent properties                   */
+#define DIAG_GET_PERM_PROPERTY_F 105 
+
+/* Put permanent properties                   */
+#define DIAG_PUT_PERM_PROPERTY_F 106 
+
+/* Permanent user callbacks                   */
+#define DIAG_PERM_USER_CMD_F     107 
+
+/* GPS Session Control                        */
+#define DIAG_GPS_SESS_CTRL_F     108 
+
+/* GPS search grid                            */
+#define DIAG_GPS_GRID_F          109 
+
+/* GPS Statistics                             */
+#define DIAG_GPS_STATISTICS_F    110 
+
+/* Packet routing for multiple instances of diag */
+#define DIAG_ROUTE_F             111 
+
+/* IS2000 status                              */
+#define DIAG_IS2000_STATUS_F     112
+
+/* RLP statistics reset                       */
+#define DIAG_RLP_STAT_RESET_F    113
+
+/* (S)TDSO statistics reset                   */
+#define DIAG_TDSO_STAT_RESET_F   114
+
+/* Logging configuration packet               */
+#define DIAG_LOG_CONFIG_F        115
+
+/* Static Trace Event reporting */
+#define DIAG_TRACE_EVENT_REPORT_F 116
+
+/* SBI Read */
+#define DIAG_SBI_READ_F           117
+
+/* SBI Write */
+#define DIAG_SBI_WRITE_F          118
+
+/* SSD Verify */
+#define DIAG_SSD_VERIFY_F         119
+
+/* Log on Request */
+#define DIAG_LOG_ON_DEMAND_F      120
+
+/* Request for extended msg report */
+#define DIAG_EXT_MSG_F            121 
+
+/* ONCRPC diag packet */
+#define DIAG_ONCRPC_F             122
+
+/* Diagnostics protocol loopback. */
+#define DIAG_PROTOCOL_LOOPBACK_F  123
+
+/* Extended build ID text */
+#define DIAG_EXT_BUILD_ID_F       124
+
+/* Request for extended msg report */
+#define DIAG_EXT_MSG_CONFIG_F     125
+
+/* Extended messages in terse format */
+#define DIAG_EXT_MSG_TERSE_F      126
+
+/* Translate terse format message identifier */
+#define DIAG_EXT_MSG_TERSE_XLATE_F 127
+
+/* Subssytem dispatcher Version 2 (delayed response capable) */
+#define DIAG_SUBSYS_CMD_VER_2_F    128
+
+/* Get the event mask */
+#define DIAG_EVENT_MASK_GET_F      129
+
+/* Set the event mask */
+#define DIAG_EVENT_MASK_SET_F      130
+
+/* RESERVED CODES: 131-139 */
+
+/* Command Code for Changing Port Settings */
+#define DIAG_CHANGE_PORT_SETTINGS  140
+
+/* Country network information for assisted dialing */
+#define DIAG_CNTRY_INFO_F          141
+
+/* Send a Supplementary Service Request */
+#define DIAG_SUPS_REQ_F            142
+
+/* Originate SMS request for MMS */
+#define DIAG_MMS_ORIG_SMS_REQUEST_F 143
+
+/* Change measurement mode*/
+#define DIAG_MEAS_MODE_F           144
+
+/* Request measurements for HDR channels */
+#define DIAG_MEAS_REQ_F            145
+
+/* Send Optimized F3 messages */
+#define DIAG_QSR_EXT_MSG_TERSE_F   146
+
+#ifdef FEATURE_TECHNICS_DIAG
+/* Factory test functions, such as phone resetting the file */
+#define DIAG_FACTORY_TEST_F  201
+
+/* Number of packets defined. */
+#define DIAG_MAX_F                 201
+#else
+/* Number of packets defined. */
+#define DIAG_MAX_F                 146
+#endif
+
+
+
+typedef enum {
+  DIAG_SUBSYS_OEM                = 0,       /* Reserved for OEM use */
+  DIAG_SUBSYS_ZREX               = 1,       /* ZREX */
+  DIAG_SUBSYS_SD                 = 2,       /* System Determination */
+  DIAG_SUBSYS_BT                 = 3,       /* Bluetooth */
+  DIAG_SUBSYS_WCDMA              = 4,       /* WCDMA */
+  DIAG_SUBSYS_HDR                = 5,       /* 1xEvDO */
+  DIAG_SUBSYS_DIABLO             = 6,       /* DIABLO */
+  DIAG_SUBSYS_TREX               = 7,       /* TREX - Off-target testing environments */
+  DIAG_SUBSYS_GSM                = 8,       /* GSM */
+  DIAG_SUBSYS_UMTS               = 9,       /* UMTS */
+  DIAG_SUBSYS_HWTC               = 10,      /* HWTC */
+  DIAG_SUBSYS_FTM                = 11,      /* Factory Test Mode */
+  DIAG_SUBSYS_REX                = 12,      /* Rex */
+  DIAG_SUBSYS_OS                 = DIAG_SUBSYS_REX,
+  DIAG_SUBSYS_GPS                = 13,      /* Global Positioning System */
+  DIAG_SUBSYS_WMS                = 14,      /* Wireless Messaging Service (WMS, SMS) */
+  DIAG_SUBSYS_CM                 = 15,      /* Call Manager */
+  DIAG_SUBSYS_HS                 = 16,      /* Handset */
+  DIAG_SUBSYS_AUDIO_SETTINGS     = 17,      /* Audio Settings */
+  DIAG_SUBSYS_DIAG_SERV          = 18,      /* DIAG Services */
+  DIAG_SUBSYS_FS                 = 19,      /* File System - EFS2 */
+  DIAG_SUBSYS_PORT_MAP_SETTINGS  = 20,      /* Port Map Settings */
+  DIAG_SUBSYS_MEDIAPLAYER        = 21,      /* QCT Mediaplayer */
+  DIAG_SUBSYS_QCAMERA            = 22,      /* QCT QCamera */
+  DIAG_SUBSYS_MOBIMON            = 23,      /* QCT MobiMon */
+  DIAG_SUBSYS_GUNIMON            = 24,      /* QCT GuniMon */
+  DIAG_SUBSYS_LSM                = 25,      /* Location Services Manager */
+  DIAG_SUBSYS_QCAMCORDER         = 26,      /* QCT QCamcorder */
+  DIAG_SUBSYS_MUX1X              = 27,      /* Multiplexer */
+  DIAG_SUBSYS_DATA1X             = 28,      /* Data */
+  DIAG_SUBSYS_SRCH1X             = 29,      /* Searcher */
+  DIAG_SUBSYS_CALLP1X            = 30,      /* Call Processor */
+  DIAG_SUBSYS_APPS               = 31,      /* Applications */
+  DIAG_SUBSYS_SETTINGS           = 32,      /* Settings */
+  DIAG_SUBSYS_GSDI               = 33,      /* Generic SIM Driver Interface */
+  DIAG_SUBSYS_UIMDIAG            = DIAG_SUBSYS_GSDI,
+  DIAG_SUBSYS_TMC                = 34,      /* Task Main Controller */
+  DIAG_SUBSYS_USB                = 35,      /* Universal Serial Bus */
+  DIAG_SUBSYS_PM                 = 36,      /* Power Management */
+  DIAG_SUBSYS_DEBUG              = 37,
+  DIAG_SUBSYS_QTV                = 38,
+  DIAG_SUBSYS_CLKRGM             = 39,      /* Clock Regime */
+  DIAG_SUBSYS_DEVICES            = 40,
+  DIAG_SUBSYS_WLAN               = 41,      /* 802.11 Technology */
+  DIAG_SUBSYS_PS_DATA_LOGGING    = 42,      /* Data Path Logging */
+  DIAG_SUBSYS_PS                 = DIAG_SUBSYS_PS_DATA_LOGGING,
+  DIAG_SUBSYS_MFLO               = 43,      /* MediaFLO */
+  DIAG_SUBSYS_DTV                = 44,      /* Digital TV */
+  DIAG_SUBSYS_RRC                = 45,      /* WCDMA Radio Resource Control state */
+  DIAG_SUBSYS_PROF               = 46,      /* Miscellaneous Profiling Related */
+  DIAG_SUBSYS_TCXOMGR            = 47,
+  DIAG_SUBSYS_NV                 = 48,      /* Non Volatile Memory */
+  DIAG_SUBSYS_AUTOCONFIG         = 49,
+  DIAG_SUBSYS_PARAMS             = 50,      /* Parameters required for debugging subsystems */
+  DIAG_SUBSYS_MDDI               = 51,      /* Mobile Display Digital Interface */
+  DIAG_SUBSYS_DS_ATCOP           = 52,
+  DIAG_SUBSYS_L4LINUX            = 53,      /* L4/Linux */
+  DIAG_SUBSYS_MVS                = 54,      /* Multimode Voice Services */
+  DIAG_SUBSYS_CNV                = 55,      /* Compact NV */
+  DIAG_SUBSYS_APIONE_PROGRAM     = 56,      /* apiOne */
+  DIAG_SUBSYS_HIT                = 57,      /* Hardware Integration Test */
+  DIAG_SUBSYS_DRM                = 58,      /* Digital Rights Management */
+  DIAG_SUBSYS_DM                 = 59,      /* Device Management */
+  DIAG_SUBSYS_FC                 = 60,      /* Flow Controller */
+  DIAG_SUBSYS_MEMORY             = 61,      /* Malloc Manager */
+  DIAG_SUBSYS_FS_ALTERNATE       = 62,      /* Alternate File System */
+  DIAG_SUBSYS_REGRESSION         = 63,      /* Regression Test Commands */
+  DIAG_SUBSYS_SENSORS            = 64,      /* The sensors subsystem */
+  DIAG_SUBSYS_FLUTE              = 65,      /* FLUTE */
+  DIAG_SUBSYS_ANALOG             = 66,      /* Analog die subsystem */
+  DIAG_SUBSYS_APIONE_PROGRAM_MODEM = 67,    /* apiOne Program On Modem Processor */
+  DIAG_SUBSYS_LTE                = 68,      /* LTE */
+  DIAG_SUBSYS_BREW               = 69,      /* BREW */
+  DIAG_SUBSYS_PWRDB              = 70,      /* Power Debug Tool */
+  DIAG_SUBSYS_CHORD              = 71,      /* Chaos Coordinator */
+  DIAG_SUBSYS_SEC                = 72,      /* Security */
+  DIAG_SUBSYS_TIME               = 73,      /* Time Services */
+  DIAG_SUBSYS_Q6_CORE            = 74,      /* Q6 core services */
+  DIAG_SUBSYS_COREBSP           = 75,      /* CoreBSP */
+                                            /* Command code allocation: 
+                                                [0 - 2047]     - HWENGINES
+                                                [2048 - 2147]  - MPROC
+                                                [2148 - 2247]  - BUSES
+                                                [2248 - 2347]  - USB
+                                                [2348 - 65535] - Reserved
+                                            */
+                                                                                                                 
+  DIAG_SUBSYS_MFLO2              = 76,      /* Media Flow */
+                                            /* Command code allocation: 
+                                                [0 - 1023]       - APPs
+                                                [1024 - 65535]   - Reserved
+                                            */
+  DIAG_SUBSYS_ULOG               = 77,  /* ULog Services */
+  DIAG_SUBSYS_APR              = 78,  /* Asynchronous Packet Router (Yu, Andy)*/
+  DIAG_SUBSYS_QNP    = 79 , /*QNP (Ravinder Are , Arun Harnoor)*/
+  DIAG_SUBSYS_STRIDE    = 80 , /* Ivailo Petrov */
+  DIAG_SUBSYS_OEMDPP    = 81 , /* to read/write calibration to DPP partition */
+  DIAG_SUBSYS_Q5_CORE   = 82 , /* Requested by ADSP team */
+  DIAG_SUBSYS_USCRIPT   = 83 , /* core/power team USCRIPT tool */
+
+  DIAG_SUBSYS_LAST,
+
+  /* Subsystem IDs reserved for OEM use */
+  DIAG_SUBSYS_RESERVED_OEM_0     = 250,
+  DIAG_SUBSYS_RESERVED_OEM_1     = 251,
+  DIAG_SUBSYS_RESERVED_OEM_2     = 252,
+  DIAG_SUBSYS_RESERVED_OEM_3     = 253,
+  DIAG_SUBSYS_RESERVED_OEM_4     = 254,
+  DIAG_SUBSYS_LEGACY             = 255
+} diagpkt_subsys_cmd_enum_type;
+/*!
+@endcond
+*/
+#endif  /* DIAGCMD_H */
+
+
+
diff --git a/AMSS/diagd3des.c b/AMSS/diagd3des.c
new file mode 100644 (file)
index 0000000..ec02fa3
--- /dev/null
@@ -0,0 +1,403 @@
+/* D3DES \r
+ *\r
+ * A portable, public domain, version of the Data Encryption Standard.\r
+ *\r
+ * Copyright (c) 2004 by Hisense Incorporated. All Rights Reserved.\r
+ */\r
+\r
+#include "diagd3des.h"\r
+\r
+static void diag_scrunch(unsigned char *, unsigned long *);\r
+static void diag_unscrun(unsigned long *, unsigned char *);\r
+static void diag_desfunc(unsigned long *, unsigned long *);\r
+static void diag_cookey(unsigned long *);\r
+\r
+static unsigned long diag_knl[32] = { 0L };\r
+\r
+static const unsigned short diag_bytebit[8]    = {\r
+       0200, 0100, 040, 020, 010, 04, 02, 01 };\r
+\r
+static const unsigned long diag_bigbyte[24] = {\r
+       0x800000L,      0x400000L,      0x200000L,      0x100000L,\r
+       0x80000L,       0x40000L,       0x20000L,       0x10000L,\r
+       0x8000L,        0x4000L,        0x2000L,        0x1000L,\r
+       0x800L,         0x400L,         0x200L,         0x100L,\r
+       0x80L,          0x40L,          0x20L,          0x10L,\r
+       0x8L,           0x4L,           0x2L,           0x1L    };\r
+\r
+/* Use the key schedule specified in the Standard (ANSI X3.92-1981). */\r
+\r
+static const unsigned char diag_pc1[56] = {\r
+       56, 48, 40, 32, 24, 16,  8,      0, 57, 49, 41, 33, 25, 17,\r
+        9,  1, 58, 50, 42, 34, 26,     18, 10,  2, 59, 51, 43, 35,\r
+       62, 54, 46, 38, 30, 22, 14,      6, 61, 53, 45, 37, 29, 21,\r
+       13,  5, 60, 52, 44, 36, 28,     20, 12,  4, 27, 19, 11,  3 };\r
+\r
+static const unsigned char diag_totrot[16] = {\r
+       1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 };\r
+\r
+static const unsigned char diag_pc2[48] = {\r
+       13, 16, 10, 23,  0,  4,  2, 27, 14,  5, 20,  9,\r
+       22, 18, 11,  3, 25,  7, 15,  6, 26, 19, 12,  1,\r
+       40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,\r
+       43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };\r
+\r
+void diag_deskey(unsigned char *key, short edf)        /* Thanks to James Gillogly & Phil Karn! */\r
+{\r
+       register int i, j, l, m, n;\r
+       unsigned char diag_pc1m[56], pcr[56];\r
+       unsigned long kn[32];\r
+\r
+       for ( j = 0; j < 56; j++ ) {\r
+               l = diag_pc1[j];\r
+               m = l & 07;\r
+               diag_pc1m[j] = (key[l >> 3] & diag_bytebit[m]) ? 1 : 0;\r
+               }\r
+       for( i = 0; i < 16; i++ ) {\r
+               if( edf == DE1 ) m = (15 - i) << 1;\r
+               else m = i << 1;\r
+               n = m + 1;\r
+               kn[m] = kn[n] = 0L;\r
+               for( j = 0; j < 28; j++ ) {\r
+                       l = j + diag_totrot[i];\r
+                       if( l < 28 ) pcr[j] = diag_pc1m[l];\r
+                       else pcr[j] = diag_pc1m[l - 28];\r
+                       }\r
+               for( j = 28; j < 56; j++ ) {\r
+                   l = j + diag_totrot[i];\r
+                   if( l < 56 ) pcr[j] = diag_pc1m[l];\r
+                   else pcr[j] = diag_pc1m[l - 28];\r
+                   }\r
+               for( j = 0; j < 24; j++ ) {\r
+                       if( pcr[diag_pc2[j]] ) kn[m] |= diag_bigbyte[j];\r
+                       if( pcr[diag_pc2[j+24]] ) kn[n] |= diag_bigbyte[j];\r
+                       }\r
+               }\r
+       diag_cookey(kn);\r
+       return;\r
+       }\r
+\r
+static void diag_cookey(register unsigned long *raw1)\r
+{\r
+       register unsigned long *cook, *raw0;\r
+       unsigned long dough[32];\r
+       register int i;\r
+\r
+       cook = dough;\r
+       for( i = 0; i < 16; i++, raw1++ ) {\r
+               raw0 = raw1++;\r
+               *cook    = (*raw0 & 0x00fc0000L) << 6;\r
+               *cook   |= (*raw0 & 0x00000fc0L) << 10;\r
+               *cook   |= (*raw1 & 0x00fc0000L) >> 10;\r
+               *cook++ |= (*raw1 & 0x00000fc0L) >> 6;\r
+               *cook    = (*raw0 & 0x0003f000L) << 12;\r
+               *cook   |= (*raw0 & 0x0000003fL) << 16;\r
+               *cook   |= (*raw1 & 0x0003f000L) >> 4;\r
+               *cook++ |= (*raw1 & 0x0000003fL);\r
+               }\r
+       diag_usekey(dough);\r
+       return;\r
+       }\r
+\r
+void diag_cpkey(register unsigned long *into)\r
+{\r
+       register unsigned long *from, *endp;\r
+\r
+       from = diag_knl, endp = &diag_knl[32];\r
+       while( from < endp ) *into++ = *from++;\r
+       return;\r
+       }\r
+\r
+void diag_usekey(register unsigned long *from)\r
+{\r
+       register unsigned long *to, *endp;\r
+\r
+       to = diag_knl, endp = &diag_knl[32];\r
+       while( to < endp ) *to++ = *from++;\r
+       return;\r
+       }\r
+\r
+void diag_des(unsigned char *inblock, unsigned char *outblock)\r
+{\r
+       unsigned long work[2];\r
+\r
+       diag_scrunch(inblock, work);\r
+       diag_desfunc(work, diag_knl);\r
+       diag_unscrun(work, outblock);\r
+       return;\r
+       }\r
+\r
+static void diag_scrunch(register unsigned char *outof, register unsigned long *into)\r
+{\r
+       *into    = (*outof++ & 0xffL) << 24;\r
+       *into   |= (*outof++ & 0xffL) << 16;\r
+       *into   |= (*outof++ & 0xffL) << 8;\r
+       *into++ |= (*outof++ & 0xffL);\r
+       *into    = (*outof++ & 0xffL) << 24;\r
+       *into   |= (*outof++ & 0xffL) << 16;\r
+       *into   |= (*outof++ & 0xffL) << 8;\r
+       *into   |= (*outof   & 0xffL);\r
+       return;\r
+       }\r
+\r
+static void diag_unscrun(register unsigned long *outof, register unsigned char *into)\r
+{\r
+       *into++ = (*outof >> 24) & 0xffL;\r
+       *into++ = (*outof >> 16) & 0xffL;\r
+       *into++ = (*outof >>  8) & 0xffL;\r
+       *into++ =  *outof++      & 0xffL;\r
+       *into++ = (*outof >> 24) & 0xffL;\r
+       *into++ = (*outof >> 16) & 0xffL;\r
+       *into++ = (*outof >>  8) & 0xffL;\r
+       *into   =  *outof        & 0xffL;\r
+       return;\r
+       }\r
+\r
+static const unsigned long diag_SP1[64] = {\r
+       0x01010400L, 0x00000000L, 0x00010000L, 0x01010404L,\r
+       0x01010004L, 0x00010404L, 0x00000004L, 0x00010000L,\r
+       0x00000400L, 0x01010400L, 0x01010404L, 0x00000400L,\r
+       0x01000404L, 0x01010004L, 0x01000000L, 0x00000004L,\r
+       0x00000404L, 0x01000400L, 0x01000400L, 0x00010400L,\r
+       0x00010400L, 0x01010000L, 0x01010000L, 0x01000404L,\r
+       0x00010004L, 0x01000004L, 0x01000004L, 0x00010004L,\r
+       0x00000000L, 0x00000404L, 0x00010404L, 0x01000000L,\r
+       0x00010000L, 0x01010404L, 0x00000004L, 0x01010000L,\r
+       0x01010400L, 0x01000000L, 0x01000000L, 0x00000400L,\r
+       0x01010004L, 0x00010000L, 0x00010400L, 0x01000004L,\r
+       0x00000400L, 0x00000004L, 0x01000404L, 0x00010404L,\r
+       0x01010404L, 0x00010004L, 0x01010000L, 0x01000404L,\r
+       0x01000004L, 0x00000404L, 0x00010404L, 0x01010400L,\r
+       0x00000404L, 0x01000400L, 0x01000400L, 0x00000000L,\r
+       0x00010004L, 0x00010400L, 0x00000000L, 0x01010004L };\r
+\r
+static const unsigned long diag_SP2[64] = {\r
+       0x80108020L, 0x80008000L, 0x00008000L, 0x00108020L,\r
+       0x00100000L, 0x00000020L, 0x80100020L, 0x80008020L,\r
+       0x80000020L, 0x80108020L, 0x80108000L, 0x80000000L,\r
+       0x80008000L, 0x00100000L, 0x00000020L, 0x80100020L,\r
+       0x00108000L, 0x00100020L, 0x80008020L, 0x00000000L,\r
+       0x80000000L, 0x00008000L, 0x00108020L, 0x80100000L,\r
+       0x00100020L, 0x80000020L, 0x00000000L, 0x00108000L,\r
+       0x00008020L, 0x80108000L, 0x80100000L, 0x00008020L,\r
+       0x00000000L, 0x00108020L, 0x80100020L, 0x00100000L,\r
+       0x80008020L, 0x80100000L, 0x80108000L, 0x00008000L,\r
+       0x80100000L, 0x80008000L, 0x00000020L, 0x80108020L,\r
+       0x00108020L, 0x00000020L, 0x00008000L, 0x80000000L,\r
+       0x00008020L, 0x80108000L, 0x00100000L, 0x80000020L,\r
+       0x00100020L, 0x80008020L, 0x80000020L, 0x00100020L,\r
+       0x00108000L, 0x00000000L, 0x80008000L, 0x00008020L,\r
+       0x80000000L, 0x80100020L, 0x80108020L, 0x00108000L };\r
+\r
+static const unsigned long diag_SP3[64] = {\r
+       0x00000208L, 0x08020200L, 0x00000000L, 0x08020008L,\r
+       0x08000200L, 0x00000000L, 0x00020208L, 0x08000200L,\r
+       0x00020008L, 0x08000008L, 0x08000008L, 0x00020000L,\r
+       0x08020208L, 0x00020008L, 0x08020000L, 0x00000208L,\r
+       0x08000000L, 0x00000008L, 0x08020200L, 0x00000200L,\r
+       0x00020200L, 0x08020000L, 0x08020008L, 0x00020208L,\r
+       0x08000208L, 0x00020200L, 0x00020000L, 0x08000208L,\r
+       0x00000008L, 0x08020208L, 0x00000200L, 0x08000000L,\r
+       0x08020200L, 0x08000000L, 0x00020008L, 0x00000208L,\r
+       0x00020000L, 0x08020200L, 0x08000200L, 0x00000000L,\r
+       0x00000200L, 0x00020008L, 0x08020208L, 0x08000200L,\r
+       0x08000008L, 0x00000200L, 0x00000000L, 0x08020008L,\r
+       0x08000208L, 0x00020000L, 0x08000000L, 0x08020208L,\r
+       0x00000008L, 0x00020208L, 0x00020200L, 0x08000008L,\r
+       0x08020000L, 0x08000208L, 0x00000208L, 0x08020000L,\r
+       0x00020208L, 0x00000008L, 0x08020008L, 0x00020200L };\r
+\r
+static const unsigned long diag_SP4[64] = {\r
+       0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,\r
+       0x00802080L, 0x00800081L, 0x00800001L, 0x00002001L,\r
+       0x00000000L, 0x00802000L, 0x00802000L, 0x00802081L,\r
+       0x00000081L, 0x00000000L, 0x00800080L, 0x00800001L,\r
+       0x00000001L, 0x00002000L, 0x00800000L, 0x00802001L,\r
+       0x00000080L, 0x00800000L, 0x00002001L, 0x00002080L,\r
+       0x00800081L, 0x00000001L, 0x00002080L, 0x00800080L,\r
+       0x00002000L, 0x00802080L, 0x00802081L, 0x00000081L,\r
+       0x00800080L, 0x00800001L, 0x00802000L, 0x00802081L,\r
+       0x00000081L, 0x00000000L, 0x00000000L, 0x00802000L,\r
+       0x00002080L, 0x00800080L, 0x00800081L, 0x00000001L,\r
+       0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,\r
+       0x00802081L, 0x00000081L, 0x00000001L, 0x00002000L,\r
+       0x00800001L, 0x00002001L, 0x00802080L, 0x00800081L,\r
+       0x00002001L, 0x00002080L, 0x00800000L, 0x00802001L,\r
+       0x00000080L, 0x00800000L, 0x00002000L, 0x00802080L };\r
+\r
+static const unsigned long diag_SP5[64] = {\r
+       0x00000100L, 0x02080100L, 0x02080000L, 0x42000100L,\r
+       0x00080000L, 0x00000100L, 0x40000000L, 0x02080000L,\r
+       0x40080100L, 0x00080000L, 0x02000100L, 0x40080100L,\r
+       0x42000100L, 0x42080000L, 0x00080100L, 0x40000000L,\r
+       0x02000000L, 0x40080000L, 0x40080000L, 0x00000000L,\r
+       0x40000100L, 0x42080100L, 0x42080100L, 0x02000100L,\r
+       0x42080000L, 0x40000100L, 0x00000000L, 0x42000000L,\r
+       0x02080100L, 0x02000000L, 0x42000000L, 0x00080100L,\r
+       0x00080000L, 0x42000100L, 0x00000100L, 0x02000000L,\r
+       0x40000000L, 0x02080000L, 0x42000100L, 0x40080100L,\r
+       0x02000100L, 0x40000000L, 0x42080000L, 0x02080100L,\r
+       0x40080100L, 0x00000100L, 0x02000000L, 0x42080000L,\r
+       0x42080100L, 0x00080100L, 0x42000000L, 0x42080100L,\r
+       0x02080000L, 0x00000000L, 0x40080000L, 0x42000000L,\r
+       0x00080100L, 0x02000100L, 0x40000100L, 0x00080000L,\r
+       0x00000000L, 0x40080000L, 0x02080100L, 0x40000100L };\r
+\r
+static const unsigned long diag_SP6[64] = {\r
+       0x20000010L, 0x20400000L, 0x00004000L, 0x20404010L,\r
+       0x20400000L, 0x00000010L, 0x20404010L, 0x00400000L,\r
+       0x20004000L, 0x00404010L, 0x00400000L, 0x20000010L,\r
+       0x00400010L, 0x20004000L, 0x20000000L, 0x00004010L,\r
+       0x00000000L, 0x00400010L, 0x20004010L, 0x00004000L,\r
+       0x00404000L, 0x20004010L, 0x00000010L, 0x20400010L,\r
+       0x20400010L, 0x00000000L, 0x00404010L, 0x20404000L,\r
+       0x00004010L, 0x00404000L, 0x20404000L, 0x20000000L,\r
+       0x20004000L, 0x00000010L, 0x20400010L, 0x00404000L,\r
+       0x20404010L, 0x00400000L, 0x00004010L, 0x20000010L,\r
+       0x00400000L, 0x20004000L, 0x20000000L, 0x00004010L,\r
+       0x20000010L, 0x20404010L, 0x00404000L, 0x20400000L,\r
+       0x00404010L, 0x20404000L, 0x00000000L, 0x20400010L,\r
+       0x00000010L, 0x00004000L, 0x20400000L, 0x00404010L,\r
+       0x00004000L, 0x00400010L, 0x20004010L, 0x00000000L,\r
+       0x20404000L, 0x20000000L, 0x00400010L, 0x20004010L };\r
+\r
+static const unsigned long diag_SP7[64] = {\r
+       0x00200000L, 0x04200002L, 0x04000802L, 0x00000000L,\r
+       0x00000800L, 0x04000802L, 0x00200802L, 0x04200800L,\r
+       0x04200802L, 0x00200000L, 0x00000000L, 0x04000002L,\r
+       0x00000002L, 0x04000000L, 0x04200002L, 0x00000802L,\r
+       0x04000800L, 0x00200802L, 0x00200002L, 0x04000800L,\r
+       0x04000002L, 0x04200000L, 0x04200800L, 0x00200002L,\r
+       0x04200000L, 0x00000800L, 0x00000802L, 0x04200802L,\r
+       0x00200800L, 0x00000002L, 0x04000000L, 0x00200800L,\r
+       0x04000000L, 0x00200800L, 0x00200000L, 0x04000802L,\r
+       0x04000802L, 0x04200002L, 0x04200002L, 0x00000002L,\r
+       0x00200002L, 0x04000000L, 0x04000800L, 0x00200000L,\r
+       0x04200800L, 0x00000802L, 0x00200802L, 0x04200800L,\r
+       0x00000802L, 0x04000002L, 0x04200802L, 0x04200000L,\r
+       0x00200800L, 0x00000000L, 0x00000002L, 0x04200802L,\r
+       0x00000000L, 0x00200802L, 0x04200000L, 0x00000800L,\r
+       0x04000002L, 0x04000800L, 0x00000800L, 0x00200002L };\r
+\r
+static const unsigned long diag_SP8[64] = {\r
+       0x10001040L, 0x00001000L, 0x00040000L, 0x10041040L,\r
+       0x10000000L, 0x10001040L, 0x00000040L, 0x10000000L,\r
+       0x00040040L, 0x10040000L, 0x10041040L, 0x00041000L,\r
+       0x10041000L, 0x00041040L, 0x00001000L, 0x00000040L,\r
+       0x10040000L, 0x10000040L, 0x10001000L, 0x00001040L,\r
+       0x00041000L, 0x00040040L, 0x10040040L, 0x10041000L,\r
+       0x00001040L, 0x00000000L, 0x00000000L, 0x10040040L,\r
+       0x10000040L, 0x10001000L, 0x00041040L, 0x00040000L,\r
+       0x00041040L, 0x00040000L, 0x10041000L, 0x00001000L,\r
+       0x00000040L, 0x10040040L, 0x00001000L, 0x00041040L,\r
+       0x10001000L, 0x00000040L, 0x10000040L, 0x10040000L,\r
+       0x10040040L, 0x10000000L, 0x00040000L, 0x10001040L,\r
+       0x00000000L, 0x10041040L, 0x00040040L, 0x10000040L,\r
+       0x10040000L, 0x10001000L, 0x10001040L, 0x00000000L,\r
+       0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L,\r
+       0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L };\r
+\r
+static void diag_desfunc(register unsigned long *block, register unsigned long *keys)\r
+{\r
+       register unsigned long fval, work, right, leftt;\r
+       register int round;\r
+\r
+       leftt = block[0];\r
+       right = block[1];\r
+       work = ((leftt >> 4) ^ right) & 0x0f0f0f0fL;\r
+       right ^= work;\r
+       leftt ^= (work << 4);\r
+       work = ((leftt >> 16) ^ right) & 0x0000ffffL;\r
+       right ^= work;\r
+       leftt ^= (work << 16);\r
+       work = ((right >> 2) ^ leftt) & 0x33333333L;\r
+       leftt ^= work;\r
+       right ^= (work << 2);\r
+       work = ((right >> 8) ^ leftt) & 0x00ff00ffL;\r
+       leftt ^= work;\r
+       right ^= (work << 8);\r
+       right = ((right << 1) | ((right >> 31) & 1L)) & 0xffffffffL;\r
+       work = (leftt ^ right) & 0xaaaaaaaaL;\r
+       leftt ^= work;\r
+       right ^= work;\r
+       leftt = ((leftt << 1) | ((leftt >> 31) & 1L)) & 0xffffffffL;\r
+\r
+       for( round = 0; round < 8; round++ ) {\r
+               work  = (right << 28) | (right >> 4);\r
+               work ^= *keys++;\r
+               fval  = diag_SP7[ work           & 0x3fL];\r
+               fval |= diag_SP5[(work >>  8) & 0x3fL];\r
+               fval |= diag_SP3[(work >> 16) & 0x3fL];\r
+               fval |= diag_SP1[(work >> 24) & 0x3fL];\r
+               work  = right ^ *keys++;\r
+               fval |= diag_SP8[ work           & 0x3fL];\r
+               fval |= diag_SP6[(work >>  8) & 0x3fL];\r
+               fval |= diag_SP4[(work >> 16) & 0x3fL];\r
+               fval |= diag_SP2[(work >> 24) & 0x3fL];\r
+               leftt ^= fval;\r
+               work  = (leftt << 28) | (leftt >> 4);\r
+               work ^= *keys++;\r
+               fval  = diag_SP7[ work           & 0x3fL];\r
+               fval |= diag_SP5[(work >>  8) & 0x3fL];\r
+               fval |= diag_SP3[(work >> 16) & 0x3fL];\r
+               fval |= diag_SP1[(work >> 24) & 0x3fL];\r
+               work  = leftt ^ *keys++;\r
+               fval |= diag_SP8[ work           & 0x3fL];\r
+               fval |= diag_SP6[(work >>  8) & 0x3fL];\r
+               fval |= diag_SP4[(work >> 16) & 0x3fL];\r
+               fval |= diag_SP2[(work >> 24) & 0x3fL];\r
+               right ^= fval;\r
+               }\r
+\r
+       right = (right << 31) | (right >> 1);\r
+       work = (leftt ^ right) & 0xaaaaaaaaL;\r
+       leftt ^= work;\r
+       right ^= work;\r
+       leftt = (leftt << 31) | (leftt >> 1);\r
+       work = ((leftt >> 8) ^ right) & 0x00ff00ffL;\r
+       right ^= work;\r
+       leftt ^= (work << 8);\r
+       work = ((leftt >> 2) ^ right) & 0x33333333L;\r
+       right ^= work;\r
+       leftt ^= (work << 2);\r
+       work = ((right >> 16) ^ leftt) & 0x0000ffffL;\r
+       leftt ^= work;\r
+       right ^= (work << 16);\r
+       work = ((right >> 4) ^ leftt) & 0x0f0f0f0fL;\r
+       leftt ^= work;\r
+       right ^= (work << 4);\r
+       *block++ = right;\r
+       *block = leftt;\r
+       return;\r
+       }\r
+\r
+ /*\r
+ *Validation sets:\r
+ *\r
+ * Single-length key, single-length plaintext -\r
+ * Key   : 0123 4567 89ab cdef\r
+ * Plain  : 0123 4567 89ab cde7\r
+ * Cipher : c957 4425 6a5e d31d\r
+ *\r
+ * Double-length key, single-length plaintext -\r
+ * Key   : 0123 4567 89ab cdef fedc ba98 7654 3210\r
+ * Plain  : 0123 4567 89ab cde7\r
+ * Cipher : 7f1d 0a77 826b 8aff\r
+ *\r
+ * Double-length key, double-length plaintext -\r
+ * Key   : 0123 4567 89ab cdef fedc ba98 7654 3210\r
+ * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff\r
+ * Cipher : 27a0 8440 406a df60 278f 47cf 42d6 15d7\r
+ *\r
+ * Triple-length key, single-length plaintext -\r
+ * Key   : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567\r
+ * Plain  : 0123 4567 89ab cde7\r
+ * Cipher : de0b 7c06 ae5e 0ed5\r
+ *\r
+ * Triple-length key, double-length plaintext -\r
+ * Key   : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567\r
+ * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff\r
+ * Cipher : ad0d 1b30 ac17 cf07 0ed1 1c63 81e4 4de5\r
+ *\r
+ * d3des V5.0a rwo 9208.07 18:44 Graven Imagery\r
+ */\r
diff --git a/AMSS/diagd3des.h b/AMSS/diagd3des.h
new file mode 100644 (file)
index 0000000..687142c
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef DIAGD3DES_H\r
+#define DIAGD3DES_H\r
+\r
+/* D3DES \r
+ *\r
+ * A portable, public domain, version of the Data Encryption Standard.\r
+ *\r
+ * Copyright (c) 2004 by Hisense Incorporated. All Rights Reserved.\r
+ */\r
+\r
+#define EN0    0       /* MODE == encrypt */\r
+#define DE1    1       /* MODE == decrypt */\r
+\r
+/* A useful alias on 68000-ish machines, but NOT USED HERE. */\r
+\r
+typedef union {\r
+       unsigned long blok[2];\r
+       unsigned short word[4];\r
+       unsigned char byte[8];\r
+       } M68K;\r
+\r
+extern void diag_deskey(unsigned char *, short);\r
+/*                   hexkey[8]     MODE\r
+ * Sets the internal key register according to the hexadecimal\r
+ * key contained in the 8 bytes of hexkey, according to the DES,\r
+ * for encryption or decryption according to MODE.\r
+ */\r
+\r
+extern void diag_usekey(unsigned long *);\r
+/*                 cookedkey[32]\r
+ * Loads the internal key register with the data in cookedkey.\r
+ */\r
+\r
+extern void diag_cpkey(unsigned long *);\r
+/*                cookedkey[32]\r
+ * Copies the contents of the internal key register into the storage\r
+ * located at &cookedkey[0].\r
+ */\r
+\r
+extern void diag_des(unsigned char *, unsigned char *);\r
+/*                 from[8]           to[8]\r
+ * Encrypts/Decrypts (according to the key currently loaded in the\r
+ * internal key register) one block of eight bytes at address 'from'\r
+ * into the block at address 'to'.  They can be the same.\r
+ */\r
+\r
+#endif\r
+\r
+\r
diff --git a/AMSS/diagdiag.c b/AMSS/diagdiag.c
new file mode 100644 (file)
index 0000000..bc87331
--- /dev/null
@@ -0,0 +1,2231 @@
+/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*\r
+\r
+                Diagnostics Packet Processing Common Routines\r
+\r
+General Description\r
+  Core diagnostic packet processing routines that are common to all targets.\r
+\r
+Copyright (c) 2000-2010 by QUALCOMM, Incorporated.  All Rights Reserved.\r
+*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/\r
+\r
+/*===========================================================================\r
+\r
+                           Edit History\r
+\r
+$Header: //source/qcom/qct/core/pkg/2H09/halcyon_modem/rel/LA2.0/AMSS/products/7x30/core/services/diag/DCM/rtos/src/diagdiag.c#1 $\r
+\r
+when       who     what, where, why\r
+--------   ---     ----------------------------------------------------------\r
+07/15/10   sg      Moving  diagdiag_memop_tbl_mutex to diagdiag_common.c \r
+07/10/10   vs      Added support for diagpeek/poke registration API.\r
+06/22/10   is      Changed external flag FEATURE_VOC_TASK into internal flag\r
+                   DIAG_VOC_TASK.\r
+06/07/10   is      Mainlined T_MSM3.\r
+06/03/10   sg      Added FEATURE_VOC_TASK back \r
+05/10/10   JV      Fix for compile error when FEATURE_DIAG_DISALLOW_MEM_OPS\r
+                   is defined.\r
+04/29/10   is      Removed functionality for ERR_HAS_NV_LOG_PACKET not defined\r
+04/20/10   is      Remove support for DIAG_GET_PROPERTY_F, DIAG_PUT_PROPERTY_F,\r
+                   DIAG_GET_PERM_PROPERTY_F, and DIAG_PUT_PERM_PROPERTY_F.\r
+03/11/10   sg      Cleaning up FEATURE_VOC_TASK feature\r
+12/28/09   ps      Fixed Klocwork errors & compiler warnings.\r
+10/29/09   sg      Split file into diagdiag_common and diagdiag.c and moved common\r
+                   functionality to diagdiag_common.c\r
+\r
+===========================================================================*/\r
+\r
+#if defined __cplusplus\r
+  extern "C" {\r
+#endif\r
+\r
+#include "comdef.h"\r
+\r
+#include "customer.h"\r
+#include "feature.h"\r
+\r
+#include "diagcmd.h"\r
+#include "diag_v.h"\r
+#include "diagi_v.h"\r
+#include "diagdiag_v.h"\r
+#include "diagbuf.h" /* For diagbuf_flush */\r
+#include "diagtarget.h"\r
+\r
+#include "ts.h"\r
+#include "hw.h"\r
+#include "assert.h"\r
+\r
+#include "msg.h"\r
+\r
+\r
+\r
+#include "qw.h"\r
+\r
+#include "osal.h"\r
+#include "diagpkt.h"\r
+\r
+\r
+\r
+#define DIAGDIAG_MAX_MEM_OP_TBL_SIZE 5\r
+\r
+typedef struct\r
+{\r
+               uint32 start;\r
+               uint32 end;\r
+               const diagpkt_user_table_entry_type * tbl;\r
+               int count;\r
+\r
+}diagdiag_memop_tbl_type;\r
+\r
+static diagdiag_memop_tbl_type diagdiag_memop_tbl[DIAGDIAG_MAX_MEM_OP_TBL_SIZE];\r
+\r
+\r
+\r
+/*==============================================================================\r
+\r
+FUNCTION diag_register_memory_address_cb\r
+\r
+DESCRIPTION\r
+\r
+  This function registers a callback function to be invoked for a certain\r
+  range of addresses specified in the parameters in the callback               \r
+\r
+   \r
+\r
+===============================================================================*/\r
+\r
+\r
+boolean\r
+diag_register_memory_address_cb (uint32 start, uint32 end,  \r
+                                        const diagpkt_user_table_entry_type * tbl, int count)\r
+\r
+{\r
+               int i = 0;\r
+               boolean ret = FALSE;\r
+\r
+        osal_lock_mutex(&diagdiag_memop_tbl_mutex); \r
+\r
+               for (i=0; i < DIAGDIAG_MAX_MEM_OP_TBL_SIZE; i++ )  \r
+               {\r
+                               if (diagdiag_memop_tbl[i].end == 0) {\r
+                                               diagdiag_memop_tbl[i].start = start;\r
+                                               diagdiag_memop_tbl[i].end = end;\r
+                                               diagdiag_memop_tbl[i].tbl = tbl;   \r
+                                               diagdiag_memop_tbl[i].count = count;\r
+                                               ret =  TRUE;\r
+                                               break;\r
+                               }\r
+               }\r
+               osal_unlock_mutex(&diagdiag_memop_tbl_mutex);\r
+\r
+               return ret;\r
+\r
+}\r
+\r
+\r
+/*==============================================================================\r
+\r
+FUNCTION diag_register_memory_address_cb\r
+\r
+DESCRIPTION\r
+\r
+  This function registers a callback function to be invoked for a certain\r
+  range of addresses specified in the parameters in the callback               \r
+\r
+   \r
+\r
+===============================================================================*/\r
+\r
+\r
+boolean\r
+diag_unregister_memory_address_cb (uint32 start, uint32 end,  \r
+                                       const diagpkt_user_table_entry_type * tbl)\r
+\r
+{\r
+               int i = 0;\r
+               boolean ret = FALSE;\r
+\r
+               osal_lock_mutex(&diagdiag_memop_tbl_mutex);\r
+\r
+               for (i=0; i < DIAGDIAG_MAX_MEM_OP_TBL_SIZE; i++ )  \r
+               {\r
+                               if ((diagdiag_memop_tbl[i].start == start)  && \r
+                                       (diagdiag_memop_tbl[i].end == end) &&\r
+                                       (diagdiag_memop_tbl[i].tbl == tbl))  \r
+                                       {\r
+                                               diagdiag_memop_tbl[i].start = 0;\r
+                                               diagdiag_memop_tbl[i].end = 0;   \r
+                                               diagdiag_memop_tbl[i].tbl = NULL;\r
+                                               diagdiag_memop_tbl[i].count = 0;\r
+                                               ret = TRUE;\r
+                                               break;\r
+                               }\r
+               }\r
+\r
+               osal_unlock_mutex(&diagdiag_memop_tbl_mutex);\r
+               \r
+\r
+               return ret;\r
+\r
+}\r
+\r
+\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_PEEKB\r
+\r
+DESCRIPTION\r
+  This procedure processes a received peek byte request. It performs the peek\r
+  operation and formats a peek response message.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_peekb (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_PEEKB_F_req_type *req = (DIAG_PEEKB_F_req_type *) req_pkt;\r
+  DIAG_PEEKB_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_PEEKB_F_rsp_type);\r
+  int i,j;\r
+  uint16 count;\r
+  PACK(byte *) src = NULL;\r
+  PACK(byte *) dest = NULL;\r
+\r
+  count = req->length;\r
+  src = (byte *) req->ptr;\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  --------------------------------------------------------------------------*/\r
+  if (diag_get_security_state() != DIAG_SEC_UNLOCKED) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Check memory peek length against max allowable length.\r
+  --------------------------------------------------------------------------*/\r
+  if (count > DIAG_MAX_PEEK_B) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Check to see if block requested is within a valid range\r
+  --------------------------------------------------------------------------*/\r
+  if (!hw_valid_addr ((void *) src, count) ) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  for (i=0;i<DIAGDIAG_MAX_MEM_OP_TBL_SIZE;i++) {\r
+                       if ( (diagdiag_memop_tbl[i].start <= (uint32)src) && \r
+                                       (diagdiag_memop_tbl[i].end >= (uint32)src + count * sizeof(byte))) {\r
+                                       for (j = 0; j < diagdiag_memop_tbl[i].count ; j++) {\r
+                                                       if ((diagdiag_memop_tbl[i].tbl[j].cmd_code_lo == DIAG_PEEKB_F) &&\r
+                                                               (diagdiag_memop_tbl[i].tbl[j].cmd_code_hi == DIAG_PEEKB_F)) {\r
+                                                       rsp = (DIAG_PEEKB_F_rsp_type *) \r
+                                                       diagdiag_memop_tbl[i].tbl[j].func_ptr(req_pkt, pkt_len);\r
\r
+                                                       return rsp;\r
+                                       }    \r
+\r
+                          }\r
+                 \r
+                       }\r
+  }\r
+\r
+  /* Allocate space for response packet */\r
+  rsp = (DIAG_PEEKB_F_rsp_type *)diagpkt_alloc(DIAG_PEEKB_F, rsp_len);\r
+\r
+  if (rsp) {\r
+    dest = &rsp->data[0];\r
+\r
+    /*--------------------------------------------------------------------------\r
+      Fill in the boilerplate for the response.\r
+    --------------------------------------------------------------------------*/\r
+    rsp->ptr      = (byte *) src;\r
+    rsp->length   = count;\r
+\r
+\r
+     \r
+    /*----------------------------------------------------------------------\r
+    Lock out interrupts to preserve consistency of the memory block.     */\r
+\r
+    osal_disable_interrupts();\r
+\r
+    for (i = 0; i < count; i++) {\r
+      *dest = *src;\r
+       src++;\r
+       dest++;\r
+    }\r
+\r
+    osal_enable_interrupts();\r
+    \r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_peekb */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_PEEKW\r
+\r
+DESCRIPTION\r
+  This procedure processes a received peek word request. It performs the peek\r
+  operation and formats a peek response message.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_peekw (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_PEEKW_F_req_type *req =(DIAG_PEEKW_F_req_type *)req_pkt;\r
+  DIAG_PEEKW_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_PEEKW_F_rsp_type);\r
+  int i,j;\r
+  uint16 count;\r
+  PACK(word *) src = NULL;\r
+  PACK(word *) dest = NULL;\r
+\r
+  word * src_w;  /* Unpacked word pointer */\r
+  word   val_w;  /* Result of peek */\r
+\r
+  count = req->length;\r
+  src = (word *) req->ptr;\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  --------------------------------------------------------------------------*/\r
+  if (diag_get_security_state() != DIAG_SEC_UNLOCKED) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Check block length against max allowed length.\r
+  -------------------------------------------------------------------------*/\r
+  if (count > DIAG_MAX_PEEK_W) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+ /*-------------------------------------------------------------------------\r
+    Check to see that the block requested is within a valid range.\r
+  --------------------------------------------------------------------------*/\r
+  if (!hw_valid_addr ((void *) src, (word)(count * sizeof (word)))) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  for (i=0;i<DIAGDIAG_MAX_MEM_OP_TBL_SIZE;i++) {\r
+                       if ( (diagdiag_memop_tbl[i].start <= (uint32)src) && \r
+                                       (diagdiag_memop_tbl[i].end >= (uint32)src + count * sizeof(byte))) {\r
+                                       for (j = 0; j < diagdiag_memop_tbl[i].count ; j++) {\r
+                                                       if ((diagdiag_memop_tbl[i].tbl[j].cmd_code_lo == DIAG_PEEKW_F) &&\r
+                                                               (diagdiag_memop_tbl[i].tbl[j].cmd_code_hi == DIAG_PEEKW_F)) {\r
+                                                       rsp = (DIAG_PEEKW_F_rsp_type *) \r
+                                                               diagdiag_memop_tbl[i].tbl[j].func_ptr(req_pkt, pkt_len);\r
+\r
+                                                       return rsp;\r
+                                       }    \r
+\r
+                                       }\r
+\r
+\r
+                       }\r
+  }\r
+\r
+  /* Allocate space for response packet */\r
+  rsp = (DIAG_PEEKW_F_rsp_type *)diagpkt_alloc(DIAG_PEEKW_F, rsp_len);\r
+\r
+  if (rsp) {\r
+    dest = &rsp->data[0];\r
+\r
+    /*--------------------------------------------------------------------------\r
+      Fill in the boilerplate for the response.\r
+    --------------------------------------------------------------------------*/\r
+    rsp->ptr = (word *) src;\r
+    rsp->length = count;\r
+\r
+    /* Test for alignment. If source address is word aligned, use\r
+       non-packed word transfers. */\r
+    if (((dword)src & 0x1) == 0x00)\r
+    {\r
+      /* Copy packed pointer to non-packed pointer */\r
+      src_w = (word*)src; \r
+\r
+      /*----------------------------------------------------------------------\r
+       Lock out interrupts to preserve consistency of the memory block.\r
+       ----------------------------------------------------------------------*/\r
+        \r
+      osal_disable_interrupts();\r
+        \r
+      for (i = 0; i < count; i++) {\r
+        val_w = *src_w;\r
+        *dest = val_w;\r
+        src_w++;\r
+        dest++;\r
+      }\r
+        \r
+      osal_enable_interrupts();\r
+        \r
+    }\r
+    else  /* Copy with packed variables */\r
+    {\r
+      /*----------------------------------------------------------------------\r
+       Lock out interrupts to preserve consistency of the memory block.\r
+       ----------------------------------------------------------------------*/\r
+        \r
+      osal_disable_interrupts();\r
+        \r
+      for (i = 0; i < count; i++) {\r
+        *dest = *src;\r
+        src++;\r
+        dest++;\r
+      }\r
+        \r
+      osal_enable_interrupts();\r
+            \r
+    }\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_peekw */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_PEEKD\r
+\r
+DESCRIPTION\r
+  This procedure processes a received peek dword request. It performs the peek\r
+  operation and formats a peek response message.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_peekd (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_PEEKD_F_req_type *req = (DIAG_PEEKD_F_req_type *)req_pkt;\r
+  DIAG_PEEKD_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_PEEKD_F_rsp_type);\r
+  int i,j;\r
+  uint16 count;\r
+  PACK(dword *) src = NULL;\r
+  PACK(dword *) dest = NULL;\r
+\r
+  dword * src_dw;  /* Unpacked word pointer */\r
+  dword   val_dw;  /* Result of peek */\r
+\r
+  count = req->length;\r
+  src = (dword *) req->ptr;\r
+\r
+  /*--------------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  --------------------------------------------------------------------------*/\r
+  if (diag_get_security_state() != DIAG_SEC_UNLOCKED) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  /*--------------------------------------------------------------------------\r
+    Check requested length against max allowable length.\r
+  --------------------------------------------------------------------------*/\r
+  if (count > DIAG_MAX_PEEK_D) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Check to see that the block requested is within a valid range.\r
+  --------------------------------------------------------------------------*/\r
+  if (!hw_valid_addr ((void *) src, (word)(count * sizeof(dword)))) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  for (i=0;i<DIAGDIAG_MAX_MEM_OP_TBL_SIZE;i++) {\r
+                       if ( (diagdiag_memop_tbl[i].start <= (uint32)src) && \r
+                                       (diagdiag_memop_tbl[i].end >= (uint32)src + count * sizeof(byte))) {\r
+                                       for (j = 0; j < diagdiag_memop_tbl[i].count ; j++) {\r
+                                                       if ((diagdiag_memop_tbl[i].tbl[j].cmd_code_lo == DIAG_PEEKD_F) &&\r
+                                                               (diagdiag_memop_tbl[i].tbl[j].cmd_code_hi == DIAG_PEEKD_F)) {\r
+                                                       rsp = (DIAG_PEEKD_F_rsp_type *) \r
+                                                               diagdiag_memop_tbl[i].tbl[j].func_ptr(req_pkt, pkt_len);\r
+\r
+                                                       return rsp;\r
+                                       }    \r
+\r
+                                       }\r
+\r
+\r
+                       }\r
+  }\r
+\r
+  /* Allocate space for response packet */\r
+  rsp = (DIAG_PEEKD_F_rsp_type *)diagpkt_alloc(DIAG_PEEKD_F, rsp_len);\r
+\r
+  if (rsp) {\r
+    dest = &rsp->data[0];\r
+\r
+    /*--------------------------------------------------------------------------\r
+      Fill in the boilerplate for the response.\r
+    --------------------------------------------------------------------------*/\r
+    rsp->ptr      = (dword *) src;\r
+    rsp->length   = count;\r
+\r
+\r
+    /* Test for alignment. If source address is dword aligned, use\r
+       non-packed dword transfers. */\r
+    if (((dword)src & 0x3) == 0x00)\r
+    {\r
+      /* Copy packed pointer to non-packed pointer */\r
+      src_dw = (dword*)src; \r
+\r
+      /*----------------------------------------------------------------------\r
+        Lock out interrupts to preserve consistency of the memory block.\r
+        ----------------------------------------------------------------------*/\r
+        \r
+      osal_disable_interrupts();\r
+       \r
+      for (i = 0; i < count; i++) {\r
+        val_dw = *src_dw;\r
+        *dest = val_dw;\r
+        src_dw++;\r
+        dest++;\r
+      }\r
+        \r
+      osal_enable_interrupts();\r
+        \r
+      }\r
+      else  /* Copy with packed variables */\r
+      {\r
+        /*----------------------------------------------------------------------\r
+          Lock out interrupts to preserve consistency of the memory block.\r
+        ----------------------------------------------------------------------*/\r
+        \r
+        osal_disable_interrupts();\r
+        \r
+        for (i = 0; i < count; i++) {\r
+          *dest = *src;\r
+          dest++;\r
+          src++;\r
+        }\r
+        \r
+        osal_enable_interrupts();\r
+        \r
+      }\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_peekd */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_POKEB\r
+\r
+DESCRIPTION\r
+  This procedure pokes a byte into memory and formats a poke response\r
+  buffer.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_pokeb (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_POKEB_F_req_type *req = (DIAG_POKEB_F_req_type *)req_pkt;\r
+  DIAG_POKEB_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_POKEB_F_rsp_type);\r
+  int i,j;\r
+  uint16 count;\r
+  PACK(byte *) src = NULL;\r
+  PACK(byte *) dest = NULL;\r
+\r
+  count = req->length;\r
+  src = &req->data[0];\r
+  dest = req->ptr;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check length of request packet.\r
+  ----------------------------------------------------------------------*/\r
+  if (pkt_len != sizeof (DIAG_POKEB_F_req_type))\r
+  {\r
+    return (diagpkt_err_rsp (DIAG_BAD_LEN_F, req_pkt, pkt_len));\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() != DIAG_SEC_UNLOCKED) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check block size against maximum allowable block size.\r
+  ----------------------------------------------------------------------*/\r
+  if (count > DIAG_MAX_POKE_B) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  /*---------------------------------------------------------------------\r
+    Check to see if address requested is within a valid range.\r
+  ----------------------------------------------------------------------*/\r
+  else if (!hw_valid_addr ((void *) dest, count * sizeof (byte))) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  for (i=0;i<DIAGDIAG_MAX_MEM_OP_TBL_SIZE;i++) {\r
+                       if ( (diagdiag_memop_tbl[i].start <= (uint32)src) && \r
+                                       (diagdiag_memop_tbl[i].end >= (uint32)src + count * sizeof(byte))) {\r
+                                       for (j = 0; j <  diagdiag_memop_tbl[i].count ; j++) {\r
+                                                       if ((diagdiag_memop_tbl[i].tbl[j].cmd_code_lo == DIAG_POKEB_F) &&\r
+                                                               (diagdiag_memop_tbl[i].tbl[j].cmd_code_hi == DIAG_POKEB_F)) {\r
+                                                       rsp = (DIAG_POKEB_F_rsp_type *) \r
+                                                               diagdiag_memop_tbl[i].tbl[j].func_ptr(req_pkt, pkt_len);\r
+\r
+                                                       return rsp;\r
+                                       }    \r
+\r
+                                       }\r
+\r
+\r
+                       }\r
+  }\r
+    /*----------------------------------------------------------------------\r
+      Lock out interrupts to preserve consistency of the memory block.\r
+    ----------------------------------------------------------------------*/\r
+   \r
+    osal_disable_interrupts();\r
+    \r
+\r
+    for (i = 0; i < count; i++) {\r
+      *dest = *src;\r
+        src++;\r
+      dest++;      \r
+    }\r
+    \r
+    osal_enable_interrupts();\r
+   \r
+\r
+\r
+  /*-------------------------------------------------------------------------\r
+   Prepare the response packet.\r
+  -------------------------------------------------------------------------*/\r
+  rsp = (DIAG_POKEB_F_rsp_type *)diagpkt_alloc(DIAG_POKEB_F, rsp_len);\r
+\r
+  if (rsp)\r
+  {\r
+    *rsp = *req;\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_pokeb */\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_POKEW\r
+\r
+DESCRIPTION\r
+  This procedure pokes a word into memory and formats a poke response\r
+  message.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_pokew (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_POKEW_F_req_type *req = (DIAG_POKEW_F_req_type *)req_pkt;\r
+  DIAG_POKEW_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_POKEW_F_rsp_type);\r
+  int i,j;\r
+  uint16 count;\r
+  PACK(word *) src = NULL;\r
+  PACK(word *) dest = NULL;\r
+\r
+  word * dest_w; /* Unpacked word pointer */\r
+  word   val_w;  /* Value to poke */\r
+  \r
+  count = req->length;\r
+  src = &req->data[0];\r
+  dest = req->ptr;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check length of request packet.  This is critical since the download\r
+    protocol used by QPST uses HDLC encoded packets with the equivalent\r
+    of command code 6.  Length check is the only thing that prevents\r
+    accidental pokes!\r
+  ----------------------------------------------------------------------*/\r
+  if (pkt_len != sizeof (DIAG_POKEW_F_req_type))\r
+  {\r
+    return (diagpkt_err_rsp (DIAG_BAD_LEN_F, req_pkt, pkt_len));\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() != DIAG_SEC_UNLOCKED) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check block length against maximum allowable length.\r
+  ----------------------------------------------------------------------*/\r
+  if (count > DIAG_MAX_POKE_W) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check to be sure the block is a valid block.\r
+  ----------------------------------------------------------------------*/\r
+  if (!hw_valid_addr ((void *) dest, (word)(count * sizeof (word)))) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  for (i=0;i<DIAGDIAG_MAX_MEM_OP_TBL_SIZE;i++) {\r
+                       if ( (diagdiag_memop_tbl[i].start <= (uint32)src) && \r
+                                       (diagdiag_memop_tbl[i].end >= (uint32)src + count * sizeof(byte))) {\r
+                                       for (j = 0; j < diagdiag_memop_tbl[i].count; j++) {\r
+                                                       if ((diagdiag_memop_tbl[i].tbl[j].cmd_code_lo == DIAG_POKEW_F) &&\r
+                                                                (diagdiag_memop_tbl[i].tbl[j].cmd_code_hi == DIAG_POKEW_F)) {\r
+                                                           rsp = (DIAG_POKEW_F_rsp_type *) \r
+                                                                 diagdiag_memop_tbl[i].tbl[j].func_ptr(req_pkt, pkt_len);\r
+\r
+                                                       return rsp;\r
+                                       }    \r
+\r
+                                       }\r
+\r
+\r
+                       }\r
+\r
+\r
+   }\r
+    /* Test for alignment. If destination address is word aligned, use\r
+       non-packed word transfers. */\r
+    if (((dword)dest & 0x01) == 0x00)\r
+    {\r
+      /* Copy packed pointer to non-packed pointer */\r
+      dest_w = (word*)dest; \r
+\r
+      /*----------------------------------------------------------------------\r
+        Lock out interrupts to preserve consistency of the memory block.\r
+      ----------------------------------------------------------------------*/\r
+    \r
+      osal_disable_interrupts();\r
+      \r
+      for (i = 0; i < count; i++) {\r
+        val_w = *src;\r
+        *dest_w = val_w;\r
+        dest_w++;\r
+        src++;\r
+      }\r
+      \r
+      osal_enable_interrupts();\r
+     \r
+    }\r
+    else  /*  Copy with packed variables */\r
+    {\r
+      /*----------------------------------------------------------------------\r
+        Lock out interrupts to preserve consistency of the memory block.\r
+      ----------------------------------------------------------------------*/\r
+      \r
+      osal_disable_interrupts();\r
+      \r
+      for (i = 0; i < count; i++) {\r
+        *dest = *src;\r
+        src++;\r
+        dest++;        \r
+      }\r
+      \r
+      osal_enable_interrupts();\r
+      \r
+    }\r
+\r
+\r
+  /*----------------------------------------------------------------------\r
+    Prepare the response packet.\r
+  ----------------------------------------------------------------------*/\r
+  rsp = (DIAG_POKEW_F_rsp_type *)diagpkt_alloc(DIAG_POKEW_F, rsp_len);\r
+\r
+  if (rsp)\r
+  {\r
+    *rsp = *req;\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_pokew */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_POKED\r
+\r
+DESCRIPTION\r
+  This procedure pokes a dword into memory and formats a poke response\r
+  message.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_poked (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_POKED_F_req_type *req = (DIAG_POKED_F_req_type *)req_pkt;\r
+  DIAG_POKED_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_POKED_F_rsp_type);\r
+  int i,j;\r
+  uint16 count;\r
+  PACK(dword *) src = NULL;\r
+  PACK(dword *) dest = NULL;\r
+\r
+  dword * dest_dw; /* Unpacked dword pointer */\r
+  dword   val_dw;  /* Value to poke */\r
+\r
+\r
+  count = req->length;\r
+  src = &req->data[0];\r
+  dest = req->ptr;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check length of request packet.\r
+  ----------------------------------------------------------------------*/\r
+  if (pkt_len != sizeof (DIAG_POKED_F_req_type))\r
+  {\r
+    return (diagpkt_err_rsp (DIAG_BAD_LEN_F, req_pkt, pkt_len));\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() != DIAG_SEC_UNLOCKED) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check block length against maximum allowed length.\r
+  ----------------------------------------------------------------------*/\r
+  if (count > DIAG_MAX_POKE_D) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check to see that requested block is a valid block.\r
+  ----------------------------------------------------------------------*/\r
+  if (!hw_valid_addr ((void *) dest, (word)(count * sizeof (dword))) ) {\r
+    return( diagpkt_err_rsp(DIAG_BAD_PARM_F, req_pkt, pkt_len) );\r
+  }\r
+\r
+\r
+  for (i=0;i<DIAGDIAG_MAX_MEM_OP_TBL_SIZE;i++) {\r
+                       if ( (diagdiag_memop_tbl[i].start <= (uint32)src) && \r
+                                       (diagdiag_memop_tbl[i].end >= (uint32)src + count * sizeof(byte))) {\r
+                                       for (j = 0; j < diagdiag_memop_tbl[i].count; j++) {\r
+                                                       if ((diagdiag_memop_tbl[i].tbl[j].cmd_code_lo == DIAG_POKED_F) &&\r
+                                                               (diagdiag_memop_tbl[i].tbl[j].cmd_code_hi == DIAG_POKED_F)) {\r
+                                                       rsp = (DIAG_POKED_F_rsp_type *) \r
+                                                               diagdiag_memop_tbl[i].tbl[j].func_ptr(req_pkt, pkt_len);\r
+\r
+                                                       return rsp;\r
+                                       }    \r
+\r
+                                       }\r
+\r
+\r
+                       }\r
+  }\r
+\r
+    /* Test for alignment. If destination address is dword aligned, use\r
+       non-packed dword transfers. */\r
+    if (((dword)dest & 0x03) == 0x00)\r
+    {\r
+      /* Copy packed pointer to non-packed pointer */\r
+      dest_dw = (dword*)dest; \r
+\r
+      /*----------------------------------------------------------------------\r
+        Lock out interrupts to preserve consistency of the memory block.\r
+      ----------------------------------------------------------------------*/\r
+      \r
+      osal_disable_interrupts();\r
+\r
+      \r
+      for (i = 0; i < count; i++) {\r
+        val_dw = *src;\r
+        *dest_dw = val_dw;\r
+        dest_dw++;\r
+        src++;\r
+      }\r
+     \r
+      osal_enable_interrupts();\r
+      \r
+    }\r
+    else  /*  Copy with packed variables */\r
+    {\r
\r
+      /*----------------------------------------------------------------------\r
+        Lock out interrupts to preserve consistency of the memory block.  */\r
+     \r
+      osal_disable_interrupts();\r
+    \r
+      for (i = 0; i < count; i++) {\r
+        *dest = *src;\r
+        src++;\r
+        dest++;        \r
+      }\r
+     \r
+      osal_enable_interrupts();\r
+     \r
+       }\r
+\r
+  /*-----------------------------------------------------------------------\r
+   Prepare the response packet.\r
+  -----------------------------------------------------------------------*/\r
+  rsp = (DIAG_POKED_F_rsp_type *)diagpkt_alloc(DIAG_POKED_F, rsp_len);\r
+\r
+  if (rsp)\r
+  {\r
+    *rsp = *req;\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_poked */\r
+\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_VER\r
+\r
+DESCRIPTION\r
+  Return the diag version\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_ver (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_DIAG_VER_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof (DIAG_DIAG_VER_F_rsp_type);\r
+\r
+  (void) req_pkt; /* suppress compiler warning */\r
+  (void) pkt_len; /* suppress compiler warning */\r
+\r
+  rsp = (DIAG_DIAG_VER_F_rsp_type *)diagpkt_alloc(DIAG_DIAG_VER_F, rsp_len);\r
+\r
+  /*-------------------------------------------------------------------------\r
+    Return diag source code version\r
+  -------------------------------------------------------------------------*/\r
+  if (rsp)\r
+  {\r
+    rsp->ver = DIAG_DIAGVER;\r
+  }\r
+  return (rsp);\r
+\r
+} /* diagdiag_diag_ver */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_FEATURE_QUERY\r
+\r
+DESCRIPTION\r
+  This procedure processes a request to query for features in the current\r
+  build.  It returns a variable length bit mask where each bit corresponds to\r
+  a particular feature defined in diagpkt.h in feature_query_enum_type.\r
+\r
+============================================================================*/\r
+PACK(void *) diagdiag_feature_query (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+\r
+  DIAG_FEATURE_QUERY_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_FEATURE_QUERY_F_rsp_type);\r
+\r
+  (void) req_pkt; /* suppress compiler warning */\r
+  (void) pkt_len; /* suppress compiler warning */\r
+\r
+  rsp =(DIAG_FEATURE_QUERY_F_rsp_type *)diagpkt_alloc(DIAG_FEATURE_QUERY_F, rsp_len);\r
+  if (rsp)\r
+  {\r
+       rsp->feature_mask_size = FEATURE_MASK_LENGTH;\r
+\r
+       /* Copy the current mask into the diag pkt */\r
+       memcpy( (void *) rsp->feature_mask,\r
+          diag_feature_mask,\r
+          FEATURE_MASK_LENGTH\r
+        );\r
+  }\r
+  /* return the size of the variable length packet.  command_code and\r
+  ** feature_mask_size is constant.  FEATURE_MASK_LENGTH changes\r
+  ** as more features are added\r
+  */\r
+  return (rsp);\r
+\r
+\r
+} /* diagdiag_feature_query */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_PASSWORD\r
+\r
+DESCRIPTION\r
+  Processes an entry of the Security Password.\r
+  This function compares the password in the phone to what was sent in\r
+  the packet.  If they are the same, the successful Security unlock is\r
+  noted (setting the diag_get_security_state() mask to UNLOCKED), and a value of TRUE\r
+  is returned to the external device.\r
+  If they are NOT the same, Security remains locked, a value of FALSE is\r
+  returned to the external device, and the phone is powered off,\r
+  to deter hackers.\r
+\r
+SIDE EFFECTS\r
+  May cause the phone to power off!  (After returning from this routine).\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_password (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_PASSWORD_F_req_type *req = (DIAG_PASSWORD_F_req_type *) req_pkt;\r
+  DIAG_PASSWORD_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof(DIAG_PASSWORD_F_rsp_type);\r
+  (void) pkt_len; /* suppress compiler warning */\r
+\r
+  rsp = (DIAG_PASSWORD_F_rsp_type *) diagpkt_alloc (DIAG_PASSWORD_F, rsp_len);\r
+\r
+/*------------------------------------------------------------------------*/\r
+\r
+  MSG_LOW ("Security Password given", 0, 0, 0);\r
+\r
+  /* If the security is already unlocked, then it doesn't matter what\r
+  ** you give as the security code.  Otherwise we need to compare\r
+  ** the given security code with the one in the phone.\r
+  */\r
+  if (rsp)\r
+  {\r
+         if ((diag_get_security_state() == DIAG_SEC_UNLOCKED) ||\r
+             (diag_check_password((void *) req->password))) {\r
+\r
+           rsp->password_ok = TRUE;\r
+           (void) diag_set_security_state(DIAG_SEC_UNLOCKED);\r
+         }\r
+         /* Otherwise, the code was incorrect.  Diag will now powerdown the phone.\r
+         */\r
+         else {\r
+           rsp->password_ok = FALSE;\r
+           (void) diag_set_security_state(DIAG_SEC_LOCKED);\r
+\r
+           diagpkt_commit(rsp);\r
+           rsp = NULL;\r
+\r
+           /* Flush DIAG's TX buffer */\r
+           diagbuf_flush();\r
+\r
+           /* Power down the phone.  This function does not return.\r
+           */\r
+           diag_powerdown();\r
+         }\r
+       }\r
+  return (rsp);\r
+\r
+} /* diagdiag_password */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+FUNCTION DIAGDIAG_TS\r
+\r
+DESCRIPTION\r
+  Return an IS-95/IS-2000 timestamp\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+===========================================================================*/\r
+PACK(void *) diagdiag_ts (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  qword ts_time;                 /* time stamp */\r
+  DIAG_TS_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof( DIAG_TS_F_rsp_type );\r
+\r
+  (void) req_pkt; /* suppress compiler warning */\r
+  (void) pkt_len; /* suppress compiler warning */\r
+\r
+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/\r
+  /*------------------------------------------------------------------------\r
+    Get the time, stuff the packet.\r
+  -------------------------------------------------------------------------*/\r
+\r
+  ts_get (ts_time);\r
+\r
+\r
+  rsp = (DIAG_TS_F_rsp_type *) diagpkt_alloc (DIAG_TS_F, rsp_len);\r
+\r
+  qw_equ_misaligned (rsp->ts, ts_time);\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_ts */\r
+\r
+\r
+\f\r
+\r
+#define MSM_MEMMAP_IO_OFFSET 0x03000000\r
+\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_OUTP\r
+\r
+DESCRIPTION\r
+  This procedure processes a received command to write a byte to a port.\r
+  The byte is written to the input port and a response packet is built.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_outp (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_OUTP_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof( DIAG_OUTP_F_rsp_type );\r
+  DIAG_OUTP_F_req_type *req = (DIAG_OUTP_F_req_type *) req_pkt;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure function\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() == DIAG_SEC_LOCKED) {\r
+    rsp = (DIAG_OUTP_F_rsp_type *)diagpkt_err_rsp( DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len );\r
+    return rsp;\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Write byte to port\r
+  ----------------------------------------------------------------------*/\r
+  (void) outp( req->port + MSM_MEMMAP_IO_OFFSET, req->data );\r
+\r
+  /*-----------------------------------------------------------------------\r
+    Prepare the response packet.\r
+  -----------------------------------------------------------------------*/\r
+  /* Allocate space for rsponse packet */\r
+  rsp = (DIAG_OUTP_F_rsp_type *)diagpkt_alloc( DIAG_OUTP_F, rsp_len );\r
+\r
+  if (rsp)\r
+  {\r
+    rsp->port = req->port;\r
+    rsp->data = req->data;\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_outp */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_OUTPW\r
+\r
+DESCRIPTION\r
+  This procedure processes a received command to write a word to a port.\r
+  The word is written to the input port and a response packet is built.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_outpw (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_OUTPW_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof( DIAG_OUTPW_F_rsp_type );\r
+  DIAG_OUTPW_F_req_type *req = (DIAG_OUTPW_F_req_type *) req_pkt;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() == DIAG_SEC_LOCKED) {\r
+    rsp = (DIAG_OUTPW_F_rsp_type *)diagpkt_err_rsp( DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len );\r
+    return rsp;\r
+  }\r
+\r
+  /*----------------------------------------------------------------------\r
+    Write word to port\r
+  ----------------------------------------------------------------------*/\r
+  (void) outpw( req->port+ MSM_MEMMAP_IO_OFFSET, req->data );\r
+\r
+  /*-----------------------------------------------------------------------\r
+    Prepare the response packet.\r
+  -----------------------------------------------------------------------*/\r
+  /* Allocate space for rsponse packet */\r
+  rsp = (DIAG_OUTPW_F_rsp_type *)diagpkt_alloc( DIAG_OUTPW_F, rsp_len );\r
+\r
+  if (rsp)\r
+  {\r
+    rsp->port = req->port;\r
+    rsp->data = req->data;\r
+  }\r
+\r
+  return (rsp);\r
+\r
+} /* diagdiag_outpw */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_INP\r
+\r
+DESCRIPTION\r
+  This procedure processes a received command to read a byte from a port.\r
+  The byte is read from the port and a response packet is built.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_inp (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_INP_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof( DIAG_INP_F_rsp_type );\r
+  DIAG_INP_F_req_type *req = (DIAG_INP_F_req_type *) req_pkt;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() == DIAG_SEC_LOCKED) {\r
+    rsp = ( DIAG_INP_F_rsp_type *)diagpkt_err_rsp( DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len );\r
+    return rsp;\r
+  }\r
+\r
+  /* Allocate space for rsponse packet */\r
+  rsp = (DIAG_INP_F_rsp_type *)diagpkt_alloc( DIAG_INP_F, rsp_len );\r
+\r
+  /*------------------------------------------------------------------------\r
+    Fill in the boilerplate for the response packet, then read the byte in\r
+    from the port.\r
+  ------------------------------------------------------------------------*/\r
+  if (rsp)\r
+  {\r
+    rsp->port = req->port;\r
+    rsp->data = (byte) inp( req->port + MSM_MEMMAP_IO_OFFSET );\r
+  }\r
+  return (rsp);\r
+\r
+} /* diagdiag_inp */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_INPW\r
+\r
+DESCRIPTION\r
+  This procedure processes a received command to read a word from a port.\r
+  The word is read from the port and a response packet is built.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_inpw (\r
+  PACK(void *) req_pkt,\r
+  uint16 pkt_len\r
+)\r
+{\r
+  DIAG_INPW_F_rsp_type *rsp;\r
+  const int rsp_len = sizeof( DIAG_INPW_F_rsp_type );\r
+  DIAG_INPW_F_req_type *req = (DIAG_INPW_F_req_type *) req_pkt;\r
+\r
+  /*----------------------------------------------------------------------\r
+    Check security, since this is a secure funciton\r
+  ----------------------------------------------------------------------*/\r
+  if (diag_get_security_state() == DIAG_SEC_LOCKED) {\r
+    rsp = (DIAG_INPW_F_rsp_type *)diagpkt_err_rsp( DIAG_BAD_SEC_MODE_F, req_pkt, pkt_len );\r
+    return rsp;\r
+  }\r
+\r
+  /* Allocate space for rsponse packet */\r
+  rsp = (DIAG_INPW_F_rsp_type *)diagpkt_alloc( DIAG_INPW_F, rsp_len );\r
+\r
+  /*------------------------------------------------------------------------\r
+    Fill in the boilerplate for the response, then input the word directly\r
+    into the response packet.\r
+  -------------------------------------------------------------------------*/\r
+  if (rsp)\r
+  {\r
+       rsp->port = req->port;\r
+       rsp->data = inpw( req->port + MSM_MEMMAP_IO_OFFSET );\r
+  }\r
+  return (rsp);\r
+\r
+} /* diagdiag_inpw */\r
+\r
+#if 1 //For now, use a fake GUID. -LD\r
+/* Default GUID (since it was unspecified) */\r
+static const diag_guid_type diag_guid =\r
+{\r
+   0xDEADD00DU,\r
+   0xDEADD00DU,\r
+   0xDEADD00DU,\r
+   0x06101975\r
+};\r
+#endif\r
+\r
+\r
+LOCAL diag_prop_struct_type diag_prop_table[DIAG_MAX_NUM_PROPS];\r
+\r
+/*===========================================================================\r
+\r
+FUNCTION DIAG_LOOKUP_PROP\r
+\r
+DESCRIPTION\r
+  Looks up the address of a callback function given its name.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  The address of the function or NULL if the function is not found in the\r
+  function table.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+\r
+===========================================================================*/\r
+void *diag_lookup_prop\r
+(\r
+  char *prop_name\r
+)\r
+{\r
+  int i = 0;\r
+\r
+  if ( prop_name == NULL )\r
+  {\r
+    return (void *) NULL;\r
+  }\r
+\r
+  while ( diag_prop_table[ i ].name != NULL )\r
+  {\r
+    if ( strncmp(\r
+                 diag_prop_table[ i ].name,\r
+                 prop_name,\r
+                 DIAG_MAX_PROPERTY_NAME_SIZE\r
+         ) == 0 )\r
+    {\r
+      return diag_prop_table[ i ].address;\r
+    }\r
+    i++;\r
+    if ( i >= DIAG_MAX_NUM_PROPS )\r
+    {\r
+      /*\r
+      ** Will get here only if the properties table has been corrupted.\r
+      */\r
+      break;\r
+    }\r
+  }\r
+  return (void *) NULL;\r
+} /* diag_lookup_prop */\r
+\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAG_GUID_IS_VALID\r
+\r
+DESCRIPTION\r
+  This static function returns true or false depending on whether the\r
+  input guid (globally unique identifier) matches that of the current build.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  TRUE if the input guid is valid, FALSE otherwise.\r
+\r
+SIDE EFFECTS\r
+  None.\r
+\r
+===========================================================================*/\r
+LOCAL boolean diag_guid_is_valid\r
+(\r
+  diag_guid_type guid\r
+)\r
+{\r
+  if ( ( guid[ 0 ] == diag_guid[ 0 ] ) &&\r
+       ( guid[ 1 ] == diag_guid[ 1 ] ) &&\r
+       ( guid[ 2 ] == diag_guid[ 2 ] ) &&\r
+       ( guid[ 3 ] == diag_guid[ 3 ] ) )\r
+  {\r
+    return TRUE;\r
+  }\r
+  else\r
+  {\r
+    return FALSE;\r
+  }\r
+} /* diag_guid_is_valid */\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_GET_GUID\r
+\r
+DESCRIPTION\r
+  This procedure processes a get_guid request. The GUID (globally unique\r
+  identifier) for this build is retrieved and returned in the response\r
+  packet. The GUID is stored during the build process.\r
+\r
+===========================================================================*/\r
+PACK(void *) diagdiag_get_guid\r
+(\r
+  PACK(void *) req_pkt, /* pointer to request packet  */\r
+  uint16 pkt_len            /* length of request packet  */\r
+)\r
+{\r
+  DIAG_GET_GUID_F_rsp_type *rsp;\r
+  const unsigned int rsp_len = sizeof (DIAG_GET_GUID_F_rsp_type);\r
+\r
+  (void) req_pkt; /* suppress compiler warning */\r
+  (void) pkt_len; /* suppress compiler warning */\r
+\r
+  /*--------------------------------------------\r
+    Allocate buffer space for response packet.\r
+  --------------------------------------------*/\r
+  rsp = (DIAG_GET_GUID_F_rsp_type *) diagpkt_alloc (DIAG_GET_GUID_F, rsp_len);\r
+\r
+  memcpy((void *) &rsp->guid[0],\r
+         (const void *) &diag_guid[0],\r
+         sizeof(diag_guid_type));\r
+\r
+  return rsp;\r
+\r
+} /* diagdiag_get_guid */\r
+\r
+\f\r
+\r
+/*===========================================================================\r
+FUNCTION DIAGDIAG_EVENT_LISTENER\r
+\r
+DESCRIPTION The event has been removed from listening\r
+============================================================================*/\r
+void\r
+diagdiag_event_listener (uint32 seq_num, const diag_event_type * event, void * param)\r
+{\r
+  MSG_3 (MSG_SSID_DIAG, MSG_LEGACY_HIGH,\r
+            "Event listener 0x%04X param:0x%08X seq:%d", \r
+            event->event_id, (uint32) param, seq_num);\r
+}\r
+\r
+/*===========================================================================\r
+FUNCTION DIAGDIAG_LOG_LISTENER\r
+\r
+DESCRIPTION The log has been added to listen\r
+============================================================================*/\r
+void\r
+diagdiag_log_listener (uint32 seq_num, const byte * log, unsigned int length,\r
+                       void * param)\r
+{\r
+  MSG_3 (MSG_SSID_DIAG, MSG_LEGACY_HIGH,\r
+         "Log listener 0x%04X param:0x%08X seq:%d", \r
+         log_get_code ((PACK(void *)) log), (uint32) param, seq_num);\r
+}\r
+\r
+\r
+/*===========================================================================\r
+FUNCTION DIAGDIAG_LISTENER_PKT\r
+\r
+DESCRIPTION   \r
+  This procedure tests the following:\r
+  1) Add log listener\r
+  2) Remove log listener\r
+  3) Add event listener\r
+  4) Remove event listener\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+============================================================================*/\r
+PACK(void *)\r
+diagdiag_listener_pkt (PACK(void *) req_pkt, uint16 pkt_len)\r
+{\r
+  diag_log_event_listener_rsp_type *rsp;\r
+  diag_log_event_listener_req_type *req = \r
+    (diag_log_event_listener_req_type *) req_pkt;\r
+\r
+  diagpkt_subsys_cmd_code_type cmd_code = diagpkt_subsys_get_cmd_code (req);\r
+\r
+  const int rsp_len = pkt_len;\r
+\r
+  /* Allocate the same length as the request */\r
+  rsp = (diag_log_event_listener_rsp_type *) \r
+    diagpkt_subsys_alloc (DIAG_SUBSYS_DIAG_SERV, cmd_code, rsp_len);\r
+\r
+  /* Send the response acknowledging that the packet has been started */\r
+  if (rsp != NULL)\r
+  {\r
+    memcpy ((void *) rsp, (void *) req, rsp_len);\r
+\r
+    switch (cmd_code)\r
+    {\r
+      case DIAGDIAG_ADD_EVENT_LISTENER_F:\r
+        (void) diag_add_event_listener (req->id, diagdiag_event_listener, (void *) req->param);\r
+        break;\r
+      case DIAGDIAG_REMOVE_EVENT_LISTENER_F:\r
+        (void) diag_remove_event_listener (req->id, diagdiag_event_listener, (void *) req->param);\r
+        break;\r
+      case DIAGDIAG_ADD_LOG_LISTENER_F:\r
+        (void) diag_add_log_listener (req->id, diagdiag_log_listener, (void *) req->param);\r
+        break;\r
+      case DIAGDIAG_REMOVE_LOG_LISTENER_F:\r
+        (void) diag_remove_log_listener (req->id, diagdiag_log_listener, (void *) req->param);\r
+        break;\r
+      default:\r
+        break;\r
+    }\r
+  }\r
+  \r
+  return rsp;\r
+\r
+} /* diagdiag_cmd_request_handler */\r
+\r
+#ifdef FEATURE_TECHNICS_DIAG\r
+#include "mobile.h"\r
+#include "uim.h"\r
+#include "flash_nand.h"\r
+#include "diagsec.h"\r
+#include "diagd3des.h"\r
+\r
+byte diagdiag_des_sec_rand[8] = {0, 0, 0, 0, 0, 0, 0, 0};\r
+extern const byte diag_cal_des_sec_code[] ;\r
+extern const byte diag_cal_des_sec_key[] ;\r
+extern const byte diag_tool_des_sec_code[] ;\r
+extern const byte diag_tool_des_sec_key[] ;\r
+\r
+static byte *diag_des_sec_code;\r
+static byte *diag_des_sec_key;\r
+dword diag_rand_init;\r
+boolean diag_des_ulock_stat = FALSE;\r
+\r
+/*===========================================================================\r
\r
+FUNCTION DIAGDIAG_MANUFACTURE_TEST\r
\r
+DESCRIPTION\r
+  This procedure processes a request to poke into Non-Volatile memory.\r
\r
+DEPENDENCIES\r
+  None.\r
\r
+RETURN VALUE\r
+  Pointer to response packet.\r
\r
+SIDE EFFECTS\r
+  None.\r
\r
+===========================================================================*/\r
+PACK(void *) diagdiag_manufacture_test (PACK(void *) req_pkt, uint16 pkt_len)\r
+{\r
+    int i;\r
+    int data_count;\r
+\r
+    static byte dir_number[] =\r
+        { '0','1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0, 0, 0, 0,0};\r
+    //uim_status_type uim_status;\r
+    byte diagdiag_des_sec_para[16];\r
+    byte diagdiag_des_sec_scrunch[8];\r
+    boolean diagdiag_des_sec_ok;\r
+    dword* sec_rand_ptr;\r
+#ifdef FEATURE_INFO_BAK\r
+    unsigned char need_data[INFO_BAK_SIZE];\r
+#endif\r
+\r
+    DIAG_MANUFACTURE_TEST_F_req_type *req = (DIAG_MANUFACTURE_TEST_F_req_type *) req_pkt;\r
+    DIAG_MANUFACTURE_TEST_F_rsp_type *rsp;\r
+    const int rsp_len = sizeof(DIAG_MANUFACTURE_TEST_F_rsp_type);\r
+\r
+    //ran_seed(diag_rand_init);\r
+\r
+    /* Allocate space for response packet */\r
+    rsp = (DIAG_MANUFACTURE_TEST_F_rsp_type *)diagpkt_alloc(DIAG_MANUFACTURE_TEST_F, rsp_len);\r
+\r
+    rsp->mask = 0x00;\r
+    for (i=0 ; i < 16; i++)\r
+    {\r
+        rsp->data[i] = 0x00;\r
+    }\r
+\r
+    switch(req->mask)\r
+    {\r
+        case 0x00:\r
+        {\r
+            for ( i=0; i<14; i++ )\r
+            {\r
+                rsp->data[i] = mob_sw_rev[i];\r
+            }\r
+            break;\r
+        }\r
+#if 0\r
+        case 0x01:\r
+        {\r
+            uim_status = uim_get_uim_status();\r
+            if (uim_status == UIM_ERR_S)\r
+            {\r
+                rsp->mask = 0x01;\r
+                for (i=0 ; i < 16; i++)\r
+                {\r
+                    rsp->data[i] = 0x00;\r
+                }\r
+            }\r
+            /* Select the CDMA DF to check if the card is an R-UIM card */\r
+            else\r
+            {\r
+                rsp->mask = 0x01;\r
+\r
+                diag_nv_read(NV_DIR_NUMBER_PCS_I, &nitem);\r
+\r
+                rsp->data[0] = 0x01;\r
+\r
+                for (i=1 ; i < NV_DIR_NUMB_PCS_SIZ; i++)\r
+                {\r
+                    rsp->data[i] = dir_number[ nitem.mob_dir_number.digitn[i-1]];\r
+                }\r
+            }\r
+            break;\r
+        }\r
+#endif\r
+        case 0x03:\r
+        {//read the BT address\r
+            nv_item_type  nv_item;\r
+            uint16 bt_add,bt_temp;\r
+            uint16 mac_add,mac_temp;\r
+\r
+            if(diag_nv_read(NV_BD_ADDR_I,&nv_item) != NV_DONE_S)\r
+            {\r
+                rsp->data[0] = 1;\r
+            }\r
+            else\r
+            {\r
+                for(i = 0;i < NV_BD_ADDR_SIZE;i++)\r
+                {\r
+                    bt_add = (uint16)nv_item.bd_addr.bd_addr[i];\r
+                    bt_temp = bt_add & 0x000F;  \r
+                    rsp->data[NV_BD_ADDR_SIZE*2 -1 - i*2] = (unsigned char) (( bt_temp <= 9 ) ? bt_temp + '0' : bt_temp - 10 + 'A');\r
+                    bt_temp = (bt_add >> 4) & 0x000F;   \r
+                    rsp->data[NV_BD_ADDR_SIZE*2 -2 - i*2] = (unsigned char) (( bt_temp <= 9 ) ? bt_temp + '0' : bt_temp - 10 + 'A');\r
+                }\r
+            }\r
+\r
+            rsp->mask=req->mask;\r
+            break;\r
+        }\r
+        case 0x06:\r
+        {//write the BT address \r
+            nv_item_type  nv_item;\r
+            uint16 bt_add,bt_temp;\r
+            uint16 mac_add,mac_temp;\r
+\r
+            for(i = 0;i < NV_BD_ADDR_SIZE;i++)\r
+            {\r
+                bt_add = 0;\r
+                bt_temp = 0;\r
+                if(req->data[2*i] <= 0x39)\r
+                {\r
+                    bt_add = req->data[2*i] - '0';\r
+                }\r
+                else\r
+                {\r
+                    bt_add = req->data[2*i]  - 'A' + 10;\r
+                }\r
+\r
+                if(req->data[2*i + 1] <= 0x39)\r
+                {\r
+                    bt_temp = req->data[2*i + 1] - '0';\r
+                }\r
+                else\r
+                {\r
+                    bt_temp = req->data[2*i + 1] -  'A' + 10;\r
+                }\r
+\r
+                bt_temp |= (bt_add << 4);\r
+                nv_item.bd_addr.bd_addr[NV_BD_ADDR_SIZE -1 - i] = bt_temp;\r
+            }\r
+\r
+            if(diag_nv_write(NV_BD_ADDR_I,&nv_item) != NV_DONE_S)\r
+            {\r
+                rsp->data[0] = 1;\r
+            }\r
+            else\r
+            {\r
+                rsp->data[0] = 0;\r
+            }\r
+\r
+            rsp->mask=req->mask;\r
+            break;\r
+        }\r
+\r
+        case 0x25:\r
+        {\r
+            diag_des_sec_key = (byte *)diag_tool_des_sec_key;\r
+            diag_des_sec_code = (byte *)diag_tool_des_sec_code;\r
+            rsp->mask = 0x25;\r
+\r
+            sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[0];\r
+\r
+            *sec_rand_ptr = ran_next ();\r
+\r
+            sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[4];\r
+\r
+            *sec_rand_ptr = ran_next ();\r
+            diag_rand_init = *sec_rand_ptr;\r
+\r
+            memcpy(diagdiag_des_sec_scrunch, diag_des_sec_key, sizeof(diagdiag_des_sec_scrunch));\r
+\r
+            diag_deskey(diagdiag_des_sec_scrunch, EN0);\r
+\r
+            diag_des( &diagdiag_des_sec_rand[0],&rsp->data[0]);\r
+\r
+            break;\r
+        }\r
+        case 0x26:\r
+        {\r
+            diag_des_sec_key = (byte *)diag_tool_des_sec_key;\r
+            diag_des_sec_code = (byte *)diag_tool_des_sec_code;\r
+            rsp->mask = 0x26;\r
+\r
+            memcpy(diagdiag_des_sec_scrunch, diag_des_sec_key, sizeof(diagdiag_des_sec_scrunch));\r
+\r
+            diag_deskey(diagdiag_des_sec_scrunch, DE1);\r
+\r
+            diag_des(&req->data[0], &diagdiag_des_sec_para[0]);\r
+\r
+            diagdiag_des_sec_ok = TRUE;\r
+\r
+            if((diagdiag_des_sec_rand[0] == 0) &&\r
+                    (diagdiag_des_sec_rand[1] == 0) &&\r
+                    (diagdiag_des_sec_rand[2] == 0) &&\r
+                    (diagdiag_des_sec_rand[3] == 0) &&\r
+                    (diagdiag_des_sec_rand[4] == 0) &&\r
+                    (diagdiag_des_sec_rand[5] == 0) &&\r
+                    (diagdiag_des_sec_rand[6] == 0) &&\r
+                    (diagdiag_des_sec_rand[7] == 0) )\r
+            {\r
+                diagdiag_des_sec_ok = FALSE;\r
+\r
+                diag_powerdown();\r
+\r
+                break;\r
+            }\r
+\r
+            for (i = 0; i < 8; i++)\r
+            {\r
+                if(diag_des_sec_code[i] != (diagdiag_des_sec_para[i] ^ diagdiag_des_sec_rand[i]))\r
+                {\r
+                    diagdiag_des_sec_ok = FALSE;\r
+\r
+                    diag_powerdown();\r
+\r
+                    break;\r
+                }\r
+            }\r
+\r
+            if(diagdiag_des_sec_ok == TRUE)\r
+            {\r
+                rsp->data[0] = 0x01;\r
+\r
+            }\r
+\r
+            sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[0];\r
+\r
+            *sec_rand_ptr = ran_next ();\r
+\r
+            sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[4];\r
+\r
+            *sec_rand_ptr = ran_next ();\r
+            diag_rand_init = *sec_rand_ptr;\r
+            diag_des_ulock_stat = TRUE;\r
+            break;\r
+        }\r
+       \r
+        case 0x32:\r
+        {//read the wlan mac address\r
+            nv_item_type  nv_item;\r
+            uint16 mac_add,mac_temp;\r
+\r
+            if(diag_nv_read(NV_WLAN_MAC_ADDRESS_I,&nv_item) != NV_DONE_S)\r
+            {\r
+                rsp->data[0] = 1;\r
+            }\r
+            else\r
+            {\r
+                for(i = 0;i < 6;i++)\r
+                {\r
+                    mac_add = (uint16)nv_item.wlan_mac_address[i];\r
+                    mac_temp = mac_add & 0x000F;  \r
+                    rsp->data[6*2 -1 - i*2] = (unsigned char) (( mac_temp <= 9 ) ? mac_temp + '0' : mac_temp - 10 + 'A');\r
+                    mac_temp = (mac_add >> 4) & 0x000F;   \r
+                    rsp->data[6*2 -2 - i*2] = (unsigned char) (( mac_temp <= 9 ) ? mac_temp + '0' : mac_temp - 10 + 'A');\r
+                }\r
+            }\r
+\r
+            rsp->mask=req->mask;\r
+            break;\r
+        }\r
+        case 0x33:\r
+        {//write the wlan mac address\r
+            nv_item_type  nv_item;\r
+            uint16 mac_add,mac_temp;\r
+\r
+            for(i = 0;i < 6;i++)\r
+            {\r
+                mac_add = 0;\r
+                mac_temp = 0;\r
+                if(req->data[2*i] <= 0x39)\r
+                {\r
+                    mac_add = req->data[2*i] - '0';\r
+                }\r
+                else\r
+                {\r
+                    mac_add = req->data[2*i]  - 'A' + 10;\r
+                }\r
+\r
+                if(req->data[2*i + 1] <= 0x39)\r
+                {\r
+                    mac_temp = req->data[2*i + 1] - '0';\r
+                }\r
+                else\r
+                {\r
+                    mac_temp = req->data[2*i + 1] -  'A' + 10;\r
+                }\r
+\r
+                mac_temp |= (mac_add << 4);\r
+                nv_item.wlan_mac_address[6 -1 - i] = mac_temp;\r
+            }\r
+\r
+            if(diag_nv_write(NV_WLAN_MAC_ADDRESS_I,&nv_item) != NV_DONE_S)\r
+            {\r
+                rsp->data[0] = 1;\r
+            }\r
+            else\r
+            {\r
+                rsp->data[0] = 0;\r
+            }\r
+\r
+            rsp->mask=req->mask;\r
+            break;\r
+        }\r
+           \r
+#ifdef FEATURE_NV_BAK\r
+        case 0x53:\r
+        {\r
+#ifdef FEATURE_INFO_BAK\r
+            efs_device_write_info_bak_data();\r
+#endif\r
+            if(efs_device_bak_nv_data(FALSE) == 0) \r
+            {\r
+                rsp->data[0] = 0x01;\r
+            }\r
+            else\r
+            {\r
+                rsp->data[0] = 0x00;\r
+            }\r
+            rsp->mask = 0x53;\r
+            break;\r
+        }\r
+        \r
+        case 0x54:\r
+        {\r
+            /* »Ö¸´NVÊý¾Ý*/\r
+            if(efs_device_restore_nv_data() == FALSE)\r
+            {\r
+                rsp->data[0] = 0x01;\r
+            }\r
+            else\r
+            {\r
+            #ifdef FEATURE_INFO_BAK\r
+                /* »Ö¸´DATÎļþ*/\r
+                if(efs_device_restore_info_bak_file() == TRUE)\r
+                {\r
+                    if(efs_device_get_info_bak_data(&need_data[0]) == FALSE)//read BOARDNO, MSNO and PHONEID data, ssd add 2008-12-23\r
+                    {\r
+                        rsp->data[0] = 0x01;//¶Áȡʧ°Ü\r
+                    }\r
+                    else\r
+                    {\r
+                        rsp->data[0] = 0x00;//¶ÁÈ¡³É¹¦\r
+                        \r
+                        for(i=0; i<BOARDNO_MAX_SIZE; i++)\r
+                        {\r
+                            rsp->data[i+1] = need_data[i];\r
+                        }\r
+                        \r
+                        rsp->data[BOARDNO_MAX_SIZE+1] = 0x00;//0x00·Ö¸ôBOARDNOºÍPHONEIDÊý¾Ý\r
+                    \r
+                        for(i=0; i<PHONEID_MAX_SIZE; i++)\r
+                        {\r
+                            rsp->data[BOARDNO_MAX_SIZE+2+i] = need_data[BOARDNO_MAX_SIZE+i];\r
+                        }\r
+                        \r
+                        rsp->data[BOARDNO_MAX_SIZE+PHONEID_MAX_SIZE+2] = 0x00;//0x00·Ö¸ôPHONEIDºÍMSNOÊý¾Ý\r
+                    \r
+                        for(i=0; i<MSNO_MAX_SIZE; i++)\r
+                        {\r
+                            rsp->data[BOARDNO_MAX_SIZE+PHONEID_MAX_SIZE+3+i] = need_data[BOARDNO_MAX_SIZE+PHONEID_MAX_SIZE+i];\r
+                        }\r
+                    }\r
+                }\r
+                else\r
+                {\r
+                    rsp->data[0] = 0x01;//»Ö¸´Ê§°Ü\r
+                }\r
+            #else\r
+                rsp->data[0] = 0x00;//»Ö¸´³É¹¦\r
+            #endif\r
+            }\r
+            \r
+            rsp->mask = 0x54;\r
+            break;\r
+        }\r
+#endif\r
+        default:\r
+        {\r
+            rsp->mask = 0xFF;\r
+            for (i=0 ; i < NV_DIR_NUMB_PCS_SIZ; i++)\r
+            {\r
+                rsp->data[i] = 0xFF;\r
+            }\r
+            break;\r
+        }\r
+    }\r
+    return (rsp);\r
+}\r
+\r
+/*===========================================================================\r
+\r
+FUNCTION DIAGDIAG_FACTORY_TEST\r
+\r
+DESCRIPTION\r
+  This procedure processes a request to poke into Non-Volatile memory.\r
+\r
+DEPENDENCIES\r
+  None.\r
+\r
+RETURN VALUE\r
+  Pointer to response packet.\r
+\r
+SIDE EFFECTS\r
+  None.\r
\r
+===========================================================================*/\r
+PACK(void *) diagdiag_factory_test (PACK(void *) req_pkt, uint16 pkt_len)\r
+{\r
+    int i;\r
+\r
+    DIAG_FACTORY_TEST_F_req_type *req = (DIAG_FACTORY_TEST_F_req_type *) req_pkt;\r
+    DIAG_FACTORY_TEST_F_rsp_type *rsp;\r
+    const int rsp_len = sizeof(DIAG_FACTORY_TEST_F_rsp_type);\r
+\r
+    /* Allocate space for response packet */\r
+    rsp = (DIAG_FACTORY_TEST_F_rsp_type *)diagpkt_alloc(DIAG_FACTORY_TEST_F, rsp_len);\r
+\r
+    rsp->mask = 0x00;\r
+    for (i=0 ; i < 16; i++)\r
+    {\r
+        rsp->data[i] = 0x00;\r
+    }  \r
+\r
+    switch(req->mask)\r
+    {\r
+        case 0x00:\r
+        {\r
+            rsp->mask = 0x00;\r
+            break;\r
+        }\r
+        default:\r
+            rsp->mask = 0xFF;\r
+            break;\r
+    }\r
+\r
+    return (rsp);\r
+}\r
+\r
+/*===========================================================================\r
\r
+FUNCTION DIAGDIAG_ENCRYPT_TEST\r
\r
+DESCRIPTION\r
\r
+DEPENDENCIES\r
+  None.\r
\r
+RETURN VALUE\r
+  Pointer to response packet.\r
\r
+SIDE EFFECTS\r
+  None.\r
\r
+===========================================================================*/\r
+PACK(void *) diagdiag_encrypt_test (PACK(void *) req_pkt, uint16 pkt_len)\r
+{\r
+    byte diagdiag_des_sec_para[16];\r
+    byte diagdiag_des_sec_scrunch[8];\r
+    boolean diagdiag_des_sec_ok;\r
+    dword* sec_rand_ptr;\r
+    int i;\r
+\r
+#ifdef NV_BAK\r
+\r
+    extern int efs_device_bak_nv_data(PACKED const byte *data_ptr,int data_size,boolean erase);\r
+#endif\r
+\r
+    DIAG_ENCRYPT_TEST_F_req_type *req = (DIAG_ENCRYPT_TEST_F_req_type *) req_pkt;\r
+    DIAG_ENCRYPT_TEST_F_rsp_type *rsp;\r
+    const int rsp_len = sizeof(DIAG_ENCRYPT_TEST_F_rsp_type);\r
+\r
+    /* Allocate space for response packet */\r
+    rsp = (DIAG_ENCRYPT_TEST_F_rsp_type *)diagpkt_alloc(DIAG_ENCRYPT_TEST_F, rsp_len);\r
+\r
+    rsp->mask = 0x00;\r
+    for (i=0 ; i < 16; i++)\r
+    {\r
+        rsp->data[i] = 0x00;\r
+    }\r
+\r
+    switch(req->mask)\r
+    {\r
+    case 0x01:\r
+        diag_des_sec_key = (byte *)diag_tool_des_sec_key;\r
+        diag_des_sec_code = (byte *)diag_tool_des_sec_code;\r
+        rsp->mask = 0x01;\r
+\r
+        sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[0];\r
+\r
+        *sec_rand_ptr = ran_next ();\r
+\r
+        sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[4];\r
+\r
+        *sec_rand_ptr = ran_next ();\r
+\r
+        memcpy(diagdiag_des_sec_scrunch, diag_des_sec_key, sizeof(diagdiag_des_sec_scrunch));\r
+\r
+        diag_deskey(diagdiag_des_sec_scrunch, EN0);\r
+\r
+        diag_des( &diagdiag_des_sec_rand[0],&rsp->data[0]);\r
+\r
+        break;\r
+\r
+    case 0x02:\r
+        diag_des_sec_key =(byte *) diag_tool_des_sec_key;\r
+        diag_des_sec_code =(byte *) diag_tool_des_sec_code;\r
+\r
+        rsp->mask = 0x02;\r
+\r
+        memcpy(diagdiag_des_sec_scrunch, diag_des_sec_key, sizeof(diagdiag_des_sec_scrunch));\r
+\r
+        diag_deskey(diagdiag_des_sec_scrunch, DE1);\r
+\r
+        diag_des(&req->data[0], &diagdiag_des_sec_para[0]);\r
+\r
+        diagdiag_des_sec_ok = TRUE;\r
+\r
+        if((diagdiag_des_sec_rand[0] == 0) &&\r
+                (diagdiag_des_sec_rand[1] == 0) &&\r
+                (diagdiag_des_sec_rand[2] == 0) &&\r
+                (diagdiag_des_sec_rand[3] == 0) &&\r
+                (diagdiag_des_sec_rand[4] == 0) &&\r
+                (diagdiag_des_sec_rand[5] == 0) &&\r
+                (diagdiag_des_sec_rand[6] == 0) &&\r
+                (diagdiag_des_sec_rand[7] == 0) )\r
+        {\r
+            diagdiag_des_sec_ok = FALSE;\r
+\r
+            diag_powerdown();\r
+\r
+            break;\r
+        }\r
+\r
+        for (i = 0; i < 8; i++)\r
+        {\r
+            if(diag_des_sec_code[i] != (diagdiag_des_sec_para[i] ^ diagdiag_des_sec_rand[i]))\r
+            {\r
+                diagdiag_des_sec_ok = FALSE;\r
+\r
+                diag_powerdown();\r
+\r
+                break;\r
+            }\r
+        }\r
+\r
+        if(diagdiag_des_sec_ok == TRUE)\r
+        {\r
+            rsp->data[0] = 0x01;\r
+\r
+        }\r
+\r
+        sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[0];\r
+\r
+        *sec_rand_ptr = ran_next ();\r
+\r
+        sec_rand_ptr = (dword*)&diagdiag_des_sec_rand[4];\r
+\r
+        *sec_rand_ptr = ran_next ();\r
+\r
+        break;\r
+\r
+    default:\r
+        rsp->mask = 0xFF;\r
+        for (i=0 ; i < sizeof(rsp->data); i++)\r
+        {\r
+            rsp->data[i] = 0xFF;\r
+        }\r
+        break;\r
+    }\r
+    return (rsp);\r
+}\r
+\r
+#endif\r
+\r
+#define DISPATCH_DECLARE(func) \\r
+extern PACK(void *) func(PACK(void *) req_pkt, word len)\r
+\r
+#if defined(FEATURE_DIAG_RPC)\r
+#error code not present\r
+#endif /* FEATURE_DIAG_RPC */\r
+\r
+#ifndef FEATURE_DIAG_DISALLOW_MEM_OPS\r
+static const diagpkt_user_table_entry_type diagdiag_tbl_mem_ops[] =\r
+{\r
+  {DIAG_PEEKB_F, DIAG_PEEKB_F, diagdiag_peekb},\r
+  {DIAG_PEEKW_F, DIAG_PEEKW_F, diagdiag_peekw},\r
+  {DIAG_PEEKD_F, DIAG_PEEKD_F, diagdiag_peekd},\r
+  {DIAG_POKEB_F, DIAG_POKEB_F, diagdiag_pokeb},\r
+  {DIAG_POKEW_F, DIAG_POKEW_F, diagdiag_pokew},\r
+  {DIAG_POKED_F, DIAG_POKED_F, diagdiag_poked},\r
+  {DIAG_OUTP_F, DIAG_OUTP_F, diagdiag_outp},\r
+  {DIAG_OUTPW_F, DIAG_OUTPW_F, diagdiag_outpw},\r
+  {DIAG_INP_F, DIAG_INP_F, diagdiag_inp},\r
+  {DIAG_INPW_F, DIAG_INPW_F, diagdiag_inpw},\r
+};\r
+#endif\r
+\r
+static const diagpkt_user_table_entry_type diagdiag_tbl_ts[]=\r
+{\r
+  {DIAG_TS_F, DIAG_TS_F, diagdiag_ts},\r
+\r
+};\r
+\r
+#ifdef FEATURE_TECHNICS_DIAG\r
+static const diagpkt_user_table_entry_type diagdiag_tbl_technics[]=\r
+{\r
+    {DIAG_ENCRYPT_TEST_F,DIAG_ENCRYPT_TEST_F, diagdiag_encrypt_test },\r
+    {DIAG_MANUFACTURE_TEST_F,DIAG_MANUFACTURE_TEST_F, diagdiag_manufacture_test },\r
+    {DIAG_FACTORY_TEST_F,DIAG_FACTORY_TEST_F, diagdiag_factory_test },\r
+};\r
+#endif\r
+\r
+static const diagpkt_user_table_entry_type diagdiag_tbl_feature[]=\r
+{\r
+ {DIAG_FEATURE_QUERY_F, DIAG_FEATURE_QUERY_F, diagdiag_feature_query},\r
+};\r
+\r
+static const diagpkt_user_table_entry_type diagdiag_tbl_misc[]=\r
+{\r
+\r
+#if defined(FEATURE_DIAG_RPC)\r
+#error code not present\r
+#endif\r
+  {DIAG_DIAG_VER_F, DIAG_DIAG_VER_F, diagdiag_ver},\r
+  {DIAG_PASSWORD_F, DIAG_PASSWORD_F, diagdiag_password},\r
+  {DIAG_GET_GUID_F, DIAG_GET_GUID_F, diagdiag_get_guid },\r
+};\r
+\r
+static const diagpkt_user_table_entry_type diagdiag_tbl_listener[] =\r
+{  \r
+  {DIAGDIAG_ADD_EVENT_LISTENER_F, DIAGDIAG_REMOVE_LOG_LISTENER_F, diagdiag_listener_pkt},\r
+};\r
+\r
+\r
+void diagdiag_tbl_init()\r
+{\r
+#ifndef FEATURE_DIAG_DISALLOW_MEM_OPS\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC (DIAG_MODEM_PROC, DIAGPKT_NO_SUBSYS_ID, diagdiag_tbl_mem_ops);\r
+#endif\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC (DIAG_MODEM_PROC, DIAGPKT_NO_SUBSYS_ID, diagdiag_tbl_feature);\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC (DIAG_MODEM_PROC, DIAGPKT_NO_SUBSYS_ID, diagdiag_tbl_ts);\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC (DIAG_MODEM_PROC, DIAGPKT_NO_SUBSYS_ID, diagdiag_tbl_misc);\r
+#ifdef FEATURE_TECHNICS_DIAG\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC(DIAG_MODEM_PROC,DIAGPKT_NO_SUBSYS_ID,diagdiag_tbl_technics);\r
+#endif\r
+#if defined(DIAG_IMAGE_APPS_PROC)\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC( DIAG_APP_PROC, DIAG_SUBSYS_DIAG_SERV, diagdiag_tbl_listener);\r
+#else\r
+#if defined(DIAG_IMAGE_MODEM_PROC)|| defined(DIAG_SINGLE_PROC)\r
+       DIAGPKT_DISPATCH_TABLE_REGISTER_PROC( DIAG_MODEM_PROC, DIAG_SUBSYS_DIAG_SERV, diagdiag_tbl_listener);\r
+#endif\r
+#endif \r
+}\r
+\r
+#if defined __cplusplus\r
+  }\r
+#endif\r
diff --git a/AMSS/diagdiag_v.h b/AMSS/diagdiag_v.h
new file mode 100644 (file)
index 0000000..c13595f
--- /dev/null
@@ -0,0 +1,1030 @@
+#ifndef DIAGDIAG_V_H\r
+#define DIAGDIAG_V_H\r
+/*==========================================================================\r
+\r
+                      Diagnostic Packet Definitions\r
+\r
+  Description: Packet definitions between the diagnostic subsystem\r
+  and the external device.\r
+\r
+  !!! NOTE: All member structures of diag packets must be PACK.\r
+  \r
+  !!! WARNING: Each command code number is part of the externalized\r
+  diagnostic command interface.  This number *MUST* be assigned\r
+  by a member of QCT's tools development team.\r
+\r
+Copyright (c) 2001-2010 by QUALCOMM, Incorporated.  All Rights Reserved.\r
+===========================================================================*/\r
+\r
+/*===========================================================================\r
+\r
+                            Edit History\r
+\r
+  $Header: //source/qcom/qct/core/pkg/2H09/halcyon_modem/rel/LA2.0/AMSS/products/7x30/core/services/diag/LSM/common/src/diagdiag_v.h#1 $\r
+\r
+when       who     what, where, why\r
+--------   ---     ----------------------------------------------------------\r
+07/10/10   vs    Moved definitions of diagpeek/poke to public header\r
+04/20/10   is    Remove support for DIAG_GET_PROPERTY_F, DIAG_PUT_PROPERTY_F,\r
+                            DIAG_GET_PERM_PROPERTY_F, and DIAG_PUT_PERM_PROPERTY_F.\r
+04/05/10   JV      Added test cases for QSR messages in the stress test\r
+03/02/10   JV      New command to enable/disable data aggregation\r
+02/25/10   JV      New command to flush diagbuf.\r
+12/15/09   JV      Mainlining code under the 'DEBUG_DIAG_TEST' feature\r
+12/07/09   cahn    Added Delayed Response to DIAG Health.\r
+11/12/09   cahn    Added variable length log types for DIAG stress test.\r
+11/04/09   cahn    DIAG Health\r
+09/20/09   sg      Added diagdiag_tbl_init prototype\r
+09/15/09   cahn    Added loopback on individual processors.\r
+09/10/09   JV      Added protptype for diagdiag_init().\r
+08/05/09   JV      Removed the CUST_H featurization around the inclusion of \r
+                   customer.h.\r
+07/31/09   JV      Merged Q6 diag code back to mainline\r
+07/14/09   mad     Featurized includion of customer.h and feature.h.\r
+                   Featured out FEATURE_QUERY pkt/response.\r
+06/11/09   JV      Added command code for Q6 stress test\r
+05/07/09   vk      moved declerations into diagdiag.h that were being referred from \r
+                   there\r
+01/14/09   vg      Fixed type added during the public and private headerfile\r
+                   split. \r
+10/03/08   vg      Updated code to use PACK() vs. PACKED\r
+05/17/05   as      Added Dual processor Diag support.\r
+06/15/04   gr      Added support for getting and setting the event mask.\r
+05/18/04   as      Removed support for DIAG_USER_CMD_F & DIAG_PERM_USER_CMD_F\r
+01/07/03   djm     add RPC support for WCDMA_PLT\r
+08/20/02   lad     Moved DIAG_DLOAD_F packet def to dloaddiag.h.\r
+                   Moved DIAG_SERIAL_CHG_F definition to diagcomm_sio.c.\r
+01/28/02   as      Support for DIAG_LOG_ON_DEMAND_F (log on demand).\r
+09/18/01   jal     Support for DIAG_CONTROL_F (mode reset/offline)\r
+08/20/01   jal     Support for Diag packet: DIAG_TS_F (timestamp),\r
+                   DIAG_SPC_F (service programming code), DIAG_DLOAD_F\r
+                  (start downloader), DIAG_OUTP_F/DIAG_OUTPW_F (IO\r
+                  port byte/word output), DIAG_INP_F/DIAG_INPW_F (IO\r
+                  port byte/word input) \r
+06/27/01   lad     Use of constants in message response packet.\r
+                   Added packet definition for DIAG_LOG_CONFIG_F.  This\r
+                   replaces extended logmask processing.\r
+                   Cleaned up DIAG_STREAMING_CONFIG_F and added subcmd to\r
+                   get diagbuf size.\r
+04/06/01   lad     Added packet definitions for the following:\r
+                   Peek/Poke\r
+                   DIAG_STREAMING_CONFIG_F\r
+                   Debug messages\r
+                   Log services\r
+                   Event services\r
+02/23/01   lad     Created file.\r
+\r
+===========================================================================*/\r
+\r
+#include "comdef.h"\r
+\r
+#ifndef FEATURE_WINCE\r
+#include "customer.h"\r
+#include "feature.h"\r
+#endif\r
+\r
+#include "diagcmd.h"\r
+#include "diagpkt.h"\r
+#include "log_codes.h"\r
+#include "qw.h"\r
+#include "diag.h"\r
+#include "diagdiag.h"\r
+#include "osal.h"\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_BAD_CMD_F\r
+         DIAG_BAD_PARM_F\r
+         DIAG_BAD_LEN_F\r
+         DIAG_BAD_VOC_F\r
+         DIAG_BAD_MODE_F\r
+         DIAG_BAD_SPC_MODE_F\r
+\r
+PURPOSE  Sent by DMSS when it detects an erroneous packet from DM. Errors\r
+         include command code out of bounds, bad length...  Includes the\r
+         first DIAG_MAX_ERR bytes of the offending input packet.\r
+         Also includes when an nv_read/write is attempted before the correct\r
+         SPC has been entered.\r
+\r
+============================================================================*/\r
+\r
+/* Prototype */\r
+void diagdiag_init (void);\r
+void diagdiag_tbl_init (void);\r
+\r
+/* -------------------------------------------------------------------------\r
+** Packet Definitions\r
+** ------------------------------------------------------------------------- */                           \r
+#if defined(T_WINNT) || defined(FEATURE_WINCE)\r
+#error code not present\r
+#endif\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_RPC_F\r
+\r
+PURPOSE  RPC Processing Request\r
+\r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_RPC_F )\r
+\r
+  /* It's just the command code */\r
+  \r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_RPC_F )\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_DIAG_VER_F\r
+PURPOSE  Sent by DM to request the version of the diag\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE(DIAG_DIAG_VER_F)\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_DIAG_VER_F)\r
+  word ver;                    /* diag version */\r
+DIAGPKT_RSP_END\r
+               \r
+/*===========================================================================\r
+\r
+PACKET   DIAG_PASSWORD_F\r
+PURPOSE  Sent by external device to enter the Security Password,\r
+         to then allow operations protected by security.  This response \r
+         indicates whether the correct Password was given or not.\r
+\r
+NOTE     If the incorrect password is entered, DIAG will POWER DOWN\r
+         the phone.\r
+\r
+===========================================================================*/\r
+#define DIAG_PASSWORD_SIZE 8\r
+DIAGPKT_REQ_DEFINE(DIAG_PASSWORD_F)\r
+  byte password[DIAG_PASSWORD_SIZE];  /* The security password */\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_PASSWORD_F)\r
+  boolean password_ok;        /* TRUE if Security Password entered correctly */\r
+DIAGPKT_RSP_END\r
+\r
+/* Logging Services */\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_LOG_CONFIG_F\r
+PURPOSE  Sent by the DM to set the equipment ID logging mask in the DMSS.  \r
+         This is necessary to use logging services with MS Equip ID != 1.\r
+\r
+!!!Note that the log mask is now sanely ordered LSB to MSB using little endian \r
+32-bit integer arrays.  This is not the same way the mask was done in \r
+DIAG_EXT_LOGMASK_F.\r
+\r
+TERMINOLOGY:\r
+  'equipment ID' - the 4-bit equipment identifier\r
+  'item ID' - the 12-bit ID that specifies the log item within this equip ID\r
+  'code' - the entire 16-bit log code (contains both equip and item ID)\r
+\r
+===========================================================================*/\r
+typedef enum {\r
+  LOG_CONFIG_DISABLE_OP = 0,\r
+  LOG_CONFIG_RETRIEVE_ID_RANGES_OP = 1, \r
+  LOG_CONFIG_RETRIEVE_VALID_MASK_OP = 2,\r
+  LOG_CONFIG_SET_MASK_OP = 3,\r
+  LOG_CONFIG_GET_LOGMASK_OP = 4\r
+} log_config_command_ops_enum_type;\r
+\r
+/* Logging config return status types. \r
+ * (*) denotes applicable to all commands \r
+ */\r
+typedef enum {\r
+  LOG_CONFIG_SUCCESS_S = 0,          /* Operation Sucessful */\r
+  LOG_CONFIG_INVALID_EQUIP_ID_S = 1, /* (*) Specified invalid equipment ID */\r
+  LOG_CONFIG_NO_VALID_MASK_S = 2     /* Valid mask not available for this ID */\r
+} log_config_status_enum_type;\r
+\r
+/* Operation data */\r
+/* DISABLE OP: LOG_CONFIG_DISAPLE_OP -no no supporting data */\r
+\r
+/* These member structures are not packed intentionally.  Each data member will \r
+ * align on a 32-bit boundary.\r
+ */\r
+typedef PACK(struct) {\r
+  uint32 equip_id;\r
+\r
+  uint32 last_item;\r
+\r
+} log_config_range_type;\r
+\r
+typedef PACK(struct) {\r
+  log_config_range_type code_range; /* range of log codes */\r
+  \r
+  byte mask[1]; /* Array of 8 bit masks of size (num_bits + 7) / 8 */\r
+} log_config_mask_type;\r
+\r
+/* ID_RANGE_OP  response type */\r
+typedef PACK(struct) {\r
+  uint32 last_item[16]; /* The last item for each of the 16 equip IDs */ \r
+} log_config_ranges_rsp_type;\r
+\r
+/* VALID_MASK_OP request type */\r
+typedef PACK(struct) {\r
+  uint32 equip_id;\r
+} log_config_valid_mask_req_type;\r
+\r
+/* VALID_MASK_OP response type */\r
+typedef log_config_mask_type log_config_valid_mask_rsp_type;\r
+\r
+/* SET_MASK_OP request type */\r
+typedef log_config_mask_type log_config_set_mask_req_type;\r
+\r
+/* GET_MASK_OP response type */\r
+typedef log_config_mask_type log_config_get_mask_rsp_type;\r
+\r
+/* SET_MASK_OP response type */\r
+typedef log_config_mask_type log_config_set_mask_rsp_type;\r
+\r
+/* This is not packed.  We use uint32 which is always aligned */\r
+typedef PACK(union) {\r
+  /* LOG_CONFIG_DISABLE_OP */\r
+  /* no additional data */\r
+\r
+  /* LOG_CONFIG_RETRIEVE_ID_RANGES_OP */\r
+  /* no additional data */\r
+  \r
+  /* LOG_CONFIG_RETRIEVE_VALID_MASK_OP */\r
+  log_config_valid_mask_req_type valid_mask;\r
+\r
+  /* LOG_CONFIG_SET_MASK_OP */\r
+  log_config_set_mask_req_type set_mask;\r
+\r
+  /* LOG_CONFIG_GET_MASK_OP */\r
+  /* no additional data */\r
+\r
+} log_config_op_req_type;\r
+\r
+typedef PACK(union) {\r
+  /* LOG_CONFIG_DISABLE_OP */\r
+  /* no additional data */\r
+\r
+  /* LOG_CONFIG_RETRIEVE_ID_RANGES_OP */\r
+  log_config_ranges_rsp_type ranges;\r
+  \r
+  /* LOG_CONFIG_RETRIEVE_VALID_MASK_OP */\r
+  log_config_valid_mask_rsp_type valid_mask;\r
+\r
+  /* LOG_CONFIG_SET_MASK_OP */\r
+  log_config_set_mask_rsp_type set_mask;\r
+\r
+  /* LOG_CONFIG_GET_MASK_OP */\r
+  log_config_get_mask_rsp_type get_mask;\r
+\r
+} log_config_op_rsp_type;\r
+\r
+\r
+DIAGPKT_REQ_DEFINE(DIAG_LOG_CONFIG_F)\r
+\r
+  byte pad[3]; /* Force following items to be on 32-bit boundary */\r
+\r
+  uint32 operation;  /* See log_config_command_ops_enum_type */\r
+\r
+  uint32 op_data[1]; /* Pointer to operation data */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_LOG_CONFIG_F)\r
+\r
+  byte pad[3]; /* Force following items to be on 32-bit boundary */\r
+\r
+  uint32 operation;  /* See log_config_command_ops_enum_type */\r
+\r
+  uint32 status;\r
+\r
+  uint32 op_data[1]; /* Pointer to operation data */\r
+\r
+DIAGPKT_RSP_END\r
+\r
+\r
+/* Number of bits in a log mask.\r
+*/\r
+#define DIAG_EXT_LOGMASK_NUM_BITS (LOG_1X_LAST_C & 0x0FFF)\r
+\r
+/* Max # of bytes in a valid log mask.\r
+*/\r
+#define DIAG_EXT_LOGMASK_NUM_BYTES ((DIAG_EXT_LOGMASK_NUM_BITS / 8) + 1)\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_EXT_LOGMASK_F\r
+PURPOSE  Sent by the DM to set the logging mask in the DMSS.  This is\r
+         necessary for logmasks > 32 bits.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE(DIAG_EXT_LOGMASK_F)\r
+  word  num_bits;                 /* Number of valid bits */\r
+  byte  mask[DIAG_EXT_LOGMASK_NUM_BYTES]; /* mask to use          */\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_EXT_LOGMASK_F)\r
+  word  num_valid_bits;                     /* Number of valid bits    */\r
+  byte  valid_mask[DIAG_EXT_LOGMASK_NUM_BYTES]; /* mask of valid log codes */\r
+DIAGPKT_RSP_END\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_LOG_F\r
+PURPOSE  Encapsulates a log record.\r
+\r
+===========================================================================*/\r
+\r
+typedef struct\r
+{\r
+  uint8 cmd_code;\r
+  uint8 more;   /* Indicates how many log entries, not including the one \r
+                   returned with this packet, are queued up in the Mobile\r
+                   Station.  If DIAG_DIAGVER >= 8, this should be set to 0 */\r
+  uint16 len;   /* Indicates the length, in bytes, of the following log entry */\r
+  uint8 log[1]; /* Contains the log entry data. */\r
+}\r
+diag_log_rsp_type;\r
+\r
+\r
+/* -------------------------------------------------------------------------\r
+** Legacy (but still supported) packet definitions for logging services.\r
+** ------------------------------------------------------------------------- */\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_LOGMASK_F\r
+PURPOSE  Sent by the DM to set the 32-bit logging mask in the DMSS.\r
+         Note: this is the legacy logging mask format.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE(DIAG_LOGMASK_F)\r
+  uint32 mask; /* 32-bit log mask  */\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_LOGMASK_F)\r
+DIAGPKT_RSP_END\r
+\r
+#ifndef FEATURE_WINCE\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_FEATURE_QUERY_F\r
+PURPOSE  Sent by external device to query the phone for a bit mask detailing\r
+         which phone features are turned on.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE(DIAG_FEATURE_QUERY_F)\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_FEATURE_QUERY_F)\r
+  word feature_mask_size;                 /* Size of the following Mask */\r
+  byte feature_mask[FEATURE_MASK_LENGTH]; /* Space for the largest possible \r
+                                             feature mask */\r
+DIAGPKT_RSP_END\r
+#endif\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_EVENT_REPORT_F\r
+PURPOSE  Sent by the DM to configure static event reporting in the DMSS.\r
+\r
+===========================================================================*/\r
+/*--------------------------------------\r
+  Special bit flags in the event ID.\r
+--------------------------------------*/\r
+#define EVENT_PAY_LENGTH   0x3\r
+#define EVENT_PAY_TWO_BYTE 0x2\r
+#define EVENT_PAY_ONE_BYTE 0x1\r
+#define EVENT_PAY_NONE     0x0\r
+\r
+/* Bitfields may not be ANSI, but all our compilers\r
+** recognize it and *should* optimize it.\r
+** Not that bit-packed structures are only as long as they need to be.\r
+** Even though we call it uint32, it is a 16 bit structure.\r
+*/\r
+typedef struct\r
+{\r
+  uint16 id              : 12;\r
+  uint16 reserved        : 1;\r
+  uint16 payload_len     : 2; /* payload length (0, 1, 2, see payload) */\r
+  uint16 time_trunc_flag : 1;\r
+} event_id_type;\r
+\r
+typedef PACK(struct)\r
+{\r
+  uint16 id; /* event_id_type id; */\r
+  qword ts;\r
+\r
+} event_type;\r
+\r
+/* Used in lieu of event_type if 'time_trunc_flag' is set in event_id_type */\r
+typedef PACK(struct)\r
+{\r
+  uint16 id; /* event_id_type id; */\r
+  uint16 trunc_ts;\r
+} event_trunc_type;\r
+\r
+/* The event payload follows the event_type structure */\r
+typedef struct\r
+{\r
+  uint8 length;\r
+  uint8 payload[1]; /* 'length' bytes */\r
+} event_payload_type;\r
+\r
+typedef PACK(struct)\r
+{\r
+  uint16 id; /* event_id_type id; */\r
+  qword ts;\r
+  uint32 drop_cnt;\r
+} event_drop_type;\r
+\r
+typedef struct\r
+{\r
+  event_id_type id;\r
+  uint16 ts;\r
+  uint32 drop_cnt;\r
+} event_drop_trunc_type;\r
+\r
+typedef struct\r
+{\r
+  uint8 cmd_code;\r
+  uint8 enable;\r
+//  uint16  watermark;   /* Maximum size (in bytes) of a event report         */ \r
+//  uint16  stale_timer; /* Time (in ms) to allow event buffer to accumulate  */\r
+\r
+} event_cfg_req_type;\r
+\r
+typedef PACK(struct)\r
+{\r
+  uint8  cmd_code;\r
+  uint16 length;\r
+\r
+} event_cfg_rsp_type;\r
+\r
+typedef PACK(struct)\r
+{\r
+  uint8  cmd_code;\r
+  uint16 length;    /* Number of bytes to follow */\r
+  uint8  events[1]; /* Series of 'event_type' structures, 'length' bytes long */\r
+} event_rpt_type;\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_STREAMING_CONFIG_F\r
+PURPOSE  Sent by the DM to configure and tweak streaming diag output services.\r
+\r
+===========================================================================*/\r
+typedef enum {\r
+  DIAG_READ_NICE_C  = 0, /* Read "Nice" values for LOG and MSG services */\r
+  DIAG_WRITE_NICE_C = 1, /* Write "Nice" values for LOG and MSG services */\r
+  DIAG_READ_PRI_C   = 2, /* Read "priority" values for LOG and MSG services */\r
+  DIAG_WRITE_PRI_C  = 3, /* Write "priority" values for LOG and MSG services */\r
+  DIAG_BUF_SIZE_C   = 4  /* Return size (in bytes) of output buffer */\r
+\r
+} diag_streaming_config_subcommand_enum_type;\r
+\r
+typedef PACK(struct) {\r
+    uint16 code; /* MSG_LVL value or Log code */\r
+\r
+    int16  val;\r
+  \r
+} diagpkt_streaming_config_entry_type;\r
+\r
+typedef PACK(struct) {\r
+\r
+  /* Number of entries in the following array */\r
+  uint8 num_entries;\r
+\r
+  /* # of log codes + 5 Message Levels is the number max $ in this array */\r
+  diagpkt_streaming_config_entry_type entry[1];\r
+\r
+} diagpkt_streaming_config_entry_list_type;\r
+\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_TS_F\r
+\r
+PURPOSE  Sent from the DM to the DMSS to request the IS-95/IS-2000 time.\r
+\r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE(DIAG_TS_F)\r
+\r
+  /* It's just the command code */\r
+  \r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_TS_F)\r
+  \r
+  qword ts;        /* Time Stamp */\r
+\r
+DIAGPKT_RSP_END\r
+\r
+#ifdef FEATURE_TECHNICS_DIAG\r
+/*===========================================================================\r
+\r
+PACKET   diag_encrypt_test_req_type\r
+\r
+ID       DIAG_ENCRYPT_TEST_F\r
+\r
+PURPOSE  Sent by DM to cause a keypress input to the handset interface.\r
+\r
+RESPONSE Diag queues a keypress to hsi and echos the request packet.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_ENCRYPT_TEST_F )\r
+\r
+ byte mask;\r
+ byte data[16];\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_ENCRYPT_TEST_F )\r
+\r
+/*===========================================================================\r
+\r
+PACKET   diag_manufacture_test_req_type\r
+\r
+ID       DIAG_MANUFACTURE_TEST_F\r
+\r
+PURPOSE  Sent by DM to cause a keypress input to the handset interface.\r
+\r
+RESPONSE Diag queues a keypress to hsi and echos the request packet.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_MANUFACTURE_TEST_F )\r
+\r
+ byte mask;\r
+ byte data[100];\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_MANUFACTURE_TEST_F )\r
+\r
+/*===========================================================================\r
+\r
+PACKET   diag_manufacture_test_req_type\r
+\r
+ID       DIAG_FACTORY_TEST_F\r
+\r
+PURPOSE  Sent by DM to cause a keypress input to the handset interface.\r
+\r
+RESPONSE Diag queues a keypress to hsi and echos the request packet.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_FACTORY_TEST_F )\r
+\r
+ byte mask;\r
+ byte data[80];\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_FACTORY_TEST_F )\r
+#endif\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_OUTP_F\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to send a byte to an\r
+         IO port\r
+\r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_OUTP_F )\r
+\r
+  word port;                   /* number of port to output to */\r
+  byte data;                   /* data to write to port */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_OUTP_F )\r
+  \r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_OUTPW_F\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to send a 16-bit word to an\r
+         IO port\r
+\r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_OUTPW_F )\r
+\r
+  word port;                   /* number of port to output to */\r
+  word data;                   /* data to write to port */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_OUTPW_F )\r
+\r
+  \r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_INP_F\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to read a byte to an\r
+         IO port\r
+\r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_INP_F )\r
+\r
+  word port;                   /* number of port to output to */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE( DIAG_INP_F )\r
+\r
+  word port;                   /* number of port to output to */\r
+  byte data;                   /* data to write to port */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_INPW_F\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to read a 16-bit word from an\r
+         IO port\r
+\r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_INPW_F )\r
+\r
+  word port;                   /* number of port to output to */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE( DIAG_INPW_F )\r
+\r
+  word port;                   /* number of port to output to */\r
+  word data;                   /* data to write to port */\r
+\r
+DIAGPKT_REQ_END\r
+\r
+\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_LOG_ON_DEMAND_F\r
+\r
+PURPOSE  Request sent from the user to register a function pointer and \r
+         log_code with the diagnostic service for every log that needs \r
+         logging on demand support.\r
+         \r
+============================================================================*/\r
+DIAGPKT_REQ_DEFINE( DIAG_LOG_ON_DEMAND_F )\r
+\r
+   uint16 log_code;             /* The log_code to be sent */\r
+   \r
+DIAGPKT_REQ_END\r
+\r
+\r
+DIAGPKT_RSP_DEFINE( DIAG_LOG_ON_DEMAND_F )\r
+\r
+  uint16 log_code;             /* The log_code sent */\r
+  uint8  status;               /* status returned from the function pointer */\r
+\r
+DIAGPKT_RSP_END\r
+\r
+/* Diagnostic extensions */\r
+/*\r
+** The maximum number of properties and callback functions. These are not\r
+** used to determine the size of any data structure; they are used merely\r
+** to guard against infinite loops caused by corruption of the callback\r
+** and properties tables.\r
+*/\r
+#define DIAG_MAX_NUM_PROPS 20\r
+#define DIAG_MAX_NUM_FUNCS 20\r
+\r
+typedef void (*diag_cb_func_type) (\r
+                                   unsigned char  *data_ptr,\r
+                                   unsigned short  data_len,\r
+                                   unsigned char  *rsp_ptr,\r
+                                   unsigned short *rsp_len_ptr\r
+);\r
+\r
+typedef struct\r
+{\r
+   char             *name;\r
+   diag_cb_func_type address;\r
+} diag_cb_struct_type;\r
+\r
+typedef struct\r
+{\r
+   char *name;\r
+   void *address;\r
+} diag_prop_struct_type;\r
+\r
+typedef enum\r
+{\r
+  DIAG_EXTN_INVALID_GUID = 1,\r
+  DIAG_EXTN_INVALID_SIZE,\r
+  DIAG_EXTN_INVALID_ADDRESS,\r
+  DIAG_EXTN_INVALID_NAME,\r
+  DIAG_EXTN_INVALID_DATA\r
+} diag_extn_err_type;\r
+\r
+/* Need to use PACKED not PACK() */\r
+PACKED typedef unsigned long diag_guid_type[ 4 ];\r
+\r
+/*===========================================================================\r
+\r
+PACKET   DIAG_GET_GUID_F\r
+\r
+PURPOSE  Sent by the DM to retrieve the GUID (globally unique identifier)\r
+         for the current build. This is stored during the build process.\r
+\r
+===========================================================================*/\r
+DIAGPKT_REQ_DEFINE(DIAG_GET_GUID_F)\r
+DIAGPKT_REQ_END\r
+\r
+DIAGPKT_RSP_DEFINE(DIAG_GET_GUID_F)\r
+  diag_guid_type guid;               /* Globally unique identifier  */\r
+DIAGPKT_RSP_END\r
+\r
+#define DIAG_MAX_PROPERTY_NAME_SIZE 40\r
+\r
+// Required DIAG Health Definitions\r
+#define MAX_VALUE_UINT32                4294967295UL   // Overflow\r
+#define DIAGBUF_ALLOC_REQUEST_OTHER     0x0\r
+#define DIAGBUF_ALLOC_REQUEST_LOG       0x1\r
+#define DIAGBUF_ALLOC_REQUEST_MSG       0x2\r
+#define DIAGBUF_ALLOC_REQUEST_DELAY     0x3\r
+\r
+\r
+/*--------------------------------------------------------------------------\r
+  Command Codes between the Diagnostic Monitor and the mobile. These command \r
+  codes are used for stress testing.\r
+----------------------------------------------------------------------------*/\r
+\r
+#define DIAGDIAG_START_STRESS_TEST_MODEM_F     0x0000 \r
+#define DIAGDIAG_CMD_REQUEST_F                 0x0001 \r
+#define DIAGDIAG_ADD_EVENT_LISTENER_F          0x0002         \r
+#define DIAGDIAG_REMOVE_EVENT_LISTENER_F       0x0003                \r
+#define DIAGDIAG_ADD_LOG_LISTENER_F            0x0004           \r
+#define DIAGDIAG_REMOVE_LOG_LISTENER_F         0x0005        \r
+#define DIAGDIAG_START_STRESS_TEST_APPS_F      0x0006\r
+#define DIAGDIAG_START_STRESS_TEST_QDSP_F      0x0007\r
+// Processor Loopback Command Codes\r
+#define DIAGDIAG_STRESS_TEST_SUBSYS_LOOPBACK_APP        0x0028 /* 40 */\r
+#define DIAGDIAG_STRESS_TEST_SUBSYS_LOOPBACK_MODEM      0x0029 /* 41 */\r
+#define DIAGDIAG_STRESS_TEST_SUBSYS_LOOPBACK_Q6         0x002A /* 42 */\r
+// DIAG Health on APPs\r
+#define DIAGDIAG_RESET_DROP_COUNT_LOG_APP      0x002B /* 43 */      \r
+#define DIAGDIAG_GET_DROP_COUNT_LOG_APP        0x002C /* 44 */ \r
+#define DIAGDIAG_RESET_DROP_COUNT_EVENT_APP    0x002D /* 45 */\r
+#define DIAGDIAG_GET_DROP_COUNT_EVENT_APP      0x002E /* 46 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_F3_APP       0x002F /* 47 */\r
+#define DIAGDIAG_GET_DROP_COUNT_F3_APP         0x0030 /* 48 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_LOG_APP       0x0031 /* 49 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_EVENT_APP     0x0032 /* 50 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_F3_APP        0x0033 /* 51 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_DELAY_APP    0x0046 /* 70 */\r
+#define DIAGDIAG_GET_DROP_COUNT_DELAY_APP      0x0047 /* 71 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_DELAY_APP     0x0048 /* 72 */\r
+// DIAG Health on MODEM                                                \r
+#define DIAGDIAG_RESET_DROP_COUNT_LOG_MODEM    0x0034 /* 52 */\r
+#define DIAGDIAG_GET_DROP_COUNT_LOG_MODEM      0x0035 /* 53 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_EVENT_MODEM  0x0036 /* 54 */\r
+#define DIAGDIAG_GET_DROP_COUNT_EVENT_MODEM    0x0037 /* 55 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_F3_MODEM     0x0038 /* 56 */\r
+#define DIAGDIAG_GET_DROP_COUNT_F3_MODEM       0x0039 /* 57 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_LOG_MODEM     0x003A /* 58 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_EVENT_MODEM   0x003B /* 59 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_F3_MODEM      0x003C /* 60 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_DELAY_MODEM  0x0050 /* 80 */\r
+#define DIAGDIAG_GET_DROP_COUNT_DELAY_MODEM    0x0051 /* 81 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_DELAY_MODEM   0x0052 /* 82 */\r
+// DIAG Health on QDSP6                                                \r
+#define DIAGDIAG_RESET_DROP_COUNT_LOG_Q6       0x003D /* 61 */\r
+#define DIAGDIAG_GET_DROP_COUNT_LOG_Q6         0x003E /* 62 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_EVENT_Q6     0x003F /* 63 */\r
+#define DIAGDIAG_GET_DROP_COUNT_EVENT_Q6       0x0040 /* 64 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_F3_Q6        0x0041 /* 65 */\r
+#define DIAGDIAG_GET_DROP_COUNT_F3_Q6          0x0042 /* 66 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_LOG_Q6        0x0043 /* 67 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_EVENT_Q6      0x0044 /* 68 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_F3_Q6         0x0045 /* 69 */\r
+#define DIAGDIAG_RESET_DROP_COUNT_DELAY_Q6     0x005A /* 90 */\r
+#define DIAGDIAG_GET_DROP_COUNT_DELAY_Q6       0x005B /* 91 */\r
+#define DIAGDIAG_GET_ALLOC_COUNT_DELAY_Q6      0x005C /* 92 */\r
+\r
+#define DIAG_FLUSH_BUFFER                      0x005D /* 93 */\r
+#define DIAG_CHANGE_THRESHOLD                  0x005E /* 94 */\r
+/* NOTE: Subsystem command codes 100-102 are used for the user-level app */\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAGDIAG_STRESS_TEST\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to stress test events.\r
+\r
+============================================================================*/\r
+typedef enum {\r
+  DIAGDIAG_STRESS_TEST_MSG = 0,\r
+  DIAGDIAG_STRESS_TEST_MSG_1 = 1,\r
+  DIAGDIAG_STRESS_TEST_MSG_2 = 2,\r
+  DIAGDIAG_STRESS_TEST_MSG_3 = 3,\r
+  DIAGDIAG_STRESS_TEST_MSG_4 = 4,\r
+  DIAGDIAG_STRESS_TEST_MSG_5 = 5,\r
+  DIAGDIAG_STRESS_TEST_MSG_6 = 6,\r
+  DIAGDIAG_STRESS_TEST_MSG_STR = 7,\r
+  DIAGDIAG_STRESS_TEST_MSG_PSEUDO_RANDOM = 8,\r
+  DIAGDIAG_STRESS_TEST_MSG_LOW = 9,\r
+  DIAGDIAG_STRESS_TEST_MSG_MED = 10,\r
+  DIAGDIAG_STRESS_TEST_MSG_HIGH = 11,\r
+  DIAGDIAG_STRESS_TEST_MSG_ERROR = 12,\r
+  DIAGDIAG_STRESS_TEST_MSG_FATAL = 13,\r
+  DIAGDIAG_STRESS_TEST_ERR = 14,\r
+  DIAGDIAG_STRESS_TEST_ERR_FATAL = 15,\r
+  DIAGDIAG_STRESS_TEST_LOG = 16,\r
+  DIAGDIAG_STRESS_TEST_EVENT_NO_PAYLOAD = 17,\r
+  DIAGDIAG_STRESS_TEST_EVENT_WITH_PAYLOAD = 18,\r
+  DIAGDIAG_STRESS_TEST_ERR_FATAL_ISR = 19, /* test panic mode from ISR */\r
+  DIAGDIAG_STRESS_TEST_CMD_REQ = 20,\r
+  /* Reserved space up to 39 */\r
+  DIAGDIAG_STRESS_TEST_LOG_64 = 40, \r
+  DIAGDIAG_STRESS_TEST_LOG_128 = 41,\r
+  DIAGDIAG_STRESS_TEST_LOG_256 = 42,\r
+  /* Log of 512 is test type 16 */\r
+  DIAGDIAG_STRESS_TEST_LOG_1K = 43,\r
+  DIAGDIAG_STRESS_TEST_LOG_2K = 44,\r
+  DIAGDIAG_STRESS_TEST_LOG_4K = 45,\r
+  DIAGDIAG_STRESS_TEST_LOG_6K = 46,\r
+  /* Test cases for QSR messages */\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG = 47,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_1 = 48,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_2 = 49,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_3 = 50,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_4 = 51,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_5 = 52,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_6 = 53,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_LOW = 54,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_MED = 55,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_HIGH = 56,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_ERROR = 57,\r
+  DIAGDIAG_STRESS_TEST_QSR_MSG_FATAL = 58,\r
+  \r
+} diag_stress_test_type_enum_type;\r
+\r
+typedef enum {\r
+  EXPLICIT_PRI = 0, /* Priority given by the user */\r
+  RELATIVE_PRI = 1  /* relative priority is relative to DIAG_PRI */\r
+} diag_stress_pri_type_enum_type;\r
+\r
+typedef struct {\r
+  uint8 test_type;  /* Decides if it is log, msg or event*/\r
+  uint8 pri_type;   /* External or relative priority */\r
+  int16 pri;        /* Priority at which the task is created */\r
+} diag_task_priority_type;\r
+\r
+typedef struct {\r
+  diag_task_priority_type priority; /* refer to diag_task_priority_type above*/\r
+  int num_iterations; /* the number of times the test_type should be called    */\r
+  int sleep_duration; /* Sleep time in milliseconds */ \r
+  int num_iterations_before_sleep; /*After NUM_ITERATIONS_BEFORE_SLEEP  iterations, sleep */\r
+} diag_per_task_test_info;\r
+\r
+typedef struct {\r
+  diagpkt_subsys_header_type header; /* Sub System header */\r
+  int num_tasks;                     /* Number of tasks, to be started */\r
+  diag_per_task_test_info test[1];   /* Place holder for per task info */\r
+} DIAGDIAG_STRESS_TEST_req_type;\r
+\r
+typedef DIAGDIAG_STRESS_TEST_req_type DIAGDIAG_STRESS_TEST_rsp_type;\r
+\r
+typedef struct {\r
+  uint16 pri_type;   /* External or relative priority */\r
+  int16  pri;        /* Priority at which the task is created */\r
+} diag_priority_type;\r
+\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAGDIAG_CMD_REQUEST\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to test command request.\r
+============================================================================*/\r
+\r
+typedef struct {\r
+  diagpkt_subsys_header_type header; /* Sub System header */\r
+  uint32 length;                     /* length of the packet */\r
+  diag_priority_type priority;\r
+  byte req[64];                      /* Packet sent */\r
+} diagdiag_cmd_req_type;\r
+\r
+typedef diagdiag_cmd_req_type diagdiag_cmd_rsp_type;\r
+\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAGDIAG_LOG_EVENT_LISTENER\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to test log and event listeners.\r
+                This type is used for adding and removing log and event listeners.\r
+============================================================================*/\r
+\r
+typedef struct {\r
+  diagpkt_subsys_header_type header; /* Sub System header */\r
+  uint32 length;\r
+  uint32 id;      /* log code or event id */\r
+  uint32 param;   /* Will be printed by debug message */\r
+} diag_log_event_listener_req_type;\r
+\r
+typedef diag_log_event_listener_req_type diag_log_event_listener_rsp_type;\r
+\r
+/* Functions required for DIAG Health */\r
+void diagbuf_reset_drop_count_log( void );\r
+uint32 diagbuf_get_drop_count_log( void );\r
+void event_reset_drop_count_event( void );\r
+uint32 event_get_drop_count_event( void );\r
+void diagbuf_reset_drop_count_f3( void );\r
+uint32 diagbuf_get_drop_count_f3( void );\r
+uint32 diagbuf_get_alloc_count_log( void );\r
+uint32 event_get_alloc_count_event( void );\r
+uint32 diagbuf_get_alloc_count_f3( void );\r
+void diagbuf_reset_drop_count_delay( void );\r
+uint32 diagbuf_get_drop_count_delay( void );\r
+uint32 diagbuf_get_alloc_count_delay( void );\r
+\r
+\r
+/* Structures required for DIAG Health */\r
+typedef struct {\r
+    diagpkt_subsys_header_type header;\r
+    uint32 drop_count;          // Also used for alloc_count\r
+} diag_health_response_type;\r
+\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_EVENT_MASK_GET_F\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to retrieve the event mask.\r
+============================================================================*/\r
+\r
+typedef struct {\r
+  diagpkt_header_type header;\r
+  uint8 pad;\r
+  uint16 reserved;\r
+} event_mask_get_req_type;\r
+\r
+typedef struct {\r
+  diagpkt_header_type header;\r
+  uint8 error_code;\r
+  uint16 reserved;\r
+  uint16 numbits;         /* number of bits in the mask           */\r
+  unsigned char mask[1];  /* size of this field = (numbits + 7)/8 */\r
+} event_mask_get_rsp_type;\r
+\r
+/*==========================================================================\r
+\r
+PACKET   DIAG_EVENT_MASK_SET_F\r
+\r
+PURPOSE  Request sent from the DM to the DMSS to set the event mask.\r
+============================================================================*/\r
+\r
+typedef struct {\r
+  diagpkt_header_type header;\r
+  uint8 pad;\r
+  uint16 reserved;\r
+  uint16 numbits;         /* number of bits in the mask           */\r
+  unsigned char mask[1];  /* size of this field = (numbits + 7)/8 */\r
+} event_mask_set_req_type;\r
+\r
+typedef struct {\r
+  diagpkt_header_type header;\r
+  uint8 error_code;\r
+  uint16 reserved;\r
+  uint16 numbits;         /* number of bits in the mask           */\r
+  unsigned char mask[1];  /* size of this field = (numbits + 7)/8 */\r
+} event_mask_set_rsp_type;\r
+\r
+typedef struct\r
+{\r
+  diagpkt_subsys_header_type header;\r
+  uint8 enable_aggregation;\r
+  uint8 reserved1;\r
+  uint16 reserved2;\r
+} diagdiag_change_threshold_req_type;\r
+\r
+\r
+typedef struct\r
+{\r
+  diagpkt_subsys_header_type header;\r
+} diagdiag_change_threshold_rsp_type;\r
+\r
+/* Error codes for the above two packets.\r
+ */\r
+#define EVENT_MASK_GENERAL_FAILURE 1\r
+#define EVENT_MASK_ARRAY_TOO_SMALL 2\r
+#define EVENT_MASK_ARRAY_TOO_BIG   3\r
+\r
+#if defined(T_WINNT) || defined(FEATURE_WINCE)\r
+#error code not present\r
+#endif\r
+\r
+extern osal_mutex_arg_t diagdiag_memop_tbl_mutex;\r
+\r
+#endif /*DIAGDIAG_V_H*/\r
+\r
diff --git a/AMSS/diagfwd.c b/AMSS/diagfwd.c
new file mode 100644 (file)
index 0000000..3a0da6f
--- /dev/null
@@ -0,0 +1,1095 @@
+/* Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/sched.h>
+#include <linux/workqueue.h>
+#include <linux/pm_runtime.h>
+#include <linux/diagchar.h>
+#ifdef CONFIG_DIAG_OVER_USB
+#include <mach/usbdiag.h>
+#endif
+#include <mach/msm_smd.h>
+#include <mach/socinfo.h>
+#include "diagmem.h"
+#include "diagchar.h"
+#include "diagfwd.h"
+#include "diagchar_hdlc.h"
+#ifdef CONFIG_DIAG_SDIO_PIPE
+#include "diagfwd_sdio.h"
+#endif
+
+MODULE_DESCRIPTION("Diag Char Driver");
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION("1.0");
+
+//add for factory mode
+#define OEM_CMD_CODE   0x0e
+
+#if defined(CONFIG_DIAG_EXT_CMDS_FOR_CG) 
+char app_sub_cmd_array[] = {
+       0x07,//read GSM BNO
+       0x08,//write GSM BNO
+  #ifdef CONFIG_BT
+       0x18,//bluetooth test
+  #endif
+  #ifdef CONFIG_DEVICE_WLAN
+       0x30,//WLAN send test
+       0x31,//WLAN recv test
+  #endif
+       0x1a,//read GSM IMEI
+       0x1b,//write GSM IMEI
+       0x1c,//read GSM SW version
+       0xc9, //recovery
+       0x00//get AP and modem version
+};
+#elif defined(CONFIG_DIAG_EXT_CMDS_FOR_EVDO_ONLY) 
+char app_sub_cmd_array[] = {
+  #ifdef CONFIG_BT
+       0x18,//bluetooth test
+  #endif
+  #ifdef CONFIG_DEVICE_WLAN
+       0x30,//WLAN send test
+       0x31,//WLAN recv test
+  #endif
+       0xc9,//recovery
+       0x00,//get AP and modem version
+       0x17 //check camera ID
+};
+#else
+char app_sub_cmd_array[] = {
+};
+#endif
+
+static int is_cmd_send_to_modem(char cmd_code, char sub_cmd)
+{
+       int i=0;
+
+       if(cmd_code != OEM_CMD_CODE)
+               return 0;
+
+       for(i=0; i<sizeof(app_sub_cmd_array); i++) {
+               if(sub_cmd == app_sub_cmd_array[i])
+               {
+                       printk("sub_cmd %d is sent to app\n", sub_cmd);
+                       return 0;
+               }
+       }
+       printk("sub_cmd %d is sent to modem\n", sub_cmd);
+       return 1;
+}
+//end.
+
+int diag_debug_buf_idx;
+unsigned char diag_debug_buf[1024];
+static unsigned int buf_tbl_size = 8; /*Number of entries in table of buffers */
+
+struct diag_send_desc_type send = { NULL, NULL, DIAG_STATE_START, 0 };
+struct diag_hdlc_dest_type enc = { NULL, NULL, 0 };
+
+#define ENCODE_RSP_AND_SEND(buf_length)                                \
+do {                                                                   \
+       send.state = DIAG_STATE_START;                                  \
+       send.pkt = driver->apps_rsp_buf;                                \
+       send.last = (void *)(driver->apps_rsp_buf + buf_length);        \
+       send.terminate = 1;                                             \
+       if (!driver->in_busy_1) {                                       \
+               enc.dest = driver->buf_in_1;                            \
+               enc.dest_last = (void *)(driver->buf_in_1 + 499);       \
+               diag_hdlc_encode(&send, &enc);                          \
+               driver->write_ptr_1->buf = driver->buf_in_1;            \
+               driver->write_ptr_1->length = buf_length + 4;           \
+               usb_diag_write(driver->legacy_ch, driver->write_ptr_1); \
+       }                                                               \
+} while (0)
+
+#define CHK_OVERFLOW(bufStart, start, end, length) \
+((bufStart <= start) && (end - start >= length)) ? 1 : 0
+
+#define CHK_APQ_GET_ID() \
+(socinfo_get_id() == 86) ? 4062 : 0
+
+void __diag_smd_send_req(void)
+{
+       void *buf = NULL;
+       int *in_busy_ptr = NULL;
+       struct diag_request *write_ptr_modem = NULL;
+
+       if (!driver->in_busy_1) {
+               buf = driver->buf_in_1;
+               write_ptr_modem = driver->write_ptr_1;
+               in_busy_ptr = &(driver->in_busy_1);
+       } else if (!driver->in_busy_2) {
+               buf = driver->buf_in_2;
+               write_ptr_modem = driver->write_ptr_2;
+               in_busy_ptr = &(driver->in_busy_2);
+       }
+
+       if (driver->ch && buf) {
+               int r = smd_read_avail(driver->ch);
+
+               if (r > IN_BUF_SIZE) {
+                       if (r < MAX_IN_BUF_SIZE) {
+                               printk(KERN_ALERT "\n diag: SMD sending in "
+                                                  "packets upto %d bytes", r);
+                               buf = krealloc(buf, r, GFP_KERNEL);
+                       } else {
+                               printk(KERN_ALERT "\n diag: SMD sending in "
+                               "packets more than %d bytes", MAX_IN_BUF_SIZE);
+                               return;
+                       }
+               }
+               if (r > 0) {
+                       if (!buf)
+                               pr_info("Out of diagmem for Modem\n");
+                       else {
+                               APPEND_DEBUG('i');
+                               smd_read(driver->ch, buf, r);
+                               APPEND_DEBUG('j');
+                               write_ptr_modem->length = r;
+                               *in_busy_ptr = 1;
+                               diag_device_write(buf, MODEM_DATA,
+                                                        write_ptr_modem);
+                       }
+               }
+       }
+}
+
+int diag_device_write(void *buf, int proc_num, struct diag_request *write_ptr)
+{
+       int i, err = 0;
+
+       if (driver->logging_mode == MEMORY_DEVICE_MODE) {
+               if (proc_num == APPS_DATA) {
+                       for (i = 0; i < driver->poolsize_write_struct; i++)
+                               if (driver->buf_tbl[i].length == 0) {
+                                       driver->buf_tbl[i].buf = buf;
+                                       driver->buf_tbl[i].length =
+                                                                driver->used;
+#ifdef DIAG_DEBUG
+                                       printk(KERN_INFO "\n ENQUEUE buf ptr"
+                                                  " and length is %x , %d\n",
+                                                  (unsigned int)(driver->buf_
+                               tbl[i].buf), driver->buf_tbl[i].length);
+#endif
+                                       break;
+                               }
+               }
+               for (i = 0; i < driver->num_clients; i++)
+                       if (driver->client_map[i].pid ==
+                                                driver->logging_process_id)
+                               break;
+               if (i < driver->num_clients) {
+                       driver->data_ready[i] |= MEMORY_DEVICE_LOG_TYPE;
+                       wake_up_interruptible(&driver->wait_q);
+               } else
+                       return -EINVAL;
+       } else if (driver->logging_mode == NO_LOGGING_MODE) {
+               if (proc_num == MODEM_DATA) {
+                       driver->in_busy_1 = 0;
+                       driver->in_busy_2 = 0;
+                       queue_work(driver->diag_wq, &(driver->
+                                                       diag_read_smd_work));
+               } else if (proc_num == QDSP_DATA) {
+                       driver->in_busy_qdsp_1 = 0;
+                       driver->in_busy_qdsp_2 = 0;
+                       queue_work(driver->diag_wq, &(driver->
+                                               diag_read_smd_qdsp_work));
+               }
+               err = -1;
+       }
+#ifdef CONFIG_DIAG_OVER_USB
+       else if (driver->logging_mode == USB_MODE) {
+               if (proc_num == APPS_DATA) {
+                       driver->write_ptr_svc = (struct diag_request *)
+                       (diagmem_alloc(driver, sizeof(struct diag_request),
+                                POOL_TYPE_WRITE_STRUCT));
+                       if (driver->write_ptr_svc) {
+                               driver->write_ptr_svc->length = driver->used;
+                               driver->write_ptr_svc->buf = buf;
+                               err = usb_diag_write(driver->legacy_ch,
+                                               driver->write_ptr_svc);
+                       } else
+                               err = -1;
+               } else if (proc_num == MODEM_DATA) {
+                       write_ptr->buf = buf;
+#ifdef DIAG_DEBUG
+                       printk(KERN_INFO "writing data to USB,"
+                               "pkt length %d\n", write_ptr->length);
+                       print_hex_dump(KERN_DEBUG, "Written Packet Data to"
+                                          " USB: ", 16, 1, DUMP_PREFIX_ADDRESS,
+                                           buf, write_ptr->length, 1);
+#endif /* DIAG DEBUG */
+                       err = usb_diag_write(driver->legacy_ch, write_ptr);
+               } else if (proc_num == QDSP_DATA) {
+                       write_ptr->buf = buf;
+                       err = usb_diag_write(driver->legacy_ch, write_ptr);
+               }
+#ifdef CONFIG_DIAG_SDIO_PIPE
+               else if (proc_num == SDIO_DATA) {
+                       if (machine_is_msm8x60_charm_surf() ||
+                                       machine_is_msm8x60_charm_ffa()) {
+                               write_ptr->buf = buf;
+                               err = usb_diag_write(driver->mdm_ch, write_ptr);
+                       } else
+                               pr_err("diag: Incorrect data while USB write");
+               }
+#endif
+               APPEND_DEBUG('d');
+       }
+#endif /* DIAG OVER USB */
+    return err;
+}
+
+void __diag_smd_qdsp_send_req(void)
+{
+       void *buf = NULL;
+       int *in_busy_qdsp_ptr = NULL;
+       struct diag_request *write_ptr_qdsp = NULL;
+
+       if (!driver->in_busy_qdsp_1) {
+               buf = driver->buf_in_qdsp_1;
+               write_ptr_qdsp = driver->write_ptr_qdsp_1;
+               in_busy_qdsp_ptr = &(driver->in_busy_qdsp_1);
+       } else if (!driver->in_busy_qdsp_2) {
+               buf = driver->buf_in_qdsp_2;
+               write_ptr_qdsp = driver->write_ptr_qdsp_2;
+               in_busy_qdsp_ptr = &(driver->in_busy_qdsp_2);
+       }
+
+       if (driver->chqdsp && buf) {
+               int r = smd_read_avail(driver->chqdsp);
+
+               if (r > IN_BUF_SIZE) {
+                       if (r < MAX_IN_BUF_SIZE) {
+                               printk(KERN_ALERT "\n diag: SMD sending in "
+                                                  "packets upto %d bytes", r);
+                               buf = krealloc(buf, r, GFP_KERNEL);
+                       } else {
+                               printk(KERN_ALERT "\n diag: SMD sending in "
+                               "packets more than %d bytes", MAX_IN_BUF_SIZE);
+                               return;
+                       }
+               }
+               if (r > 0) {
+                       if (!buf)
+                               printk(KERN_INFO "Out of diagmem for QDSP\n");
+                       else {
+                               APPEND_DEBUG('i');
+                               smd_read(driver->chqdsp, buf, r);
+                               APPEND_DEBUG('j');
+                               write_ptr_qdsp->length = r;
+                               *in_busy_qdsp_ptr = 1;
+                               diag_device_write(buf, QDSP_DATA,
+                                                        write_ptr_qdsp);
+                       }
+               }
+       }
+}
+
+static void diag_print_mask_table(void)
+{
+/* Enable this to print mask table when updated */
+#ifdef MASK_DEBUG
+       int first;
+       int last;
+       uint8_t *ptr = driver->msg_masks;
+       int i = 0;
+
+       while (*(uint32_t *)(ptr + 4)) {
+               first = *(uint32_t *)ptr;
+               ptr += 4;
+               last = *(uint32_t *)ptr;
+               ptr += 4;
+               printk(KERN_INFO "SSID %d - %d\n", first, last);
+               for (i = 0 ; i <= last - first ; i++)
+                       printk(KERN_INFO "MASK:%x\n", *((uint32_t *)ptr + i));
+               ptr += ((last - first) + 1)*4;
+
+       }
+#endif
+}
+
+static void diag_update_msg_mask(int start, int end , uint8_t *buf)
+{
+       int found = 0;
+       int first;
+       int last;
+       uint8_t *ptr = driver->msg_masks;
+       uint8_t *ptr_buffer_start = &(*(driver->msg_masks));
+       uint8_t *ptr_buffer_end = &(*(driver->msg_masks)) + MSG_MASK_SIZE;
+
+       mutex_lock(&driver->diagchar_mutex);
+       /* First SSID can be zero : So check that last is non-zero */
+
+       while (*(uint32_t *)(ptr + 4)) {
+               first = *(uint32_t *)ptr;
+               ptr += 4;
+               last = *(uint32_t *)ptr;
+               ptr += 4;
+               if (start >= first && start <= last) {
+                       ptr += (start - first)*4;
+                       if (end <= last)
+                               if (CHK_OVERFLOW(ptr_buffer_start, ptr,
+                                                 ptr_buffer_end,
+                                                 (((end - start)+1)*4)))
+                                       memcpy(ptr, buf , ((end - start)+1)*4);
+                               else
+                                       printk(KERN_CRIT "Not enough"
+                                                        " buffer space for"
+                                                        " MSG_MASK\n");
+                       else
+                               printk(KERN_INFO "Unable to copy"
+                                                " mask change\n");
+
+                       found = 1;
+                       break;
+               } else {
+                       ptr += ((last - first) + 1)*4;
+               }
+       }
+       /* Entry was not found - add new table */
+       if (!found) {
+               if (CHK_OVERFLOW(ptr_buffer_start, ptr, ptr_buffer_end,
+                                 8 + ((end - start) + 1)*4)) {
+                       memcpy(ptr, &(start) , 4);
+                       ptr += 4;
+                       memcpy(ptr, &(end), 4);
+                       ptr += 4;
+                       memcpy(ptr, buf , ((end - start) + 1)*4);
+               } else
+                       printk(KERN_CRIT " Not enough buffer"
+                                        " space for MSG_MASK\n");
+       }
+       mutex_unlock(&driver->diagchar_mutex);
+       diag_print_mask_table();
+
+}
+
+static void diag_update_event_mask(uint8_t *buf, int toggle, int num_bits)
+{
+       uint8_t *ptr = driver->event_masks;
+       uint8_t *temp = buf + 2;
+
+       mutex_lock(&driver->diagchar_mutex);
+       if (!toggle)
+               memset(ptr, 0 , EVENT_MASK_SIZE);
+       else
+               if (CHK_OVERFLOW(ptr, ptr,
+                                ptr+EVENT_MASK_SIZE,
+                                 num_bits/8 + 1))
+                       memcpy(ptr, temp , num_bits/8 + 1);
+               else
+                       printk(KERN_CRIT "Not enough buffer space "
+                                        "for EVENT_MASK\n");
+       mutex_unlock(&driver->diagchar_mutex);
+}
+
+static void diag_update_log_mask(int equip_id, uint8_t *buf, int num_items)
+{
+       uint8_t *temp = buf;
+       struct mask_info {
+               int equip_id;
+               int index;
+       };
+       int i = 0;
+       unsigned char *ptr_data;
+       int offset = 8*MAX_EQUIP_ID;
+       struct mask_info *ptr = (struct mask_info *)driver->log_masks;
+
+       mutex_lock(&driver->diagchar_mutex);
+       /* Check if we already know index of this equipment ID */
+       for (i = 0; i < MAX_EQUIP_ID; i++) {
+               if ((ptr->equip_id == equip_id) && (ptr->index != 0)) {
+                       offset = ptr->index;
+                       break;
+               }
+               if ((ptr->equip_id == 0) && (ptr->index == 0)) {
+                       /*Reached a null entry */
+                       ptr->equip_id = equip_id;
+                       ptr->index = driver->log_masks_length;
+                       offset = driver->log_masks_length;
+                       driver->log_masks_length += ((num_items+7)/8);
+                       break;
+               }
+               ptr++;
+       }
+       ptr_data = driver->log_masks + offset;
+       if (CHK_OVERFLOW(driver->log_masks, ptr_data, driver->log_masks
+                                        + LOG_MASK_SIZE, (num_items+7)/8))
+               memcpy(ptr_data, temp , (num_items+7)/8);
+       else
+               printk(KERN_CRIT " Not enough buffer space for LOG_MASK\n");
+       mutex_unlock(&driver->diagchar_mutex);
+}
+
+static void diag_update_pkt_buffer(unsigned char *buf)
+{
+       unsigned char *ptr = driver->pkt_buf;
+       unsigned char *temp = buf;
+
+       mutex_lock(&driver->diagchar_mutex);
+       if (CHK_OVERFLOW(ptr, ptr, ptr + PKT_SIZE, driver->pkt_length))
+               memcpy(ptr, temp , driver->pkt_length);
+       else
+               printk(KERN_CRIT " Not enough buffer space for PKT_RESP\n");
+       mutex_unlock(&driver->diagchar_mutex);
+}
+
+void diag_update_userspace_clients(unsigned int type)
+{
+       int i;
+
+       mutex_lock(&driver->diagchar_mutex);
+       for (i = 0; i < driver->num_clients; i++)
+               if (driver->client_map[i].pid != 0)
+                       driver->data_ready[i] |= type;
+       wake_up_interruptible(&driver->wait_q);
+       mutex_unlock(&driver->diagchar_mutex);
+}
+
+void diag_update_sleeping_process(int process_id)
+{
+       int i;
+
+       mutex_lock(&driver->diagchar_mutex);
+       for (i = 0; i < driver->num_clients; i++)
+               if (driver->client_map[i].pid == process_id) {
+                       driver->data_ready[i] |= PKT_TYPE;
+                       break;
+               }
+       wake_up_interruptible(&driver->wait_q);
+       mutex_unlock(&driver->diagchar_mutex);
+}
+
+static int diag_process_apps_pkt(unsigned char *buf, int len)
+{
+       uint16_t start;
+       uint16_t end, subsys_cmd_code;
+       int i, cmd_code, subsys_id;
+       int packet_type = 1;
+       unsigned char *temp = buf;
+
+       /* event mask */
+       if ((*buf == 0x60) && (*(++buf) == 0x0)) {
+               diag_update_event_mask(buf, 0, 0);
+               diag_update_userspace_clients(EVENT_MASKS_TYPE);
+       }
+       /* check for set event mask */
+       else if (*buf == 0x82) {
+               buf += 4;
+               diag_update_event_mask(buf, 1, *(uint16_t *)buf);
+               diag_update_userspace_clients(
+               EVENT_MASKS_TYPE);
+       }
+       /* log mask */
+       else if (*buf == 0x73) {
+               buf += 4;
+               if (*(int *)buf == 3) {
+                       buf += 4;
+                       /* Read Equip ID and pass as first param below*/
+                       diag_update_log_mask(*(int *)buf, buf+8,
+                                                        *(int *)(buf+4));
+                       diag_update_userspace_clients(LOG_MASKS_TYPE);
+               }
+       }
+       /* Check for set message mask  */
+       else if ((*buf == 0x7d) && (*(++buf) == 0x4)) {
+               buf++;
+               start = *(uint16_t *)buf;
+               buf += 2;
+               end = *(uint16_t *)buf;
+               buf += 4;
+               diag_update_msg_mask((uint32_t)start, (uint32_t)end , buf);
+               diag_update_userspace_clients(MSG_MASKS_TYPE);
+       }
+       /* Set all run-time masks
+       if ((*buf == 0x7d) && (*(++buf) == 0x5)) {
+               TO DO
+       } */
+#if defined(CONFIG_DIAG_OVER_USB)
+        /* Check for ID for APQ8060 AND NO MODEM present */
+       else if (!(driver->ch) && CHK_APQ_GET_ID()) {
+               /* Respond to polling for Apps only DIAG */
+               if ((*buf == 0x4b) && (*(buf+1) == 0x32) &&
+                                                        (*(buf+2) == 0x03)) {
+                       for (i = 0; i < 3; i++)
+                               driver->apps_rsp_buf[i] = *(buf+i);
+                       for (i = 0; i < 13; i++)
+                               driver->apps_rsp_buf[i+3] = 0;
+
+                       ENCODE_RSP_AND_SEND(15);
+                       return 0;
+               }
+               /* respond to 0x0 command */
+               else if (*buf == 0x00) {
+                       for (i = 0; i < 55; i++)
+                               driver->apps_rsp_buf[i] = 0;
+
+                       ENCODE_RSP_AND_SEND(54);
+                       return 0;
+               }
+               /* respond to 0x7c command */
+               else if (*buf == 0x7c) {
+                       driver->apps_rsp_buf[0] = 0x7c;
+                       for (i = 1; i < 8; i++)
+                               driver->apps_rsp_buf[i] = 0;
+                       /* Tools ID for APQ 8060 */
+                       *(int *)(driver->apps_rsp_buf + 8) = CHK_APQ_GET_ID();
+                       *(unsigned char *)(driver->apps_rsp_buf + 12) = '\0';
+                       *(unsigned char *)(driver->apps_rsp_buf + 13) = '\0';
+                       ENCODE_RSP_AND_SEND(13);
+                       return 0;
+               }
+       }
+#endif
+       /* Check for registered clients and forward packet to user-space */
+       else{
+               cmd_code = (int)(*(char *)buf);
+               temp++;
+               subsys_id = (int)(*(char *)temp);
+               temp++;
+               subsys_cmd_code = *(uint16_t *)temp;
+               temp += 2;
+
+               printk("cmd_code is %x, subsys_id is %x, subsys_cmd_code is %x\n", cmd_code,subsys_id,subsys_cmd_code);
+
+               for (i = 0; i < diag_max_registration; i++) {
+                       if (driver->table[i].process_id != 0) {
+                               if (driver->table[i].cmd_code ==
+                                    cmd_code && driver->table[i].subsys_id ==
+                                    subsys_id &&
+                                   driver->table[i].cmd_code_lo <=
+                                    subsys_cmd_code &&
+                                         driver->table[i].cmd_code_hi >=
+                                    subsys_cmd_code){
+                                       driver->pkt_length = len;
+                                       diag_update_pkt_buffer(buf);
+                                       diag_update_sleeping_process(
+                                               driver->table[i].process_id);
+                                               return 0;
+                                   } /* end of if */
+                               else if (driver->table[i].cmd_code == 255
+                                         && cmd_code == 75) {
+                                       if (driver->table[i].subsys_id ==
+                                           subsys_id &&
+                                          driver->table[i].cmd_code_lo <=
+                                           subsys_cmd_code &&
+                                            driver->table[i].cmd_code_hi >=
+                                           subsys_cmd_code){
+                                               driver->pkt_length = len;
+                                               diag_update_pkt_buffer(buf);
+                                               diag_update_sleeping_process(
+                                                       driver->table[i].
+                                                       process_id);
+                                               return 0;
+                                       }
+                               } /* end of else-if */
+                               else if (driver->table[i].cmd_code == 255 &&
+                                         driver->table[i].subsys_id == 255) {
+                                       if (driver->table[i].cmd_code_lo <=
+                                                        cmd_code &&
+                                                    driver->table[i].
+                                                   cmd_code_hi >= cmd_code){
+                                               //add for factory mode
+                                               if(is_cmd_send_to_modem((char)cmd_code, (char)subsys_id)){
+                                                       return packet_type;     
+                                           }
+                                               //end
+
+                                               driver->pkt_length = len;
+                                               diag_update_pkt_buffer(buf);
+                                               diag_update_sleeping_process
+                                                       (driver->table[i].
+                                                        process_id);
+                                               return 0;
+                                       }
+                               } /* end of else-if */
+                       } /* if(driver->table[i].process_id != 0) */
+               }  /* for (i = 0; i < diag_max_registration; i++) */
+       } /* else */
+               return packet_type;
+}
+
+void diag_process_hdlc(void *data, unsigned len)
+{
+       struct diag_hdlc_decode_type hdlc;
+       int ret, type = 0;
+#ifdef DIAG_DEBUG
+       int i;
+       printk(KERN_INFO "\n HDLC decode function, len of data  %d\n", len);
+#endif
+       hdlc.dest_ptr = driver->hdlc_buf;
+       hdlc.dest_size = USB_MAX_OUT_BUF;
+       hdlc.src_ptr = data;
+       hdlc.src_size = len;
+       hdlc.src_idx = 0;
+       hdlc.dest_idx = 0;
+       hdlc.escaping = 0;
+
+       ret = diag_hdlc_decode(&hdlc);
+
+       if (ret)
+               type = diag_process_apps_pkt(driver->hdlc_buf,
+                                                         hdlc.dest_idx - 3);
+       else if (driver->debug_flag) {
+               printk(KERN_ERR "Packet dropped due to bad HDLC coding/CRC"
+                               " errors or partial packet received, packet"
+                               " length = %d\n", len);
+               print_hex_dump(KERN_DEBUG, "Dropped Packet Data: ", 16, 1,
+                                          DUMP_PREFIX_ADDRESS, data, len, 1);
+               driver->debug_flag = 0;
+       }
+       /* implies this packet is NOT meant for apps */
+       if (!(driver->ch) && type == 1 && CHK_APQ_GET_ID()) {
+               if (driver->chqdsp)
+                       smd_write(driver->chqdsp, driver->hdlc_buf,
+                                                        hdlc.dest_idx - 3);
+               type = 0;
+       }
+
+#ifdef DIAG_DEBUG
+       printk(KERN_INFO "\n hdlc.dest_idx = %d", hdlc.dest_idx);
+       for (i = 0; i < hdlc.dest_idx; i++)
+               printk(KERN_DEBUG "\t%x", *(((unsigned char *)
+                                                       driver->hdlc_buf)+i));
+#endif /* DIAG DEBUG */
+       /* ignore 2 bytes for CRC, one for 7E and send */
+       if ((driver->ch) && (ret) && (type) && (hdlc.dest_idx > 3)) {
+               APPEND_DEBUG('g');
+               smd_write(driver->ch, driver->hdlc_buf, hdlc.dest_idx - 3);
+               APPEND_DEBUG('h');
+#ifdef DIAG_DEBUG
+               printk(KERN_INFO "writing data to SMD, pkt length %d\n", len);
+               print_hex_dump(KERN_DEBUG, "Written Packet Data to SMD: ", 16,
+                              1, DUMP_PREFIX_ADDRESS, data, len, 1);
+#endif /* DIAG DEBUG */
+       }
+
+}
+
+#ifdef CONFIG_DIAG_OVER_USB
+#define N_LEGACY_WRITE (driver->poolsize + 5) /* 2+1 for modem ; 2 for q6 */
+#define N_LEGACY_READ  1
+
+int diagfwd_connect(void)
+{
+       int err;
+
+       printk(KERN_DEBUG "diag: USB connected\n");
+       err = usb_diag_alloc_req(driver->legacy_ch, N_LEGACY_WRITE,
+                       N_LEGACY_READ);
+       if (err)
+               printk(KERN_ERR "diag: unable to alloc USB req on legacy ch");
+
+       driver->usb_connected = 1;
+       driver->in_busy_1 = 0;
+       driver->in_busy_2 = 0;
+       driver->in_busy_qdsp_1 = 0;
+       driver->in_busy_qdsp_2 = 0;
+
+       /* Poll SMD channels to check for data*/
+       queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
+       queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));
+       /* Poll USB channel to check for data*/
+       queue_work(driver->diag_wq, &(driver->diag_read_work));
+#ifdef CONFIG_DIAG_SDIO_PIPE
+       if (machine_is_msm8x60_charm_surf() || machine_is_msm8x60_charm_ffa()) {
+               if (driver->mdm_ch && !IS_ERR(driver->mdm_ch))
+                       diagfwd_connect_sdio();
+               else
+                       printk(KERN_INFO "diag: No USB MDM ch");
+       }
+#endif
+       return 0;
+}
+
+int diagfwd_disconnect(void)
+{
+       printk(KERN_DEBUG "diag: USB disconnected\n");
+       driver->usb_connected = 0;
+       driver->in_busy_1 = 1;
+       driver->in_busy_2 = 1;
+       driver->in_busy_qdsp_1 = 1;
+       driver->in_busy_qdsp_2 = 1;
+       driver->debug_flag = 1;
+       usb_diag_free_req(driver->legacy_ch);
+#ifdef CONFIG_DIAG_SDIO_PIPE
+       if (machine_is_msm8x60_charm_surf() || machine_is_msm8x60_charm_ffa())
+               if (driver->mdm_ch && !IS_ERR(driver->mdm_ch))
+                       diagfwd_disconnect_sdio();
+#endif
+       /* TBD - notify and flow control SMD */
+       return 0;
+}
+
+int diagfwd_write_complete(struct diag_request *diag_write_ptr)
+{
+       unsigned char *buf = diag_write_ptr->buf;
+       /*Determine if the write complete is for data from modem/apps/q6 */
+       /* Need a context variable here instead */
+       if (buf == (void *)driver->buf_in_1) {
+               driver->in_busy_1 = 0;
+               APPEND_DEBUG('o');
+               queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
+       } else if (buf == (void *)driver->buf_in_2) {
+               driver->in_busy_2 = 0;
+               APPEND_DEBUG('O');
+               queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
+       } else if (buf == (void *)driver->buf_in_qdsp_1) {
+               driver->in_busy_qdsp_1 = 0;
+               APPEND_DEBUG('p');
+               queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));
+       } else if (buf == (void *)driver->buf_in_qdsp_2) {
+               driver->in_busy_qdsp_2 = 0;
+               APPEND_DEBUG('P');
+               queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));
+       }
+#ifdef CONFIG_DIAG_SDIO_PIPE
+       else if (buf == (void *)driver->buf_in_sdio)
+               if (machine_is_msm8x60_charm_surf() ||
+                                        machine_is_msm8x60_charm_ffa())
+                       diagfwd_write_complete_sdio();
+               else
+                       pr_err("diag: Incorrect buffer pointer while WRITE");
+#endif
+       else {
+               diagmem_free(driver, (unsigned char *)buf, POOL_TYPE_HDLC);
+               diagmem_free(driver, (unsigned char *)diag_write_ptr,
+                                                POOL_TYPE_WRITE_STRUCT);
+               APPEND_DEBUG('q');
+       }
+       return 0;
+}
+
+int diagfwd_read_complete(struct diag_request *diag_read_ptr)
+{
+       int status = diag_read_ptr->status;
+       unsigned char *buf = diag_read_ptr->buf;
+
+       /* Determine if the read complete is for data on legacy/mdm ch */
+       if (buf == (void *)driver->usb_buf_out) {
+               driver->read_len_legacy = diag_read_ptr->actual;
+               APPEND_DEBUG('s');
+#ifdef DIAG_DEBUG
+               printk(KERN_INFO "read data from USB, pkt length %d",
+                   diag_read_ptr->actual);
+               print_hex_dump(KERN_DEBUG, "Read Packet Data from USB: ", 16, 1,
+                      DUMP_PREFIX_ADDRESS, diag_read_ptr->buf,
+                      diag_read_ptr->actual, 1);
+#endif /* DIAG DEBUG */
+               if (driver->logging_mode == USB_MODE) {
+                       if (status != -ECONNRESET && status != -ESHUTDOWN)
+                               queue_work(driver->diag_wq,
+                                       &(driver->diag_proc_hdlc_work));
+                       else
+                               queue_work(driver->diag_wq,
+                                                &(driver->diag_read_work));
+               }
+       }
+#ifdef CONFIG_DIAG_SDIO_PIPE
+       else if (buf == (void *)driver->usb_buf_mdm_out) {
+               if (machine_is_msm8x60_charm_surf() ||
+                                        machine_is_msm8x60_charm_ffa()) {
+                       driver->read_len_mdm = diag_read_ptr->actual;
+                       diagfwd_read_complete_sdio();
+               } else
+                       pr_err("diag: Incorrect buffer pointer while READ");
+       }
+#endif
+       else
+               printk(KERN_ERR "diag: Unknown buffer ptr from USB");
+
+       return 0;
+}
+
+void diag_read_work_fn(struct work_struct *work)
+{
+       APPEND_DEBUG('d');
+       driver->usb_read_ptr->buf = driver->usb_buf_out;
+       driver->usb_read_ptr->length = USB_MAX_OUT_BUF;
+       usb_diag_read(driver->legacy_ch, driver->usb_read_ptr);
+       APPEND_DEBUG('e');
+}
+
+void diag_process_hdlc_fn(struct work_struct *work)
+{
+       APPEND_DEBUG('D');
+       diag_process_hdlc(driver->usb_buf_out, driver->read_len_legacy);
+       diag_read_work_fn(work);
+       APPEND_DEBUG('E');
+}
+
+void diag_usb_legacy_notifier(void *priv, unsigned event,
+                       struct diag_request *d_req)
+{
+       switch (event) {
+       case USB_DIAG_CONNECT:
+               diagfwd_connect();
+               break;
+       case USB_DIAG_DISCONNECT:
+               diagfwd_disconnect();
+               break;
+       case USB_DIAG_READ_DONE:
+               diagfwd_read_complete(d_req);
+               break;
+       case USB_DIAG_WRITE_DONE:
+               diagfwd_write_complete(d_req);
+               break;
+       default:
+               printk(KERN_ERR "Unknown event from USB diag\n");
+               break;
+       }
+}
+
+#endif /* DIAG OVER USB */
+
+static void diag_smd_notify(void *ctxt, unsigned event)
+{
+       queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
+}
+
+#if defined(CONFIG_MSM_N_WAY_SMD)
+static void diag_smd_qdsp_notify(void *ctxt, unsigned event)
+{
+       queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));
+}
+#endif
+
+static int diag_smd_probe(struct platform_device *pdev)
+{
+       int r = 0;
+
+       if (pdev->id == 0)
+               r = smd_open("DIAG", &driver->ch, driver, diag_smd_notify);
+#if defined(CONFIG_MSM_N_WAY_SMD)
+       if (pdev->id == 1)
+               r = smd_named_open_on_edge("DIAG", SMD_APPS_QDSP
+                       , &driver->chqdsp, driver, diag_smd_qdsp_notify);
+#endif
+       pm_runtime_set_active(&pdev->dev);
+       pm_runtime_enable(&pdev->dev);
+       printk(KERN_INFO "diag opened SMD port ; r = %d\n", r);
+
+       return 0;
+}
+
+static int diagfwd_runtime_suspend(struct device *dev)
+{
+       dev_dbg(dev, "pm_runtime: suspending...\n");
+       return 0;
+}
+
+static int diagfwd_runtime_resume(struct device *dev)
+{
+       dev_dbg(dev, "pm_runtime: resuming...\n");
+       return 0;
+}
+
+static const struct dev_pm_ops diagfwd_dev_pm_ops = {
+       .runtime_suspend = diagfwd_runtime_suspend,
+       .runtime_resume = diagfwd_runtime_resume,
+};
+
+static struct platform_driver msm_smd_ch1_driver = {
+
+       .probe = diag_smd_probe,
+       .driver = {
+                  .name = "DIAG",
+                  .owner = THIS_MODULE,
+                  .pm   = &diagfwd_dev_pm_ops,
+                  },
+};
+
+void diagfwd_init(void)
+{
+       diag_debug_buf_idx = 0;
+       driver->read_len_legacy = 0;
+       if (driver->buf_in_1 == NULL)
+               driver->buf_in_1 = kzalloc(IN_BUF_SIZE, GFP_KERNEL);
+               if (driver->buf_in_1 == NULL)
+                       goto err;
+       if (driver->buf_in_2 == NULL)
+               driver->buf_in_2 = kzalloc(IN_BUF_SIZE, GFP_KERNEL);
+               if (driver->buf_in_2 == NULL)
+                       goto err;
+       if (driver->buf_in_qdsp_1 == NULL)
+               driver->buf_in_qdsp_1 = kzalloc(IN_BUF_SIZE, GFP_KERNEL);
+               if (driver->buf_in_qdsp_1 == NULL)
+                       goto err;
+       if (driver->buf_in_qdsp_2 == NULL)
+               driver->buf_in_qdsp_2 = kzalloc(IN_BUF_SIZE, GFP_KERNEL);
+               if (driver->buf_in_qdsp_2 == NULL)
+                       goto err;
+       if (driver->usb_buf_out  == NULL &&
+            (driver->usb_buf_out = kzalloc(USB_MAX_OUT_BUF,
+                                        GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->hdlc_buf == NULL
+           && (driver->hdlc_buf = kzalloc(HDLC_MAX, GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->msg_masks == NULL
+           && (driver->msg_masks = kzalloc(MSG_MASK_SIZE,
+                                            GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->log_masks == NULL &&
+           (driver->log_masks = kzalloc(LOG_MASK_SIZE, GFP_KERNEL)) == NULL)
+               goto err;
+       driver->log_masks_length = 8*MAX_EQUIP_ID;
+       if (driver->event_masks == NULL &&
+           (driver->event_masks = kzalloc(EVENT_MASK_SIZE,
+                                           GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->client_map == NULL &&
+           (driver->client_map = kzalloc
+            ((driver->num_clients) * sizeof(struct diag_client_map),
+                  GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->buf_tbl == NULL)
+                       driver->buf_tbl = kzalloc(buf_tbl_size *
+                         sizeof(struct diag_write_device), GFP_KERNEL);
+       if (driver->buf_tbl == NULL)
+               goto err;
+       if (driver->data_ready == NULL &&
+            (driver->data_ready = kzalloc(driver->num_clients * sizeof(struct
+                                        diag_client_map), GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->table == NULL &&
+            (driver->table = kzalloc(diag_max_registration*
+                     sizeof(struct diag_master_table),
+                      GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->write_ptr_1 == NULL)
+               driver->write_ptr_1 = kzalloc(
+                       sizeof(struct diag_request), GFP_KERNEL);
+               if (driver->write_ptr_1 == NULL)
+                       goto err;
+       if (driver->write_ptr_2 == NULL)
+               driver->write_ptr_2 = kzalloc(
+                       sizeof(struct diag_request), GFP_KERNEL);
+               if (driver->write_ptr_2 == NULL)
+                       goto err;
+       if (driver->write_ptr_qdsp_1 == NULL)
+               driver->write_ptr_qdsp_1 = kzalloc(
+                       sizeof(struct diag_request), GFP_KERNEL);
+               if (driver->write_ptr_qdsp_1 == NULL)
+                       goto err;
+       if (driver->write_ptr_qdsp_2 == NULL)
+               driver->write_ptr_qdsp_2 = kzalloc(
+                       sizeof(struct diag_request), GFP_KERNEL);
+               if (driver->write_ptr_qdsp_2 == NULL)
+                       goto err;
+       if (driver->usb_read_ptr == NULL)
+               driver->usb_read_ptr = kzalloc(
+                       sizeof(struct diag_request), GFP_KERNEL);
+               if (driver->usb_read_ptr == NULL)
+                       goto err;
+       if (driver->pkt_buf == NULL &&
+            (driver->pkt_buf = kzalloc(PKT_SIZE,
+                        GFP_KERNEL)) == NULL)
+               goto err;
+       if (driver->apps_rsp_buf == NULL)
+                       driver->apps_rsp_buf = kzalloc(150, GFP_KERNEL);
+               if (driver->apps_rsp_buf == NULL)
+                       goto err;
+       driver->diag_wq = create_singlethread_workqueue("diag_wq");
+#ifdef CONFIG_DIAG_OVER_USB
+       INIT_WORK(&(driver->diag_proc_hdlc_work), diag_process_hdlc_fn);
+       INIT_WORK(&(driver->diag_read_work), diag_read_work_fn);
+       driver->legacy_ch = usb_diag_open(DIAG_LEGACY, driver,
+                       diag_usb_legacy_notifier);
+       if (IS_ERR(driver->legacy_ch)) {
+               printk(KERN_ERR "Unable to open USB diag legacy channel\n");
+               goto err;
+       }
+#ifdef CONFIG_DIAG_SDIO_PIPE
+       if (machine_is_msm8x60_charm_surf() || machine_is_msm8x60_charm_ffa())
+               diagfwd_sdio_init();
+#endif
+#endif
+       platform_driver_register(&msm_smd_ch1_driver);
+
+       return;
+err:
+               printk(KERN_INFO "\n Could not initialize diag buffers\n");
+               kfree(driver->buf_in_1);
+               kfree(driver->buf_in_2);
+               kfree(driver->buf_in_qdsp_1);
+               kfree(driver->buf_in_qdsp_2);
+               kfree(driver->usb_buf_out);
+               kfree(driver->hdlc_buf);
+               kfree(driver->msg_masks);
+               kfree(driver->log_masks);
+               kfree(driver->event_masks);
+               kfree(driver->client_map);
+               kfree(driver->buf_tbl);
+               kfree(driver->data_ready);
+               kfree(driver->table);
+               kfree(driver->pkt_buf);
+               kfree(driver->write_ptr_1);
+               kfree(driver->write_ptr_2);
+               kfree(driver->write_ptr_qdsp_1);
+               kfree(driver->write_ptr_qdsp_2);
+               kfree(driver->usb_read_ptr);
+               kfree(driver->apps_rsp_buf);
+               if (driver->diag_wq)
+                       destroy_workqueue(driver->diag_wq);
+}
+
+void diagfwd_exit(void)
+{
+       smd_close(driver->ch);
+       smd_close(driver->chqdsp);
+       driver->ch = 0;         /*SMD can make this NULL */
+       driver->chqdsp = 0;
+#ifdef CONFIG_DIAG_OVER_USB
+       if (driver->usb_connected)
+               usb_diag_free_req(driver->legacy_ch);
+#endif
+       platform_driver_unregister(&msm_smd_ch1_driver);
+#ifdef CONFIG_DIAG_OVER_USB
+       usb_diag_close(driver->legacy_ch);
+#endif
+
+       kfree(driver->buf_in_1);
+       kfree(driver->buf_in_2);
+       kfree(driver->buf_in_qdsp_1);
+       kfree(driver->buf_in_qdsp_2);
+       kfree(driver->usb_buf_out);
+       kfree(driver->hdlc_buf);
+       kfree(driver->msg_masks);
+       kfree(driver->log_masks);
+       kfree(driver->event_masks);
+       kfree(driver->client_map);
+       kfree(driver->buf_tbl);
+       kfree(driver->data_ready);
+       kfree(driver->table);
+       kfree(driver->pkt_buf);
+       kfree(driver->write_ptr_1);
+       kfree(driver->write_ptr_2);
+       kfree(driver->write_ptr_qdsp_1);
+       kfree(driver->write_ptr_qdsp_2);
+       kfree(driver->usb_read_ptr);
+       kfree(driver->apps_rsp_buf);
+       destroy_workqueue(driver->diag_wq);
+}
diff --git a/AMSS/diagsec.c b/AMSS/diagsec.c
new file mode 100644 (file)
index 0000000..b6cb621
--- /dev/null
@@ -0,0 +1,27 @@
+/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*\r
+\r
+                  D O W N L O A D  S E C U R I T Y   P R O C E S S I N G\r
+\r
+*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/\r
+\f\r
+/*===========================================================================\r
+\r
+                     INCLUDE FILES FOR MODULE\r
+\r
+===========================================================================*/\r
+#include "diagsec.h"\r
+\r
+\f\r
+/*===========================================================================\r
+\r
+            LOCAL DEFINITIONS AND DECLARATIONS FOR MODULE\r
+\r
+This section contains local definitions for constants, macros, types,\r
+variables and other items needed by this module.\r
+\r
+===========================================================================*/\r
+\r
+#ifdef FEATURE_TECHNICS_DIAG\r
+const byte diag_tool_des_sec_code[] ={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};\r
+const byte diag_tool_des_sec_key[] ={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};\r
+#endif\r
diff --git a/AMSS/diagsec.h b/AMSS/diagsec.h
new file mode 100644 (file)
index 0000000..a7add72
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef DIAGSEC_H\r
+#define DIAGSEC_H\r
+/*===========================================================================\r
+\r
+          Downloader Security Processing Header File\r
+\r
+===========================================================================*/\r
+\r
+\r
+/*===========================================================================\r
+\r
+                     INCLUDE FILES FOR MODULE\r
+\r
+===========================================================================*/\r
+\r
+#include "comdef.h"\r
+\r
+/*===========================================================================\r
+\r
+                      PUBLIC DATA DECLARATIONS\r
+\r
+===========================================================================*/\r
+extern const byte diag_tool_des_sec_code[];\r
+extern const byte diag_tool_des_sec_key[] ;\r
+\r
+#endif /* DIAGSEC_H */\r
diff --git a/AMSS/nv/nv_info_tab.c b/AMSS/nv/nv_info_tab.c
new file mode 100644 (file)
index 0000000..c9fd8e3
--- /dev/null
@@ -0,0 +1,7257 @@
+/*===========================================================================
+
+                             NV_INFO_TAB.C  
+
+DESCRIPTION
+  This file is generated by NVC and contains NV Items table.
+
+  $Header: //source/qcom/qct/core/pkg/2H09/halcyon_modem/rel/LA2.0/AMSS/products/7x30/core/services/nv/src/nv_info_tab.c#1 $
+  Copyright (c) 2006 by QUALCOMM Incorporated. All Rights Reserved.
+===========================================================================*/
+
+/* NVC Version: 2.0.0 */
+
+/* Include Files */
+#include "comdef.h"
+#include "nvi.h"
+#include "nvim.h"
+#include "nvim_items.h"
+
+const nvim_item_info_type nvim_item_info_table[] = {
+        { sizeof(dword), 0, 1},
+      { sizeof(dword), 0, 1},
+      { sizeof(byte), 0, 1},
+      { sizeof(byte), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_config_chksum_type), 0, 1},
+      { sizeof(nvi_pref_mode_type), 2, 1},
+      { sizeof(nvi_pref_serv_type), 2, 1},
+      { sizeof(nvi_pref_serv_type), 2, 1},
+      { sizeof(nvi_sid_lock_type), 2, 1},
+      { sizeof(nvi_sid_acq_type), 2, 1},
+      { sizeof(nvi_sid_lock_type), 2, 1},
+      { sizeof(nvi_sid_acq_type), 2, 1},
+      { sizeof(nvi_firstchp_type), 2, 1},
+      { sizeof(nvi_sid_type), 2, 1},
+      { sizeof(nvi_analog_reg_type), 2, 1},
+      { sizeof(nvi_cdmach_type), 2, 1},
+      { sizeof(nvi_cdmach_type), 2, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_word_type), 2, 1},
+      { sizeof(nvi_a_key_type), 2, 1},
+      { sizeof(nvi_a_key_chksum_type), 2, 1},
+      { sizeof(nvi_ssd_type), 2, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_ssd_type), 2, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_count_type), 2, 1},
+      { sizeof(nvi_min1_type), 2, 1},
+      { sizeof(nvi_min2_type), 2, 1},
+      { sizeof(nvi_mob_term_type), 2, 1},
+      { sizeof(nvi_mob_term_type), 2, 1},
+      { sizeof(nvi_mob_term_type), 2, 1},
+      { sizeof(nvi_accolc_type), 2, 1},
+      { sizeof(nvi_sid_nid_type), 2, 1},
+      { sizeof(nvi_min_chksum_type), 2, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_name_type), 2, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_zone_list_type), 0, 1},
+      { sizeof(nvi_sid_nid_list_type), 0, 1},
+      { sizeof(nvi_dist_reg_type), 0, 1},
+      { sizeof(nvi_cdmach_type), 2, 1},
+      { sizeof(nvi_call_time_type), 2, 1},
+      { sizeof(nvi_call_time_type), 2, 1},
+      { sizeof(nvi_call_time_type), 2, 1},
+      { sizeof(nvi_call_time_type), 2, 1},
+      { sizeof(nvi_run_time_type), 0, 1},
+      { sizeof(nvi_dial_type), 110, 1},
+      { sizeof(nvi_stdial_type), 20, 1},
+      { sizeof(nvi_stack_idx_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_name_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_auto_answer_type), 0, 1},
+      { sizeof(nvi_auto_redial_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_maintrsn_type), 0, 1},
+      { sizeof(nvi_lckrsn_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_lock_code_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_sec_code_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_err_log_type), 20, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_fm_tx_pwr_type), 0, 1},
+      { sizeof(nvi_fr_temp_offset_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_fact_info_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pwr_table_type), 0, 1},
+      { sizeof(nvi_freq_table_type), 0, 1},
+      { sizeof(nvi_temp_table_type), 0, 1},
+      { sizeof(nvi_pwr_table_type), 0, 1},
+      { sizeof(nvi_pwr_table_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_cdma_rx_lin_slp_type), 0, 1},
+      { sizeof(nvi_freq_int1_table_type), 0, 1},
+      { sizeof(nvi_freq_int1_table_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_cdma_tx_lin_master_slp_type), 0, 1},
+      { sizeof(nvi_temp_table_type), 0, 1},
+      { sizeof(nvi_volt_table_type), 0, 1},
+      { sizeof(nvi_temp_table_type), 0, 1},
+      { sizeof(nvi_volt_table_type), 0, 1},
+      { sizeof(nvi_freq_table_type), 0, 1},
+      { sizeof(nvi_cdma_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_cdma_err_slp_vs_hdet_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_fm_agc_adj_vs_freq_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_call_cnt_type), 2, 1},
+      { sizeof(nvi_call_cnt_type), 2, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_imsi_mcc_type), 2, 1},
+      { sizeof(nvi_imsi_11_12_type), 2, 1},
+      { sizeof(nvi_dir_number_type), 2, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_fsc_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_run_time_type), 0, 1},
+      { sizeof(nvi_run_time_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_fsc2_type), 0, 1},
+      { sizeof(nvi_fsc2_chksum_type), 0, 1},
+      { sizeof(nvi_wdc_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_temp_int1_table_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_temp_int1_table_type), 0, 1},
+      { sizeof(nvi_temp_int1_table_type), 0, 1},
+      { sizeof(nvi_temp_int1_table_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_temp_table_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_imsi_addr_num_type), 2, 1},
+      { sizeof(nvi_tmsi_zone_length_type), 2, 1},
+      { sizeof(nvi_tmsi_zone_type), 2, 1},
+      { sizeof(nvi_tmsi_code_type), 2, 1},
+      { sizeof(nvi_tmsi_exp_time_type), 2, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_mob_dir_data_type), 2, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_dial_type), 1, 1},
+      { sizeof(nvi_sec_code_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_mru2_table_type), 2, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_up_link_info_type), 2, 1},
+      { sizeof(nvi_up_parms_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_dtaco_control_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_sid_nid_lock_type), 2, 1},
+      { sizeof(nvi_enabled_type), 2, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_sys_pref_type), 2, 1},
+      { sizeof(nvi_home_sid_nid_type), 2, 1},
+      { sizeof(nvi_enabled_type), 2, 1},
+      { sizeof(nvi_enabled_type), 2, 1},
+      { sizeof(nvi_min1_type), 2, 1},
+      { sizeof(nvi_min2_type), 2, 1},
+      { sizeof(nvi_imsi_mcc_type), 2, 1},
+      { sizeof(nvi_imsi_11_12_type), 2, 1},
+      { sizeof(nvi_imsi_addr_num_type), 2, 1},
+      { sizeof(nvi_up_alert_record_type), 9, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_pref_voice_so_type), 2, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_data_pkt_orig_str_type), 0, 1},
+      { sizeof(nvi_up_key_type), 2, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_roam_msg_type), 6, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ubrowser_type), 32, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_fm_hdet_adc_range_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pn_id_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_user_zone_type), 35, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pap_user_id_type), 0, 1},
+      { sizeof(nvi_pap_password_type), 0, 1},
+      { sizeof(nvi_sta_values_type), 0, 1},
+      { sizeof(nvi_sta_values_type), 0, 1},
+      { sizeof(nvi_sta_values_type), 0, 1},
+      { sizeof(nvi_sta_values_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pcs_rx_lin_slp_type), 0, 1},
+      { sizeof(nvi_pcs_rx_comp_vs_freq_type), 0, 1},
+      { sizeof(nvi_pcs_tx_comp_vs_freq_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_pcs_tx_lin_master_slp_type), 0, 1},
+      { sizeof(nvi_pcs_tx_lin_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_pcs_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pcs_pdm1_vs_freq_type), 0, 1},
+      { sizeof(nvi_pcs_pdm2_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_pcs_rx_lin_vs_temp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pcs_pa_range_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_pdm1_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_pdm2_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_rx_slp_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_tx_slp_vs_temp_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_pa_offset_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_sms_bc_service_table_type), 128, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_cdma_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_cdma_lna_12_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pcs_cdma_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_pcs_cdma_lna_12_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_ruim_chv_type), 0, 1},
+      { sizeof(nvi_ruim_chv_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_pa_range_offsets_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_mm_ringer_file_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_ruim_sms_status_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_pcs_pa_range_offsets_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_diag_restart_config_type), 0, 1},
+      { sizeof(nvi_band_pref_type), 2, 1},
+      { sizeof(nvi_roam_pref_type), 2, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_bd_addr_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_enabled_type), 2, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ds_mip_gen_user_prof_type), 6, 1},
+      { sizeof(nvi_ds_mip_ss_user_prof_type), 6, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_hdr_srch_params_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_hdramp_address_data_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_hdrscp_protocol_subtype_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_hdrstream_curr_stream_cfg_type), 0, 1},
+      { sizeof(nvi_hdr_chan_mgmt_params_type), 0, 1},
+      { sizeof(nvi_hdr_chan_mgmt_params_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_hdramac_initial_config_type), 0, 1},
+      { sizeof(nvi_hdramac_power_params_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_hdrfmac_handoff_delays_type), 0, 1},
+      { sizeof(nvi_hdrrmac_power_params_type), 0, 1},
+      { sizeof(nvi_hdrrmac_rate_params_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_pwr_backoff_vs_volt_med_type), 0, 1},
+      { sizeof(nvi_pwr_backoff_vs_volt_low_type), 0, 1},
+      { sizeof(nvi_pa_backoff_volts_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_ds_mip_mn_ha_time_delta_type), 6, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ant2_cdma_rx_lin_slp_type), 0, 1},
+      { sizeof(nvi_ant2_cdma_rx_comp_vs_freq_type), 0, 1},
+      { sizeof(nvi_ant2_cdma_rx_lin_vs_temp_type), 0, 1},
+      { sizeof(nvi_ant2_cdma_rx_slp_vs_temp_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_ant2_cdma_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_ant2_cdma_lna_12_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ant2_pcs_rx_lin_slp_type), 0, 1},
+      { sizeof(nvi_ant2_pcs_rx_comp_vs_freq_type), 0, 1},
+      { sizeof(nvi_ant2_pcs_rx_lin_vs_temp_type), 0, 1},
+      { sizeof(nvi_ant2_pcs_rx_slp_vs_temp_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_ant2_pcs_cdma_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_ant2_pcs_cdma_lna_12_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_wcdma_rx_lin_type), 0, 1},
+      { sizeof(nvi_wcdma_rx_comp_vs_freq_type), 0, 1},
+      { sizeof(nvi_wcdma_rx_lin_vs_temp_type), 0, 1},
+      { sizeof(nvi_wcdma_rx_slp_vs_temp_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_master_0_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_master_1_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_comp_vs_freq_0_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_comp_vs_freq_1_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_vs_temp_0_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_vs_temp_1_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_slp_vs_temp_0_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_slp_vs_temp_1_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ue_imei_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_hdrfmac_drc_lock_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_sms_vm_number_type), 0, 1},
+      { sizeof(nvi_sms_gw_parms_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_ecc_list_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_test_code_ver_type), 0, 1},
+      { sizeof(nvi_sys_sw_ver_type), 0, 1},
+      { sizeof(nvi_rf_cal_ver_type), 0, 1},
+      { sizeof(nvi_rf_config_ver_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_rf_cal_dat_file_type), 0, 1},
+      { sizeof(nvi_domain_name_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_plmn_id_info_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_hdr_an_auth_nai_type), 0, 1},
+      { sizeof(nvi_hdr_an_auth_password_type), 0, 1},
+      { sizeof(nvi_enabled_type), 2, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_hdrkep_config_type), 0, 1},
+      { sizeof(nvi_hdrauth_config_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_cdma_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_pcs_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_cdma_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_pcs_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_dfm_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_fm_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_cdma_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_pcs_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_fm_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_cdma_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_pcs_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_int32_type), 0, 1},
+      { sizeof(nvi_int32_type), 0, 1},
+      { sizeof(nvi_int32_type), 0, 1},
+      { sizeof(nvi_int32_type), 0, 1},
+      { sizeof(nvi_int32_type), 0, 1},
+      { sizeof(nvi_int32_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ds_mip_enable_prof_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_qword_type), 0, 1},
+      { sizeof(nvi_qword_type), 0, 1},
+      { sizeof(nvi_sms_bc_service_table_options_type), 128, 1},
+      { sizeof(nvi_acq_db_type), 0, 1},
+      { sizeof(nvi_acq_list1_type), 0, 1},
+      { sizeof(nvi_gsm_cal_arfcn_type), 0, 1},
+      { sizeof(nvi_dcs_cal_arfcn_type), 0, 1},
+      { sizeof(nvi_gsm_rx_gain_range_1_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_rx_gain_range_2_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_rx_gain_range_3_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_rx_gain_range_4_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_rx_gain_range_1_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_rx_gain_range_2_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_rx_gain_range_3_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_rx_gain_range_4_freq_comp_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_acq_list1_type), 0, 1},
+      { sizeof(nvi_acq_list2_type), 0, 1},
+      { sizeof(nvi_acq_list2_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_gsm_pa_gain_slope_type), 0, 1},
+      { sizeof(nvi_dcs_pa_gain_slope_type), 0, 1},
+      { sizeof(nvi_gsm_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_hdrrup_srch_params_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_sms_routing_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_sms_cd_parms_type), 20, 1},
+      { sizeof(nvi_acq_order_pref_type), 4, 1},
+      { sizeof(nvi_net_sel_mode_pref_type), 4, 1},
+      { sizeof(nvi_srv_domain_pref_type), 4, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_apn_name_type), 0, 1},
+      { sizeof(nvi_equivalent_plmn_list_type), 0, 1},
+      { sizeof(nvi_ds_mip_dmu_pkoid_type), 6, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_wcdma_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_lna_offset_vs_freq_2_type), 0, 1},
+      { sizeof(nvi_wcdma_lna_offset_vs_freq_3_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_vbatt_type), 0, 1},
+      { sizeof(nvi_wcdma_therm_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_qword_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_ds_mip_dmu_mn_auth_type), 6, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_cdma_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_pcs_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_gsm_locigprs_type), 0, 1},
+      { sizeof(nvi_gsm_kcgprs_type), 0, 1},
+      { sizeof(nvi_err_fatal_options_type), 0, 1},
+      { sizeof(nvi_ppp_password_type), 0, 1},
+      { sizeof(nvi_trk_lo_adj_vs_temp_type), 0, 1},
+      { sizeof(nvi_rot_freq_vs_temp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ppp_user_id_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_gainrange_switchpoint_type), 0, 1},
+      { sizeof(nvi_gainrange_switchpoint_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_hdr_an_ppp_nai_type), 0, 1},
+      { sizeof(nvi_hdr_an_ppp_password_type), 0, 1},
+      { sizeof(nvi_cdmach_type), 2, 1},
+      { sizeof(nvi_cdmach_type), 2, 1},
+      { sizeof(nvi_gsmumts_imsi_type), 0, 1},
+      { sizeof(nvi_rtsp_proxy_server_addr_type), 0, 1},
+      { sizeof(nvi_sms_default_template_type), 0, 1},
+      { sizeof(nvi_sms_default_template_type), 0, 1},
+      { sizeof(nvi_non_compliance_comment_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_pkt_dial_string_type), 0, 1},
+      { sizeof(nvi_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_df_type), 0, 1},
+      { sizeof(nvi_gsm_pa_temp_comp_index_14_type), 0, 1},
+      { sizeof(nvi_dcs_pa_temp_comp_index_15_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_rtsp_proxy_server_addr_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_mru3_table_type), 2, 1},
+      { sizeof(nvi_band_pref_type), 2, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_cdma_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_pcs_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_cdma_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_pcs_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_cdma_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_pcs_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_cdma_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_pcs_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_cdma_p1_rise_fall_offset_type), 0, 1},
+      { sizeof(nvi_c1_pcs_p1_rise_fall_offset_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_cdma_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_cdma_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_pcs_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_pcs_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_sms_gw_cb_service_table_type), 200, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c1_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_gsm_850_pa_temp_comp_index_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_pa_temp_comp_index_15_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_gsm_1900_cal_arfcn_type), 0, 1},
+      { sizeof(nvi_gsm_1900_rx_gain_range_1_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_1900_rx_gain_range_2_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_1900_rx_gain_range_3_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_1900_rx_gain_range_4_freq_comp_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_gsm_1900_pa_gain_slope_type), 0, 1},
+      { sizeof(nvi_gsm_1900_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_gainrange_switchpoint_type), 0, 1},
+      { sizeof(nvi_gsm_850_cal_arfcn_type), 0, 1},
+      { sizeof(nvi_gsm_850_rx_gain_range_1_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_850_rx_gain_range_2_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_850_rx_gain_range_3_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_850_rx_gain_range_4_freq_comp_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_tx_burst_ramp_index_type), 0, 1},
+      { sizeof(nvi_gsm_850_pa_gain_slope_type), 0, 1},
+      { sizeof(nvi_gsm_850_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_gainrange_switchpoint_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_lna_offset_vs_freq_2_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_lna_offset_vs_freq_3_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_master_0_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_master_1_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_comp_vs_freq_0_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_comp_vs_freq_1_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_vs_temp_0_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_vs_temp_1_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_slp_vs_temp_0_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_slp_vs_temp_1_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_rplmnact_type), 0, 1},
+      { sizeof(nvi_enum_type), 0, 1},
+      { sizeof(nvi_hdr_an_auth_passwd_long_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_hdr_an_auth_user_id_long_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_ppp_configure_data_type), 4, 1},
+      { sizeof(nvi_cell_1x_olta_backoff_type), 0, 1},
+      { sizeof(nvi_cell_hdr_olta_backoff_type), 0, 1},
+      { sizeof(nvi_pcs_olta_backoff_type), 0, 1},
+      { sizeof(nvi_bc6_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_bc6_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_bc6_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c0_bc6_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc6_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_minmax_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc6_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc6_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc6_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc6_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc6_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_c1_bc6_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_bc6_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_c0_bc6_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc6_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc6_p1_rise_fall_offset_type), 0, 1},
+      { sizeof(nvi_c1_bc6_p1_rise_fall_offset_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_int4_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_bc6_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_sec_device_key_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_pa_temp_comp_index_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c0_bc6_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc6_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_bc5_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_bc5_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_bc5_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_bc5_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_bc5_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_c0_bc5_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc5_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc5_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc5_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc5_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc5_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc5_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c1_bc5_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc5_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc5_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc5_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc5_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc5_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_bc5_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_bc4_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_bc4_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_bc4_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_bc4_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_bc4_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_c0_bc4_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc4_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc4_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc4_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc4_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc4_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc4_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c1_bc4_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc4_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc4_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc4_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc4_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc4_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_bc4_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_bc3_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_bc3_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_bc3_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_bc3_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_bc3_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_c0_bc3_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc3_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc3_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc3_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc3_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc3_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc3_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c1_bc3_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc3_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc3_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc3_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc3_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc3_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_bc3_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_bc1_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_bc1_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_bc1_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_bc1_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_bc1_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_c0_bc1_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc1_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc1_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc1_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc1_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc1_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc1_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c1_bc1_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc1_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc1_lna_1_offset_vs_freq_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_c1_bc1_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc1_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc1_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_bc1_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_bc0_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_linearizer_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_tx_comp_type), 0, 1},
+      { sizeof(nvi_bc0_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_bc0_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_bc0_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_bc0_p1_rise_fall_off_type), 0, 1},
+      { sizeof(nvi_c0_bc0_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc0_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c0_bc0_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc0_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc0_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c0_bc0_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c0_bc0_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_c1_bc0_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc0_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_c1_bc0_lna_1_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc0_lna_2_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc0_lna_3_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_c1_bc0_lna_4_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int2_type), 0, 1},
+      { sizeof(nvi_c1_bc0_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_rfr_vco_coarse_tuning_1900_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_ppp_ncp_remote_initiate_type), 3, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_data_pkt_orig_str_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_800_vga_gain_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_wcdma_800_vga_gain_offset_vs_temp_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_800_lna_offset_vs_freq_2_type), 0, 1},
+      { sizeof(nvi_wcdma_800_lna_offset_vs_freq_3_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_800_lna_offset_vs_freq_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_master_0_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_master_1_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_comp_vs_freq_0_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_comp_vs_freq_1_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_vs_temp_0_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_vs_temp_1_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_slp_vs_temp_0_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_wcdma_800_tx_slp_vs_temp_1_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lim_vs_temp_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lim_vs_freq_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_800_exp_hdet_vs_agc_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ps_ipv6_iid_type), 0, 1},
+      { sizeof(nvi_uint64_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_vco_temp_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int1_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_rr_stored_last_best_arfcns_band_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_ip6_sm_config_type), 0, 1},
+      { sizeof(nvi_c1_bc0_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_c1_bc1_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_c1_bc3_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_c1_bc4_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_c1_bc5_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_c1_bc6_vco_coarse_tune_table_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_ipv6_address_type), 0, 1},
+      { sizeof(nvi_ipv6_address_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_aagps_default_url_type), 0, 1},
+      { sizeof(nvi_aagps_default_ip_address_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { 0, 0, 0},
+      { 0, 0, 0},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_qword_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_default_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_850_tx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_850_rx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_900_tx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_900_rx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_1800_tx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_1800_rx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_1900_tx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_gsm_1900_rx_type), 0, 1},
+      { sizeof(nvi_rf_antsel_umts_800_type), 0, 1},
+      { sizeof(nvi_rf_antsel_umts_1900_type), 0, 1},
+      { sizeof(nvi_rf_antsel_umts_2100_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_prl_pref_type), 2, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_byte_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_wcdma_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_cal_chan_type), 0, 1},
+      { sizeof(nvi_wcdma_800_rx_cal_chan_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_brew_bkey_type), 0, 1},
+      { sizeof(nvi_brew_server_type), 0, 1},
+      { sizeof(nvi_word_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_dword_type), 0, 1},
+      { sizeof(nvi_brew_subscriber_id_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wlan_tech_pref_type), 2, 1},
+      { sizeof(nvi_uint32_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wlan_scan_pref_type), 2, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_master_2_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_master_3_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_comp_vs_freq_2_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_comp_vs_freq_3_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_vs_temp_2_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lin_vs_temp_3_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_slp_vs_temp_2_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_slp_vs_temp_3_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_pa_range_map_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_master_2_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_master_3_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_comp_vs_freq_2_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_comp_vs_freq_3_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_vs_temp_2_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_lin_vs_temp_3_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_slp_vs_temp_2_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_tx_slp_vs_temp_3_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_1900_pa_range_map_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_master_2_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_master_3_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_comp_vs_freq_2_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_comp_vs_freq_3_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_vs_temp_2_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_lin_vs_temp_3_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_slp_vs_temp_2_type), 0, 1},
+      { sizeof(nvi_wcdma_800_tx_slp_vs_temp_3_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_uint16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_wcdma_800_pa_range_map_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_gsm_prui_00_type), 0, 1},
+      { sizeof(nvi_gsm_prui_01_type), 0, 1},
+      { sizeof(nvi_gsm_prui_02_type), 0, 1},
+      { sizeof(nvi_gsm_prui_03_type), 0, 1},
+      { sizeof(nvi_gsm_prui_04_type), 0, 1},
+      { sizeof(nvi_gsm_prui_05_type), 0, 1},
+      { sizeof(nvi_gsm_prui_06_type), 0, 1},
+      { sizeof(nvi_gsm_prui_07_type), 0, 1},
+      { sizeof(nvi_gsm_prui_08_type), 0, 1},
+      { sizeof(nvi_gsm_prui_09_type), 0, 1},
+      { sizeof(nvi_gsm_prui_10_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_00_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_01_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_02_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_03_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_04_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_05_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_06_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_07_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_08_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_09_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_10_type), 0, 1},
+      { sizeof(nvi_gsm_prdi_11_type), 0, 1},
+      { sizeof(nvi_dcs_prui_00_type), 0, 1},
+      { sizeof(nvi_dcs_prui_01_type), 0, 1},
+      { sizeof(nvi_dcs_prui_02_type), 0, 1},
+      { sizeof(nvi_dcs_prui_03_type), 0, 1},
+      { sizeof(nvi_dcs_prui_04_type), 0, 1},
+      { sizeof(nvi_dcs_prui_05_type), 0, 1},
+      { sizeof(nvi_dcs_prui_06_type), 0, 1},
+      { sizeof(nvi_dcs_prui_07_type), 0, 1},
+      { sizeof(nvi_dcs_prui_08_type), 0, 1},
+      { sizeof(nvi_dcs_prui_09_type), 0, 1},
+      { sizeof(nvi_dcs_prui_10_type), 0, 1},
+      { sizeof(nvi_dcs_prui_11_type), 0, 1},
+      { sizeof(nvi_dcs_prui_12_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_00_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_01_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_02_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_03_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_04_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_05_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_06_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_07_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_08_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_09_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_10_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_11_type), 0, 1},
+      { sizeof(nvi_dcs_prdi_12_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_00_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_01_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_02_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_03_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_04_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_05_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_06_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_07_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_08_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_09_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_10_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_11_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_02_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_03_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_04_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_05_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_06_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_07_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_09_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_10_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_brui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_brdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_brui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_brui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_brui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_brdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_brui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_brui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_brui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_brdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_brdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_brdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_c0_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_c0_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_1900_c0_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_c1_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_dcs_c1_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm1900_c1_tx_freq_comp_type), 0, 1},
+      { sizeof(nvi_gsm_enable_tx_freq_comp_vs_pcl_type), 0, 1},
+      { sizeof(nvi_dcs_enable_tx_freq_comp_vs_pcl_type), 0, 1},
+      { sizeof(nvi_gsm_1900_enable_tx_freq_comp_vs_pcl_type), 0, 1},
+      { sizeof(nvi_therm_comp_thresholds_type), 0, 1},
+      { sizeof(nvi_vbatt_comp_thresholds_type), 0, 1},
+      { sizeof(nvi_wcdma_c0_tx_comp_vs_freq_0_type), 0, 1},
+      { sizeof(nvi_wcdma_c0_tx_comp_vs_freq_1_type), 0, 1},
+      { sizeof(nvi_wcdma_c1_tx_comp_vs_freq_0_type), 0, 1},
+      { sizeof(nvi_wcdma_c1_tx_comp_vs_freq_1_type), 0, 1},
+      { sizeof(nvi_wcdma_tx_lim_vs_volt_offset_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tl_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tl_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tl_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tl_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_tm_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_tm_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_tm_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_tm_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vl_th_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vl_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vl_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vm_th_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vm_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vm_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_prui_12_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_vh_th_prdi_12_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_prui_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_prui_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_prui_13_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_prdi_15_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_dcs_vh_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_prui_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_prui_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_prui_13_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_prdi_15_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_prdi_14_type), 0, 1},
+      { sizeof(nvi_gsm_1900_vh_th_prdi_13_type), 0, 1},
+      { sizeof(nvi_factory_data_1_type), 0, 1},
+      { sizeof(nvi_factory_data_2_type), 0, 1},
+      { sizeof(nvi_factory_data_3_type), 0, 1},
+      { sizeof(nvi_factory_data_4_type), 0, 1},
+      { sizeof(nvi_gsm_prui_11_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_00_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_01_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_11_type), 0, 1},
+      { sizeof(nvi_gsm_1900_prdi_08_type), 0, 1},
+      { sizeof(nvi_appx5_pref_type), 0, 1},
+      { sizeof(nvi_wlan_net_sel_mode_pref_type), 0, 1},
+      { sizeof(nvi_boolean_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_uint8_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_int16_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg1_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg2_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg3_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg4_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg5_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg6_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg7_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg8_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg1_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg2_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg3_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg4_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg5_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg6_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg7_f1_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg8_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg1_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg2_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg3_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg4_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg5_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg6_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg7_f1_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg8_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg1_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg2_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg3_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg4_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg5_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg6_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg7_f1_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg8_f1_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg1_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg2_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg3_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg4_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg5_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg6_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg7_f2_type), 0, 1},
+      { sizeof(nvi_gsm_amam_master_tbl_seg8_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg1_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg2_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg3_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg4_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg5_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg6_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg7_f2_type), 0, 1},
+      { sizeof(nvi_dcs_amam_master_tbl_seg8_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg1_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg2_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg3_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg4_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg5_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg6_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg7_f2_type), 0, 1},
+      { sizeof(nvi_gsm_850_amam_master_tbl_seg8_f2_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg1_f2_type), 0, 1},
+      { sizeof(nvi_gsm_1900_amam_master_tbl_seg2_f2_type), 0,&nbs