Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284104
b: refs/heads/master
c: f6baaec
h: refs/heads/master
v: v3
  • Loading branch information
Eliot Blennerhassett authored and Takashi Iwai committed Dec 22, 2011
1 parent 5cded9e commit de0e882
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47a74a5d1ed2af23c2dc1ccfdcc0176e40404345
refs/heads/master: f6baaec2af36494469aa37558db8c79186f2fa03
18 changes: 0 additions & 18 deletions trunk/sound/pci/asihpi/hpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,8 @@

#ifndef _HPI_H_
#define _HPI_H_
/* HPI Version
If HPI_VER_MINOR is odd then its a development release not intended for the
public. If HPI_VER_MINOR is even then is a release version
i.e 3.05.02 is a development version
*/
#define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \
((maj << 16) + (min << 8) + rel)

#define HPI_VER_MAJOR(v) ((int)(v >> 16))
#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))

#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0)
#define HPI_VER_STRING "4.08.00"

/* Library version as documented in hpi-api-versions.txt */
#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 0, 0)

#include <linux/types.h>
#define HPI_BUILD_EXCLUDE_DEPRECATED
#define HPI_BUILD_KERNEL_MODE

/******************************************************************************/
Expand Down
32 changes: 32 additions & 0 deletions trunk/sound/pci/asihpi/hpi_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** HPI Version Definitions
Development releases have odd minor version.
Production releases have even minor version.
\file hpi_version.h
*/

#ifndef _HPI_VERSION_H
#define _HPI_VERSION_H

/* Use single digits for versions less that 10 to avoid octal. */
/* *** HPI_VER is the only edit required to update version *** */
/** HPI version */
#define HPI_VER HPI_VERSION_CONSTRUCTOR(4, 10, 1)

/** HPI version string in dotted decimal format */
#define HPI_VER_STRING "4.10.01"

/** Library version as documented in hpi-api-versions.txt */
#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 2, 0)

/** Construct hpi version number from major, minor, release numbers */
#define HPI_VERSION_CONSTRUCTOR(maj, min, r) ((maj << 16) + (min << 8) + r)

/** Extract major version from hpi version number */
#define HPI_VER_MAJOR(v) ((int)(v >> 16))
/** Extract minor version from hpi version number */
#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
/** Extract release from hpi version number */
#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))

#endif
23 changes: 12 additions & 11 deletions trunk/sound/pci/asihpi/hpidspcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ hotplug firmware loader from individual dsp code files
#define SOURCEFILE_NAME "hpidspcd.c"
#include "hpidspcd.h"
#include "hpidebug.h"
#include "hpi_version.h"

struct dsp_code_private {
/** Firmware descriptor */
const struct firmware *firmware;
struct pci_dev *dev;
};

#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))

/*-------------------------------------------------------------------*/
short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
u32 *os_error_code)
Expand Down Expand Up @@ -66,22 +64,25 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
if ((header.type != 0x45444F43) || /* "CODE" */
(header.adapter != adapter)
|| (header.size != firmware->size)) {
dev_printk(KERN_ERR, &dev->dev, "Invalid firmware file\n");
dev_printk(KERN_ERR, &dev->dev,
"Invalid firmware header size %d != file %zd\n",
header.size, firmware->size);
goto error2;
}

if ((header.version / 100 & ~1) != (HPI_VER_DECIMAL / 100 & ~1)) {
if ((header.version >> 9) != (HPI_VER >> 9)) {
/* Consider even and subsequent odd minor versions to be compatible */
dev_printk(KERN_ERR, &dev->dev,
"Incompatible firmware version "
"DSP image %d != Driver %d\n", header.version,
HPI_VER_DECIMAL);
"DSP image %X != Driver %X\n", header.version,
HPI_VER);
goto error2;
}

if (header.version != HPI_VER_DECIMAL) {
dev_printk(KERN_WARNING, &dev->dev,
"Firmware: release version mismatch DSP image %d != Driver %d\n",
header.version, HPI_VER_DECIMAL);
if (header.version != HPI_VER) {
dev_printk(KERN_INFO, &dev->dev,
"Firmware: release version mismatch DSP image %X != Driver %X\n",
header.version, HPI_VER);
}

HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);
Expand Down
4 changes: 0 additions & 4 deletions trunk/sound/pci/asihpi/hpidspcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Functions for reading DSP code to load into DSP

#include "hpi_internal.h"

/** Code header version is decimal encoded e.g. 4.06.10 is 40601 */
#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))

/** Header structure for dsp firmware file
This structure must match that used in s2bin.c for generation of asidsp.bin
*/
Expand Down
3 changes: 2 additions & 1 deletion trunk/sound/pci/asihpi/hpimsgx.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
AudioScience HPI driver
Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>
Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
Expand All @@ -22,6 +22,7 @@ Extended Message Function With Response Caching
*****************************************************************************/
#define SOURCEFILE_NAME "hpimsgx.c"
#include "hpi_internal.h"
#include "hpi_version.h"
#include "hpimsginit.h"
#include "hpicmn.h"
#include "hpimsgx.h"
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/pci/asihpi/hpioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Common Linux HPI ioctl and module probe/remove functions
#define SOURCEFILE_NAME "hpioctl.c"

#include "hpi_internal.h"
#include "hpi_version.h"
#include "hpimsginit.h"
#include "hpidebug.h"
#include "hpimsgx.h"
Expand Down

0 comments on commit de0e882

Please sign in to comment.