hpimsginit.c (f43dc23d5ea91fca257be02138a255f02d98e806) | hpimsginit.c (0a1602c02be606b72003104dbf5f0f8293c42588) |
---|---|
1/****************************************************************************** 2 3 AudioScience HPI driver 4 Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of version 2 of the GNU General Public License as 8 published by the Free Software Foundation; --- 18 unchanged lines hidden (view full) --- 27/* The actual message size for each object type */ 28static u16 msg_size[HPI_OBJ_MAXINDEX + 1] = HPI_MESSAGE_SIZE_BY_OBJECT; 29/* The actual response size for each object type */ 30static u16 res_size[HPI_OBJ_MAXINDEX + 1] = HPI_RESPONSE_SIZE_BY_OBJECT; 31/* Flag to enable alternate message type for SSX2 bypass. */ 32static u16 gwSSX2_bypass; 33 34/** \internal | 1/****************************************************************************** 2 3 AudioScience HPI driver 4 Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of version 2 of the GNU General Public License as 8 published by the Free Software Foundation; --- 18 unchanged lines hidden (view full) --- 27/* The actual message size for each object type */ 28static u16 msg_size[HPI_OBJ_MAXINDEX + 1] = HPI_MESSAGE_SIZE_BY_OBJECT; 29/* The actual response size for each object type */ 30static u16 res_size[HPI_OBJ_MAXINDEX + 1] = HPI_RESPONSE_SIZE_BY_OBJECT; 31/* Flag to enable alternate message type for SSX2 bypass. */ 32static u16 gwSSX2_bypass; 33 34/** \internal |
35 * Used by ASIO driver to disable SSX2 for a single process 36 * \param phSubSys Pointer to HPI subsystem handle. 37 * \param wBypass New bypass setting 0 = off, nonzero = on 38 * \return Previous bypass setting. 39 */ 40u16 hpi_subsys_ssx2_bypass(const struct hpi_hsubsys *ph_subsys, u16 bypass) 41{ 42 u16 old_value = gwSSX2_bypass; 43 44 gwSSX2_bypass = bypass; 45 46 return old_value; 47} 48 49/** \internal | |
50 * initialize the HPI message structure 51 */ 52static void hpi_init_message(struct hpi_message *phm, u16 object, 53 u16 function) 54{ 55 memset(phm, 0, sizeof(*phm)); 56 if ((object > 0) && (object <= HPI_OBJ_MAXINDEX)) 57 phm->size = msg_size[object]; 58 else 59 phm->size = sizeof(*phm); 60 61 if (gwSSX2_bypass) 62 phm->type = HPI_TYPE_SSX2BYPASS_MESSAGE; 63 else 64 phm->type = HPI_TYPE_MESSAGE; 65 phm->object = object; 66 phm->function = function; 67 phm->version = 0; | 35 * initialize the HPI message structure 36 */ 37static void hpi_init_message(struct hpi_message *phm, u16 object, 38 u16 function) 39{ 40 memset(phm, 0, sizeof(*phm)); 41 if ((object > 0) && (object <= HPI_OBJ_MAXINDEX)) 42 phm->size = msg_size[object]; 43 else 44 phm->size = sizeof(*phm); 45 46 if (gwSSX2_bypass) 47 phm->type = HPI_TYPE_SSX2BYPASS_MESSAGE; 48 else 49 phm->type = HPI_TYPE_MESSAGE; 50 phm->object = object; 51 phm->function = function; 52 phm->version = 0; |
68 /* Expect adapter index to be set by caller */ | 53 phm->adapter_index = 0xFFFF; 54 /* Expect actual adapter index to be set by caller */ |
69} 70 71/** \internal 72 * initialize the HPI response structure 73 */ 74void hpi_init_response(struct hpi_response *phr, u16 object, u16 function, 75 u16 error) 76{ --- 54 unchanged lines hidden --- | 55} 56 57/** \internal 58 * initialize the HPI response structure 59 */ 60void hpi_init_response(struct hpi_response *phr, u16 object, u16 function, 61 u16 error) 62{ --- 54 unchanged lines hidden --- |