]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c
Set status field in fw_rsc_vdev after MessageQCopy_attach and before RscTable_update...
[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / resources / RscTable.c
index c17f203cc2ecfb63890e4ce43bb4a3a627bb8ed4..af4255c322617b240a33419b66f41037b301a823 100644 (file)
@@ -1090,6 +1090,32 @@ RscTable_free (RscTable_Handle * handle)
     return status;
 }
 
+Int RscTable_setStatus(UInt16 procId, UInt32 value)
+{
+    Int i;
+    Int status = 0;
+
+    RscTable_Object * obj = (RscTable_Object *)RscTable_state.handles[procId];
+    RscTable_Header * table = (RscTable_Header *)obj->rscTable;
+
+    /* Look for the vdev entry and update the status */
+    for (i = 0; i < table->num; i++) {
+        RscTable_MemEntry * entry =
+                (RscTable_MemEntry *)((UInt32)table + table->offset[i]);
+        if (entry->type == TYPE_VDEV) {
+            struct fw_rsc_vdev *vdev = (struct fw_rsc_vdev *)entry;
+            vdev->status = value;
+            break;
+        }
+    }
+
+    if (i == table->num) {
+        status = RSCTABLE_E_FAIL;
+    }
+
+    return status;
+}
+
 #if defined (__cplusplus)
 }
 #endif /* defined (__cplusplus) */