aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2010-03-24 10:23:31 +1300
committerTakashi Iwai <tiwai@suse.de>2010-03-24 07:39:36 +0100
commitf0d34e8d1e408f1244a129adf0b35d1846ff14ef (patch)
tree55d60a0cd0716e1beb1f73e640278a9e25af4c43
parent105a76080344ecc812f8f733c6935b3d35c7eded (diff)
downloadalsa-driver-build-unstable-f0d34e8d1e408f1244a129adf0b35d1846ff14ef.tar.gz
snd-asihpi: Reinit response size for every msg/response transaction. Minor fix const ptr
Response size must be reinitialised for each use, because it is used as a buffer size limit. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--pci/asihpi/hpimsgx.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/pci/asihpi/hpimsgx.c b/pci/asihpi/hpimsgx.c
index 231ae6cb9..c7ddbcfa8 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) {