All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@audioscience.com
To: tiwai@suse.de
Cc: Eliot Blennerhassett <eblennerhassett@audioscience.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH - ASIHPI 5/8] Log warning if DSP code version doesn't match driver.
Date: Thu, 05 Jun 2008 16:06:58 +1200	[thread overview]
Message-ID: <1212638821-2779-5-git-send-email-linux@audioscience.com> (raw)
In-Reply-To: <1212638821-2779-4-git-send-email-linux@audioscience.com>

From: Eliot Blennerhassett <linux@audioscience.com>


Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>

diff --git a/pci/asihpi/hpidspcd.c b/pci/asihpi/hpidspcd.c
index 2665370..8c0f251 100644
--- a/pci/asihpi/hpidspcd.c
+++ b/pci/asihpi/hpidspcd.c
@@ -56,6 +56,9 @@ struct code_header {
 #pragma pack(pop)
 #endif
 
+#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
+	    HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
+
 /***********************************************************************/
 #include "linux/pci.h"
 /*-------------------------------------------------------------------*/
@@ -100,6 +103,13 @@ short HpiDspCode_Open(
 		goto error2;
 	}
 
+	if (header.version != HPI_VER_DECIMAL) {
+		HPI_DEBUG_LOG(WARNING,
+			"Version mismatch  DSP image %d != Driver %d\n",
+			header.version, HPI_VER_DECIMAL);
+		/* goto error2;  still allow driver to load */
+	}
+
 	HPI_DEBUG_LOG(INFO, "Dsp code %s opened\n", fw_name);
 	psDspCode->psFirmware = psFirmware;
 	psDspCode->dwBlockLength = header.size / sizeof(u32);
-- 
1.5.4.3

  reply	other threads:[~2008-06-05  4:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  4:06 [PATCH - ASIHPI 1/8] Common init files for HPI linux
2008-06-05  4:06 ` [PATCH - ASIHPI 2/8] Fix sampleclock source get. Fix volume control dB range linux
2008-06-05  4:06   ` [PATCH - ASIHPI 3/8] Replace hpimod.c with hpioctl.c linux
2008-06-05  4:06     ` [PATCH - ASIHPI 4/8] Include pci table again, avoiding warning about extern linux
2008-06-05  4:06       ` linux [this message]
2008-06-05  4:06         ` [PATCH - ASIHPI 6/8] Version 3.10.00. Add new functions for HD radio tuner, and for firmware debug linux
2008-06-05  4:07           ` [PATCH - ASIHPI 7/8] Support variable size cached control information linux
2008-06-05  4:07             ` [PATCH - ASIHPI 8/8] Checkpatch tweaks linux
2008-06-05  4:34 ` [PATCH - ASIHPI 1/8] Common init files for HPI Eliot Blennerhassett
2008-06-06 10:34   ` Takashi Iwai
2008-06-11 23:22     ` 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=1212638821-2779-5-git-send-email-linux@audioscience.com \
    --to=linux@audioscience.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=eblennerhassett@audioscience.com \
    --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.