Пример #1
0
/*===========================================================================
FUNCTION DSI_GET_NV_ITEM 

DESCRIPTION
  Get an item from the nonvolatile memory.  

RETURN VALUE
  The NV return code.

DEPENDENCIES
  NV task is expected to be available.  Must run in the DS task context.

SIDE EFFECTS
  None

===========================================================================*/
nv_stat_enum_type dsi_get_nv_item 
(
  nv_items_enum_type  item,           /* Which item */
  nv_item_type       *data_ptr        /* Pointer to space for item */
)
{
  ASSERT(rex_self() == &ds_tcb);
  nv_command.tcb_ptr = rex_self();    /* notify this task when done */
  nv_command.sigs = DS_NV_CMD_SIG;
  nv_command.done_q_ptr = NULL;       /* command goes on no queue when done */

  nv_command.item = item;             /* item to read */
  nv_command.cmd = NV_READ_F;

  /* Set up NV so that it will read the data into the correct location */
  nv_command.data_ptr = data_ptr;


  /* Clear the return signal, call NV, and wait for a response */
  (void) rex_clr_sigs( rex_self(), DS_NV_CMD_SIG );
  nv_cmd( &nv_command );
  (void) dsi_wait( DS_NV_CMD_SIG );

  /*-------------------------------------------------------
  Report error on return code.
  ---------------------------------------------------------*/
  if(( nv_command.status != NV_DONE_S ) &&
     ( nv_command.status != NV_NOTACTIVE_S))                                     
  {
    ERR( "NV Read Failed Item %d Code %d", 
         nv_command.item, nv_command.status, 0 );
  }

  return( nv_command.status );
}
Пример #2
0
/*===========================================================================
FUNCTION GSDI_PUT_NV

DESCRIPTION
  Put an item on to the nonvolatile memory.

RETURN VALUE
  The NV return code, except for NV_NOTACTIVE_S, which is handled
  internally.

DEPENDENCIES
  This routine is not reentrant.  Shouldn't be a problem, as it doesn't exit
  till we're done.
===========================================================================*/
nv_stat_enum_type gsdi_put_nv(
  nv_items_enum_type item,        /* which item */
  nv_item_type *data_ptr          /* pointer to space for item */
)
{

  MSG_MED(" -- In GSDI_PUT_NV",0,0,0);

  /*
  ** notify this task when done
  */
  gsdi_nv_cmd.tcb_ptr = rex_self();
  gsdi_nv_cmd.sigs    = GSDI_NV_SIG;

  /*
  ** command goes on no queue when done
  */
  gsdi_nv_cmd.done_q_ptr = NULL;

  /*
  ** item to read
  */
  gsdi_nv_cmd.item = item;
  gsdi_nv_cmd.cmd  = NV_WRITE_F;
  gsdi_nv_cmd.data_ptr = data_ptr;

  /*
  ** Clear REX Signals
  */
  (void) rex_clr_sigs( rex_self(), GSDI_NV_SIG );

  #ifndef TEST_FRAMEWORK
  /*
  ** Send Command to NV
  */
  nv_cmd( &gsdi_nv_cmd );

  /*
  ** Wait for Signal from NV that it's complete
  */
  (void)gsdi_wait(GSDI_NV_SIG);
#endif /*TEST_FRAMEWORK*/
  
  /*
  ** Clear Signal
  */
  (void) rex_clr_sigs( rex_self(), GSDI_NV_SIG );

  MSG_MED(" -- NV STATUS = %x",gsdi_nv_cmd.status,0,0);

  if( gsdi_nv_cmd.status != NV_DONE_S ) {
      MMGSDI_DEBUG_ERR( "NV Write Failed Item %d Code %d",
                        gsdi_nv_cmd.item,
                        gsdi_nv_cmd.status,
                        0 );
  }

  return ( gsdi_nv_cmd.status );
}
Пример #3
0
/*===========================================================================

FUNCTION cmnv_q_srv

DESCRIPTION
  Services the cmnv_q by writing the item at the head of the queue to NV.

DEPENDENCIES
  CM NV queue must have already been initialized with
  cmnv_q_init().

RETURN VALUE
  none

SIDE EFFECTS
  none

===========================================================================*/
static void cmnv_q_srv( void )
{

  /* Point at item at the head of the CM NV Q.
  */
  cmnv_item_s_type *item_ptr = cmnv_q_check();

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

  /* If Q is NOT empty, prepare the NV write command
  ** and send it to be serviced by the NV task.
  */
  if( item_ptr != NULL )
  {
    cmnv_cmd_async.item       = item_ptr->item;/* item to write */
    cmnv_cmd_async.cmd        = NV_WRITE_F;    /* NV operation */
    /*lint -save -e826 */
    cmnv_cmd_async.data_ptr   = (nv_item_type*) &item_ptr->data;/* data to write */
    /*lint -restore */
    cmnv_cmd_async.tcb_ptr    = rex_self();    /* Notify CM task when done */
    cmnv_cmd_async.sigs       = CM_NV_ASYNC_SIG;/* Signal with this sig when done */
    cmnv_cmd_async.done_q_ptr = NULL;          /* Return cmd to NO Q when done */

    nv_cmd( &cmnv_cmd_async );                 /* Send command to NV task */
  }

}
Пример #4
0
/*===========================================================================

FUNCTION cmnv_write_wait

DESCRIPTION
  Write an item from the NV memory in a synchronous fashion; that is, this
  function only returns  after the NV write is done being serviced by the
  NV task.

  This function is only expected to be used during power-up initialization.
  During operation cmnv_write() must be used to write items to NV.

DEPENDENCIES
  mc_task_start() must have already been called.

  This function is only expected to be used during power-up initialization.
  During operation cmnv_write() must be used to items to NV.

RETURN VALUE
  none

SIDE EFFECTS
  none

===========================================================================*/
void cmnv_write_wait(

    nv_items_enum_type    nv_item,
        /* NV item to write */

    nv_item_type          *data_ptr
        /* pointer to data associated with the NV item */
)
{

  /* Prepare the NV write command
  */
  cmnv_cmd_sync.item       = nv_item;       /* Item to write */
  cmnv_cmd_sync.cmd        = NV_WRITE_F;    /* NV operation */
  cmnv_cmd_sync.data_ptr   = data_ptr;      /* Read into this buffer */
  cmnv_cmd_sync.tcb_ptr    = rex_self();    /* Notify CM task when done */
  cmnv_cmd_sync.sigs       = CM_NV_SYNC_SIG;/* Signal with this sig when done */
  cmnv_cmd_sync.done_q_ptr = NULL;          /* Return cmd to NO Q when done */

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

  /* Write from NV by:
  ** 1. Clearing the NV signal
  ** 2. Queuing a write command to the NV task
  ** 3. Waiting for NV task to finish servicing the write command.
  */
  (void) rex_clr_sigs( rex_self(), CM_NV_SYNC_SIG );
  nv_cmd( &cmnv_cmd_sync );
  cm_wait( CM_NV_SYNC_SIG );
  (void) rex_clr_sigs( rex_self(), CM_NV_SYNC_SIG );

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

  /* If NV write failed, generate an error message.
  */
  if( cmnv_cmd_sync.status != NV_DONE_S )
  {
    CM_ERR( "NV write failed, item=%d, stat=%d",
             cmnv_cmd_sync.item, cmnv_cmd_sync.status, 0 );
  }
}
Пример #5
0
/*==============================================================================

FUNCTION          HSU_CONF_SEL_NV_WRITE

DESCRIPTION
Write an item to the NV memory.

DEPENDENCIES
Context must be of TMC, otherwise the function ASSERTs.

RETURN VALUE
nv_stat_enum_type (see nv.h).

SIDE EFFECTS
The calling function is stopped until NV write operation is finished.

==============================================================================*/
static nv_stat_enum_type hsu_conf_sel_nv_write
(
 nv_items_enum_type  nv_item,
 nv_item_type *      data_ptr  
 ) 
{
  rex_tcb_type * self_tcb = rex_self();
  if (self_tcb == &tmc_tcb)
  {
    return tmcnv_write(nv_item, data_ptr);
  }
  else
  {
    HSU_ASSERT("*_read(): tcb is not of TMC." == NULL);
    return NV_FAIL_S;
  }
} /* hsu_conf_sel_nv_write */
rce_nde_p rce_nfy_wait_rex(rce_nde_p nde_p, rce_nfy_p nfy_p)
{
   if (RCE_NULL != nfy_p)
   {
      RCEVT_SIGEX_SIGREX* sigex_p = (RCEVT_SIGEX_SIGREX*)(&(nfy_p->sigex));
      rce_nde_p rc = RCE_NULL;
      if (rex_self() == sigex_p->signal)
      {
         rex_wait(sigex_p->mask);
         rex_clr_sigs(sigex_p->signal, sigex_p->mask);
         rc = nde_p;
      }
      else
      {
         ERR_FATAL("cannot wait event", 0, 0, 0);
      }
      return rc;
   }
   else
   {
      ERR_FATAL("null handle use", 0, 0, 0);
      return RCE_NULL;
   }
}
Пример #7
0
/*===========================================================================

FUNCTION init_video_encode_raw_frame

DESCRIPTION
  This is the main structure that does the encoding for a video frame for 
  offline encoding. It is called every frame
  
  
DEPENDENCIES
  None
 
ARGUMENTS IN    
  None
   
ARGUMENTS IN/OUT   
  inputBuf: data to be encoded
  target_height: target height of the encoded frame
  target_width: target width of the encoded frame
  frame_duration: Duration of frame
  initialize: state
  
ARGUMENTS OUT
  None
      
RETURN VALUE
  VIDEO_SUCCESS  if operation went fine
  VIDEO_FAILURE    otherwise
      
SIDE EFFECTS
  None
  
 
===========================================================================*/
video_status_type venc_create
(
 // venc_blob                 ** ppConfigs, 
    video_init_type           init_data,
    uint32                    target_bitrate,
    vencoder_frame_cb_fn      frame_callback_ptr,
    venc_cb_fn                callback_ptr,
    venc_malloc_fn            malloc_ptr,
    venc_free_fn              free_ptr,
    void *                    client_data

)
{  
    video_status_type ret_status;
    //init_data.
    if(venc_context)
    {
        MSG_ERROR("Video Encode Raw Engine already started",0,0,0);
        return VIDEO_FAILURE;
    }

    venc_context = malloc (sizeof (venc_context_type));

    if(venc_context)
    {
      memset(venc_context, 0, sizeof (venc_context_type));
      venc_context->state = VIDEO_ENC_RAW_ENG_NOT_INIT;
      venc_context->frame_address = malloc(sizeof(venc_context->frame_address) * VENC_FRAME_BUFFER_SIZE);
      venc_context->frame_inuse = malloc (sizeof(venc_context->frame_inuse) *VENC_FRAME_BUFFER_SIZE);
    }
    if (venc_context == NULL || venc_context->frame_address == NULL
       || venc_context->frame_inuse == NULL)
    {
        MSG_ERROR ("venc create: Unable to allocate raw engine "
                    "variable structure!",
                     0, 0, 0);
        MSG_HIGH ("start: Exiting function, early", 0, 0, 0);
        return VIDEO_FAILURE;
     }
     venc_context->tcb = rex_self();

     memset(venc_context->frame_address, 0, sizeof(venc_context->frame_address) * VENC_FRAME_BUFFER_SIZE);
     memset (venc_context->frame_inuse,0,sizeof(venc_context->frame_inuse)*VENC_FRAME_BUFFER_SIZE);

     venc_context->encode_height  = init_data.frame_height;
     venc_context->encode_width   = init_data.frame_width;
     venc_context->client_data    = init_data.client_data;
     venc_context->callback       = init_data.frame_callback_ptr;

     /*Over write callback function pointer addres to Venc Address*/
     init_data.frame_callback_ptr = (vencoder_frame_cb_fn) venc_framecallback;

     rex_clr_sigs(venc_context->tcb, VENC_SIG);

     venc_context->state = VIDEO_ENC_RAW_ENG_DSP_INIT;
     venc_context->num_buffers =0;

     MSG_MED("DSP Image Loaded Succesfully",0,0,0);

     ret_status = video_eng_init(&init_data, transcoder_video_engine_cb, (void*)venc_context);
     if(ret_status == VIDEO_SUCCESS)
     {
        (void)rex_wait(VENC_SIG);
     }

     if(venc_context->videoStatus != VIDEO_SUCCESS)
     {  

         MSG_ERROR("Video Engine Initialization failed",0,0,0);
     }
     else
     {
   
         MSG_MED("Video Engine Initialized Succesfully",0,0,0);
     }
     rex_clr_sigs(venc_context->tcb, VENC_SIG);

     /* Start the Video Engine */
     if (venc_context->videoStatus != VIDEO_SUCCESS) 
     {
         return VIDEO_FAILURE;
     }
     else
     {

         ret_status = video_eng_start(transcoder_video_engine_cb, (void*)venc_context);
         if(ret_status == VIDEO_SUCCESS)
         {
            (void)rex_wait(VENC_SIG);
         }

         rex_clr_sigs(venc_context->tcb, VENC_SIG); 

        if(venc_context->videoStatus != VIDEO_SUCCESS)
        {
            MSG_ERROR("Video Engine Start failed",0,0,0);
            return VIDEO_FAILURE;
        }
        else
        {
            MSG_MED("Video Engine Started Succesfully",0,0,0);
         }
    return VIDEO_SUCCESS;
    }
}
Пример #8
0
/*===========================================================================

FUNCTION video_enc_raw_engine_stop

DESCRIPTION
  This procedure stops recording video, saving the output file.
  It also cleans up and exits the raw engine.
  This is a synchronous function, and must be called from the UI task.
  
ARGUMENTS IN    
 NONE
      
RETURN VALUE
  VIDEO_SUCCESS  if operation went fine
  VIDEO_FAILURE    otherwise
  
===========================================================================*/
video_status_type venc_exit( void      *client_data )
{  
    video_status_type ret_status;
    boolean           stop_failed = FALSE;
    uint8             i=0;
  
    if(!venc_context)
    {
        MSG_ERROR("Video Encode Raw Engine already stopped",0,0,0);
        return VIDEO_FAILURE;
    }
    /* check the state */
    if(venc_context->state != VIDEO_ENC_RAW_ENG_START && 
       venc_context->state != VIDEO_ENC_RAW_ENG_PAUSE &&
       venc_context->state != VIDEO_ENC_RAW_ENG_ENCODE
       
      )
    {
        if(venc_context)
        {
            free(venc_context);
            venc_context = NULL;
        }
        return VIDEO_FAILURE;
    }
  
    venc_context->state = VIDEO_ENC_RAW_ENG_STOPPING;
    /* Stop the Video Engine */
    venc_context->tcb = rex_self();
    rex_clr_sigs(venc_context->tcb, VENC_SIG);
    ret_status = video_eng_stop(transcoder_video_engine_cb, (void*)venc_context);
    if(ret_status == VIDEO_SUCCESS)
    {
       (void)rex_wait(VENC_SIG);
    }

	if(venc_context->videoStatus != VIDEO_SUCCESS)
    { 
        MSG_ERROR("Video Engine Stop Failed",0,0,0);
        stop_failed = TRUE;
    }
    else
    {
        MSG_MED("Video Engine Stop Success",0,0,0);
    }

    venc_context->state = VIDEO_ENC_RAW_ENG_STOPPED;

    /* Exit the Video Engine */
    rex_clr_sigs(venc_context->tcb, VENC_SIG);
    ret_status = video_eng_exit(transcoder_video_engine_cb, (void*)venc_context);
    if(ret_status == VIDEO_SUCCESS)
    {
        (void)rex_wait(VENC_SIG);
    }

    if(venc_context->videoStatus != VIDEO_SUCCESS)
    { 
        MSG_ERROR("Video Engine Exit Failure",0,0,0);
        stop_failed = TRUE;
    }
    else
    {
        MSG_MED("Video Engine Exit Success",0,0,0);
    }

    /* Free the data */
    for(i=0; i<VENC_FRAME_BUFFER_SIZE; i++)
    {
       if(venc_context->frame_address[i])
       {
           if(venc_context->frame_address[i]->Y_Address)
           {
               free(venc_context->frame_address[i]->Y_Address);
               venc_context->frame_address[i]->Y_Address = NULL;
           }
           free(venc_context->frame_address[i]);
            venc_context->frame_address[i] = NULL;
        }
    }

    if(venc_context->frame_address)
    {
        free(venc_context->frame_address);
        venc_context->frame_address = NULL;
    }
    
    if(venc_context->frame_inuse)
    {
        free(venc_context->frame_inuse);
        venc_context->frame_inuse   = NULL;  
    }
    venc_context->client_data   = NULL;
    venc_context->callback      = NULL;

    if(venc_context)
    {
        free(venc_context);
        venc_context = NULL;
    }

    if(stop_failed)
    {
        return VIDEO_FAILURE;
    }
  
    return VIDEO_SUCCESS;
}
Пример #9
0
/*===========================================================================
FUNCTION GSDI_GET_NV

DESCRIPTION
  Get an item from the nonvolatile memory.

RETURN VALUE
  The NV return code, except for NV_NOTACTIVE_S, which is handled
  internally.

DEPENDENCIES
  This routine is not reentrant.  Shouldn't be a problem, as it doesn't exit
  till we're done.
===========================================================================*/
nv_stat_enum_type gsdi_get_nv(
  nv_items_enum_type item,
  nv_item_type *data_ptr
)
{
  MSG_MED(" -- In GSDI_GET_NV",0,0,0);

  /*
  ** notify this task when done
  */
  gsdi_nv_cmd.tcb_ptr = rex_self();
  gsdi_nv_cmd.sigs = GSDI_NV_SIG;

  /*
  ** command goes on no queue when done
  */
  gsdi_nv_cmd.done_q_ptr = NULL;

  /*
  ** item to read
  */
  gsdi_nv_cmd.item = item;
  gsdi_nv_cmd.cmd = NV_READ_F;

  /*
  ** Set the Data Ptr for NV ITEM TO read
  */
   gsdi_nv_cmd.data_ptr = data_ptr;

  /*
  ** Clear REX Signals
  */
  (void) rex_clr_sigs( rex_self(), GSDI_NV_SIG );

  /*
  ** Send Command to NV
  */
  #ifdef FEATURE_MMGSDI_LTK 
  
  /* 
  ** Non Context Switching Function Call...therfore, not signal will ever 
  ** get set to get us out of the wait...which is why the wait is also 
  ** in the #else below
  */
  mmgsdi_ltk_nv_cmd(&gsdi_nv_cmd); 

  #else 
#ifndef TEST_FRAMEWORK

  nv_cmd( &gsdi_nv_cmd );

  /*
  ** Wait for Signal from NV that it's complete
  */
  (void)gsdi_wait(GSDI_NV_SIG);
#endif /*TEST_FRAMEWORK*/

  /*
  ** Clear Signal
  */
  (void) rex_clr_sigs( rex_self(), GSDI_NV_SIG );

  MSG_MED(" -- NV STATUS = %x",gsdi_nv_cmd.status,0,0);

  #endif /* FEATURE_MMGSDI_LTK */

  if ( gsdi_nv_cmd.status != NV_DONE_S )
  {
    MMGSDI_DEBUG_ERR(" NV GET FAILED ",0,0,0);
  }
  return ( gsdi_nv_cmd.status );
}
Пример #10
0
/*===========================================================================

FUNCTION cmnv_read_wait

DESCRIPTION
  Read an item from the NV memory.

  Note that NV reads are done in a synchronous fashion; that is, this
  function only returns  after the NV read is done being serviced by the
  NV task.

DEPENDENCIES
  mc_task_start() must have already been called.

RETURN VALUE
  none

SIDE EFFECTS
  none

===========================================================================*/
void cmnv_read_wait(

    nv_items_enum_type  nv_item,
        /* NV item to read */

    nv_item_type        *data_ptr
        /* pointer to buffer to place data associated with the NV item */
)
{
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

  CM_ASSERT(data_ptr != NULL); 

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

  /* Prepare the NV read command
  */
  cmnv_cmd_sync.item       = nv_item;       /* Item to read */
  cmnv_cmd_sync.cmd        = NV_READ_F;     /* NV operation */
  cmnv_cmd_sync.data_ptr   = data_ptr;      /* Read into this buffer */
  cmnv_cmd_sync.tcb_ptr    = rex_self();    /* Notify CM task when done */
  cmnv_cmd_sync.sigs       = CM_NV_SYNC_SIG;/* Signal with this sig when done */
  cmnv_cmd_sync.done_q_ptr = NULL;          /* Return cmd to NO Q when done */

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

  /* Read from NV by:
  ** 1. Clearing the NV signal
  ** 2. Queuing a read command to the NV task
  ** 3. Waiting for NV task to finish servicing the read command.
  */
  (void) rex_clr_sigs( rex_self(), CM_NV_SYNC_SIG );

  cmnv_cmd_sync.tcb_ptr = rex_self();

  #ifdef FEATURE_NV_RPC_SUPPORT
  if (0 == std_strncmp ((cmnv_cmd_sync.tcb_ptr)->task_name,"ONCR", 4))
  {
    (void)nv_cmd_remote(cmnv_cmd_sync.cmd,
                        cmnv_cmd_sync.item,
                        cmnv_cmd_sync.data_ptr
                        );
  }
  else
  #endif
  {
    nv_cmd( &cmnv_cmd_sync );
  }

  cm_wait( CM_NV_SYNC_SIG );
  (void) rex_clr_sigs( rex_self(), CM_NV_SYNC_SIG );

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

  /* If NV read failed, substitute a default value.
  */
  if( cmnv_cmd_sync.status != NV_DONE_S )
  {
    CM_MSG_HIGH( "NV read failed, item=%d, stat=%d",
             cmnv_cmd_sync.item, cmnv_cmd_sync.status, 0 );

    /*lint -save -e641 */
    switch( cmnv_cmd_sync.item )
    {
      case NV_PREF_MODE_I:

        /* If this target supports ACP, default the mode preference
        ** to automatic. Else, default mode preference to digital only.
        */
        #ifdef FEATURE_ACP
#error code not present
        #else
          data_ptr->pref_mode.mode = NV_MODE_DIGITAL_ONLY;
        #endif
        break;

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

      case NV_SYSTEM_PREF_I:
        data_ptr->system_pref.sys = NV_SP_STANDARD;
        break;

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

      case NV_BAND_PREF_I:
        data_ptr->band_pref.band = (nv_band_pref_enum_type)CM_BAND_PREF_ANY;
        break;

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

      case NV_BAND_PREF_16_31_I:
        data_ptr->band_pref.band = (nv_band_pref_enum_type)(CM_BAND_PREF_ANY >> 16) ;
                                               //(NV_BAND_PREF_ANY & 0xFFFF);
        break;

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

      case NV_BAND_PREF_32_63_I:
        data_ptr->band_pref_32_63.band = (uint32)(CM_BAND_PREF_ANY >> 32 );

        break;


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

      case NV_ROAM_PREF_I:
        data_ptr->roam_pref.roam = NV_ROAM_PREF_ANY;
        break;

      #if (defined (FEATURE_HDR_HYBRID) || defined(FEATURE_HYBR_GW))
#error code not present
      #endif /* FEATURE_HDR_HYBRID */

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

      case NV_CURR_NAM_I:
        data_ptr->curr_nam = (int)CM_NAM_1;
        break;

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

      case NV_FTM_MODE_I:
        #if defined( FEATURE_CDMA_800 ) || defined( FEATURE_CDMA_1900 )
        data_ptr->ftm_mode = DMSS_MODE;
        #else
        data_ptr->ftm_mode = AMSS_MODE;
        #endif /* defined( FEATURE_CDMA_800 ) || defined( FEATURE_CDMA_1900 ) */
        break;

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

       case NV_AUTO_NAM_I:
         data_ptr->auto_nam = FALSE;
         break;

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

      case NV_SRDA_ENABLED_I:
        data_ptr->srda_enabled = FALSE;
        break;

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

      case NV_SEC_CODE_I:
        (void) memset( (byte*) data_ptr->sec_code.digits,
                       '0',
                       sizeof(data_ptr->sec_code.digits) );
        return;

      /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
      case NV_ACQ_ORDER_PREF_I:
      #ifdef FEATURE_WCDMA
#error code not present
      #else
        data_ptr->acq_order_pref.acq_order = CM_GW_ACQ_ORDER_PREF_GSM_WCDMA;
      #endif
        break;

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

      case NV_NET_SEL_MODE_PREF_I:
        data_ptr->net_sel_mode_pref.net_sel_mode = CM_NETWORK_SEL_MODE_PREF_AUTOMATIC;
        break;

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

      case NV_SERVICE_DOMAIN_PREF_I:
        data_ptr->service_domain_pref.srv_domain = CM_SRV_DOMAIN_PREF_CS_ONLY;
        break;

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

      #if (defined(FEATURE_UIM_RUIM) && defined(FEATURE_UIM_RUN_TIME_ENABLE))
      case NV_RTRE_CONFIG_I:
        data_ptr->rtre_config = NV_RTRE_CONFIG_NV_ONLY;
        break;
      #endif /* (defined(FEATURE_UIM_RUIM) && defined(FEATURE_UIM_RUN_TIME_ENABLE)) */

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

      #if ( defined(FEATURE_DUAL_SLOTS) )
      case NV_UIM_CDMA_PREF_SLOT_I:
        data_ptr->uim_cdma_pref_slot = NV_UIM_SLOT_NONE;
        break;

      case NV_UIM_GSM_PREF_SLOT_I:
        data_ptr->uim_gsm_pref_slot = NV_UIM_SLOT_NONE;
        break;
      #endif /* ( defined(FEATURE_DUAL_SLOTS) ) */

     /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
      case NV_PS_DATA_ORIG_PREF_I:
        data_ptr->ps_data_orig_pref = NV_PS_DATA_ORIG_PREF_ANY;
        break;

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

     case NV_GSM_AMR_CALL_CONFIG_I:
        data_ptr->gsm_amr_call_config = FALSE;
        break;

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

      case NV_PRL_PREF_I:
        data_ptr->prl_pref.prl = CM_PRL_PREF_ANY;
        break;

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

      case NV_WLAN_TECH_PREF_I:
        data_ptr->wlan_tech_pref.tech_pref = CM_WLAN_TECH_PREF_ANY;
        break;

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

      case NV_WLAN_BSS_TYPE_PREF_I:
        data_ptr->wlan_bss_type_pref.bss_type_pref = CM_WLAN_BSS_TYPE_PREF_ANY;
        break;

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

      case NV_WLAN_SCAN_PREF_I:
        data_ptr->wlan_scan_pref.scan_mode = CM_WLAN_SCAN_PREF_AUTO;
      break;

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

      case NV_WLAN_NET_SEL_MODE_PREF_I:
        data_ptr->wlan_net_sel_mode_pref.net_sel_mode =
                                  CM_NETWORK_SEL_MODE_PREF_AUTOMATIC;
      break;

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

      case NV_ACCOLC_I:

        (void) memset( (byte*)  data_ptr->accolc.ACCOLCpClass,
                       0,
                       sizeof( data_ptr->accolc.ACCOLCpClass) );
        return;

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

      #ifdef FEATURE_DDTM_CNTL
      case NV_DDTM_SETTINGS_I:

        /* Return error, the calling function should write the
        ** correct values to NV
        */
        data_ptr->ddtm_settings.num_srv_opt = CM_INVALID_DDTM_NUM_SRV_OPT;
        return;
      #endif


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

      case NV_GPRS_ANITE_GCF_I:
        data_ptr->gprs_anite_gcf = FALSE;
        break;

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

      case NV_UMTS_CALL_VT_CODEC_LIST_I:
        data_ptr->umts_call_vt_codec_list = FALSE;
        break;

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

      case NV_MOB_CAI_REV_I:
        #if defined( FEATURE_CDMA_800 ) || defined( FEATURE_CDMA_1900 )
        /* P_REV_IS2000 (6) is the default suggested by CP
        */
        data_ptr->mob_cai_rev = P_REV_IS2000;
        #else
        data_ptr->mob_cai_rev = 0;
        #endif
        break;

      case NV_ENS_ENABLED_I:
        #if defined(FEATURE_GSM) || defined(FEATURE_WCDMA)
#error code not present
        #endif
        break;
      /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

      case NV_HOME_MCC_I:
        data_ptr->home_mcc = CM_INVALID_MOBILE_COUNTRY_CODE;
        break;

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

      case NV_USR_SID_TO_MCC_ASSOC_TBL_I:
        data_ptr->usr_sid_to_mcc_assoc_tbl.tbl_len = 0;
        break;

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

      case NV_HS_BASED_PLUS_DIAL_SETTING_I:
        data_ptr->hs_based_plus_dial_setting = CM_HS_BASED_PLUS_DIAL_DISABLED;
        break;

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

      case NV_IMSI_MCC_I:
        data_ptr->imsi_mcc.imsi_mcc = CM_INVALID_MOBILE_COUNTRY_CODE;
        break;

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

      case NV_DISABLE_CM_CALL_TYPE_I:
        data_ptr->disable_cm_call_type = CM_CALL_TYPE_NONE_MASK;
        break;

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

      default:
        CM_SWITCH_ERR( "Unexpected NV item=%d",cmnv_cmd_sync.item,0,0 );
        break;

    } /* switch */
    /*lint -restore */

  } /* if */
Пример #11
0
static void
video_async_task (dword parm)
{
  rex_sigs_type sigs;
  uint8 usedfilehandle;

  (void) parm;
  /*lint -e{716} infinite loop requires here */
  while (1) 
  {
    /* XXX: Replace 0xffffffff with the actual signal mask once we know
     * what signal to use to process the async writes. 0xffffffff will work
     * though.
     */
    sigs = rex_wait (0xffffffff);
    (void)rex_clr_sigs (rex_self (), 0xffffffff);

    if ((sigs & TASK_OFFLINE_SIG) != 0)
      task_offline ();

    if ((sigs & TASK_STOP_SIG) != 0)
      task_stop ();

    if ((VIDEO_ASYNC_SIG & sigs) != 0) 
    {
       efs_process_async_writes ();
    }

    if( ((sigs & VIDEO_ASYNC_SIG_FILECLOSE)  != 0)||
        ((sigs & VIDEO_ASYNC_SIG_FILEUNLINK) != 0)
      )
      {
        for(usedfilehandle = 0;usedfilehandle<MAX_FILE_CLOSE_SIZE;usedfilehandle++)
        {
          if(fs_handle_close[usedfilehandle])
          {
            (void)video_eng_file_fclose (fs_handle_close[usedfilehandle]);
            fs_handle_close[usedfilehandle] = NULL;
          }
        }
        for(usedfilehandle = 0;usedfilehandle<MAX_FILE_CLOSE_SIZE;usedfilehandle++)
        {
          if(filenames [usedfilehandle].used == 1)
          {
            efs_unlink (filenames [usedfilehandle].filename);
            filenames [usedfilehandle].used = 0;
          }
        }      
      }
     /* this should be before INIT if block in this loop
      ** Here we assume that all the previous call to the efs 
      ** are synchronous
      */
      if (sigs & VIDEO_ASYNC_SIG_REQ_COMPLETE)
      {
          (void)rex_set_sigs(video_async_client_tcb,
                             video_async_client_sig
                            );
          video_async_client_tcb = NULL;
      }
  }
}