changeset 153:ac77167940a3

l1_trace.c: passes compilation after heavy cleaning
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 16 May 2016 20:02:59 +0000
parents c8053743ed67
children f9d2c65905f5
files chipsetsw/layer1/cfile/l1_trace.c
diffstat 1 files changed, 85 insertions(+), 208 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_trace.c	Mon May 16 06:59:30 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_trace.c	Mon May 16 20:02:59 2016 +0000
@@ -15,7 +15,7 @@
   #include "debug.cfg"
 #endif
 
-//omaps00090550 #include "l1_macro.h"
+#include "l1_macro.h"
 #include "l1_confg.h"
 
 #include <string.h>
@@ -179,10 +179,12 @@
   extern unsigned short       layer_1_sync_end_time;
   extern unsigned short       max_cpu_flag;
 
-  // Variables for DSP CPU load measurement
-  extern unsigned short       l1_dsp_cpu_load_trace_flag;
-  extern UWORD32              dsp_max_cpu_load_trace_array[4];
-  extern UWORD32              dsp_max_cpu_load_idle_frame;
+  #if 0	/* FreeCalypso */
+    // Variables for DSP CPU load measurement
+    extern unsigned short       l1_dsp_cpu_load_trace_flag;
+    extern UWORD32              dsp_max_cpu_load_trace_array[4];
+    extern UWORD32              dsp_max_cpu_load_idle_frame;
+  #endif
 #endif // (TRACE_TYPE == 1)
 
 
@@ -203,10 +205,13 @@
   extern UWORD16 layer_1_sync_end_time;
   extern UWORD16 max_cpu_flag;
 
-  // Variables for DSP CPU load measurement
-  extern unsigned short l1_dsp_cpu_load_trace_flag;
-  extern UWORD32        dsp_max_cpu_load_trace_array[4];
-  extern UWORD32        dsp_max_cpu_load_idle_frame;
+  #if 0	/* FreeCalypso */
+    // Variables for DSP CPU load measurement
+    extern unsigned short l1_dsp_cpu_load_trace_flag;
+    extern UWORD32        dsp_max_cpu_load_trace_array[4];
+    extern UWORD32        dsp_max_cpu_load_idle_frame;
+  #endif
+
 //  extern BOOL           l1_trace_enabled;
 #endif //(TRACE_TYPE==4)
 
@@ -296,10 +301,12 @@
    unsigned short       layer_1_sync_end_time;
    unsigned short       max_cpu_flag = 0;
 
-   // Variables for DSP CPU load measurement
-   UWORD32              dsp_max_cpu_load_trace_array[4] = {0L, 0L, 0L, 0L};
-   UWORD32              dsp_max_cpu_load_idle_frame = 0L;
-   unsigned short       l1_dsp_cpu_load_trace_flag = 0;
+   #if 0	/* FreeCalypso */
+     // Variables for DSP CPU load measurement
+     UWORD32              dsp_max_cpu_load_trace_array[4] = {0L, 0L, 0L, 0L};
+     UWORD32              dsp_max_cpu_load_idle_frame = 0L;
+     unsigned short       l1_dsp_cpu_load_trace_flag = 0;
+   #endif
   #endif //(TRACE_TYPE == 1)
 
 //#pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END
@@ -484,6 +491,7 @@
     intram_trace_size = 0;
   #endif
 
+#if 0	/* FreeCalypso TCS211 reconstruction */
 #if ((TRACE_TYPE==1) || (TRACE_TYPE == 4))
 #if (MELODY_E2 || L1_MP3 || L1_AAC || L1_DYN_DSP_DWNLD)
   trace_info.dsptrace_handler_globals.nested_disable_count = 0;
@@ -491,6 +499,7 @@
   trace_info.dsptrace_handler_globals.dsp_trace_level_copy = 0x0000;
 #endif
 #endif // ((TRACE_TYPE==1) || (TRACE_TYPE == 4))
+#endif
 
   #if (BURST_PARAM_LOG_ENABLE == 1)
     burst_param_log_index = 0;
@@ -508,7 +517,7 @@
 trace_info.prev_saic_flag_val = 2;
 trace_info.prev_swh_flag_val = 2;
 #endif
-#if (CODE_VERSION!=SIMULATION)
+#if 0	/* FreeCalypso TCS211 reconstruction */
   trace_info.pwmgt_trace_var.fail_step  = 0xFF;
   trace_info.pwmgt_trace_var.fail_id    = 0xFF;
   trace_info.pwmgt_trace_var.fail_cause = 0xFF;
@@ -5784,6 +5793,7 @@
     max_cpu = 0;
 } /* end of Trace_L1S_CPU_load() */
 
+#if 0	/* FreeCalypso: feature not present in our chipset */
 /********** DSP CPU load measurement *************/
 void l1_dsp_cpu_load_read()
 {
@@ -5862,6 +5872,7 @@
     }
   }
 } /* end of l1_dsp_cpu_load_read() */
+#endif
 
 #endif
 
@@ -6216,7 +6227,7 @@
 /* Return     :                                          */
 /*                                                       */
 /*-------------------------------------------------------*/
-void l1_trace_IT_DSP_error(UWORD8 cause)
+void l1_trace_IT_DSP_error()
 {
   #if (TRACE_TYPE==1) || (TRACE_TYPE==4)
 
@@ -6232,9 +6243,7 @@
        msg->SignalCode = TRACE_INFO;
 
        ((T_TRACE_INFO *)(msg->SigP))->debug_code = IT_DSP_ERROR;
-
        ((T_TRACE_INFO *)(msg->SigP))->tab[0] = l1s.actual_time.fn_mod42432;
-       ((T_TRACE_INFO *)(msg->SigP))->tab[1] = cause; // cause
 
        // send message...
        os_send_sig(msg, L1C1_QUEUE);
@@ -6279,6 +6288,7 @@
 } /* end function l1_trace_PCM_DSP_error */
 #endif /* L1_PCM_EXTRACTION */
 
+#if 0	/* LoCosto function not present in TCS211 */
 /*-------------------------------------------------------*/
 /* l1_trace_burst_param()                                */
 /*-------------------------------------------------------*/
@@ -6317,10 +6327,8 @@
      }
 
   #endif
-
-
-}
-
+}
+#endif
 
 #if (L1_SAIC !=0)
 /*-------------------------------------------------------*/
@@ -6872,6 +6880,9 @@
           }
           break;
 
+/* the following LoCosto stanzas don't exist in TCS211 */
+#if 0
+
           case SAIC_DEBUG:
           {
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
@@ -6903,6 +6914,7 @@
             L1_send_trace_cpy(str);
 #endif
 	  break;
+
           case KPD_CR:
           {
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
@@ -6919,8 +6931,6 @@
           }
           break;
 
-
-
           case BURST_PARAM:
           {
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
@@ -6948,6 +6958,8 @@
           }
           break;
 
+#endif
+
           case TOA_NOT_UPDATED:  // should not occur
           {
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
@@ -6965,6 +6977,7 @@
 
           case IT_DSP_ERROR:
           {
+#if 0	/* FreeCalypso TCS211 reconstruction */
             WORD8 cause = ((T_TRACE_INFO *)(msg->SigP))->tab[1];
             if (cause == IT_DSP_ERROR_CPU_OVERLOAD)
             {
@@ -6989,6 +7002,7 @@
             }
 #endif    /* end FF_L1_FAST_DECODING */
             else
+#endif
             {
               sprintf (str,">  ERROR: Unknown IT_DSP_ERROR! %ld\n\r",
                            ((T_TRACE_INFO *)(msg->SigP))->tab[0]);
@@ -7147,7 +7161,11 @@
           }
           break;
 
-#if (MELODY_E2 || L1_MP3 || L1_AAC || L1_DYN_DSP_DWNLD)
+/*
+ * FreeCalypso TCS211 reconstruction: removing the following
+ * DSP trace enable/disable traces in order to pass compilation.
+ */
+#if 0 //(MELODY_E2 || L1_MP3 || L1_AAC || L1_DYN_DSP_DWNLD)
           case DSP_TRACE_DISABLE:
           {
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
@@ -7175,6 +7193,11 @@
           break;
 #endif
 
+/*
+ * FreeCalypso TCS211 reconstruction: removing the following stanza
+ * in order to pass compilation.
+ */
+#if 0
           case PWMGT_FAIL_SLEEP:
           {
       #if (CODE_VERSION!= SIMULATION)
@@ -7218,6 +7241,8 @@
       #endif //NO SIMULATION
           }
           break;
+#endif
+
           case TRACE_SLEEP:
           {
             // trace special events -> usefulf for debug
@@ -7660,7 +7685,10 @@
         }
         break;
         #endif
-                  case IQ_LOW:
+
+/* FreeCalypso TCS211 reconstruction: IQ_LOW undefined */
+#if 0
+        case IQ_LOW:
         {
 
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
@@ -7675,8 +7703,7 @@
 #endif
         }
         break;
-
-
+#endif
 
           default:
           {
@@ -7736,6 +7763,7 @@
     }
   }
 
+#if 0	/* FreeCalypso: feature not present in our chipset */
   /***********************************************************************/
   /* DSP CPU load                                                        */
   /***********************************************************************/
@@ -7770,6 +7798,7 @@
       l1_dsp_cpu_load_trace_flag = 0;
     }
   }
+#endif
 
   /***********************************************************************/
   /* L1A messages                                                        */
@@ -9810,13 +9839,10 @@
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->A[7].radio_freq_no,
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->A[7].rxlev);
 #else
-sprintf(str,"IBA_I %ld %d %d %d %d %d (%d %d)(%d %d)(%d %d)(%d %d)(%d %d)(%d %d)(%d %d)(%d %d)\n\r",
+sprintf(str,"IBA_I %ld %d %d (%d %d)(%d %d)(%d %d)(%d %d)(%d %d)(%d %d)(%d %d)(%d %d)\n\r",
                 l1s.actual_time.fn_mod42432,
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->ba_id,
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->s_rxlev,
-                ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->qual_acc_idle,
-                ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->qual_nbr_meas_idle,
-                ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->nbr_of_carriers,
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->A[0].radio_freq_no,
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->A[0].rxlev,
                 ((T_MPHC_RXLEV_PERIODIC_IND *)(msg->SigP))->A[1].radio_freq_no,
@@ -11757,7 +11783,11 @@
         }
         break;
 
-
+/*
+ * FreeCalypso TCS211 reconstruction: PAUSE/RESUME of AMR VM playback
+ * appears to be a LoCosto addition.
+ */
+#if 0
 // Voice memo playing
         case MMI_VM_AMR_PAUSE_REQ:
         {
@@ -11815,7 +11845,7 @@
 #endif
         }
         break;
-
+#endif	/* FreeCalypso */
 
       #endif // L1_VOICE_MEMO_AMR
 
@@ -11969,7 +11999,6 @@
 
         case MMI_SR_RECO_START_REQ:
         {
-
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
           vsi_o_event_ttrace("SRR_R %ld %02ld %02ld",
                   l1s.actual_time.fn_mod42432,
@@ -12013,7 +12042,6 @@
 
         case MMI_SR_RECO_STOP_CON:
         {
-        {
 #if ( (OP_L1_STANDALONE == 0) && (L1_COMPRESSED_TRACING == 1) )
           vsi_o_event_ttrace("SRR_E %ld %02ld %02ld %08lx %02ld %08lx %02ld %08lx %02ld %08lx %04lx %04lx %04lx",
                   l1s.actual_time.fn_mod42432,
@@ -14527,17 +14555,11 @@
 /*********************************/
 void l1_trace_recovery(void)
 {
-char *s={"L1 Recovery performed"};
   trace_info.l1_memorize_error = '.'; // memorize an error in the L1
   L1_send_trace_cpy("> RECOVERY \n\r");
   l1_trace_L1_tasks(); // trace L1 tasks status
   // inform Riviera DAR system about the Recovery performed.
-  #if (OP_L1_STANDALONE == 1)
-  rvf_send_trace1  (s, (T_RVT_MSG_LG)strlen(s),(UWORD32)0,0, (UWORD32)trace_info.l1_trace_user_id) ;// omaps00090550
-  #else
-  rvf_send_trace1  (s, (T_RVT_MSG_LG)strlen(s),(UWORD32)0,RV_TRACE_LEVEL_WARNING, (UWORD32)trace_info.l1_trace_user_id) ;// omaps00090550
-  #endif
-//  L1_send_trace_cpy_DAR("L1 Recovery performed"); //omaps00090550
+  L1_send_trace_cpy_DAR("L1 Recovery performed");
 }
 #endif //L1_RECOVERY
 
@@ -14642,7 +14664,11 @@
     if (trace_info.PM_Task == 255) // 1st PM error in the frame: This PM is memorized
       trace_info.PM_Task  = task;  // memorize the Task of this 1st PM error
 
-#if ( ((TRACE_TYPE==1) || (TRACE_TYPE == 4)))
+/*
+ * FreeCalypso TCS211 reconstruction: the following logic
+ * appears to be a LoCosto addition.
+ */
+#if 0 //( ((TRACE_TYPE==1) || (TRACE_TYPE == 4)))
      if (trace_info.current_config->l1_dyn_trace & 1 <<  L1_DSP_TRACE_FULL_DUMP)
      {
 #if(MELODY_E2 || L1_MP3 || L1_AAC || L1_DYN_DSP_DWNLD )
@@ -14658,6 +14684,12 @@
     if (trace_info.Not_PM_Task == 255) // 1st PM recovery case: task of recovery needs to be memorized
       trace_info.Not_PM_Task = task;
   }
+
+/*
+ * FreeCalypso TCS211 reconstruction: the following logic
+ * appears to be a LoCosto addition.
+ */
+#if 0
 if (pm< 0x00C0) //sajal made changed it from- if (pm<= 0x00C0)
 
   {
@@ -14669,7 +14701,7 @@
       #endif
 
    }
-
+#endif
 }
 
 /*-------------------------------------------------------*/
@@ -15815,6 +15847,7 @@
     max_cpu = 0;
 } /* end of Trace_L1S_CPU_load() */
 
+#if 0	/* FreeCalypso: feature not present in our chipset */
 /********** DSP CPU load measurement *************/
 void l1_dsp_cpu_load_read()
 {
@@ -15893,6 +15926,7 @@
     }
   }
 } /* end of l1_dsp_cpu_load_read() */
+#endif
 
     #endif //((TRACE_TYPE == 1) && (CODE_VERSION != SIMULATION))
   #endif // (TRACE_TYPE == 1) // (TRACE_TYPE == 4)
@@ -16808,6 +16842,7 @@
 }
 #endif    // AMR
 
+#if 0	/* FreeCalypso: function not present in TCS211 */
 void l1_trace_fail_sleep(UWORD8 pwmgr_fail_step, UWORD8 pwmgr_fail_id, UWORD8 pwmgr_fail_cause)
 {
   #if (TRACE_TYPE==1) || (TRACE_TYPE==4)
@@ -16842,16 +16877,16 @@
        }
      }
   #endif
-
-
-}
-
+}
+#endif
 
 /* l1_trace_sleep()                                      */
 /* Parameters :                                          */
 /* Return     :                                          */
 
-void l1_trace_sleep(UWORD32 start_fn, UWORD32 end_fn, UWORD8 type_sleep,UWORD8 wakeup_type,UWORD8 big_sleep_type, UWORD16 int_id)
+UWORD16 int_id;
+
+void l1_trace_sleep(UWORD32 start_fn, UWORD32 end_fn, UWORD8 type_sleep,UWORD8 wakeup_type,UWORD8 big_sleep_type)
 {
   #if (CODE_VERSION == SIMULATION)
 
@@ -17050,7 +17085,7 @@
 /* Return     :                                          */
 /* Functionality :                                       */
 
-void trace_fct(UWORD8 fct_id, UWORD32 radio_freq)
+void trace_fct(UWORD8 fct_id, WORD32 radio_freq)
 {
 #if (TRACE_TYPE==1) || (TRACE_TYPE==4)
 
@@ -17140,164 +17175,6 @@
 #endif  // C_DEBUG_TRACE_TYPE
 
 
-#if ((TRACE_TYPE==1) || (TRACE_TYPE == 4))
-#if (MELODY_E2 || L1_MP3 ||  L1_AAC || L1_DYN_DSP_DWNLD )
-
-
-/* l1_disable_dsp_trace                                  */
-/* Parameters :  none                                    */
-/* Return     :  none                                    */
-/* Description :  Disables DSP trace                     */
-
-
-void l1_disable_dsp_trace()
-{
-#if (CODE_VERSION != SIMULATION)
-  T_NDB_MCU_DSP* dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
-#else
-  T_NDB_MCU_DSP* dsp_ndb_ptr = l1s_dsp_com.dsp_ndb_ptr;
-#endif
-
-  xSignalHeaderRec *msg;
-
-  // Only lower nested level disable triggers Disable DSP Trace message to DSP
-  if (trace_info.dsptrace_handler_globals.nested_disable_count == 0)
-  {
-    trace_info.dsptrace_handler_globals.trace_flag_blocked = TRUE;
-
-    if (dsp_ndb_ptr->d_debug_trace_type != 0x0000)
-    {
-      trace_info.dsptrace_handler_globals.nested_disable_count++;
-
-      // save trace type configuration, set re-init buffer (0x1000) and enable DSP trace (0x8000)
-      trace_info.dsptrace_handler_globals.dsp_trace_level_copy = dsp_ndb_ptr->d_debug_trace_type;
-      dsp_ndb_ptr->d_debug_trace_type = (API)0x9000; // 0x8000 Disable DSP Trace and 0x1000 Re-init Trace buffer
-
-      // Allocate DEBUG message.
-      msg = os_alloc_sig(sizeof(T_TRACE_INFO));
-      DEBUGMSG(status,NU_ALLOC_ERR)
-      msg->SignalCode = TRACE_INFO;
-
-      ((T_TRACE_INFO *)(msg->SigP))->debug_code = DSP_TRACE_DISABLE;
-      dsp_ndb_ptr->d_debug_buffer_size = 0;
-
-      // send message...
-      os_send_sig(msg, L1C1_QUEUE);
-      DEBUGMSG(status,NU_SEND_QUEUE_ERR)
-
-#if (DSP_DEBUG_TRACE_ENABLE)
-      trace_info.dsp_debug_buf_start[0] = NULL;
-      trace_info.dsp_debug_buf_start[1] = NULL;
-#endif
-    }
-  }
-  // In case higher nested levels disable, increment nested counter
-  else if (trace_info.dsptrace_handler_globals.nested_disable_count > 0)
-  {
-    trace_info.dsptrace_handler_globals.nested_disable_count++;
-  }
-}
-
-
-/* l1_enable_dsp_trace                                   */
-/*-------------------------------------------------------*/
-/*                                                       */
-/* Parameters :  none                                    */
-/* Return     :  none                                    */
-/*                                                       */
-/* Description :  Enables DSP trace                      */
-
-
-void l1_enable_dsp_trace()
-{
-#if (CODE_VERSION != SIMULATION)
-  T_NDB_MCU_DSP* dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
-#else
-  T_NDB_MCU_DSP* dsp_ndb_ptr = l1s_dsp_com.dsp_ndb_ptr;
-#endif
-
-  xSignalHeaderRec *msg;
-
-  if ((trace_info.dsptrace_handler_globals.trace_flag_blocked == TRUE) && (dsp_ndb_ptr->d_debug_trace_type == 0x0000))
-  {
-    // Only lower nested level disable triggers Enable DSP Trace message to DSP
-    if (trace_info.dsptrace_handler_globals.nested_disable_count == 1)
-    {
-      trace_info.dsptrace_handler_globals.trace_flag_blocked = FALSE;
-      trace_info.dsptrace_handler_globals.nested_disable_count--;
-
-      // restore trace type configuration, set re-init buffer (0x1000) and enable DSP trace (0x8000)
-      dsp_ndb_ptr->d_debug_buffer_size = C_DEBUG_BUFFER_SIZE;
-      dsp_ndb_ptr->d_debug_trace_type = (API)trace_info.dsptrace_handler_globals.dsp_trace_level_copy | 0x9000;
-      trace_info.dsptrace_handler_globals.dsp_trace_level_copy = 0x0000;
-
-      // Allocate DEBUG message.
-      msg = os_alloc_sig(sizeof(T_TRACE_INFO));
-      DEBUGMSG(status,NU_ALLOC_ERR)
-      msg->SignalCode = TRACE_INFO;
-
-      ((T_TRACE_INFO *)(msg->SigP))->debug_code = DSP_TRACE_ENABLE;
-
-      // send message...
-      os_send_sig(msg, L1C1_QUEUE);
-      DEBUGMSG(status,NU_SEND_QUEUE_ERR);
-    }
-    // In case higher nested levels enable, decrement nested counter
-    else if (trace_info.dsptrace_handler_globals.nested_disable_count > 1)
-    {
-      trace_info.dsptrace_handler_globals.nested_disable_count--;
-    }
-  }
-}
-
-
-/* l1_get_dsp_trace_mask                                 */
-/* Parameters :  none                                    */
-/* Return     :  dsp trace mask                          */
-/* Description :  Returns DSP Trace Mask copy beyond     */
-/*                potential trace disabling due to       */
-/*                DSP Trace Handler behavior             */
-
-
-UWORD16 l1_get_dsp_trace_mask ()
-{
-#if (CODE_VERSION != SIMULATION)
-  T_NDB_MCU_DSP* dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
-#else
-  T_NDB_MCU_DSP* dsp_ndb_ptr = l1s_dsp_com.dsp_ndb_ptr;
-#endif
-
-  if (trace_info.dsptrace_handler_globals.trace_flag_blocked == TRUE)
-    return trace_info.dsptrace_handler_globals.dsp_trace_level_copy;
-  else
-    return dsp_ndb_ptr->d_debug_trace_type;
-}
-
-/* l1_set_dsp_trace_mask                                 */
-/* Parameters :  new dsp trace mask                      */
-/* Return     :  none                                    */
-/* Description :  Sets DSP Trace Mask safely regarding   */
-/*                DSP Trace Handler behavior             */
-
-
-void l1_set_dsp_trace_mask (UWORD16 mask)
-{
-#if (CODE_VERSION != SIMULATION)
-  T_NDB_MCU_DSP* dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
-#else
-  T_NDB_MCU_DSP* dsp_ndb_ptr = l1s_dsp_com.dsp_ndb_ptr;
-#endif
-
-  if (trace_info.dsptrace_handler_globals.trace_flag_blocked == TRUE)
-    trace_info.dsptrace_handler_globals.dsp_trace_level_copy = mask;
-  else
-    dsp_ndb_ptr->d_debug_trace_type = (API)(mask | 0x8000);
-}
-
-#endif
-#endif // (TRACE_TYPE==1) || (TRACE_TYPE == 4)
-
-
 #if (L1_AUDIO_MCU_ONOFF == 1)
 
 /* l1_trace_audio_onoff()                               */