1 /*===========================================================================
\r
3 N V I T E M M A N A G E R T A S K
\r
5 All the declarations and definitions necessary to support the table
\r
6 lookup of mapping between an NV item and the Flash File System files
\r
7 which simulate storage in an EEPROM. External tasks queue requests for
\r
8 this task for NV EEPROM read and write operations. This tasks then
\r
9 performs the necessary internal operations to read, write
\r
10 and control access to the Flash File System files which simulate storage
\r
12 This task includes the following files:
\r
13 nv.h - NVM Item Manager task services
\r
14 nvim.h, nvim.c - NVM Item Manager item services
\r
15 nvio.h, nvio.c - NVM Item Manager read/write services
\r
16 nvi.h - Common definitions
\r
18 EXTERNALIZED FUNCTIONS
\r
20 Write an error log without requiring any tasking services.
\r
22 Read an error log without requiring any tasking services.
\r
24 This is the applications read and write interface to this task.
\r
26 This is the nv task initialization entry, started up with rex_def_task.
\r
28 INITIALIZATION AND SEQUENCING REQUIREMENTS
\r
29 This task should be started up with rex_def_task. Caution must be
\r
30 taken when invoking error services from this task. These services invoke
\r
31 this task again (to log errors) and could cause an infinite loop.
\r
34 Copyright (c) 2005-2010 by QUALCOMM, Incorporated.
\r
35 All Rights Reserved.
\r
36 Qualcomm Confidential and Proprietary
\r
38 ===========================================================================*/
\r
41 /*===========================================================================
\r
43 EDIT HISTORY FOR FILE
\r
45 $Header: //source/qcom/qct/core/pkg/2H09/halcyon_modem/rel/LA2.0/AMSS/products/7x30/core/services/nv/src/nvim.c#1 $ $DateTime: 2010/10/20 22:41:15 $ $Author: cbirch $
\r
47 when who what, where, why
\r
48 -------- --- ---------------------------------------------------------
\r
49 10/12/09 as Moved nvdiag_init call in to NVIM task
\r
50 09/25/09 pc Dual SIM/Dual Standby support for LCU
\r
51 07/23/09 sri UMTS build support for remoted functions: nv_rtre_control,
\r
52 nv_rtre_polling_for_nam and nv_rtre_polling_control
\r
53 07/08/09 sri Moved function implementations from nv.h and removed inline
\r
54 05/27/09 sri Adding "default" case in nvim_remove_item and the function
\r
55 nv_cmd_remote() modified to protect some NV items remote
\r
56 read/write access under FEATURE_NV_ACCESS_FILTER
\r
57 03/18/09 sri NV task priority is kept unchanged.
\r
58 01/08/08 pc Ensured mutex initialization for synchronous calls.
\r
59 12/13/07 pc Introduced kxmutexes around NV access.
\r
60 06/08/07 pc Added support for mdn based nai
\r
61 12/15/06 ck Include the header file fs_diag_access.h
\r
62 06/05/05 pc Created NV-2.
\r
63 ===========================================================================*/
\r
65 /* ======================================================================
\r
67 INCLUDE FILES FOR MODULE
\r
69 ========================================================================*/
\r
74 #ifdef FEATURE_NV_ITEM_MGR
\r
84 #include "fs_public.h"
\r
85 #include "nv_items.h"
\r
86 #include "fs_diag_access.h"
\r
88 #ifdef FEATURE_CDMA1X
\r
95 #error code not present
\r
97 #include "nvim_items.h"
\r
99 #error code not present
\r
102 #ifdef FEATURE_NV_RUIM
\r
103 #include "nvruimi.h"
\r
106 #ifdef FEATURE_NV_CNV
\r
107 #include "fs_public.h"
\r
108 #include "nv_cnv.h"
\r
111 #ifdef FEATURE_MDN_BASED_NAI
\r
112 #define PS_NAI_DFLT_DOMAIN "@default.com"
\r
114 #endif /* FEATURE_MDN_BASED_NAI */
\r
116 #ifdef FEATURE_WINCE
\r
117 #error code not present
\r
119 #ifdef FEATURE_QUARTZ_135
\r
120 #include "quartz/KxMutex.h"
\r
122 #include <KxMutex.h>
\r
126 #include <stdlib.h>
\r
129 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
131 /* DATA DEFINITIONS */
\r
133 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
135 static KxMutex nv_access_op_cs;
\r
137 extern rex_crit_sect_type nv_crit_sect;
\r
138 extern const nvim_item_info_type nvim_item_info_table[];
\r
139 extern nv_rtre_control_type nv_rtre_control_value;
\r
140 extern nv_rtre_polling_control_type nv_rtre_polling_control_value;
\r
142 #ifdef FEATURE_NV_CNV
\r
143 /* File to back up the data into */
\r
144 const char *cnv_file = "/nvm/nv_cnv.bin";
\r
147 boolean nvi_task_running=FALSE;
\r
149 /* Contains the roaming list "valid" indicator */
\r
150 boolean nv_prl_valid_data[NV_MAX_NAMS];
\r
152 /* Contains the roaming list "prl_version" field */
\r
153 word nv_prl_version_data[NV_MAX_NAMS];
\r
155 /* Buffer holding the union of all internal NVM storage types. Use as */
\r
156 /* a working buffer when reading or writing data from or to NVM and the */
\r
157 /* data requires translation between internal format and external format. */
\r
158 nvi_item_type nvi_item;
\r
160 /* Data buffer for individual writes/reads issued internally. */
\r
161 nv_item_type local_item;
\r
163 /* Command buffer for individual writes/reads issued internally. */
\r
164 nv_cmd_type local_cmd;
\r
166 #ifdef NV_FEATURE_PRL_ITEMS
\r
167 /* Globally used buffer to contain the roaming list read-from */
\r
168 /* or written-to NV memory. */
\r
169 nv_roaming_list_type nv_pr_list;
\r
172 #ifdef NV_FEATURE_RENTAL_ITEMS
\r
173 #error code not present
\r
176 /* Dynamic pool available in EFS */
\r
177 word nvi_memavail_data=0;
\r
179 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
181 /* REX Timers and Queues */
\r
183 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
185 rex_timer_type nv_rpt_timer; /* NV watchdog report timer. */
\r
186 rex_timer_type nv_write_timer; /* NVM write timer. */
\r
187 LOCAL q_type nv_cmd_q; /* NV task command queue. */
\r
189 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
193 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
196 /* Flag to determine if EEPROM initialization has occurred */
\r
197 static boolean nvi_initialized = FALSE;
\r
199 /* Flag to determine if kxmutex initialization has occured */
\r
200 static boolean nv_cs_init_flag = FALSE;
\r
202 /* The total factory data block cache for peek/poke access */
\r
203 byte fact_data[NVIM_FACTORY_DATA_SIZE];
\r
205 static boolean nverr_init( void );
\r
206 static void nverr_update_log( void );
\r
208 extern void nvdiag_init (void);
\r
210 /* Structure used to essentially double buffer the error log */
\r
213 nv_err_log_type external[NV_MAX_ERR_LOG];
\r
214 nv_err_log_type internal[NV_MAX_ERR_LOG];
\r
215 boolean update_required[NV_MAX_ERR_LOG];
\r
216 boolean update_in_progress[NV_MAX_ERR_LOG];
\r
217 boolean processing_required;
\r
220 #if defined( FEATURE_UIM_RUN_TIME_ENABLE )
\r
221 /* Run Time R-UIM Enable control. Default: do not use the R-UIM */
\r
222 #ifdef FEATURE_RTRE_DEFAULT_IS_NV
\r
223 nv_rtre_control_type nv_rtre_control_value = NV_RTRE_CONTROL_NO_RUIM;
\r
225 nv_rtre_control_type nv_rtre_control_value = NV_RTRE_CONTROL_USE_RUIM;
\r
227 /* Run Time R-UIM Enable polling control. Default: do not poll */
\r
228 nv_rtre_polling_control_type nv_rtre_polling_control_value =
\r
229 NV_RTRE_POLLING_CONTROL_NO_POLL;
\r
230 #endif /* FEATURE_UIM_RUN_TIME_ENABLE */
\r
232 #ifdef FEATURE_DIAG_FS_ACCESS_VALIDATION
\r
233 #ifdef FEATURE_EFS2
\r
234 #include "fs_diag.h"
\r
236 #include "fsdiag.h"
\r
239 static const char *nv_access_dirs[] = {
\r
245 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
249 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
251 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
255 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
258 #ifdef FEATURE_DIAG_FS_ACCESS_VALIDATION
\r
260 /*==================================================================
\r
261 Function: NV_CHECK_REMOTE_ACCESS
\r
263 Description: This functions returns access permissions for
\r
264 directories specified by input parameter "path".
\r
265 ==================================================================*/
\r
267 nv_check_remote_access (char *path, uint32 op_type)
\r
271 #ifdef FEATURE_TECHNICS_DIAG
\r
279 /*====================================================================
\r
280 Function: NV_REGISTER_REMOTE_ACCESS_CHECK
\r
282 Description: Registers callback function nv_check_remote_access()
\r
283 with directory listed in nv_access_dirs. On any access to
\r
284 nv_access_dirs directories, nv_check_remote_access will
\r
285 be called to determine access permissions.
\r
286 =====================================================================*/
\r
288 nv_register_remote_access_check (void)
\r
290 diag_fs_register_access_check (nv_access_dirs, 1, nv_check_remote_access);
\r
292 #endif /* FEATURE_DIAG_FS_ACCESS_VALIDATION */
\r
295 /*===========================================================================
\r
297 FUNCTION NV_READ_ERR_LOG
\r
300 This function reads an error log from NVM.
\r
303 The function MUST NOT USE ANY TASK SERVICES, so that it can be
\r
304 called when tasks are not initialized. The function MUST NOT
\r
305 USE ERROR SERVICES. It returns status to the caller if there
\r
309 NV_DONE_S if it worked
\r
310 NV_NOT_ACTIVE_S if item was not active
\r
311 NV_FAIL_S if item could not be read
\r
316 ===========================================================================*/
\r
320 nv_err_log_type *nv_err_log_ptr /* Pointer where to return read data */
\r
323 word isave; /* Save processor flags */
\r
324 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
326 if(!nvi_initialized) {
\r
327 return NV_DONE_S; /* can not read errors before nv built */
\r
330 /* check and reject illegal request. */
\r
331 if (nv_err_log_ptr->address >= NV_MAX_ERR_LOG) {
\r
335 /* copy the shadow copy of the error log */
\r
336 INTLOCK_SAV( isave ); /* Disable interrupts and save PSW */
\r
337 nv_err_log_ptr->err_count = nverr_log.external[nv_err_log_ptr->address].err_count;
\r
338 std_strlcpy((char *)nv_err_log_ptr->file_name,
\r
339 (char *)nverr_log.external[nv_err_log_ptr->address].file_name,
\r
340 sizeof(nv_err_log_ptr->file_name));
\r
341 nv_err_log_ptr->line_num = nverr_log.external[nv_err_log_ptr->address].line_num;
\r
342 nv_err_log_ptr->fatal = nverr_log.external[nv_err_log_ptr->address].fatal;
\r
343 INTFREE_SAV( isave ); /* Restore interrupts (PSW) */
\r
346 } /* nv_read_err_log */
\r
349 /*===========================================================================
\r
351 FUNCTION NV_WRITE_ERR_LOG
\r
354 This function writes the boot error log to NVM.
\r
357 The function MUST NOT USE ANY TASK SERVICES, so that it can be
\r
358 called when tasks are not initialized. The function MUST NOT
\r
359 USE ERROR SERVICES. It returns status to the caller if there
\r
363 NV_DONE_S - if it worked
\r
364 NV_FAIL_S - if item could not be written
\r
369 ===========================================================================*/
\r
373 nv_err_log_type *nv_err_log_ptr /* Pointer where to get write data */
\r
376 static boolean nv_err_fataling = FALSE;
\r
377 nv_stat_enum_type status; /* NV read status */
\r
380 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
381 if (nv_err_fataling) return NV_FAIL_S;
\r
383 if (!nvi_initialized) {
\r
384 return NV_DONE_S; /* can not write errors before nv built */
\r
387 /* Check if file system is error fataling */
\r
388 if ((rex_self() == &fs_tcb) && (nv_err_log_ptr->fatal)) {
\r
389 nv_err_fataling = TRUE; /* NV is not usable once FS err fatals */
\r
390 return NV_DONE_S; /* can not write this error */
\r
393 /* check and reject illegal request. */
\r
395 if (nv_err_log_ptr->address >= NV_MAX_ERR_LOG) {
\r
398 /* If the task is running we queue the write to the nv part as to not
\r
399 * interrupt a write in progress. This is a somewhat device dependend
\r
400 * concept in that we assume a write can not be safely interrupted during
\r
401 * a write, which is not true of all nv devices.
\r
402 * Note that error_fatals always take the direct route.
\r
404 if (nvi_task_running && !(nv_err_log_ptr->fatal)) {
\r
405 /* put error into shadow copy of nv error record */
\r
406 INTLOCK_SAV(isave);
\r
407 nverr_log.processing_required = TRUE;
\r
408 (void) memcpy((void *)&(nverr_log.external[nv_err_log_ptr->address]),
\r
409 (void *)nv_err_log_ptr,
\r
410 sizeof(nv_err_log_type)); /* data buffer size */
\r
411 nverr_log.update_required[nv_err_log_ptr->address] = TRUE;
\r
412 INTFREE_SAV(isave);
\r
414 /* Signal the nv task that there is a buffer to process */
\r
415 (void) rex_set_sigs(&nv_tcb, NV_ERR_LOG_SIG);
\r
419 if ((nv_err_log_ptr->fatal)) {
\r
420 nv_err_fataling = TRUE;
\r
421 /* allow lower levels to run with ints disabled */
\r
422 nvi_task_running = FALSE;
\r
425 status = nvio_write_item
\r
427 nv_err_log_ptr->address, /* Item index within its array */
\r
428 (void *)&nv_err_log_ptr->err_count, /* data buffer */
\r
429 nvim_op_get_size(NV_ERR_LOG_I),
\r
430 0 /* context=0 implies no context is defined */
\r
433 INTLOCK_SAV(isave);
\r
434 if (!(nv_err_log_ptr->fatal)) {
\r
435 (void) memcpy((void *)&(nverr_log.external[nv_err_log_ptr->address]),
\r
436 (void *)nv_err_log_ptr,
\r
437 sizeof(nv_err_log_type)); /* data buffer size */
\r
439 INTFREE_SAV(isave);
\r
443 } /* nv_write_err_log */
\r
445 /*===========================================================================
\r
447 FUNCTION NVIM_OP_GET_PRESENCE
\r
450 This function determines whether an entry is present.
\r
456 0 : NVIM_NOT_PRESENT : Not present
\r
457 1 : NVIM_PRESENT : Present
\r
458 2 : NVIM_WRITE_ONCE : Present and write once only
\r
462 ===========================================================================*/
\r
464 nvim_op_get_presence (
\r
465 nv_items_enum_type item /* Item ID */
\r
468 if (item < NVIM_ITEM_INFO_TABLE_SIZE)
\r
470 return nvim_item_info_table[item].is_present;
\r
474 ERR("Item code %d out of range", item, 0, 0);
\r
478 } /* nvim_op_get_presence */
\r
481 /*===========================================================================
\r
483 FUNCTION NVIM_OP_GET_ARRAY_SIZE
\r
486 This function returns the array size of an item, given its ID (item code).
\r
495 Only a meaningful return value if the entry is valid which is determined
\r
496 by calling nv_op_is_valid_entry
\r
498 ===========================================================================*/
\r
500 nvim_op_get_array_size (
\r
501 nv_items_enum_type item /* Item ID */
\r
504 if (item < NVIM_ITEM_INFO_TABLE_SIZE) {
\r
505 return nvim_item_info_table[item].array_size;
\r
508 ERR("Item %d out of range", item, 0, 0);
\r
511 } /* nvim_op_get_array_size */
\r
515 /*===========================================================================
\r
517 FUNCTION NVIM_OP_GET_SIZE
\r
520 This function returns the size of an item, given its ID (item code).
\r
529 Only a meaningful return value if the entry is valid which is determined
\r
530 by calling nv_op_is_valid_entry
\r
532 ===========================================================================*/
\r
535 nv_items_enum_type item /* Item ID */
\r
538 if (item < NVIM_ITEM_INFO_TABLE_SIZE)
\r
540 return (nvim_item_info_table[item].item_size);
\r
544 ERR("Item %d out of range", item, 0, 0);
\r
547 } /* nvim_op_get_size */
\r
551 /*===========================================================================
\r
553 FUNCTION NV_DETERMINE_ESN_VALIDITY
\r
556 This function is determines if the current ESN has been programmed with the
\r
557 status of this check returned.
\r
563 TRUE if the current ESN is non-zero with proper checksums, else FALSE
\r
567 ===========================================================================*/
\r
570 nv_determine_esn_validity( void)
\r
572 /* This is gross, but there is not enough stack space
\r
573 * for these next two items so we declare them as the appear in the enum
\r
575 dword nv_item1_esn; /* tmp buffer for esn */
\r
576 dword nv_item2_esn_chksum; /* tmp buffer for esn checksum */
\r
577 nv_stat_enum_type status; /* to get status of NV operations */
\r
579 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
581 /* Start by reading the ESN and returning FALSE if it is now -1 */
\r
583 status = nvio_read_item(NV_ESN_I,/* file handle */
\r
584 0, /* file position */
\r
585 &nv_item1_esn, /* data ptr */
\r
586 sizeof(nv_item1_esn), /* data count */
\r
587 0); /* context=0 implies no context is defined */
\r
589 if( (status != NV_DONE_S) ||
\r
590 (nv_item1_esn == 0xFFFFFFFF) ) {
\r
591 /* ------------------------- */
\r
592 /* The ESN has not been set, */
\r
594 /* ------------------------- */
\r
595 ERR( "ESN has not been set", 0, 0, 0);
\r
599 if( nv_item1_esn == 0 ) {
\r
600 QSR_MSG_HIGH( 1495149522ULL, "ESN is zero for factory test",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
603 /* --------------------------------------------------------------------- */
\r
604 /* To get here the ESN has been set. Determine if the checksums are */
\r
605 /* valid. Do this be comparing calculated checksums against stored sums */
\r
606 /* --------------------------------------------------------------------- */
\r
608 status = nvio_read_item(NV_ESN_CHKSUM_I,/* file handle */
\r
609 0, /* file position */
\r
610 &nv_item2_esn_chksum, /* data ptr */
\r
611 sizeof(nv_item2_esn_chksum), /* data count */
\r
612 0); /* context=0 implies no context is defined */
\r
614 /* --------------------------------------------------------------------- */
\r
615 /* To get here the ESN is valid and this is not a pre-Version 5. */
\r
616 /* Check for proper checksums and return TRUE if so, else return FALSE */
\r
617 /* --------------------------------------------------------------------- */
\r
619 if( crc_30_calc( (byte *)&nv_item1_esn, sizeof(nv_item1_esn) * 8) !=
\r
620 nv_item2_esn_chksum) {
\r
621 /* ------------------------- */
\r
622 /* The ESN checksum is not */
\r
623 /* valid, return FALSE */
\r
624 /* ------------------------- */
\r
625 ERR( "Stored ESN CHKSUM bad: %u", nv_item2_esn_chksum, 0, 0);
\r
633 #ifdef FEATURE_NV_CNV
\r
634 /*======================================================================
\r
635 FUNCTION NVI_CNV_CHECK
\r
638 This function checks for the presence of a CNV file in EFS.
\r
639 If it is found, the items are inserted into the current nv.
\r
642 EFS must be initialized. The item manager must also have completed
\r
643 nv_init. This routine expects to be called at the end of NV_INIT.
\r
649 NV items could be updated if a valid CNV fileis present.
\r
651 ======================================================================*/
\r
652 void nvim_cnv_check(void)
\r
654 int file_handle = NULL;
\r
655 struct fs_stat sbuf;
\r
659 static byte buffer[32];
\r
665 cnv_item_hdr_type item_head;
\r
666 static nv_item_type item;
\r
668 nv_cmd_ext_type cmd_ext;
\r
670 /* Open the file */
\r
671 file_handle = efs_open(cnv_file, O_RDWR);
\r
672 if (file_handle < 0)
\r
674 QSR_MSG_HIGH ( 1964571546ULL, "Cannot open CNV file", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
678 /* Stat to get the file size */
\r
679 if (efs_fstat(file_handle, &sbuf) < 0)
\r
681 QSR_MSG_HIGH ( 945998922ULL, "Error on fstat of CNV file",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
685 /* Cycle thru the contents to check CRC */
\r
686 crc16 = (word) CRC_16_STEP_SEED;
\r
688 size_left = sbuf.st_size;
\r
689 while (size_left > 0) {
\r
691 if (count > sizeof (buffer))
\r
692 count = sizeof (buffer);
\r
694 size = efs_read(file_handle, buffer, count);
\r
697 QSR_MSG_MED ( 2881874282ULL, "Unable to read CNV data", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
701 crc16 = crc_16_step (crc16, buffer, count);
\r
702 size_left -= count;
\r
705 if (crc16 != CRC_16_OK) {
\r
706 QSR_MSG_HIGH ( 2303037548ULL, "Invalid CRC for CNV data", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
710 QSR_MSG_MED ( 2373619479ULL, "Valid CNV file detected", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
712 /* Rewind the file back to the first item and ignore the header
\r
714 offset = efs_lseek (file_handle, sizeof(cnv_header_type), SEEK_SET);
\r
718 QSR_MSG_HIGH ( 1998497732ULL, "Cannot seek to the beginning of the file",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
722 size_left = sbuf.st_size - (sizeof(cnv_header_type) + sizeof(crc16)
\r
723 + sizeof(cnv_item_hdr_type));
\r
725 while (size_left > 0)
\r
727 /* Read in an item. */
\r
728 size = efs_read (file_handle, (void *) &item_head, sizeof (item_head));
\r
729 if (size != sizeof (item_head))
\r
731 QSR_MSG_MED ( 1772854668ULL, "Unable to read handover item header", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
735 size_left -= sizeof (item_head);
\r
737 QSR_MSG_MED ( 852213282ULL, "CNV item: %d, size %d", item_head.nv_item_number,
\r
738 item_head.nv_item_size, 0);//auto-gen, to change remove 'QSR_' and first param
\r
740 /* Read in the raw data. */
\r
741 size = efs_read (file_handle, (void *) &item, item_head.nv_item_size);
\r
742 if (size != item_head.nv_item_size)
\r
744 QSR_MSG_MED ( 267230007ULL, "Unable to read CNV item", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
748 /* Write the item to NV. */
\r
749 cmd.item = (nv_items_enum_type) item_head.nv_item_number;
\r
750 cmd.cmd = NV_WRITE_F;
\r
751 cmd.data_ptr = &item;
\r
753 cmd_ext.nvcmd = &cmd;
\r
754 cmd_ext.context = 0;
\r
756 if (nvio_write (&cmd_ext) != NV_DONE_S)
\r
758 QSR_MSG_HIGH ( 1264321974ULL, "Unable to write handover item: %d, size %d",
\r
759 item_head.nv_item_number, item_head.nv_item_size, 0);//auto-gen, to change remove 'QSR_' and first param
\r
763 if ((item_head.nv_item_size % 4) != 0)
\r
765 pad_size = 4 - (item_head.nv_item_size % 4);
\r
767 offset = efs_lseek(file_handle, pad_size, SEEK_CUR);
\r
770 QSR_MSG_HIGH ( 1039740364ULL, "Cannot seek forward to the next item",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
774 size_left -= (item_head.nv_item_size + pad_size);
\r
777 /* Close the file */
\r
778 efs_close (file_handle);
\r
780 /* Remove the file since we are done updating the NV items */
\r
781 if (efs_unlink (cnv_file) < 0)
\r
783 QSR_MSG_HIGH ( 2406613708ULL, "Unable to remove CNV file", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
785 } /* nvi_cnv_check */
\r
787 #endif /*FEATURE_NV_CNV*/
\r
790 /*===========================================================================
\r
792 FUNCTION NVIM_BUILD_SEC
\r
795 This function builds all NVM variables.
\r
800 NV_DONE_S if it worked
\r
801 NV_FAIL_S if a variable could not be initialized.
\r
805 ===========================================================================*/
\r
807 static nv_stat_enum_type
\r
808 nvim_build_sec(void)
\r
810 nv_stat_enum_type status; /* Status to return to calling procedure */
\r
811 word cnt; /* Counter for attempts to write variable */
\r
812 nv_cmd_ext_type local_cmd_ext;
\r
814 /* Initialize the lock code to the default value (0000) */
\r
815 for( cnt=0; cnt<NV_LOCK_CODE_SIZE; cnt++) {
\r
816 local_item.lock_code.digits[ cnt] = '0';
\r
819 local_cmd.item = NV_LOCK_CODE_I;
\r
820 local_cmd.tcb_ptr = NULL;
\r
821 local_cmd.sigs = 0;
\r
822 local_cmd.done_q_ptr = NULL;
\r
823 local_cmd.cmd = NV_WRITE_F;
\r
824 local_cmd.data_ptr = &local_item;
\r
826 local_cmd_ext.nvcmd = &local_cmd;
\r
827 local_cmd_ext.context = 0; /* No context is defined */
\r
829 status = nvio_write(&local_cmd_ext);
\r
830 if(status != NV_DONE_S)
\r
835 /* Initialize the sec code to the default value (0000) */
\r
836 for( cnt=0; cnt<NV_SEC_CODE_SIZE; cnt++) {
\r
837 local_item.sec_code.digits[ cnt] = '0';
\r
839 local_cmd.item = NV_SEC_CODE_I;
\r
840 local_cmd.tcb_ptr = NULL;
\r
841 local_cmd.sigs = 0;
\r
842 local_cmd.done_q_ptr = NULL;
\r
843 local_cmd.cmd = NV_WRITE_F;
\r
844 local_cmd.data_ptr = &local_item;
\r
846 local_cmd_ext.nvcmd = &local_cmd;
\r
847 local_cmd_ext.context = 0; /* No context is defined */
\r
849 status = nvio_write(&local_cmd_ext);
\r
855 /*===========================================================================
\r
857 FUNCTION NVIM_CLEAR_CRCS
\r
860 This function is called to clear CRCs in NV when the NV is built. The function
\r
861 clears the NAM checksums, the MIN checksums within each NAM, and, if
\r
862 the ESN and IMEI have not already been written (assigned), the ESN, the IMEI,
\r
863 the ESN checksum, the IMEI checksum. This action lets higher level tasks
\r
864 know that these parameters are not valid and that service programming is
\r
868 NVM must have been built.
\r
871 NV_DONE_S if it worked
\r
872 NV_FAIL_S if the EEPROM access has failed
\r
875 NV parameters identified above are zeroed.
\r
877 ===========================================================================*/
\r
879 LOCAL nv_stat_enum_type
\r
880 nvim_clear_crcs (void)
\r
882 byte nam_idx; /* NAM counter */
\r
883 byte min_idx; /* MIN counter */
\r
884 nv_cmd_ext_type local_cmd_ext;
\r
885 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
887 /* Setup command buffer parameters. */
\r
889 local_cmd.cmd = NV_WRITE_F;
\r
890 local_cmd.tcb_ptr = NULL;
\r
891 local_cmd.sigs = 0;
\r
892 local_cmd.done_q_ptr = NULL;
\r
893 local_cmd.data_ptr = &local_item;
\r
895 /* Clear all NAMs checksums and the MIN checksums for each NAM. */
\r
897 for (nam_idx = 0; nam_idx < NV_MAX_NAMS; nam_idx++) {
\r
898 local_item.nam_chksum.nam = nam_idx;
\r
899 local_item.nam_chksum.chksum = 0;
\r
900 local_cmd.item = NV_NAM_CHKSUM_I;
\r
902 local_cmd_ext.nvcmd = &local_cmd;
\r
903 local_cmd_ext.context = 0; /* No context is defined */
\r
905 local_cmd.status = nvio_write(&local_cmd_ext);
\r
907 QSR_MSG_LOW( 705624602ULL, "NAM %d NAM checksum zero status %d", nam_idx, local_cmd.status, 0);//auto-gen, to change remove 'QSR_' and first param
\r
908 if (local_cmd.status != NV_DONE_S) {
\r
909 return (local_cmd.status);
\r
912 local_item.min_chksum.nam = nam_idx;
\r
913 for (min_idx = 0; min_idx < NV_MAX_MINS; min_idx++) {
\r
914 local_item.min_chksum.chksum[min_idx] = 0;
\r
916 local_cmd.item = NV_MIN_CHKSUM_I;
\r
918 local_cmd_ext.nvcmd = &local_cmd;
\r
919 local_cmd_ext.context = 0; /* No context is defined */
\r
921 local_cmd.status = nvio_write(&local_cmd_ext);
\r
923 QSR_MSG_LOW( 1811374263ULL, "NAM %d MIN checksum zero status %d", nam_idx, local_cmd.status, 0);//auto-gen, to change remove 'QSR_' and first param
\r
924 if (local_cmd.status != NV_DONE_S) {
\r
925 return (local_cmd.status);
\r
929 /* --------------------------------------------------------------------- */
\r
930 /* Next we determine if the ESN is now proper and if not then clear the */
\r
931 /* ESN,the ESN checksum, and the ESN valid flag. */
\r
932 /* --------------------------------------------------------------------- */
\r
933 if( nv_determine_esn_validity() == FALSE) {
\r
934 /* ------------------------------------------------------------------- */
\r
935 /* The ESN has not yet been assigned/written. Zero associated items */
\r
936 /* Note that to get here status == NV_DONE_S */
\r
937 /* ------------------------------------------------------------------- */
\r
938 local_item.esn.esn = 0;
\r
939 local_cmd.item = NV_ESN_I;
\r
941 local_cmd_ext.nvcmd = &local_cmd;
\r
942 local_cmd_ext.context = 0; /* No context is defined */
\r
944 local_cmd.status = nvio_write(&local_cmd_ext);
\r
946 QSR_MSG_LOW( 983002661ULL, "ESN zero status %d", local_cmd.status, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
947 if (local_cmd.status != NV_DONE_S) {
\r
948 return local_cmd.status;
\r
951 return local_cmd.status;
\r
952 } /* nvim_clear_crcs */
\r
955 /*===========================================================================
\r
957 FUNCTION NVIM_INIT_RENTAL_TIMER
\r
960 This function reads the rental timer item structure out of NVRAM and
\r
961 initializes the "nv_rental_item_image" state data item. It also
\r
962 validates the data structure and recovers from a previous bad powerdown.
\r
968 NV_DONE_S if it worked
\r
969 NV_FAIL_S if the EEPROM access has failed
\r
974 ===========================================================================*/
\r
976 LOCAL nv_stat_enum_type
\r
977 nvim_init_rental_timer (void)
\r
980 #ifdef NV_FEATURE_RENTAL_ITEMS
\r
981 #error code not present
\r
987 /*===========================================================================
\r
989 FUNCTION NVIM_INIT_RENTAL_CNT
\r
992 This function reads the rental count item from NV and initializes
\r
993 the "nv_rental_cnt_image" state data item.
\r
999 NV_DONE_S if it worked
\r
1000 NV_FAIL_S if the EEPROM access has failed
\r
1005 ===========================================================================*/
\r
1007 LOCAL nv_stat_enum_type
\r
1008 nvim_init_rental_cnt (void) {
\r
1009 #ifdef NV_FEATURE_RENTAL_ITEMS
\r
1010 #error code not present
\r
1017 /*===========================================================================
\r
1019 FUNCTION NVIM_INIT_PRL_DATA
\r
1022 This function initializes the "prl_valid_data" and "prl_version_data"
\r
1023 state data items. These are maintained as NV state data so the functions
\r
1024 "nv_prl_is_valid()" and "nvim_prl_version()" can return an immediate
\r
1031 NV_DONE_S if it worked
\r
1032 NV_FAIL_S if failed
\r
1037 ===========================================================================*/
\r
1040 nvim_init_prl_data (void)
\r
1043 nv_roaming_list_header_type prl_header;
\r
1044 nv_stat_enum_type status;
\r
1046 prl_header.nam = FALSE;
\r
1047 prl_header.prl_version = 0;
\r
1048 prl_header.valid = FALSE;
\r
1050 for (nam=0; nam<NV_MAX_NAMS; nam++) {
\r
1051 /* For each nam, read the prl header */
\r
1052 status = nvio_read_prl_item(nam,
\r
1053 (void *)&prl_header, /* data ptr */
\r
1054 NV_ROAMING_LIST_HEADER_SIZE);/* data count */
\r
1055 /* Set state data items -- note that the item's active flag */
\r
1056 /* occupies the "nam" field in the external type. */
\r
1057 if (status == NV_DONE_S) {
\r
1058 nv_prl_version_data[nam] = prl_header.prl_version;
\r
1059 nv_prl_valid_data[nam] = prl_header.valid;
\r
1062 nv_prl_version_data[nam] = NV_PRL_VERSION_INVALID;
\r
1063 nv_prl_valid_data[nam] = FALSE;
\r
1070 /*===========================================================================
\r
1072 FUNCTION NVIM_REMOVE_ITEM
\r
1075 This procedure processes NVM remove requests for a particular item.
\r
1081 Status of read operation.
\r
1086 ===========================================================================*/
\r
1088 nv_stat_enum_type
\r
1089 nvim_remove_item (
\r
1090 nv_cmd_ext_type *cmd_ext_ptr /* Pointer to Command block */
\r
1093 //Filename size is incremented from 20 to 28 to account for context
\r
1094 char file_name[28];
\r
1095 nv_stat_enum_type status;
\r
1097 if ((cmd_ext_ptr->nvcmd->item != NV_SMS_I) && (cmd_ext_ptr->nvcmd->item != NV_SMS_GW_I))
\r
1098 return NV_BADPARM_S;
\r
1100 #ifdef FEATURE_NV_RUIM
\r
1101 if (cmd_ext_ptr->context == 0) {
\r
1102 if ( nvruim_free(cmd_ext_ptr->nvcmd, &status) == NV_RUIM_SUPPORTS_ITEM )
\r
1105 #ifdef FEATURE_DUAL_STANDBY
\r
1107 if ( nvruim_free_ext(cmd_ext_ptr, &status) == NV_RUIM_SUPPORTS_ITEM )
\r
1112 status = NV_DONE_S;
\r
1114 if (cmd_ext_ptr->nvcmd->item >= NV_MAX_I) {
\r
1115 status = NV_BADPARM_S;
\r
1118 switch(cmd_ext_ptr->nvcmd->item) {
\r
1121 if(cmd_ext_ptr->nvcmd->data_ptr->sms.address >= NVI_MAX_SMS_ADDR)
\r
1122 status = NV_BADPARM_S;
\r
1124 //If context is not defined, use the old path
\r
1125 if (cmd_ext_ptr->context == 0)
\r
1126 (void) snprintf(file_name, sizeof(file_name), "/nvm/sms_%05d",
\r
1127 cmd_ext_ptr->nvcmd->data_ptr->sms.address);
\r
1128 else //Else, context is defined, use context for path
\r
1129 (void) snprintf(file_name, sizeof(file_name), "/nvm/context%d/sms_%05d",
\r
1130 cmd_ext_ptr->context,cmd_ext_ptr->nvcmd->data_ptr->sms.address);
\r
1131 efs_unlink(file_name);
\r
1135 if(cmd_ext_ptr->nvcmd->data_ptr->sms_gw.address >= NVI_MAX_SMS_ADDR)
\r
1136 status = NV_BADPARM_S;
\r
1138 //If context is not defined, use the old path
\r
1139 if (cmd_ext_ptr->context == 0)
\r
1140 (void) snprintf(file_name, sizeof(file_name), "/nvm/sms_gw_%05d",
\r
1141 cmd_ext_ptr->nvcmd->data_ptr->sms_gw.address);
\r
1142 else //Else, context is defined, use context for path
\r
1143 (void) snprintf(file_name, sizeof(file_name), "/nvm/context%d/sms_gw_%05d",
\r
1144 cmd_ext_ptr->context,cmd_ext_ptr->nvcmd->data_ptr->sms_gw.address);
\r
1145 efs_unlink(file_name);
\r
1149 status = NV_BADPARM_S;
\r
1153 }/*nvim_remove_item*/
\r
1156 /*===========================================================================
\r
1158 FUNCTION NVIM_REMOVE_ALL
\r
1161 This removes all files under the NVM directory
\r
1167 Status of read operation.
\r
1172 ===========================================================================*/
\r
1174 nv_stat_enum_type
\r
1175 nvim_remove_all ( void )
\r
1177 struct fs_dirent *dirent;
\r
1180 dir = efs_opendir("nvm/sms");
\r
1181 while((dirent = efs_readdir(dir))!= NULL){
\r
1182 efs_unlink( dirent->d_name );
\r
1184 efs_closedir (dir);
\r
1185 efs_rmdir("/nvm/sms");
\r
1187 dir = efs_opendir("nvm/prl");
\r
1188 while((dirent = efs_readdir(dir))!= NULL){
\r
1189 efs_unlink( dirent->d_name );
\r
1191 efs_closedir (dir);
\r
1192 efs_rmdir("/nvm/prl");
\r
1194 dir = efs_opendir("nvm/nvm");
\r
1195 while((dirent = efs_readdir(dir))!= NULL){
\r
1196 efs_unlink( dirent->d_name );
\r
1198 efs_closedir (dir);
\r
1199 efs_rmdir("/nvm/nvm");
\r
1201 dir = efs_opendir("nvm");
\r
1202 while((dirent = efs_readdir(dir))!= NULL){
\r
1203 efs_unlink( dirent->d_name );
\r
1205 efs_closedir (dir);
\r
1208 }/*nvim_remove_all*/
\r
1211 /*===========================================================================
\r
1213 FUNCTION NVIM_MIGRATION_NEEDED
\r
1216 This function will decide if there is a need to unlink the nvm directory
\r
1217 during a transition of older NV services to NV-2
\r
1223 0 if migration is not required
\r
1224 1 if migratuion is required
\r
1229 ===========================================================================*/
\r
1232 nvim_migration_needed(void)
\r
1234 struct fs_stat temp_buf;
\r
1235 /* Make sure that the change to efs_get is made so that it returns
\r
1237 if(efs_stat("nvm/num/0",&temp_buf) == -1)
\r
1244 /*===========================================================================
\r
1249 This function checks the major version number of the the NV task
\r
1250 as stored at edit time, against the major version number of the
\r
1251 NV EEPROM as read from NVM. If the numbers are different then the
\r
1252 function completely rebuilds the NV EEPROM. If the major version
\r
1253 number has not changed then the function checks if the number of
\r
1254 items defined in NVI.H has increased from the internal NVM stored
\r
1255 items count. If so then only those new items are built. Once the
\r
1256 NV EEPROM has been initialized the function updates the stored
\r
1257 major version number to the one contained in NVI.H.
\r
1263 NV_DONE_S if it worked
\r
1264 NV_FAIL_S if the EEPROM access has failed
\r
1267 Rebuilding the NVM takes a significant amount of time, measured in
\r
1268 seconds on serial eeprom devices, if NVM is rebuilt. Startup time
\r
1269 will vary with the type of EEPROM.
\r
1271 ===========================================================================*/
\r
1273 LOCAL nv_stat_enum_type
\r
1276 nv_stat_enum_type status; /* Status to return to caller */
\r
1277 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
1279 if(!nv_cs_init_flag)
\r
1280 nv_access_op_cs_init();
\r
1282 NV_GLOBAL_LOCK_INIT();
\r
1283 if (nvim_migration_needed()) {
\r
1284 status = nvim_remove_all();
\r
1285 if ((status = nvim_build_sec()) == NV_DONE_S) {
\r
1286 status = nvim_clear_crcs();
\r
1290 status = NV_DONE_S;
\r
1293 #ifdef FEATURE_NV_CNV
\r
1294 /* If the file was dropped in as part of a CEFS image, then restore
\r
1298 /* Remove the file since we are done updating the NV items and just
\r
1299 in case the file is left hanging around because of error conditions */
\r
1300 if (efs_unlink (cnv_file) < 0) {
\r
1301 QSR_MSG_HIGH ( 2406613708ULL, "Unable to remove CNV file", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
1305 (void)nverr_init(); /* cannot init err logging until nv is built */
\r
1306 (void)nvim_init_rental_timer(); /* validate the rental timer item */
\r
1307 (void)nvim_init_rental_cnt(); /* validate the rental count item */
\r
1309 #if !defined( FEATURE_NV_RUIM ) || defined( FEATURE_UIM_RUN_TIME_ENABLE )
\r
1310 nvim_init_prl_data(); /* initialize prl state data items */
\r
1311 #endif /* FEATURE_RUIM */
\r
1313 #ifdef FEATURE_DIAG_FS_ACCESS_VALIDATION
\r
1314 nv_register_remote_access_check();
\r
1320 #ifdef FEATURE_MDN_BASED_NAI
\r
1322 /*===========================================================================
\r
1324 FUNCTION NV_BCD_TO_CHAR
\r
1327 Functions to convert MDN (BCD form) into ASCII characters.
\r
1333 Returns the characters for the numeric values between 1 - 9.
\r
1334 Returns 0 for 10, * for 11 and # for 12.
\r
1339 ===========================================================================*/
\r
1340 char nv_bcd_to_char
\r
1342 word num_to_convert
\r
1345 switch(num_to_convert)
\r
1356 return '0' + num_to_convert;
\r
1364 QSR_MSG_ERROR ( 2574375817ULL, "Invalid BCD digit (%d)", num_to_convert, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
1367 } /* nv_bcd_to_char */
\r
1370 /*===========================================================================
\r
1372 FUNCTION NV_NAI_FROM_MDN
\r
1375 Functions form NAI based on given MDN and domain .
\r
1387 ===========================================================================*/
\r
1389 boolean nv_nai_from_mdn
\r
1391 char * nai_to_write,
\r
1392 word * len, // len should be set to MAX_NAI_LENGTH
\r
1393 nv_mob_dir_data_type * mob_dir,
\r
1394 char * domain // must be null terminated
\r
1399 ASSERT (nai_to_write);
\r
1404 if (*len < mob_dir->n_digits + 1)
\r
1406 QSR_MSG_ERROR ( 2878414871ULL, "Output nai buffer too small for MDN",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
1410 for (i = 0; i < mob_dir->n_digits; i++)
\r
1412 nai_to_write[i] = nv_bcd_to_char(mob_dir->digitn[i]);
\r
1413 if (nai_to_write[i] == ' ')
\r
1415 QSR_MSG_ERROR ( 3975514337ULL, "Invalid MDN when converting to NAI",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
1416 return FALSE; // item_to_be_written = FALSE;
\r
1420 nai_to_write[i] = 0;
\r
1422 cpylen = strlen(domain);
\r
1423 if (cpylen > *len - i - 1)
\r
1425 QSR_MSG_ERROR ( 4243638384ULL, "Output nai buffer too small for domain",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
1426 return FALSE; // item_to_be_written = FALSE;
\r
1429 std_strlcat(&(nai_to_write[i]), domain, *len - i - 1);
\r
1430 nai_to_write[i+cpylen] = 0; // NULL terminate
\r
1431 *len = i + cpylen;
\r
1433 } /* nv_nai_from_mdn */
\r
1435 /*===========================================================================
\r
1437 FUNCTION NV_GET_DFLT_MIP_PROFILE
\r
1440 Sets the current profile with the parameters for the default MIP profile.
\r
1451 ===========================================================================*/
\r
1453 LOCAL void nv_get_dflt_mip_profile
\r
1455 nv_ds_mip_gen_user_prof_type * prof
\r
1460 prof->index = MIP_DLFT_PROFILE_NUM;
\r
1461 prof->nai_length = 0;
\r
1463 prof->mn_ha_spi_set = TRUE;
\r
1464 prof->mn_ha_spi = MIP_MD5_SPI;
\r
1465 prof->mn_aaa_spi_set = TRUE;
\r
1466 prof->mn_aaa_spi = MIP_CHAP_SPI;
\r
1467 prof->rev_tun_pref = FALSE;
\r
1468 prof->home_addr = DYNAMIC_HOME_ADDR;
\r
1469 prof->primary_ha_addr = DYNAMIC_HA_ADDR;
\r
1470 prof->secondary_ha_addr = UNSET_HA_ADDR;
\r
1471 } /* nv_get_dflt_mip_profile */
\r
1472 #endif /* FEATURE_MDN_BASED_NAI */
\r
1476 /*===========================================================================
\r
1478 FUNCTION NV_OTASP_COMMIT
\r
1481 This function performs the OTASP "commit" operation, which updates
\r
1482 a number of OTASP-related nv items at once.
\r
1488 NV_DONE_S if it worked
\r
1489 Others Failure for internal call
\r
1494 ===========================================================================*/
\r
1496 LOCAL nv_stat_enum_type
\r
1498 nv_cmd_ext_type *cmd_ext_ptr /* Command block */
\r
1501 nv_cmd_ext_type local_cmd_ext;
\r
1503 #ifdef FEATURE_NV_OTASP
\r
1505 /* Define constants for the switch statement below */
\r
1506 #define NV_COMMIT_DIR_NUM 0
\r
1507 #define NV_COMMIT_IMSI_ADDR 1
\r
1508 #define NV_COMMIT_IMSI_MCC 2
\r
1509 #define NV_COMMIT_IMSI_11_12 3
\r
1510 #define NV_COMMIT_MIN1 4
\r
1511 #define NV_COMMIT_MIN2 5
\r
1512 #define NV_COMMIT_ACCOLC 6
\r
1513 #define NV_COMMIT_MOB_HOME 7
\r
1514 #define NV_COMMIT_MOB_SID 8
\r
1515 #define NV_COMMIT_MOB_NID 9
\r
1516 #define NV_COMMIT_SID_NID 10
\r
1517 #define NV_COMMIT_FIRSTCHP 11
\r
1518 #define NV_COMMIT_HOME_SID 12
\r
1519 #define NV_COMMIT_ROAM_LIST 13
\r
1520 #define NV_COMMIT_SPC 14
\r
1521 #define NV_COMMIT_IMSI_T_S1 15
\r
1522 #define NV_COMMIT_IMSI_T_S2 16
\r
1523 #define NV_COMMIT_IMSI_T_11_12 17
\r
1524 #define NV_COMMIT_IMSI_T_MCC 18
\r
1525 #define NV_COMMIT_IMSI_T_ADDR_NUM 19
\r
1526 #define NV_COMMIT_NAM_LOCK 20
\r
1527 #define NV_COMMIT_PRIMARY_MIP_NAI_AFTER_MDN 21
\r
1528 #define NV_COMMIT_PRIMARY_SIP_NAI_AFTER_MDN 22
\r
1529 #define NV_COMMIT_AN_NAI_AFTER_MDN 23
\r
1531 #define NV_COMMIT_DONE 255
\r
1533 boolean item_to_be_written; /* Flag controls whether write occurs */
\r
1534 byte i, commit_state=0; /* Index variables */
\r
1536 #ifdef FEATURE_MDN_BASED_NAI
\r
1538 /* use the largest of the source nai fields (MIP, SIP, AN) */
\r
1539 #define MAX_NAI_LENGTH NV_MAX_PPP_USER_ID_LENGTH
\r
1541 char nai_to_write[MAX_NAI_LENGTH]; // max for MIP, check SIP
\r
1542 char domain[MAX_NAI_LENGTH + 1];
\r
1543 char * domain_ptr;
\r
1545 #endif /* FEATURE_MDN_BASED_NAI */
\r
1547 QSR_MSG_HIGH ( 771664511ULL, "NV Starting OTASP commit", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
1549 /* Raise NV task priority for OTASP commit operation (and save */
\r
1550 /* original priority so it can be restored at end of commit) */
\r
1552 QSR_MSG_HIGH ( 3779412989ULL, "NV Priority raised for OTASP", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
1553 /* Set up generic command buffer parameters */
\r
1554 local_cmd.cmd = NV_WRITE_F;
\r
1555 local_cmd.tcb_ptr = NULL;
\r
1556 local_cmd.sigs = 0;
\r
1557 local_cmd.done_q_ptr = NULL;
\r
1558 local_cmd.data_ptr = &local_item;
\r
1559 local_cmd.status = NV_DONE_S;
\r
1561 while (commit_state != NV_COMMIT_DONE) {
\r
1563 item_to_be_written = FALSE;
\r
1564 switch (commit_state) {
\r
1566 case NV_COMMIT_DIR_NUM:
\r
1568 /* Read control flag to determine if item should be written */
\r
1569 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_mob_dir) {
\r
1571 /* Write NV_DIR_NUMBER_PCS_I */
\r
1572 item_to_be_written = TRUE;
\r
1573 local_item.mob_dir_number.nam =
\r
1574 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1575 local_item.mob_dir_number.n_digits =
\r
1576 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->mob_dir.n_digits;
\r
1577 for (i=0; i < NV_DIR_NUMB_PCS_SIZ; ++i) {
\r
1578 local_item.mob_dir_number.digitn[i] =
\r
1579 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->mob_dir.digitn[i];
\r
1581 local_cmd.item = NV_DIR_NUMBER_PCS_I;
\r
1584 /* Set next state */
\r
1585 #ifdef FEATURE_MDN_BASED_NAI
\r
1586 if (item_to_be_written)
\r
1588 commit_state = NV_COMMIT_PRIMARY_MIP_NAI_AFTER_MDN;
\r
1591 #endif /* FEATURE_MDN_BASED_NAI */
\r
1592 commit_state = NV_COMMIT_IMSI_ADDR;
\r
1595 case NV_COMMIT_IMSI_ADDR:
\r
1597 /* Read control flag to determine if items should be written */
\r
1598 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_ftc_cdma) {
\r
1600 /* Write NV_IMSI_ADDR_NUM_I */
\r
1601 item_to_be_written = TRUE;
\r
1602 local_item.imsi_addr_num.nam =
\r
1603 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1604 local_item.imsi_addr_num.num =
\r
1605 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.imsi_addr_num;
\r
1606 local_cmd.item = NV_IMSI_ADDR_NUM_I;
\r
1607 /* Set commit_state to write the additional items of this group */
\r
1608 commit_state = NV_COMMIT_IMSI_MCC;
\r
1611 /* Control flag indicates no items from this group should */
\r
1612 /* be written, so set commit_state to bypass them all */
\r
1613 commit_state = NV_COMMIT_FIRSTCHP;
\r
1617 case NV_COMMIT_IMSI_MCC:
\r
1619 /* Write NV_IMSI_MCC_I */
\r
1620 item_to_be_written = TRUE;
\r
1621 local_item.imsi_mcc.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1622 local_item.imsi_mcc.imsi_mcc =
\r
1623 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.mcc;
\r
1624 local_cmd.item = NV_IMSI_MCC_I;
\r
1625 /* Set commit_state to write the next item of this group */
\r
1629 case NV_COMMIT_IMSI_11_12:
\r
1631 /* Write NV_IMSI_11_12_I */
\r
1632 item_to_be_written = TRUE;
\r
1633 local_item.imsi_11_12.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1634 local_item.imsi_11_12.imsi_11_12 =
\r
1635 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.imsi_11_12;
\r
1636 local_cmd.item = NV_IMSI_11_12_I;
\r
1637 /* Set commit_state to write the next item of this group */
\r
1641 case NV_COMMIT_MIN1:
\r
1643 /* Write NV_MIN1_I */
\r
1644 item_to_be_written = TRUE;
\r
1645 local_item.min1.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1646 local_item.min1.min1[NV_CDMA_MIN_INDEX] =
\r
1647 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.imsi_s1;
\r
1648 /* Set both the CDMA min and the analog min to this same value */
\r
1649 local_item.min1.min1[NV_ANALOG_MIN_INDEX] =
\r
1650 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.imsi_s1;
\r
1651 local_cmd.item = NV_MIN1_I;
\r
1652 /* Set commit_state to write the next item of this group */
\r
1656 case NV_COMMIT_MIN2:
\r
1658 /* Write NV_MIN2_I */
\r
1659 item_to_be_written = TRUE;
\r
1660 local_item.min2.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1661 local_item.min2.min2[NV_CDMA_MIN_INDEX] =
\r
1662 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.imsi_s2;
\r
1663 /* Set both the CDMA min and the analog min to this same value */
\r
1664 local_item.min2.min2[NV_ANALOG_MIN_INDEX] =
\r
1665 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.imsi_s2;
\r
1666 local_cmd.item = NV_MIN2_I;
\r
1667 /* Set commit_state to write the next item of this group */
\r
1671 case NV_COMMIT_ACCOLC:
\r
1673 /* Write NV_ACCOLC_I */
\r
1674 item_to_be_written = TRUE;
\r
1675 local_item.accolc.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1676 local_item.accolc.ACCOLCpClass[NV_CDMA_MIN_INDEX] =
\r
1677 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.accolc;
\r
1678 local_cmd.item = NV_ACCOLC_I;
\r
1679 /* Set commit_state to write the next item of this group */
\r
1683 case NV_COMMIT_MOB_HOME:
\r
1685 /* Write NV_MOB_TERM_HOME_I */
\r
1686 item_to_be_written = TRUE;
\r
1687 local_item.mob_term_home.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1688 local_item.mob_term_home.enabled[NV_CDMA_MIN_INDEX] =
\r
1689 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.mob_term_home;
\r
1690 local_cmd.item = NV_MOB_TERM_HOME_I;
\r
1691 /* Set commit_state to write the next item of this group */
\r
1695 case NV_COMMIT_MOB_SID:
\r
1697 /* Write NV_MOB_TERM_FOR_SID_I */
\r
1698 item_to_be_written = TRUE;
\r
1699 local_item.mob_term_for_sid.nam =
\r
1700 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1701 local_item.mob_term_for_sid.enabled[NV_CDMA_MIN_INDEX] =
\r
1702 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.mob_term_for_sid;
\r
1703 local_cmd.item = NV_MOB_TERM_FOR_SID_I;
\r
1704 /* Set commit_state to write the next item of this group */
\r
1708 case NV_COMMIT_MOB_NID:
\r
1710 /* Write NV_MOB_TERM_FOR_NID_I */
\r
1711 item_to_be_written = TRUE;
\r
1712 local_item.mob_term_for_nid.nam =
\r
1713 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1714 local_item.mob_term_for_nid.enabled[NV_CDMA_MIN_INDEX] =
\r
1715 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.mob_term_for_nid;
\r
1716 local_cmd.item = NV_MOB_TERM_FOR_NID_I;
\r
1717 /* Set commit_state to write the next item of this group */
\r
1721 case NV_COMMIT_SID_NID:
\r
1723 /* Write NV_SID_NID_I */
\r
1724 item_to_be_written = TRUE;
\r
1725 /* All the targets which have SSPR Enhancements use NV item HOME SID-NID */
\r
1726 #if (defined (NV_FEATURE_SSPR_ENHANCEMENTS) || defined (NV_FEATURE_TRIMODE_ITEMS))
\r
1727 local_item.home_sid_nid.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1728 for(i=0;i<NV_MAX_HOME_SID_NID;i++)
\r
1730 local_item.home_sid_nid.pair[i].sid =
\r
1731 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.pair[i].sid;
\r
1732 local_item.home_sid_nid.pair[i].nid =
\r
1733 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.pair[i].nid;
\r
1735 local_cmd.item = NV_HOME_SID_NID_I;
\r
1737 local_item.sid_nid.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1738 for(i=0;i<NV_MAX_SID_NID;i++)
\r
1740 local_item.sid_nid.pair[NV_CDMA_MIN_INDEX][i].sid =
\r
1741 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.pair[i].sid;
\r
1742 local_item.sid_nid.pair[NV_CDMA_MIN_INDEX][i].nid =
\r
1743 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_cdma.pair[i].nid;
\r
1745 local_cmd.item = NV_SID_NID_I;
\r
1747 /* Set next state */
\r
1748 commit_state = NV_COMMIT_FIRSTCHP;
\r
1751 case NV_COMMIT_FIRSTCHP:
\r
1753 /* Read control flag to determine if items should be written */
\r
1754 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_ftc_amps) {
\r
1756 /* Write NV_ANALOG_FIRSTCHP_I */
\r
1757 item_to_be_written = TRUE;
\r
1758 local_item.analog_firstchp.nam =
\r
1759 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1760 local_item.analog_firstchp.channel =
\r
1761 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_amps.firstchp;
\r
1762 local_cmd.item = NV_ANALOG_FIRSTCHP_I;
\r
1763 /* Set commit_state to write the next item of this group */
\r
1764 commit_state = NV_COMMIT_HOME_SID;
\r
1767 /* Control flag indicates no items from this group should */
\r
1768 /* be written, so set commit_state to bypass them all */
\r
1769 commit_state = NV_COMMIT_SPC;
\r
1773 case NV_COMMIT_HOME_SID:
\r
1775 /* Write NV_ANALOG_HOME_SID_I */
\r
1776 item_to_be_written = TRUE;
\r
1777 local_item.analog_home_sid.nam =
\r
1778 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1779 local_item.analog_home_sid.sid =
\r
1780 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->ftc_amps.home_sid;
\r
1781 local_cmd.item = NV_ANALOG_HOME_SID_I;
\r
1782 /* Set next state */
\r
1783 commit_state = NV_COMMIT_SPC;
\r
1786 case NV_COMMIT_SPC:
\r
1788 /* Read control flag to determine if item should be written */
\r
1789 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_spc) {
\r
1791 /* Write NV_SEC_CODE_I */
\r
1792 item_to_be_written = TRUE;
\r
1793 local_item.sec_code = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->spc;
\r
1794 local_cmd.item = NV_SEC_CODE_I;
\r
1796 /* Set next state */
\r
1797 commit_state = NV_COMMIT_IMSI_T_S1;
\r
1800 case NV_COMMIT_IMSI_T_S1:
\r
1802 /* Read control flag to determine if items should be written */
\r
1803 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_imsi_t) {
\r
1805 /* Write NV_IMSI_T_S1 */
\r
1806 item_to_be_written = TRUE;
\r
1807 local_item.imsi_t_s1.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1808 local_item.imsi_t_s1.min1[NV_CDMA_MIN_INDEX] =
\r
1809 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->imsi_t.s1;
\r
1810 local_cmd.item = NV_IMSI_T_S1_I;
\r
1811 /* Set commit_state to write the next item of this group */
\r
1816 /* Control flag indicates no items from this group should */
\r
1817 /* be written, so set commit_state to bypass them all */
\r
1818 commit_state = NV_COMMIT_ROAM_LIST;
\r
1822 case NV_COMMIT_IMSI_T_S2:
\r
1824 /* Write NV_IMSI_T_S2_I */
\r
1825 item_to_be_written = TRUE;
\r
1826 local_item.imsi_t_s2.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1827 local_item.imsi_t_s2.min2[NV_CDMA_MIN_INDEX] =
\r
1828 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->imsi_t.s2;
\r
1829 local_cmd.item = NV_IMSI_T_S2_I;
\r
1830 /* Set commit_state to write the next item of this group */
\r
1834 case NV_COMMIT_IMSI_T_11_12:
\r
1836 /* Write NV_IMSI_T_11_12_I */
\r
1837 item_to_be_written = TRUE;
\r
1838 local_item.imsi_t_11_12.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1839 local_item.imsi_t_11_12.imsi_11_12 =
\r
1840 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->imsi_t.imsi_t_11_12;
\r
1841 local_cmd.item = NV_IMSI_T_11_12_I;
\r
1842 /* Set commit_state to write the next item of this group */
\r
1846 case NV_COMMIT_IMSI_T_MCC:
\r
1848 /* Write NV_IMSI_T_MCC_I */
\r
1849 item_to_be_written = TRUE;
\r
1850 local_item.imsi_t_mcc.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1851 local_item.imsi_t_mcc.imsi_mcc =
\r
1852 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->imsi_t.mcc;
\r
1853 local_cmd.item = NV_IMSI_T_MCC_I;
\r
1854 /* Set commit_state to write the next item of this group */
\r
1858 case NV_COMMIT_IMSI_T_ADDR_NUM:
\r
1860 /* Write NV_IMSI_T_MCC_I */
\r
1861 item_to_be_written = TRUE;
\r
1862 local_item.imsi_t_addr_num.nam =
\r
1863 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1864 local_item.imsi_t_addr_num.num =
\r
1865 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->imsi_t.addr_num;
\r
1866 local_cmd.item = NV_IMSI_T_ADDR_NUM_I;
\r
1867 /* Set next state */
\r
1868 commit_state = NV_COMMIT_ROAM_LIST;
\r
1871 case NV_COMMIT_ROAM_LIST:
\r
1873 /* Commit to the Roaming List MUST be the last commit to be performed */
\r
1874 /* This is, because the local_cmd.data_ptr gets assigned to pointer to */
\r
1875 /* nv_pr_list during this sequence of operations. If one must add any */
\r
1876 /* other NV item in the commit switch after Roaming List at all, then */
\r
1877 /* (s)he should make sure to reassign this to local_item */
\r
1879 /* Read control flag to determine if item should be written */
\r
1880 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_roam_list) {
\r
1882 /* Write NV_ROAMING_LIST_I */
\r
1883 item_to_be_written = TRUE;
\r
1884 local_cmd.data_ptr = (nv_item_type *)&nv_pr_list;
\r
1885 #ifdef NV_FEATURE_IS683A_PRL
\r
1886 local_cmd.item = NV_ROAMING_LIST_683_I;
\r
1888 local_cmd.item = NV_ROAMING_LIST_I;
\r
1891 /* Set next state */
\r
1892 commit_state = NV_COMMIT_NAM_LOCK;
\r
1895 case NV_COMMIT_NAM_LOCK:
\r
1896 /* Read control flag to determine if items should be written */
\r
1897 if (cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->commit_nam_lock)
\r
1899 #ifdef FEATURE_OTASP_OTAPA
\r
1900 /* Write NV_NAM_LOCK_I */
\r
1901 item_to_be_written = TRUE;
\r
1902 local_item.nam_lock.nam = cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam;
\r
1903 local_item.nam_lock.enabled =
\r
1904 cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->nam_lock.enabled;
\r
1905 local_cmd.item = NV_NAM_LOCK_I;
\r
1907 ERR("Attempted to write NV_NAM_LOCK_I when FEATURE_OTASP_OTAPA not on",
\r
1911 /* Set commit_state to signify we've finished committing */
\r
1912 commit_state = NV_COMMIT_DONE;
\r
1916 #ifdef FEATURE_MDN_BASED_NAI
\r
1917 case NV_COMMIT_PRIMARY_MIP_NAI_AFTER_MDN:
\r
1919 /*-------------------------------------------------------------------
\r
1920 Note: this defaults to read/write profile at index 0.
\r
1921 Customer should use whichever index they assign
\r
1922 to the active MIP profile.
\r
1923 -------------------------------------------------------------------*/
\r
1924 local_item.ds_mip_gen_user_prof.index = MIP_DLFT_PROFILE_NUM;
\r
1925 local_cmd.cmd = NV_READ_F;
\r
1926 local_cmd.item = NV_DS_MIP_GEN_USER_PROF_I;
\r
1928 local_cmd_ext.nvcmd = &local_cmd;
\r
1929 local_cmd_ext.context = 0; /* No context is defined */
\r
1931 local_cmd.status = nvio_read(&local_cmd_ext);
\r
1932 if (local_cmd.status == NV_NOTACTIVE_S)
\r
1934 nv_get_dflt_mip_profile( &(local_item.ds_mip_gen_user_prof) );
\r
1936 else if (local_cmd.status != NV_DONE_S)
\r
1938 QSR_MSG_ERROR ( 1094358265ULL, "Error %d reading NV",local_cmd.status,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
1939 commit_state = NV_COMMIT_PRIMARY_SIP_NAI_AFTER_MDN;
\r
1943 if(local_item.ds_mip_gen_user_prof.nai_length < NV_MAX_NAI_LENGTH)
\r
1944 local_item.ds_mip_gen_user_prof.nai[
\r
1945 local_item.ds_mip_gen_user_prof.nai_length] = 0;
\r
1947 std_strchr( (char*) local_item.ds_mip_gen_user_prof.nai, '@' );
\r
1948 if (domain_ptr == NULL)
\r
1950 QSR_MSG_HIGH( 437141575ULL, "Using default domain",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
1951 domain_ptr = PS_NAI_DFLT_DOMAIN;
\r
1953 std_strlcpy(domain,domain_ptr,NV_MAX_NAI_LENGTH);
\r
1954 domain[NV_MAX_NAI_LENGTH] = 0; // NULL terminate
\r
1956 nai_length = NV_MAX_NAI_LENGTH; // max bytes to write
\r
1957 if( !nv_nai_from_mdn( nai_to_write,
\r
1959 &(cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->mob_dir),
\r
1962 ERR("Couldn't convert MDN and domain to NAI!",0,0,0);
\r
1963 commit_state = NV_COMMIT_PRIMARY_SIP_NAI_AFTER_MDN;
\r
1967 item_to_be_written = TRUE;
\r
1968 local_cmd.cmd = NV_WRITE_F;
\r
1969 local_item.ds_mip_gen_user_prof.nai_length = nai_length;
\r
1970 memcpy( (char*) local_item.ds_mip_gen_user_prof.nai,
\r
1973 commit_state = NV_COMMIT_PRIMARY_SIP_NAI_AFTER_MDN;
\r
1976 case NV_COMMIT_PRIMARY_SIP_NAI_AFTER_MDN:
\r
1978 local_cmd.cmd = NV_READ_F;
\r
1979 local_cmd.item = NV_PPP_USER_ID_I;
\r
1981 local_cmd_ext.nvcmd = &local_cmd;
\r
1982 local_cmd_ext.context = 0; /* No context is defined */
\r
1984 local_cmd.status = nvio_read(&local_cmd_ext);
\r
1985 if (local_cmd.status == NV_NOTACTIVE_S)
\r
1987 local_item.ppp_user_id.user_id_len = 0;
\r
1989 else if (local_cmd.status != NV_DONE_S)
\r
1991 QSR_MSG_ERROR ( 1094358265ULL, "Error %d reading NV",local_cmd.status,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
1992 commit_state = NV_COMMIT_AN_NAI_AFTER_MDN;
\r
1996 // copy the old domain from the user profile, or the default domain
\r
1997 local_item.ppp_user_id.user_id[local_item.ppp_user_id.user_id_len] = 0;
\r
1998 domain_ptr = std_strchr( (char*) local_item.ppp_user_id.user_id, '@' );
\r
1999 if (domain_ptr == NULL)
\r
2001 QSR_MSG_HIGH( 1009080534ULL, "Using default domain for SIP nai",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
2002 domain_ptr = PS_NAI_DFLT_DOMAIN;
\r
2004 std_strlcpy(domain,domain_ptr,NV_MAX_PPP_USER_ID_LENGTH);
\r
2005 domain[NV_MAX_PPP_USER_ID_LENGTH] = 0; // NULL terminate
\r
2007 nai_length = NV_MAX_PPP_USER_ID_LENGTH; // max bytes to write
\r
2008 if( !nv_nai_from_mdn( nai_to_write,
\r
2010 &(cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->mob_dir),
\r
2013 ERR("Couldn't convert MDN and domain to NAI!",0,0,0);
\r
2014 commit_state = NV_COMMIT_AN_NAI_AFTER_MDN;
\r
2018 item_to_be_written = TRUE;
\r
2019 local_cmd.cmd = NV_WRITE_F;
\r
2020 local_cmd.item = NV_PPP_USER_ID_I;
\r
2021 local_item.ppp_user_id.user_id_len = nai_length;
\r
2022 memcpy( (char*) local_item.ppp_user_id.user_id,
\r
2025 commit_state = NV_COMMIT_AN_NAI_AFTER_MDN;
\r
2028 case NV_COMMIT_AN_NAI_AFTER_MDN:
\r
2030 local_cmd.cmd = NV_READ_F;
\r
2031 local_cmd.item = NV_HDR_AN_AUTH_USER_ID_LONG_I;
\r
2033 local_cmd_ext.nvcmd = &local_cmd;
\r
2034 local_cmd_ext.context = 0; /* No context is defined */
\r
2036 local_cmd.status = nvio_read(&local_cmd_ext);
\r
2037 if (local_cmd.status == NV_NOTACTIVE_S)
\r
2039 local_item.hdr_an_ppp_user_id.user_id_len = 0;
\r
2041 else if (local_cmd.status != NV_DONE_S)
\r
2043 QSR_MSG_ERROR ( 1094358265ULL, "Error %d reading NV",local_cmd.status,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
2044 commit_state = NV_COMMIT_IMSI_ADDR;
\r
2048 // copy the old domain from the user profile, or the default domain
\r
2049 local_item.hdr_an_ppp_user_id.user_id[
\r
2050 local_item.hdr_an_ppp_user_id.user_id_len] = 0;
\r
2052 std_strchr( (char*) local_item.hdr_an_ppp_user_id.user_id, '@' );
\r
2053 if (domain_ptr == NULL)
\r
2055 QSR_MSG_HIGH( 4198565724ULL, "Using default domain for AN nai",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
2056 domain_ptr = PS_NAI_DFLT_DOMAIN;
\r
2058 std_strlcpy(domain,domain_ptr,NV_MAX_AN_PPP_USER_ID_LENGTH);
\r
2059 domain[NV_MAX_AN_PPP_USER_ID_LENGTH] = 0; // NULL terminate
\r
2061 nai_length = NV_MAX_AN_PPP_USER_ID_LENGTH; // max bytes to write
\r
2062 if( !nv_nai_from_mdn( nai_to_write,
\r
2064 &(cmd_ext_ptr->nvcmd->data_ptr->otasp_commit->mob_dir),
\r
2067 ERR("Couldn't convert MDN and domain to NAI!",0,0,0);
\r
2068 commit_state = NV_COMMIT_IMSI_ADDR;
\r
2072 item_to_be_written = TRUE;
\r
2073 local_cmd.cmd = NV_WRITE_F;
\r
2074 local_cmd.item = NV_HDR_AN_AUTH_USER_ID_LONG_I;
\r
2075 local_item.hdr_an_ppp_user_id.user_id_len = nai_length;
\r
2076 memcpy( (char*) local_item.hdr_an_ppp_user_id.user_id,
\r
2079 commit_state = NV_COMMIT_IMSI_ADDR;
\r
2081 #endif /* FEATURE_MDN_BASED_NAI */
\r
2085 /* Restore original NV task priority before returning */
\r
2087 QSR_MSG_HIGH ( 3773457423ULL, "NV Priority Returned to NORMAL", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2088 return(cmd_ext_ptr->nvcmd->status = NV_BADCMD_S);
\r
2092 if (item_to_be_written == TRUE) {
\r
2093 local_cmd_ext.nvcmd = &local_cmd;
\r
2094 local_cmd_ext.context = 0; /* No context is defined */
\r
2096 local_cmd.status = nvio_write(&local_cmd_ext);
\r
2098 if (local_cmd.status != NV_DONE_S) {
\r
2099 /* Restore original NV task priority before returning */
\r
2101 QSR_MSG_HIGH ( 3773457423ULL, "NV Priority Returned to NORMAL", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2102 return (local_cmd.status);
\r
2106 /* Reset data_ptr for next item */
\r
2107 local_cmd.data_ptr = &local_item;
\r
2110 /* Restore original NV task priority before returning */
\r
2112 QSR_MSG_HIGH ( 3773457423ULL, "NV Priority Returned to NORMAL", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2113 return (local_cmd.status);
\r
2116 return NV_BADTG_S;
\r
2118 #endif /* FEATURE_NV_OTASP */
\r
2119 } /* nv_otasp_commit */
\r
2122 /*===========================================================================
\r
2124 FUNCTION NV_PRL_IS_VALID
\r
2127 This function returns the "valid" indicator from the specified NAM's
\r
2134 TRUE if the roaming list "valid" field is TRUE
\r
2135 FALSE if the roaming list "valid" field is FALSE or if the
\r
2136 specified NAM is invalid or if the roaming list
\r
2137 is currently NOT_ACTIVE
\r
2142 ===========================================================================*/
\r
2144 boolean nv_prl_is_valid
\r
2146 byte nam /* Which NAM the request is for */
\r
2149 /* Check for illegal NAM */
\r
2150 if (nam >= NV_MAX_NAMS) return FALSE;
\r
2152 /* Note that valid field is set FALSE if prl is NOT_ACTIVE */
\r
2153 return nv_prl_valid_data[nam];
\r
2157 /*===========================================================================
\r
2159 FUNCTION NV_PRL_VERSION
\r
2162 This function returns the "prl_version" indicator from the specified NAM's
\r
2169 prl_version if the roaming list for the specified NAM is
\r
2171 NV_PRL_VERSION_INVALID if the specified NAM is invalid or if the
\r
2172 roaming list for the specified NAM is
\r
2173 currently NOT_ACTIVE
\r
2178 ===========================================================================*/
\r
2180 word nv_prl_version
\r
2182 byte nam /* Which NAM the request is for */
\r
2185 /* Check for illegal NAM */
\r
2186 if (nam >= NV_MAX_NAMS) return NV_PRL_VERSION_INVALID;
\r
2188 /* Note that prl_version field is set to NV_PRL_VERSION_INVALID if */
\r
2189 /* the roaming list is NOT_ACTIVE */
\r
2190 return nv_prl_version_data[nam];
\r
2194 /*===========================================================================
\r
2196 FUNCTION NVIMNV_TASK_START
\r
2199 This function performs NV task initialization. The function
\r
2200 first sets the acknowledge signal back to MC to acknowledge that it has
\r
2201 been created. It then waits for the start signal back to it. While
\r
2202 waiting for the start signal and keeps kicking the watchdog timer
\r
2203 everytime its interval timer has expired. When it gets the start
\r
2204 signal it then performs file initialization.
\r
2205 Once initialization completes, it then acknowledges it back to MC
\r
2206 and returns to the caller.
\r
2215 The calling task stays here until it receives the START signal.
\r
2217 ===========================================================================*/
\r
2219 static void nvimnv_task_start
\r
2221 rex_sigs_type rpt_sig, /* report timer signal for task */
\r
2222 dog_report_type dog_rpt, /* Watchdog report for the task */
\r
2223 rex_timer_type *rpt_timer_ptr /* pointer to report timer */
\r
2227 rex_sigs_type sigs; /* Signals returned by rex_timed_wait. */
\r
2229 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2231 /* Acknowledge task creation. */
\r
2233 (void) rex_set_sigs(&tmc_tcb, TMC_ACK_SIG);
\r
2235 /* Continue to set watchdog timer while waiting for start signal from MC. */
\r
2239 /* Set a timed wait for OR of signals and a watchdog report timer. */
\r
2241 sigs = rex_timed_wait(TASK_START_SIG | rpt_sig, rpt_timer_ptr, DOG_MC_RPT_TIME);
\r
2243 /* If start signal is set then perform file initialization and
\r
2244 signal back to MC. */
\r
2246 if ((sigs & TASK_START_SIG) != 0)
\r
2248 (void) rex_clr_sigs(&nv_tcb, TASK_START_SIG);
\r
2250 /* Initialize the EFS files. */
\r
2251 if (nv_init() != NV_DONE_S)
\r
2253 ERR_FATAL("Failed NVIM EFS initialization", 0, 0, 0);
\r
2256 QSR_MSG_MED( 1502779829ULL, "NVIM initialization successfull", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2257 nvi_initialized = TRUE;
\r
2261 /* Signal back to TMC acknowledgement. */
\r
2262 (void) rex_set_sigs(&tmc_tcb, TMC_ACK_SIG);
\r
2265 /* Otherwise timer has expired. Kick the watchdog and loop. */
\r
2268 (void) rex_clr_sigs(&nv_tcb, rpt_sig);
\r
2269 dog_report(dog_rpt);
\r
2272 } /* nvimnv_task_start */
\r
2275 /*===========================================================================
\r
2277 FUNCTION NV_FRONT_OP
\r
2280 This is the function called by both nv_cmd and nv_task. This is required
\r
2281 in order to use kxmutexes for both synchronous and asynchronous accesses via
\r
2285 The NV task must have been started up already. All of the items in
\r
2286 the nv_cmd_block must be already set.
\r
2289 None directly. The status variable of the nv_cmd_type will be updated
\r
2290 to reflect the current status of this command as it is processed.
\r
2293 The nv_cmd_type is placed on the NV command queue. It must not be
\r
2294 modified until the command has been processed.
\r
2296 ===========================================================================*/
\r
2300 nv_cmd_ext_type *cmd_ext_ptr /* Pointer to NV command buffer */
\r
2303 nv_cmd_type *cmd_ptr = cmd_ext_ptr->nvcmd;
\r
2304 uint16 context = cmd_ext_ptr->context;
\r
2306 if (context > MAX_NV_CONTEXT) {
\r
2307 cmd_ptr->status = NV_FAIL_S;
\r
2308 QSR_MSG_HIGH( 3451605573ULL, "NV context out of bounds", 0, 0, 0); //auto-gen, to change remove 'QSR_' and first param
\r
2312 (void)KxMutex_Lock(&nv_access_op_cs);
\r
2314 switch (cmd_ptr->cmd) {
\r
2316 cmd_ptr->status = nvio_read(cmd_ext_ptr);
\r
2320 cmd_ptr->status = nvio_write(cmd_ext_ptr);
\r
2324 cmd_ptr->status = NV_FAIL_S;
\r
2328 cmd_ptr->status = NV_FAIL_S;
\r
2332 cmd_ptr->status = nvim_remove_item(cmd_ext_ptr);
\r
2335 case NV_CHKPNT_ENA_F:
\r
2338 case NV_CHKPNT_DIS_F:
\r
2341 case NV_OTASP_COMMIT_F:
\r
2342 cmd_ptr->status = nv_otasp_commit(cmd_ext_ptr);
\r
2345 case NV_REPLACE_F:
\r
2346 cmd_ptr->status = nvio_write(cmd_ext_ptr);
\r
2349 case NV_INCREMENT_F:
\r
2350 cmd_ptr->status = nvim_increment(cmd_ext_ptr);
\r
2353 #ifdef FEATURE_UIM_RUN_TIME_ENABLE
\r
2354 case NV_RTRE_OP_CONFIG_F:
\r
2355 /* The function nvruim_process_rtre_configuration doesnot have any
\r
2356 dependency on context. However creating new function to take input
\r
2357 parameter cmd_ext_ptr */
\r
2358 cmd_ptr->status =
\r
2359 (nv_stat_enum_type)nvruim_process_rtre_configuration(cmd_ext_ptr->nvcmd,
\r
2360 &nv_rtre_control_value,
\r
2361 &nv_rtre_polling_control_value);
\r
2366 cmd_ptr->status = NV_BADCMD_S;
\r
2371 (void)KxMutex_Unlock(&nv_access_op_cs);
\r
2374 /* Free memory allocated for cmd_ext_ptr */
\r
2375 free(cmd_ext_ptr);
\r
2377 } /* nv_front_op_ext */
\r
2380 /*===========================================================================
\r
2385 This is the NV task, created via rex_def_task from the Main Control task.
\r
2386 The NV task sets MC_ACK_SIG when it is done with initialization and it
\r
2387 then waits for NV_START_SIG before starting its normal operations. The
\r
2388 NV task then enters a main loop, awaiting for commands received on its
\r
2389 input queue. Each command received is processed and the loop continues.
\r
2390 While in the main loop the task kicks the watchdog periodically.
\r
2392 *MODIFIED to handle new parameter nv_cmd_ext_type
\r
2403 ===========================================================================*/
\r
2407 dword parm /* from REX - ignored */
\r
2410 nv_cmd_ext_type *cmd_ext_ptr; /* Pointer to command received on nv_cmd_q */
\r
2411 nv_cmd_type *cmd_ptr;
\r
2412 rex_sigs_type rex_sigs; /* REX signals word */
\r
2413 rex_tcb_type *task_ptr; /* Task to signal back on request completion. */
\r
2414 rex_sigs_type task_sigs; /* Signals to set back to requesting task */
\r
2416 /*-------------------------------------------------------------------------*/
\r
2418 /* Keep Lint happy */
\r
2424 QSR_MSG_MED( 3850502563ULL, "NV task created", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2426 /* Initialize the watchdog report timer and NV write timer. */
\r
2428 rex_def_timer(&nv_rpt_timer, &nv_tcb, NV_RPT_TIMER_SIG);
\r
2430 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2432 /* Initialize the NV command queue. */
\r
2433 (void) q_init(&nv_cmd_q);
\r
2435 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2438 /* Wait for start signal. */
\r
2440 nvimnv_task_start (NV_RPT_TIMER_SIG, DOG_NV_RPT, &nv_rpt_timer);
\r
2443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2444 /* Kick the wathcdog and start task operations. */
\r
2448 /* signal nv err log operations to queue writes to nv */
\r
2449 nvi_task_running = TRUE;
\r
2451 for (;;) { /* while (TRUE) and Lint happy */
\r
2453 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2455 /* Set REX wait with mask of all possible input signals. */
\r
2457 rex_sigs = rex_wait( NV_RPT_TIMER_SIG /* Watchdog timer elapsed */
\r
2458 | NV_CMD_Q_SIG /* Input of command queue */
\r
2459 | NV_ERR_LOG_SIG /* Process the nverr record */
\r
2460 | TASK_STOP_SIG /* Stop the NV task */
\r
2461 | TASK_OFFLINE_SIG); /* Go offline */
\r
2463 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2465 /* Kick watchdog and start the watchdog report timer. */
\r
2466 /* Note that the watchdog is kicked after every wakeup, */
\r
2467 /* following input of any signal to the NV task. */
\r
2472 /*-------------------------------------------------------------------------*/
\r
2474 /* COMMAND QUEUE SIGNAL */
\r
2476 /*-------------------------------------------------------------------------*/
\r
2478 if ((rex_sigs & NV_RPT_TIMER_SIG) != 0) {
\r
2479 QSR_MSG_LOW( 252695986ULL, "NV_RPT_TIMER_SIG received", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2480 /* write out any old ERR() if required */
\r
2481 nverr_update_log();
\r
2484 if ((rex_sigs & NV_ERR_LOG_SIG) != 0) {
\r
2485 QSR_MSG_LOW( 180449550ULL, "NV_ERR_LOG_SIG received", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2486 (void) rex_clr_sigs(&nv_tcb, NV_ERR_LOG_SIG);
\r
2487 /* write out any old ERR() if required */
\r
2488 nverr_update_log();
\r
2490 /* Check if command queue signal was set. */
\r
2491 /* If set then clear signal and proceeed. */
\r
2493 if ((rex_sigs & NV_CMD_Q_SIG) != 0) {
\r
2494 QSR_MSG_LOW( 3275661280ULL, "NV_CMD_Q_SIG received", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2495 (void) rex_clr_sigs(&nv_tcb, NV_CMD_Q_SIG);
\r
2497 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2498 /* Enter a loop where the command queue is checked and */
\r
2499 while ((cmd_ext_ptr = (nv_cmd_ext_type *) q_get(&nv_cmd_q)) != NULL)
\r
2501 cmd_ptr = cmd_ext_ptr->nvcmd;
\r
2503 nv_front_op(cmd_ext_ptr);
\r
2504 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2506 /* Save for a moment the requesting task TCB and signal to set. */
\r
2508 task_ptr = cmd_ptr->tcb_ptr;
\r
2509 task_sigs = cmd_ptr->sigs;
\r
2511 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2513 /* If specified in request then return buffer to specified queue. */
\r
2515 if (cmd_ptr->done_q_ptr != NULL)
\r
2516 q_put(cmd_ptr->done_q_ptr, &cmd_ptr->link);
\r
2518 /* If specified in request then signal the requesting task. */
\r
2520 if (task_ptr != NULL)
\r
2521 (void) rex_set_sigs(task_ptr, task_sigs);
\r
2523 /* At the end of the loop kick the watchdog timer. */
\r
2528 } /* if command queue signal */
\r
2530 /*-------------------------------------------------------------------------*/
\r
2532 /* OFFLINE COMMAND SIGNAL */
\r
2534 /*-------------------------------------------------------------------------*/
\r
2536 /* Check if offline command signal was set. If set then clear signal, */
\r
2537 /* send ack back to MC, and proceeed. */
\r
2539 if ((rex_sigs & TASK_OFFLINE_SIG) != 0) {
\r
2540 QSR_MSG_MED( 1000812593ULL, "TASK_OFFLINE_SIG received", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2541 (void) rex_clr_sigs(&nv_tcb, TASK_OFFLINE_SIG);
\r
2542 (void) rex_set_sigs(&tmc_tcb, TMC_ACK_SIG);
\r
2543 /* write out any old ERR() if required */
\r
2544 nverr_update_log();
\r
2545 } /* if offline command signal */
\r
2547 /*-------------------------------------------------------------------------*/
\r
2549 /* POWERDOWN (STOP) COMMAND SIGNAL */
\r
2551 /*-------------------------------------------------------------------------*/
\r
2553 /* Check if powerdown command signal was set. */
\r
2554 /* If set then clear signal and proceeed. */
\r
2556 if ((rex_sigs & TASK_STOP_SIG) != 0) {
\r
2557 /* write out any old ERR() if required */
\r
2558 nverr_update_log();
\r
2559 QSR_MSG_MED( 2124372139ULL, "TASK_STOP_SIG received", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2560 (void) rex_clr_sigs(&nv_tcb, TASK_STOP_SIG);
\r
2562 nvi_task_running=FALSE;
\r
2565 /* Send ack back to MC. */
\r
2566 /* (void) rex_set_sigs(&tmc_tcb, TMC_ACK_SIG); */
\r
2567 } /* if stop command signal */
\r
2569 /*-------------------------------------------------------------------------*/
\r
2571 /* WATCHDOG REPORT TIMER SIGNAL */
\r
2573 /*-------------------------------------------------------------------------*/
\r
2575 /* PC debug only. */
\r
2577 #ifdef FEATURE_NV_UNIT_TEST
\r
2578 if ((rex_sigs & NV_RPT_TIMER_SIG) != 0) {
\r
2579 (void) rex_clr_sigs(&nv_tcb, NV_RPT_TIMER_SIG);
\r
2580 QSR_MSG_LOW( 252695986ULL, "NV_RPT_TIMER_SIG received", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2584 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
\r
2590 /*===========================================================================
\r
2591 FUNCTION NVERR_INIT
\r
2594 Initialize nv error queue for external tasks
\r
2597 Called once, by NV.C to init buffers
\r
2600 False if init conflict.
\r
2605 ===========================================================================*/
\r
2607 nverr_init( void ) {
\r
2609 static boolean nv_error_initialized = FALSE;
\r
2610 static boolean nv_error_init_in_progress = FALSE;
\r
2612 /* We have allready visited this routine */
\r
2613 if(nv_error_initialized) {
\r
2614 nv_error_init_in_progress = FALSE;
\r
2618 /* Flag incase multiple paths initing nv at same time. */
\r
2619 if(nv_error_init_in_progress) return FALSE;
\r
2620 nv_error_init_in_progress = TRUE;
\r
2622 /* read up shadow copy of error log */
\r
2623 for(i=0; i< NV_MAX_ERR_LOG; i++) {
\r
2624 (void) nvio_read_item (
\r
2626 (byte) i, /* Item index within its array */
\r
2627 (byte*)&(nverr_log.external[i].err_count), /* data buffer */
\r
2628 nvim_op_get_size(NV_ERR_LOG_I),
\r
2629 0 /* context=0 implies no context is defined */
\r
2631 nverr_log.update_required[i] = FALSE;
\r
2633 nverr_log.processing_required = FALSE;
\r
2635 nv_error_initialized = TRUE;
\r
2636 nv_error_init_in_progress = FALSE;
\r
2641 /*===========================================================================
\r
2642 FUNCTION NVERR_UPDATE_LOG
\r
2645 write dirty error log items out to nv.
\r
2648 nverr_init must have been called.
\r
2656 ===========================================================================*/
\r
2658 nverr_update_log( void ) {
\r
2659 int i; /* loop counter */
\r
2660 word isave; /* save flags for interrupt diasble/enable */
\r
2662 /* If no errors waiting to be saved, get out of here */
\r
2663 if(!nverr_log.processing_required) return;
\r
2667 /* update internal copy of err_log to write out from */
\r
2668 INTLOCK_SAV( isave ); /* Disable interrupts and save PSW */
\r
2669 (void) memcpy((void *) nverr_log.internal,
\r
2670 (void *) nverr_log.external,
\r
2671 sizeof(nverr_log.internal)); /* data buffer size */
\r
2673 (void) memcpy((void *) nverr_log.update_in_progress,
\r
2674 (void *) nverr_log.update_required,
\r
2675 sizeof(nverr_log.update_in_progress)); /* data buffer size */
\r
2677 for(i=0; i< NV_MAX_ERR_LOG; i++) {
\r
2678 nverr_log.update_required[i] = FALSE;
\r
2680 nverr_log.processing_required = FALSE;
\r
2681 INTFREE_SAV( isave ); /* Restore interrupts (PSW) */
\r
2683 /* write out internal shadow copy of error log */
\r
2684 for(i=0; i< NV_MAX_ERR_LOG; i++) {
\r
2685 if(nverr_log.update_in_progress[i]) {
\r
2686 QSR_MSG_MED( 427085943ULL, "nverr_log entry %d update in progress ", i, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2691 (byte) i, /* Item index within its array */
\r
2692 (byte *)&(nverr_log.internal[i].err_count), /* data buffer */
\r
2693 nvim_op_get_size(NV_ERR_LOG_I),
\r
2694 0 /* context=0 implies no context is defined */
\r
2701 /*===========================================================================
\r
2703 FUNCTION NV_MAX_SIZE_OF_ROAMING_LIST
\r
2706 This function returns the maximum number of bytes available for
\r
2707 storage of a roaming list (per NAM). The value returned depends
\r
2708 on the total amount of NVRAM installed in the phone and the total
\r
2709 number of NAMs defined.
\r
2712 The function cannot be called until NV is initialized. A
\r
2713 premature call will raise err_fatal.
\r
2716 The maximum number of bytes available for storage of a roaming list
\r
2722 ===========================================================================*/
\r
2725 nv_max_size_of_roaming_list( void ) {
\r
2726 if (!nvi_initialized)
\r
2728 ERR_FATAL("Illegal task start-up order", 0, 0, 0);
\r
2731 #if !defined( FEATURE_NV_RUIM ) || defined( FEATURE_UIM_RUN_TIME_ENABLE )
\r
2732 #if defined( FEATURE_UIM_RUN_TIME_ENABLE )
\r
2733 /* Determine if the R-UIM is available */
\r
2734 if (NV_RTRE_CONTROL_USE_RUIM != nv_rtre_control())
\r
2735 #endif /* FEATURE_UIM_RUN_TIME_ENABLE */
\r
2737 #ifdef NV_FEATURE_PRL_ITEMS
\r
2738 return NV_ROAMING_LIST_MAX_SIZE;
\r
2743 #if defined( FEATURE_UIM_RUN_TIME_ENABLE )
\r
2745 #if defined( FEATURE_NVRUIM_ADM_ACCESS ) || defined( FEATURE_BUILD_JCDMA )
\r
2746 /* Return a max number here and check the size in nvruim before writing */
\r
2747 return NV_ROAMING_LIST_MAX_SIZE;
\r
2750 #endif /* FEATURE_RUIM_ADM_ACCESS */
\r
2752 #endif /*( FEATURE_UIM_RUN_TIME_ENABLE ) */
\r
2756 #endif /* !FEATURE_NV_RUIM || FEATURE_UIM_RUN_TIME_ENABLE */
\r
2758 } /* nv_max_size_of_roaming_list */
\r
2761 /*===========================================================================
\r
2763 FUNCTION NV_MAX_SIZE_OF_WEB_CACHE
\r
2766 This function returns the maximum number of bytes currently available
\r
2767 for storage of the Unwired Planet cache. At this time, the cache
\r
2768 size is always zero (it is not currently used).
\r
2771 The function cannot be called until NV is initialized. A
\r
2772 premature call will raise err_fatal.
\r
2775 The maximum number of bytes currently available for storage of the
\r
2776 Unwired Planet cache.
\r
2781 ===========================================================================*/
\r
2784 nv_max_size_of_web_cache( void ) {
\r
2785 if (!nvi_initialized) {
\r
2786 ERR_FATAL("Illegal task start-up order", 0, 0, 0);
\r
2789 } /* nv_max_size_of_web_cache */
\r
2792 /*===========================================================================
\r
2797 This function will return TRUE once the files are available that simulate
\r
2801 This is a special use function, normally called by error services
\r
2802 to allow early access to NV, and before the NV task has been started.
\r
2803 The NV Item Manager allows access once file initialization is complete.
\r
2806 TRUE - The NV has been built and direct read/write is allowed
\r
2807 FALSE - The NV has not been built and access is not allowed
\r
2812 ===========================================================================*/
\r
2814 boolean nv_built (void)
\r
2817 return nvi_initialized;
\r
2822 /*===========================================================================
\r
2827 This is the outside world's interface to the non volatile memory task
\r
2828 this function takes an already filled out nv_cmd_type and place it on
\r
2829 the nv queue. The function returns to the caller after setting the
\r
2830 status to busy indicaton. This does _not_ mean that the command has
\r
2831 been executed yet, just that it is waiting to be executed.
\r
2834 The NV task must have been started up already. All of the items in
\r
2835 the nv_cmd_block must be already set.
\r
2838 None directly. The status variable of the nv_cmd_type will be updated
\r
2839 to reflect the current status of this command as it is processed.
\r
2842 The nv_cmd_type is placed on the NV command queue. It must not be
\r
2843 modified until the command has been processed.
\r
2845 ===========================================================================*/
\r
2849 nv_cmd_type *cmd_ptr /* Pointer to NV command buffer */
\r
2853 nv_cmd_ext_type *cmd_ext_ptr = (nv_cmd_ext_type *) malloc (sizeof(nv_cmd_ext_type));
\r
2855 if (cmd_ext_ptr != NULL)
\r
2858 /* Converting nv_cmd_type to nv_cmd_ext_type by setting context to 0 */
\r
2859 cmd_ext_ptr->nvcmd = cmd_ptr;
\r
2860 cmd_ext_ptr->context = 0;
\r
2862 /* Set the request status to busy. initialize and link the command */
\r
2863 /* onto the NV command queue, set a signal to the NV task and exit. */
\r
2864 if (cmd_ext_ptr->nvcmd->tcb_ptr != NULL)
\r
2866 cmd_ext_ptr->nvcmd->status = NV_BUSY_S;
\r
2867 (void) q_link(cmd_ext_ptr, &cmd_ext_ptr->link);
\r
2868 q_put(&nv_cmd_q, &cmd_ext_ptr->link);
\r
2869 (void) rex_set_sigs(&nv_tcb, NV_CMD_Q_SIG);
\r
2875 /* For synchronous calls, we need to ensure mutexes are initiliazed */
\r
2876 if(!nv_cs_init_flag)
\r
2877 nv_access_op_cs_init();
\r
2879 nv_front_op(cmd_ext_ptr);
\r
2880 } /* if command has no tcb */
\r
2883 QSR_MSG_HIGH ( 3639666217ULL, "Could not allocate memory for variable of type nv_cmd_ext_type", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2888 /*===========================================================================
\r
2890 FUNCTION NV_CMD_EXT
\r
2893 This is the outside world's interface to the non volatile memory task
\r
2894 this function takes an already filled out nv_cmd_type and place it on
\r
2895 the nv queue. The function returns to the caller after setting the
\r
2896 status to busy indicaton. This does _not_ mean that the command has
\r
2897 been executed yet, just that it is waiting to be executed.
\r
2900 The NV task must have been started up already. All of the items in
\r
2901 the nv_cmd_block must be already set. This function allows items across
\r
2902 multiple SIMs to be accessed.
\r
2905 None directly. The status variable of the nv_cmd_ext_type will be updated
\r
2906 to reflect the current status of this command as it is processed.
\r
2909 The nv_cmd_ext_type is placed on the NV command queue. It must not be
\r
2910 modified until the command has been processed.
\r
2912 ===========================================================================*/
\r
2916 nv_cmd_ext_type *cmd_ext_ptr /* Pointer to NV command buffer */
\r
2919 nv_cmd_ext_type *lcmd_ext_ptr = (nv_cmd_ext_type *) malloc (sizeof(nv_cmd_ext_type));
\r
2921 if (lcmd_ext_ptr != NULL)
\r
2923 /* copy the parameters into the allocated momory */
\r
2924 lcmd_ext_ptr->nvcmd = cmd_ext_ptr->nvcmd;
\r
2925 lcmd_ext_ptr->context = cmd_ext_ptr->context;
\r
2927 QSR_MSG_HIGH ( 3639666217ULL, "Could not allocate memory for variable of type nv_cmd_ext_type", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
2931 /* Set the request status to busy. initialize and link the command */
\r
2932 /* onto the NV command queue, set a signal to the NV task and exit. */
\r
2933 if (lcmd_ext_ptr->nvcmd->tcb_ptr != NULL)
\r
2935 lcmd_ext_ptr->nvcmd->status = NV_BUSY_S;
\r
2936 (void) q_link(lcmd_ext_ptr, &lcmd_ext_ptr->link);
\r
2937 q_put(&nv_cmd_q, &lcmd_ext_ptr->link);
\r
2938 (void) rex_set_sigs(&nv_tcb, NV_CMD_Q_SIG);
\r
2943 /* For synchronous calls, we need to ensure mutexes are initiliazed */
\r
2944 if(!nv_cs_init_flag)
\r
2945 nv_access_op_cs_init();
\r
2947 nv_front_op(lcmd_ext_ptr);
\r
2948 } /* if command has no tcb */
\r
2949 } /* nv_cmd_ext */
\r
2953 /*===========================================================================
\r
2958 This is same as nv_cmd but it waits till NV finishes its operation.
\r
2961 The NV task must have been started up already. All of the items in
\r
2962 the nv_cmd_block must be already set.
\r
2965 None directly. The status variable of the nv_cmd_type will be updated
\r
2966 to reflect the current status of this command as it is processed.
\r
2971 ===========================================================================*/
\r
2975 nv_cmd_type *cmd_ptr, /* Pointer to NV command buffer */
\r
2976 nv_item_type *data_ptr /* Pointer to structure that contains item data */
\r
2979 #ifdef FEATURE_RPC
\r
2980 nv_cmd_ext_type *cmd_ext_ptr = (nv_cmd_ext_type *) malloc (sizeof(nv_cmd_ext_type));
\r
2983 rex_tcb_type *client_tcb = cmd_ptr->tcb_ptr;
\r
2984 nv_item_type *client_data = cmd_ptr->data_ptr;
\r
2986 /* Set the request status to busy. initialize and link the command */
\r
2987 /* onto the NV command queue, set a signal to the NV task and exit. */
\r
2989 cmd_ptr->tcb_ptr = rex_self();
\r
2990 cmd_ptr->data_ptr = data_ptr;
\r
2992 cmd_ptr->status = NV_BUSY_S;
\r
2994 /* Converting nv_cmd_type to nv_cmd_ext_type by setting context to 0 */
\r
2995 if (cmd_ext_ptr != NULL)
\r
2997 cmd_ext_ptr->nvcmd = cmd_ptr;
\r
2998 cmd_ext_ptr->context = 0;
\r
3000 /* Putting nv_cmd_ext on queue */
\r
3001 (void) q_link(cmd_ext_ptr, &cmd_ext_ptr->link);
\r
3002 q_put(&nv_cmd_q, &cmd_ext_ptr->link);
\r
3003 (void) rex_set_sigs(&nv_tcb, NV_CMD_Q_SIG);
\r
3005 rex_wait( cmd_ptr->sigs );
\r
3006 rex_clr_sigs( cmd_ptr->tcb_ptr, cmd_ptr->sigs );
\r
3010 QSR_MSG_HIGH ( 3639666217ULL, "Could not allocate memory for variable of type nv_cmd_ext_type", 0, 0, 0);//auto-gen, to change remove 'QSR_' and first param
\r
3012 /* Restore params */
\r
3014 cmd_ptr->tcb_ptr = client_tcb;
\r
3015 cmd_ptr->data_ptr = client_data;
\r
3017 QSR_MSG_HIGH( 3143198573ULL, "nv_cmd_r():FEATURE_RPC not defined",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
3021 /*===========================================================================
\r
3023 FUNCTION NV_CMD_EXT_R
\r
3026 This is same as nv_cmd but it waits till NV finishes its operation.
\r
3029 The NV task must have been started up already. All of the items in
\r
3030 the nv_cmd_block must be already set.
\r
3033 None directly. The status variable of the nv_cmd_type will be updated
\r
3034 to reflect the current status of this command as it is processed.
\r
3039 ===========================================================================*/
\r
3043 nv_cmd_ext_type *cmd_ext_ptr, /* Pointer to NV command buffer */
\r
3044 nv_item_type *data_ptr /* Pointer to structure that contains item data */
\r
3047 #ifdef FEATURE_RPC
\r
3049 rex_tcb_type *client_tcb = cmd_ext_ptr->nvcmd->tcb_ptr;
\r
3050 nv_item_type *client_data = cmd_ext_ptr->nvcmd->data_ptr;
\r
3052 /* Set the request status to busy. initialize and link the command */
\r
3053 /* onto the NV command queue, set a signal to the NV task and exit. */
\r
3055 cmd_ext_ptr->nvcmd->tcb_ptr = rex_self();
\r
3056 cmd_ext_ptr->nvcmd->data_ptr = data_ptr;
\r
3058 cmd_ext_ptr->nvcmd->status = NV_BUSY_S;
\r
3060 /* Putting nv_cmd_ext on queue */
\r
3061 (void) q_link(cmd_ext_ptr, &cmd_ext_ptr->link);
\r
3062 q_put(&nv_cmd_q, &cmd_ext_ptr->link);
\r
3063 (void) rex_set_sigs(&nv_tcb, NV_CMD_Q_SIG);
\r
3065 rex_wait( cmd_ptr->sigs );
\r
3066 rex_clr_sigs( cmd_ptr->tcb_ptr, cmd_ptr->sigs );
\r
3068 /* Restore params */
\r
3069 cmd_ext_ptr->nvcmd->tcb_ptr = client_tcb;
\r
3070 cmd_ext_ptr->nvcmd->data_ptr = client_data;
\r
3072 QSR_MSG_HIGH( 2675320387ULL, "nv_cmd_ext_r():FEATURE_RPC not defined",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
3075 } /* nv_cmd_ext_r */
\r
3078 /*===========================================================================
\r
3080 FUNCTION NV_CMD_REMOTE
\r
3083 This is the outside world's interface to the non volatile memory task.
\r
3086 The NV task must have been started up already. All of the items in
\r
3087 the nv_cmd_type must be already set.
\r
3091 NV_DONE_S, - Request completed okay
\r
3092 NV_BUSY_S, - Request is queued
\r
3093 NV_BADCMD_S, - Unrecognizable command field
\r
3094 NV_FULL_S, - The NVM is full
\r
3095 NV_FAIL_S, - Command failed, reason other than NVM was full
\r
3096 NV_NOTACTIVE_S, - Variable was not active
\r
3097 NV_BADPARM_S, - Bad parameter in command block
\r
3098 NV_READONLY_S, - Parameter is write-protected and thus read only
\r
3099 NV_BADTG_S, - Item not valid for Target
\r
3100 NV_NOMEM_S, - free memory exhausted
\r
3101 NV_NOTALLOC_S - address is not a valid allocation
\r
3104 The nv_cmd_type is placed on the NV command queue. It must not be
\r
3105 modified until the command has been processed!
\r
3107 ===========================================================================*/
\r
3109 nv_stat_enum_type
\r
3111 nv_func_enum_type cmd,
\r
3112 nv_items_enum_type item,
\r
3113 nv_item_type *data_ptr
\r
3116 nv_cmd_type nv_rpc_cmd;
\r
3117 #ifdef FEATURE_NV_RPC_SUPPORT
\r
3119 #ifdef FEATURE_NV_ACCESS_FILTER
\r
3120 if(cmd == NV_READ_F)
\r
3122 if(unreadable_nv_item(item))
\r
3124 return NV_BADPARM_S;
\r
3129 if((cmd == NV_WRITE_F)||(cmd == NV_REPLACE_F))
\r
3131 if(unwritable_nv_item(item))
\r
3133 return NV_BADPARM_S;
\r
3139 nv_rpc_cmd.status = NV_BUSY_S;
\r
3140 (void) q_link(&nv_rpc_cmd, &nv_rpc_cmd.link);
\r
3141 nv_rpc_cmd.tcb_ptr = rex_self();
\r
3142 nv_rpc_cmd.sigs = NV_QIDS_RPC_SIG;
\r
3143 nv_rpc_cmd.cmd = cmd;
\r
3144 nv_rpc_cmd.item = item;
\r
3145 nv_rpc_cmd.data_ptr = data_ptr;
\r
3146 nv_rpc_cmd.done_q_ptr = NULL;
\r
3148 nv_cmd( &nv_rpc_cmd );
\r
3149 rex_wait( NV_QIDS_RPC_SIG ); /* this signal needs to be reserved for all worker task*/
\r
3151 rex_clr_sigs( nv_rpc_cmd.tcb_ptr, NV_QIDS_RPC_SIG );
\r
3154 QSR_MSG_HIGH( 2469021251ULL, "nv_stat_enum_type(): FEATURE_NV_RPC_SUPPORT not defined",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
3155 nv_rpc_cmd.status = NV_FAIL_S;
\r
3157 return nv_rpc_cmd.status;
\r
3161 /*===========================================================================
\r
3163 FUNCTION NV_CMD_EXT_REMOTE
\r
3166 This is the outside world's interface to the non volatile memory task.
\r
3169 The NV task must have been started up already. All of the items in
\r
3170 the nv_cmd_ext_type must be already set.
\r
3174 NV_DONE_S, - Request completed okay
\r
3175 NV_BUSY_S, - Request is queued
\r
3176 NV_BADCMD_S, - Unrecognizable command field
\r
3177 NV_FULL_S, - The NVM is full
\r
3178 NV_FAIL_S, - Command failed, reason other than NVM was full
\r
3179 NV_NOTACTIVE_S, - Variable was not active
\r
3180 NV_BADPARM_S, - Bad parameter in command block
\r
3181 NV_READONLY_S, - Parameter is write-protected and thus read only
\r
3182 NV_BADTG_S, - Item not valid for Target
\r
3183 NV_NOMEM_S, - free memory exhausted
\r
3184 NV_NOTALLOC_S - address is not a valid allocation
\r
3187 The nv_cmd_ext_type is placed on the NV command queue. It must not be
\r
3188 modified until the command has been processed!
\r
3190 ===========================================================================*/
\r
3192 nv_stat_enum_type
\r
3193 nv_cmd_ext_remote (
\r
3194 nv_func_enum_type cmd,
\r
3195 nv_items_enum_type item,
\r
3196 nv_item_type *data_ptr,
\r
3200 nv_cmd_type nv_rpc_cmd;
\r
3201 #ifdef FEATURE_NV_RPC_SUPPORT
\r
3202 nv_cmd_ext_type nv_rpc_cmd_ext;
\r
3204 #ifdef FEATURE_NV_ACCESS_FILTER
\r
3205 if(cmd == NV_READ_F)
\r
3207 if(unreadable_nv_item(item))
\r
3209 return NV_BADPARM_S;
\r
3214 if((cmd == NV_WRITE_F)||(cmd == NV_REPLACE_F))
\r
3216 if(unwritable_nv_item(item))
\r
3218 return NV_BADPARM_S;
\r
3224 nv_rpc_cmd.status = NV_BUSY_S;
\r
3225 (void) q_link(&nv_rpc_cmd, &nv_rpc_cmd.link);
\r
3226 nv_rpc_cmd.tcb_ptr = rex_self();
\r
3227 nv_rpc_cmd.sigs = NV_QIDS_RPC_SIG;
\r
3228 nv_rpc_cmd.cmd = cmd;
\r
3229 nv_rpc_cmd.item = item;
\r
3230 nv_rpc_cmd.data_ptr = data_ptr;
\r
3231 nv_rpc_cmd.done_q_ptr = NULL;
\r
3233 nv_rpc_cmd_ext.nvcmd = &nv_rpc_cmd;
\r
3234 nv_rpc_cmd_ext.context = context;
\r
3235 (void) q_link(&nv_rpc_cmd_ext, &nv_rpc_cmd_ext.link);
\r
3237 nv_cmd_ext( &nv_rpc_cmd_ext );
\r
3238 rex_wait( NV_QIDS_RPC_SIG ); /* this signal needs to be reserved for all worker task*/
\r
3240 rex_clr_sigs( nv_rpc_cmd.tcb_ptr, NV_QIDS_RPC_SIG );
\r
3243 QSR_MSG_HIGH( 2201780199ULL, "nv_cmd_ext_remote(): FEATURE_NV_RPC_SUPPORT not defined",0,0,0);//auto-gen, to change remove 'QSR_' and first param
\r
3244 nv_rpc_cmd.status = NV_FAIL_S;
\r
3247 return nv_rpc_cmd.status;
\r
3251 /*===========================================================================
\r
3253 FUNCTION NV_RTRE_USE_RUIM_FOR_NAM
\r
3256 This function determines if the R-UIM is to be used (based on RTRE control)
\r
3257 and the NAM is the R-UIM NAM.
\r
3260 The return value has a default setting and is updated when NV receives
\r
3261 a NV_RTRE_OP_CONFIG_F command.
\r
3264 The RTRE control indicates to use the R-UIM and the NAM matches the R-UIM
\r
3268 This function uses the current value of the RTRE control. It may
\r
3271 ===========================================================================*/
\r
3274 nv_rtre_use_ruim_for_nam (
\r
3278 #ifdef FEATURE_UIM_RUN_TIME_ENABLE
\r
3279 /* Determine if the current RTRE control is for the R-UIM */
\r
3280 return ((NV_RTRE_CONTROL_USE_RUIM == nv_rtre_control()) &&
\r
3281 /* and the NAM matches the R-UIM NAM */
\r
3282 (NV_RUIM_NAM == nam));
\r
3286 #endif /*FEATURE_UIM_RUN_TIME_ENABLE*/
\r
3289 /*==================================================================
\r
3290 Function: NV_ACCESS_OP_CS_INIT
\r
3292 Description: This functions initialises kxmutex.
\r
3293 ==================================================================*/
\r
3295 void nv_access_op_cs_init(void)
\r
3297 if (!(KxMutex_Init(&nv_access_op_cs,"KXMUTEX_NV_ACCESS_OP_CS")))
\r
3299 ERR_FATAL("nv_access_op_cs KxMutex_Alloc Failed",0,0,0);
\r
3301 nv_cs_init_flag = TRUE;
\r
3304 /*===========================================================================
\r
3306 FUNCTION NV_RTRE_CONTROL
\r
3309 This function provides the current RTRE control. The control indicates
\r
3310 whether the use the R-UIM in an operation or not.
\r
3313 The return value has a default setting and is updated when NV receives
\r
3314 a NV_RTRE_OP_CONFIG_F command.
\r
3320 This function returns the current value of the RTRE control. It may
\r
3323 ===========================================================================*/
\r
3325 nv_rtre_control_type
\r
3326 nv_rtre_control( void )
\r
3328 #ifdef FEATURE_UIM_RUN_TIME_ENABLE
\r
3329 /* Retrieve the current RTRE control value */
\r
3330 return (nv_rtre_control_value);
\r
3332 return NV_RTRE_CONTROL_NO_RUIM;
\r
3333 #endif /*FEATURE_UIM_RUN_TIME_ENABLE*/
\r
3337 /*===========================================================================
\r
3339 FUNCTION NV_RTRE_POLLING_CONTROL
\r
3342 This function provides the current RTRE polling control. The polling control
\r
3343 indicates whether to poll the UIM card when originating a call or while on
\r
3344 the traffic channel.
\r
3347 The return value has a default setting and is updated when NV receives
\r
3348 a NV_RTRE_OP_CONFIG_F command.
\r
3351 The RTRE polling control
\r
3354 This function returns the current value of the RTRE polling control. It may
\r
3357 ===========================================================================*/
\r
3359 nv_rtre_polling_control_type
\r
3360 nv_rtre_polling_control( void ) {
\r
3361 #ifdef FEATURE_UIM_RUN_TIME_ENABLE
\r
3362 /* Retrieve the current RTRE control value */
\r
3363 return (nv_rtre_polling_control_value);
\r
3365 return NV_RTRE_POLLING_CONTROL_NO_POLL;
\r
3366 #endif /*FEATURE_UIM_RUN_TIME_ENABLE*/
\r
3369 /*===========================================================================
\r
3371 FUNCTION NV_RTRE_POLLING_FOR_NAM
\r
3374 This function provides the current RTRE polling control when the NAM is the
\r
3375 R_UIM NAM. The polling control indicates whether to poll the UIM card when
\r
3376 originating a call or while on the traffic channel.
\r
3379 The return value has a default setting and is updated when NV receives
\r
3380 a NV_RTRE_OP_CONFIG_F command.
\r
3383 The RTRE polling control indicates whether to poll and the NAM matches the
\r
3387 This function returns the current value of the RTRE polling control. It may
\r
3390 ===========================================================================*/
\r
3393 nv_rtre_polling_for_nam (
\r
3397 #ifdef FEATURE_UIM_RUN_TIME_ENABLE
\r
3398 /* Retrieve the current RTRE control value */
\r
3399 return ((NV_RTRE_POLLING_CONTROL_POLL == nv_rtre_polling_control_value) &&
\r
3400 /* and the NAM matches the R-UIM NAM */
\r
3401 (NV_RUIM_NAM == nam));
\r
3405 #endif /*FEATURE_UIM_RUN_TIME_ENABLE*/
\r
3409 #endif /* FEATURE_NV_ITEM_MGR */
\r