summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d803f0)
raw | patch | inline | side by side (parent: 7d803f0)
author | vwan@ti.com <vwan@ti.com> | |
Tue, 15 Apr 2014 00:27:00 +0000 (17:27 -0700) | ||
committer | Chris Ring <cring@ti.com> | |
Tue, 15 Apr 2014 20:03:00 +0000 (13:03 -0700) |
The physical device address of vrings needs to be updated in the
resource table in QNX, after memory has been allocated for these
vrings. This is so that Resource_getVringDA() on the slave side
can return the correct physical device address.
Signed-off-by: VW <vwan@ti.com>
resource table in QNX, after memory has been allocated for these
vrings. This is so that Resource_getVringDA() on the slave side
can return the correct physical device address.
Signed-off-by: VW <vwan@ti.com>
qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c | patch | blob | history |
diff --git a/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c b/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c
index 18acc6f400c89857d50b5358cf17cc1e6f431a2f..d805116b546a1860f8b04353a81435434f2a347c 100644 (file)
vring = (struct fw_rsc_vdev_vring *)
((UInt32)vdev + sizeof(*vdev) +
(sizeof(*vring) * j));
+ /*
+ * Making a copy of original vring, given obj->vrings[j].da
+ * is used as slave virtual address in RscTable_getInfo(),
+ * and that is what the original vring definition contains.
+ */
Memory_copy (&obj->vrings[j], vring, sizeof (*vring));
printf ("RscTable_process: vring [%d] @ [0x%08x]\n",
vring->num, vring->da);
obj->vringPa = pa;
obj->vringBufsPa = pa + vr_size;
+
+ /*
+ * Override the vring 'da' field in resource table.
+ * This allows the slave to look it up when creating
+ * the VirtQueues
+ */
+ for (j = 0; j < vdev->num_of_vrings; j++) {
+ vring = (struct fw_rsc_vdev_vring *)
+ ((UInt32)vdev + sizeof(*vdev) +
+ (sizeof(*vring) * j));
+ vring->da = obj->vringPa + (j *
+ vr_size / vdev->num_of_vrings);
+ }
}
break;
}