[alsa-devel] [PATCH 3/7] Reinit response size for every msg/response transaction. Minor fix const ptr

linux at audioscience.com linux at audioscience.com
Tue Mar 23 09:14:23 CET 2010


From: Eliot Blennerhassett <eblennerhassett at audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett at audioscience.com>
---
 pci/asihpi/hpimsgx.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/pci/asihpi/hpimsgx.c b/pci/asihpi/hpimsgx.c
index 231ae6c..c7ddbcf 100644
--- a/pci/asihpi/hpimsgx.c
+++ b/pci/asihpi/hpimsgx.c
@@ -35,7 +35,7 @@ static struct hpios_spinlock msgxLock;
 static HPI_HandlerFunc *hpi_entry_points[HPI_MAX_ADAPTERS];
 
 static HPI_HandlerFunc *HPI_LookupEntryPointFunction(
-	struct hpi_pci *PciInfo
+	const struct hpi_pci *PciInfo
 )
 {
 
@@ -555,8 +555,10 @@ static void InStreamOpen(
 		HpiOs_Msgxlock_UnLock(&msgxLock);
 
 		/* issue a reset */
-		memcpy(&hm, phm, sizeof(hm));
-		hm.wFunction = HPI_ISTREAM_RESET;
+		HPI_InitMessageResponse(&hm, &hr, HPI_OBJ_ISTREAM,
+			HPI_ISTREAM_RESET);
+		hm.wAdapterIndex = phm->wAdapterIndex;
+		hm.wObjIndex = phm->wObjIndex;
 		HW_EntryPoint(&hm, &hr);
 
 		HpiOs_Msgxlock_Lock(&msgxLock);
@@ -600,8 +602,10 @@ static void InStreamClose(
 			NULL;
 		HpiOs_Msgxlock_UnLock(&msgxLock);
 		/* issue a reset */
-		memcpy(&hm, phm, sizeof(hm));
-		hm.wFunction = HPI_ISTREAM_RESET;
+		HPI_InitMessageResponse(&hm, &hr, HPI_OBJ_ISTREAM,
+			HPI_ISTREAM_RESET);
+		hm.wAdapterIndex = phm->wAdapterIndex;
+		hm.wObjIndex = phm->wObjIndex;
 		HW_EntryPoint(&hm, &hr);
 		HpiOs_Msgxlock_Lock(&msgxLock);
 		if (hr.wError) {
@@ -654,8 +658,10 @@ static void OutStreamOpen(
 		HpiOs_Msgxlock_UnLock(&msgxLock);
 
 		/* issue a reset */
-		memcpy(&hm, phm, sizeof(hm));
-		hm.wFunction = HPI_OSTREAM_RESET;
+		HPI_InitMessageResponse(&hm, &hr, HPI_OBJ_OSTREAM,
+			HPI_OSTREAM_RESET);
+		hm.wAdapterIndex = phm->wAdapterIndex;
+		hm.wObjIndex = phm->wObjIndex;
 		HW_EntryPoint(&hm, &hr);
 
 		HpiOs_Msgxlock_Lock(&msgxLock);
@@ -700,8 +706,10 @@ static void OutStreamClose(
 			NULL;
 		HpiOs_Msgxlock_UnLock(&msgxLock);
 		/* issue a reset */
-		memcpy(&hm, phm, sizeof(hm));
-		hm.wFunction = HPI_OSTREAM_RESET;
+		HPI_InitMessageResponse(&hm, &hr, HPI_OBJ_OSTREAM,
+			HPI_OSTREAM_RESET);
+		hm.wAdapterIndex = phm->wAdapterIndex;
+		hm.wObjIndex = phm->wObjIndex;
 		HW_EntryPoint(&hm, &hr);
 		HpiOs_Msgxlock_Lock(&msgxLock);
 		if (hr.wError) {
-- 
1.7.0.rc0.8.ge3f67d



More information about the Alsa-devel mailing list