[PATCH] asihpi fix 64 bit compile error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Eliot Blennerhassett <eblennerhassett@xxxxxxxxxxxxxxxx>

Changes:
Add missed conditional compilation in hpi.h for 64 bit build.
Tweak struct HPI_RESOURCE so size is constant for 32/64 bit.  Update size 
check to reflect this.
-- 
--
Eliot Blennerhassett
AudioScience Inc.
diff -r 7306cb0ea4fa pci/asihpi/hpi.h
--- a/pci/asihpi/hpi.h	Mon Jan 29 14:23:31 2007
+++ b/pci/asihpi/hpi.h	Tue Jan 30 13:21:54 2007
@@ -47,7 +47,7 @@
 #define HPI_VER_MINOR(v) (((v)>>8) & 0xFF )
 #define HPI_VER_RELEASE(v) ((v) & 0xFF )
 
-#define HPI_VER HPI_VERSION_CONSTRUCTOR( 3, 05, 07 )
+#define HPI_VER HPI_VERSION_CONSTRUCTOR( 3, 5, 10 )
 
 /** Define HPI_WITHOUT_HPI_DATA to remove public definition and use of HPI_DATA struct */
 /* #define HPI_WITHOUT_HPI_DATA */
@@ -723,8 +723,7 @@
 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40	/*!< This packet must make its way to the host across the HPI interface */
 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41	/*!< This packet must make its way to the host across the HPI interface */
 
-#define HPI_ETHERNET_UDP_PORT (5151)	/*!< UDP messaging port */
-#define HPI_ETHERNET_UDP_PORT_BROADCAST_RESPONSE (5152)	/*!< UDP message port for returning broadcast responses */
+#define HPI_ETHERNET_UDP_PORT (44600)	/*!< UDP messaging port */
 
 /** \defgroup tonedet_attr Tonedetector attributes
 \{
@@ -2118,10 +2117,10 @@
 	typedef struct {
 		union {
 			HPI_PCI *Pci;
+		} r;
 #ifndef HPI_64BIT		/* keep structure size constant */
-			u32 dwPadTo64;
+		u32 dwPadTo64;
 #endif
-		} r;
 		u16 wBusType;	/* HPI_BUS_PNPISA, _PCI, _USB etc */
 		u16 wPadding;
 
@@ -2258,7 +2257,9 @@
 	typedef struct {
 		union {
 			HPI_MSG_DATA Data;
+#ifndef HPI_64BIT
 			HPI_DATA_LEGACY32 Data32;
+#endif
 			u16 wVelocity;
 			HPI_PUNCHINOUT Pio;
 			u32 dwTimeScale;
diff -r 7306cb0ea4fa pci/asihpi/hpicheck.h
--- a/pci/asihpi/hpicheck.h	Mon Jan 29 14:23:31 2007
+++ b/pci/asihpi/hpicheck.h	Tue Jan 30 13:21:54 2007
@@ -60,7 +60,7 @@
 
 compile_time_size_check(HPI_RESPONSE, 64);
 
-compile_time_obj_check(HPI_SUBSYS, 8, 52);
+compile_time_obj_check(HPI_SUBSYS, 12, 52);
 compile_time_obj_check(HPI_ADAPTER, 8, 32);
 compile_time_obj_check(HPI_ADAPTERX, 12, 32);
 compile_time_obj_check(HPI_STREAM, 32, 20);
@@ -83,7 +83,9 @@
 /* API HPI_FORMAT must have fixed size */
 compile_time_size_check(HPI_DATA, 7 * 4);
 compile_time_size_check(HPI_BUFFER, 7 * 4);
+#ifndef HPI_64BIT
 compile_time_size_check(HPI_DATA_LEGACY32, 7 * 4);
+#endif
 
 /* Message DATA must fit inside API data */
 compile_time_assert((sizeof(HPI_MSG_DATA) <= sizeof(HPI_DATA)), data_fit);
diff -r 7306cb0ea4fa pci/asihpi/hpifunc.c
--- a/pci/asihpi/hpifunc.c	Mon Jan 29 14:23:31 2007
+++ b/pci/asihpi/hpifunc.c	Tue Jan 30 13:21:54 2007
@@ -2002,7 +2002,7 @@
 *
 * Returns information about the input stream.
 *
-*This includes the size of the stream?s hardware buffer returned in pdwBufferSize. 
+*This includes the size of the streams hardware buffer returned in pdwBufferSize. 
 * Also includes whether the stream is currently recording (the state) and the amount of audio data currently contained in the buffer.
 */
 
@@ -2023,7 +2023,7 @@
 
 /** Returns extended information about the input stream.
 *
-* This includes the size of the stream?s hardware buffer returned in pdwBufferSize.  Also includes whether the
+* This includes the size of the streams hardware buffer returned in pdwBufferSize.  Also includes whether the
 * stream is currently recording (the state), the amount of audio data currently contained in the buffer and how many samples have been recorded.
 *
 * \param pdwSamplesRecorded The SamplesRecorded parameter returns the number of samples recorded since the
@@ -2084,14 +2084,14 @@
 * Note that when (wMode== HPI_MPEG_ANC_HASENERGY, see below) an additional 5 bytes per frame are
 * automatically allocated for energy information.
 * \param wMode The mode for the ancillary data extraction to operate in. Valid settings are HPI_MPEG_ANC_RAW and
-* HPI_MPEG_ANC_HASENERGY. The ?RAW? mode indicates that the entire ancillary data field is taken up by data from the
-* Anc data buffer. The ?HASENERGY? option tells the encoder that the MPEG frames have energy information stored in them
+* HPI_MPEG_ANC_HASENERGY. The RAW mode indicates that the entire ancillary data field is taken up by data from the
+* Anc data buffer. The HASENERGY option tells the encoder that the MPEG frames have energy information stored in them
 * (5 bytes per stereo frame, 3 per mono). The encoder will insert the energy bytes before filling the remainder of the
 * ancillary data space with data from the ancillary data buffer.
-* \param wAlignment HPI_MPEG_ANC_ALIGN_LEFT ? the wBytesPerFrame data immediately follow the audio data.
+* \param wAlignment HPI_MPEG_ANC_ALIGN_LEFT  the wBytesPerFrame data immediately follow the audio data.
 * Spare space is left at the end of the frame.
-* HPI_MPEG_ANC_ALIGN_RIGHT ? the wBytesPerFrame data is packed against the end of the frame. Spare space is left at the start of the frame.
-* HPI_MPEG_ANC_ALIGN_FILL ? all ancillary data space in the frame is used. wBytesPerFrame or more data is written per frame. There is no spare space.
+* HPI_MPEG_ANC_ALIGN_RIGHT  the wBytesPerFrame data is packed against the end of the frame. Spare space is left at the start of the frame.
+* HPI_MPEG_ANC_ALIGN_FILL  all ancillary data space in the frame is used. wBytesPerFrame or more data is written per frame. There is no spare space.
 *This parameter is ignored for MP3 encoding, effectively it is fixed at HPI_MPEG_ANC_ALIGN_FILL  (See Note 2)
 * \param wIdleBit This field tells the encoder what to set all the bits of the ancillary data field to in the case where there is no data waiting to be inserted.
 * Valid values are 0 or 1.  This parameter is ignored for MP3 encoding, if no data is available, no data will be inserted  (See Note 2)
@@ -2148,7 +2148,7 @@
 }
 
 /**
-* Writes dwNumberOfAncDataFramesToWrite frames from pAncFrameBuffer to the stream?s ancillary data buffer.
+* Writes dwNumberOfAncDataFramesToWrite frames from pAncFrameBuffer to the streams ancillary data buffer.
 *
 *The first bit of ancillary information that follows the valid audio data is bit 7 of  bData[0]. The first 8 bits of ancillary information following
 * valid audio data are from bData[0]. In the case where there are 6 bytes total of ancillary information (48 bits) the last byte inserted in the frame is bData[5].
@@ -2190,8 +2190,8 @@
 * for the buffer can be calculated using HPI_StreamEstimateHostBufferSize()
 *
 * \return Error 0 upon success\n
-* HPI_ERROR_INVALID_DATASIZE if memory can?t be allocated (retrying the call with a smaller size may succeed)\n
-* HPI_ERROR_INVALID_OPERATION if virtual address of buffer can?t be found.
+* HPI_ERROR_INVALID_DATASIZE if memory cant be allocated (retrying the call with a smaller size may succeed)\n
+* HPI_ERROR_INVALID_OPERATION if virtual address of buffer cant be found.
 */
 u16 HPI_InStreamHostBufferAllocate(HPI_HSUBSYS * phSubSys,	///< Pointer to HPI subsystem handle
 				   HPI_HISTREAM hInStream,	///< Handle of the InStream
@@ -2374,7 +2374,8 @@
 *
 * \note Not all adapters have controls at all nodes, or between all nodes.  Consult the Mixer Map for your particular
 *adapter to find out the location and type of controls in its mixer.
-* \example Say you have an audio adapter with a mixer that has the following layout: 
+*
+* Say you have an audio adapter with a mixer that has the following layout: 
 * (Need to add diagram.)
 * You can see that the mixer has two meter controls, located on each of the Outstream source nodes, two volume controls, located between
 * the OutStream sources and the LineOut destination nodes and one level control located on the LineOut destination node.
@@ -2395,7 +2396,7 @@
 			u16 wSrcNodeTypeIndex,	///< Index of particular source node type i.e. the 2nd HPI_SOURCENODE_OSTREAM would be specified as index=1
 			u16 wDstNodeType,	///< Destination node type i.e. HPI_DESTNODE_LINEOUT
 			u16 wDstNodeTypeIndex,	///< Index of particular source node type i.e. the 3rd HPI_DESTNODE_LINEOUT would be specified as index=2
-			u16 wControlType,	// HPI_CONTROL_METER, _VOLUME etc///< Type of mixer control i.e. HPI_CONTROL_METER,  VOLUME, METER or LEVEL. See additional HPI_CONTROL_xxxx types defined in HPI.H
+			u16 wControlType,	///< Type of mixer control i.e. HPI_CONTROL_METER,  VOLUME, METER or LEVEL. See additional HPI_CONTROL_xxxx types defined in HPI.H
 			HPI_HCONTROL * phControlHandle	///< Handle to the particular control
     )
 {
diff -r 7306cb0ea4fa pci/asihpi/hpimod.c
--- a/pci/asihpi/hpimod.c	Mon Jan 29 14:23:31 2007
+++ b/pci/asihpi/hpimod.c	Tue Jan 30 13:21:54 2007
@@ -623,7 +623,9 @@
 	       __stringify(DRIVER_VERSION), hpiDebugLevel);
 	printk("Spinlock on=%d Local copy=%d\n", USE_SPINLOCK, COPY_TO_LOCAL);
 	HPI_SubSysGetVersionEx(NULL, &dwVersion);
-	printk(KERN_INFO "HPI_SubSysGetVersion=%x\n", dwVersion);
+	printk(KERN_INFO "SubSys Version=%d.%02d.%02d\n",
+	       HPI_VER_MAJOR(dwVersion),
+	       HPI_VER_MINOR(dwVersion), HPI_VER_RELEASE(dwVersion));
 
 	HPI_InitMessage(&hm, HPI_OBJ_SUBSYSTEM, HPI_SUBSYS_DRIVER_LOAD);
 	HPI_MessageEx(&hm, &hr, HOWNER_KERNEL);
diff -r 7306cb0ea4fa pci/asihpi/hpios.h
--- a/pci/asihpi/hpios.h	Mon Jan 29 14:23:31 2007
+++ b/pci/asihpi/hpios.h	Tue Jan 30 13:21:54 2007
@@ -73,8 +73,12 @@
 /* /////////////////////////// PROTOTYPES /////////////////////////////////// */
 
 /* memory allocation */
+#ifndef HpiOs_MemAlloc
 void *HpiOs_MemAlloc(u32 dwSize);
+#endif
+#ifndef HpiOs_MemFree
 void HpiOs_MemFree(void *ptr);
+#endif
 
 /* physical memory allocation */
 #ifndef NO_HPIOS_LOCKEDMEM_OPS
@@ -105,14 +109,14 @@
 
 /** Get the physical PCI address of memory represented by LockedMemHandle.
 
-If handle is NULL *pPhysicalAddr is set to zero and return 1 
+If handle is NULL *pPhysicalAddr is set to zero and return 1
 */
 u16 HpiOs_LockedMem_GetPhysAddr(HpiOs_LockedMem_Handle LockedMemHandle,
 				u32 * pPhysicalAddr);
 
 /** Get the CPU address of of memory represented by LockedMemHandle.
 
-If handle is NULL *ppvVirtualAddr is set to NULL and return 1 
+If handle is NULL *ppvVirtualAddr is set to NULL and return 1
 */
 u16 HpiOs_LockedMem_GetVirtAddr(HpiOs_LockedMem_Handle LockedMemHandle,
 				void **ppvVirtualAddr);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux