All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@audioscience.com
To: patch@alsa-project.org
Cc: tiwai@suse.de,
	Eliot Blennerhassett <eblennerhassett@audioscience.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH 3/7] Reinit response size for every msg/response transaction. Minor fix const ptr
Date: Tue, 23 Mar 2010 21:14:23 +1300	[thread overview]
Message-ID: <1269332067-25959-4-git-send-email-linux@audioscience.com> (raw)
In-Reply-To: <1269332067-25959-1-git-send-email-linux@audioscience.com>

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Signed-off-by: Eliot Blennerhassett <eblennerhassett@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

  parent reply	other threads:[~2010-03-23  8:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23  8:14 [PATCH 0/7] snd-asihpi playback improvement + others linux
2010-03-23  8:14 ` [PATCH 1/7] Remove obsolete comment Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> linux
2010-03-23 14:07   ` Takashi Iwai
2010-03-23  8:14 ` [PATCH 2/7] - const correct pointer parameters. - add a new stream state wait and function linux
2010-03-23  8:14 ` linux [this message]
2010-03-23  8:14 ` [PATCH 4/7] Bump lib version due to added and removed APIs linux
2010-03-23  8:14 ` [PATCH 5/7] Use adapter properties for stream buffer constraints. Default to less logging, remove VPRINTK3 Log buffer info in decimal linux
2010-03-23  8:14 ` [PATCH 6/7] Keep HPI buffer pointers in sync with ALSA after prewrite linux
2010-03-23  8:14 ` [PATCH 7/7] Support mic control caching. Move an enum out of public api linux
2010-03-23 14:07 ` [PATCH 0/7] snd-asihpi playback improvement + others Takashi Iwai
2010-03-24 11:06   ` Takashi Iwai
2010-03-24 20:05     ` Eliot Blennerhassett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1269332067-25959-4-git-send-email-linux@audioscience.com \
    --to=linux@audioscience.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=eblennerhassett@audioscience.com \
    --cc=patch@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.