hpi_internal.h 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516
  1. /******************************************************************************
  2. AudioScience HPI driver
  3. Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of version 2 of the GNU General Public License as
  6. published by the Free Software Foundation;
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  14. HPI internal definitions
  15. (C) Copyright AudioScience Inc. 1996-2009
  16. ******************************************************************************/
  17. #ifndef _HPI_INTERNAL_H_
  18. #define _HPI_INTERNAL_H_
  19. #include "hpi.h"
  20. /** maximum number of memory regions mapped to an adapter */
  21. #define HPI_MAX_ADAPTER_MEM_SPACES (2)
  22. /* Each OS needs its own hpios.h */
  23. #include "hpios.h"
  24. /* physical memory allocation */
  25. /** Allocate and map an area of locked memory for bus master DMA operations.
  26. On success, *pLockedMemeHandle is a valid handle, and 0 is returned
  27. On error *pLockedMemHandle marked invalid, non-zero returned.
  28. If this function succeeds, then HpiOs_LockedMem_GetVirtAddr() and
  29. HpiOs_LockedMem_GetPyhsAddr() will always succed on the returned handle.
  30. */
  31. u16 hpios_locked_mem_alloc(struct consistent_dma_area *p_locked_mem_handle,
  32. /**< memory handle */
  33. u32 size, /**< Size in bytes to allocate */
  34. struct pci_dev *p_os_reference
  35. /**< OS specific data required for memory allocation */
  36. );
  37. /** Free mapping and memory represented by LockedMemHandle
  38. Frees any resources, then invalidates the handle.
  39. Returns 0 on success, 1 if handle is invalid.
  40. */
  41. u16 hpios_locked_mem_free(struct consistent_dma_area *locked_mem_handle);
  42. /** Get the physical PCI address of memory represented by LockedMemHandle.
  43. If handle is invalid *pPhysicalAddr is set to zero and return 1
  44. */
  45. u16 hpios_locked_mem_get_phys_addr(struct consistent_dma_area
  46. *locked_mem_handle, u32 *p_physical_addr);
  47. /** Get the CPU address of of memory represented by LockedMemHandle.
  48. If handle is NULL *ppvVirtualAddr is set to NULL and return 1
  49. */
  50. u16 hpios_locked_mem_get_virt_addr(struct consistent_dma_area
  51. *locked_mem_handle, void **ppv_virtual_addr);
  52. /** Check that handle is valid
  53. i.e it represents a valid memory area
  54. */
  55. u16 hpios_locked_mem_valid(struct consistent_dma_area *locked_mem_handle);
  56. /* timing/delay */
  57. void hpios_delay_micro_seconds(u32 num_micro_sec);
  58. struct hpi_message;
  59. struct hpi_response;
  60. typedef void hpi_handler_func(struct hpi_message *, struct hpi_response *);
  61. /* If the assert fails, compiler complains
  62. something like size of array `msg' is negative.
  63. Unlike linux BUILD_BUG_ON, this works outside function scope.
  64. */
  65. #define compile_time_assert(cond, msg) \
  66. typedef char ASSERT_##msg[(cond) ? 1 : -1]
  67. /******************************************* bus types */
  68. enum HPI_BUSES {
  69. HPI_BUS_ISAPNP = 1,
  70. HPI_BUS_PCI = 2,
  71. HPI_BUS_USB = 3,
  72. HPI_BUS_NET = 4
  73. };
  74. enum HPI_SUBSYS_OPTIONS {
  75. /* 0, 256 are invalid, 1..255 reserved for global options */
  76. HPI_SUBSYS_OPT_NET_ENABLE = 257,
  77. HPI_SUBSYS_OPT_NET_BROADCAST = 258,
  78. HPI_SUBSYS_OPT_NET_UNICAST = 259,
  79. HPI_SUBSYS_OPT_NET_ADDR = 260,
  80. HPI_SUBSYS_OPT_NET_MASK = 261,
  81. HPI_SUBSYS_OPT_NET_ADAPTER_ADDRESS_ADD = 262
  82. };
  83. /** Volume flags
  84. */
  85. enum HPI_VOLUME_FLAGS {
  86. /** Set if the volume control is muted */
  87. HPI_VOLUME_FLAG_MUTED = (1 << 0),
  88. /** Set if the volume control has a mute function */
  89. HPI_VOLUME_FLAG_HAS_MUTE = (1 << 1),
  90. /** Set if volume control can do autofading */
  91. HPI_VOLUME_FLAG_HAS_AUTOFADE = (1 << 2)
  92. /* Note Flags >= (1<<8) are for DSP internal use only */
  93. };
  94. /******************************************* CONTROL ATTRIBUTES ****/
  95. /* (in order of control type ID */
  96. /* This allows for 255 control types, 256 unique attributes each */
  97. #define HPI_CTL_ATTR(ctl, ai) ((HPI_CONTROL_##ctl << 8) + ai)
  98. /* Get the sub-index of the attribute for a control type */
  99. #define HPI_CTL_ATTR_INDEX(i) (i & 0xff)
  100. /* Extract the control from the control attribute */
  101. #define HPI_CTL_ATTR_CONTROL(i) (i >> 8)
  102. /** Enable event generation for a control.
  103. 0=disable, 1=enable
  104. \note generic to all controls that can generate events
  105. */
  106. /** Unique identifiers for every control attribute
  107. */
  108. enum HPI_CONTROL_ATTRIBUTES {
  109. HPI_GENERIC_ENABLE = HPI_CTL_ATTR(GENERIC, 1),
  110. HPI_GENERIC_EVENT_ENABLE = HPI_CTL_ATTR(GENERIC, 2),
  111. HPI_VOLUME_GAIN = HPI_CTL_ATTR(VOLUME, 1),
  112. HPI_VOLUME_AUTOFADE = HPI_CTL_ATTR(VOLUME, 2),
  113. HPI_VOLUME_MUTE = HPI_CTL_ATTR(VOLUME, 3),
  114. HPI_VOLUME_GAIN_AND_FLAGS = HPI_CTL_ATTR(VOLUME, 4),
  115. HPI_VOLUME_NUM_CHANNELS = HPI_CTL_ATTR(VOLUME, 6),
  116. HPI_VOLUME_RANGE = HPI_CTL_ATTR(VOLUME, 10),
  117. HPI_METER_RMS = HPI_CTL_ATTR(METER, 1),
  118. HPI_METER_PEAK = HPI_CTL_ATTR(METER, 2),
  119. HPI_METER_RMS_BALLISTICS = HPI_CTL_ATTR(METER, 3),
  120. HPI_METER_PEAK_BALLISTICS = HPI_CTL_ATTR(METER, 4),
  121. HPI_METER_NUM_CHANNELS = HPI_CTL_ATTR(METER, 5),
  122. HPI_MULTIPLEXER_SOURCE = HPI_CTL_ATTR(MULTIPLEXER, 1),
  123. HPI_MULTIPLEXER_QUERYSOURCE = HPI_CTL_ATTR(MULTIPLEXER, 2),
  124. HPI_AESEBUTX_FORMAT = HPI_CTL_ATTR(AESEBUTX, 1),
  125. HPI_AESEBUTX_SAMPLERATE = HPI_CTL_ATTR(AESEBUTX, 3),
  126. HPI_AESEBUTX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBUTX, 4),
  127. HPI_AESEBUTX_USERDATA = HPI_CTL_ATTR(AESEBUTX, 5),
  128. HPI_AESEBURX_FORMAT = HPI_CTL_ATTR(AESEBURX, 1),
  129. HPI_AESEBURX_ERRORSTATUS = HPI_CTL_ATTR(AESEBURX, 2),
  130. HPI_AESEBURX_SAMPLERATE = HPI_CTL_ATTR(AESEBURX, 3),
  131. HPI_AESEBURX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBURX, 4),
  132. HPI_AESEBURX_USERDATA = HPI_CTL_ATTR(AESEBURX, 5),
  133. HPI_LEVEL_GAIN = HPI_CTL_ATTR(LEVEL, 1),
  134. HPI_LEVEL_RANGE = HPI_CTL_ATTR(LEVEL, 10),
  135. HPI_TUNER_BAND = HPI_CTL_ATTR(TUNER, 1),
  136. HPI_TUNER_FREQ = HPI_CTL_ATTR(TUNER, 2),
  137. HPI_TUNER_LEVEL_AVG = HPI_CTL_ATTR(TUNER, 3),
  138. HPI_TUNER_LEVEL_RAW = HPI_CTL_ATTR(TUNER, 4),
  139. HPI_TUNER_SNR = HPI_CTL_ATTR(TUNER, 5),
  140. HPI_TUNER_GAIN = HPI_CTL_ATTR(TUNER, 6),
  141. HPI_TUNER_STATUS = HPI_CTL_ATTR(TUNER, 7),
  142. HPI_TUNER_MODE = HPI_CTL_ATTR(TUNER, 8),
  143. HPI_TUNER_RDS = HPI_CTL_ATTR(TUNER, 9),
  144. HPI_TUNER_DEEMPHASIS = HPI_CTL_ATTR(TUNER, 10),
  145. HPI_TUNER_PROGRAM = HPI_CTL_ATTR(TUNER, 11),
  146. HPI_TUNER_HDRADIO_SIGNAL_QUALITY = HPI_CTL_ATTR(TUNER, 12),
  147. HPI_TUNER_HDRADIO_SDK_VERSION = HPI_CTL_ATTR(TUNER, 13),
  148. HPI_TUNER_HDRADIO_DSP_VERSION = HPI_CTL_ATTR(TUNER, 14),
  149. HPI_TUNER_HDRADIO_BLEND = HPI_CTL_ATTR(TUNER, 15),
  150. HPI_VOX_THRESHOLD = HPI_CTL_ATTR(VOX, 1),
  151. HPI_CHANNEL_MODE_MODE = HPI_CTL_ATTR(CHANNEL_MODE, 1),
  152. HPI_BITSTREAM_DATA_POLARITY = HPI_CTL_ATTR(BITSTREAM, 1),
  153. HPI_BITSTREAM_CLOCK_EDGE = HPI_CTL_ATTR(BITSTREAM, 2),
  154. HPI_BITSTREAM_CLOCK_SOURCE = HPI_CTL_ATTR(BITSTREAM, 3),
  155. HPI_BITSTREAM_ACTIVITY = HPI_CTL_ATTR(BITSTREAM, 4),
  156. HPI_SAMPLECLOCK_SOURCE = HPI_CTL_ATTR(SAMPLECLOCK, 1),
  157. HPI_SAMPLECLOCK_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 2),
  158. HPI_SAMPLECLOCK_SOURCE_INDEX = HPI_CTL_ATTR(SAMPLECLOCK, 3),
  159. HPI_SAMPLECLOCK_LOCAL_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 4),
  160. HPI_SAMPLECLOCK_AUTO = HPI_CTL_ATTR(SAMPLECLOCK, 5),
  161. HPI_SAMPLECLOCK_LOCAL_LOCK = HPI_CTL_ATTR(SAMPLECLOCK, 6),
  162. HPI_MICROPHONE_PHANTOM_POWER = HPI_CTL_ATTR(MICROPHONE, 1),
  163. HPI_EQUALIZER_NUM_FILTERS = HPI_CTL_ATTR(EQUALIZER, 1),
  164. HPI_EQUALIZER_FILTER = HPI_CTL_ATTR(EQUALIZER, 2),
  165. HPI_EQUALIZER_COEFFICIENTS = HPI_CTL_ATTR(EQUALIZER, 3),
  166. HPI_COMPANDER_PARAMS = HPI_CTL_ATTR(COMPANDER, 1),
  167. HPI_COMPANDER_MAKEUPGAIN = HPI_CTL_ATTR(COMPANDER, 2),
  168. HPI_COMPANDER_THRESHOLD = HPI_CTL_ATTR(COMPANDER, 3),
  169. HPI_COMPANDER_RATIO = HPI_CTL_ATTR(COMPANDER, 4),
  170. HPI_COMPANDER_ATTACK = HPI_CTL_ATTR(COMPANDER, 5),
  171. HPI_COMPANDER_DECAY = HPI_CTL_ATTR(COMPANDER, 6),
  172. HPI_COBRANET_SET = HPI_CTL_ATTR(COBRANET, 1),
  173. HPI_COBRANET_GET = HPI_CTL_ATTR(COBRANET, 2),
  174. /*HPI_COBRANET_SET_DATA = HPI_CTL_ATTR(COBRANET, 3), */
  175. /*HPI_COBRANET_GET_DATA = HPI_CTL_ATTR(COBRANET, 4), */
  176. HPI_COBRANET_GET_STATUS = HPI_CTL_ATTR(COBRANET, 5),
  177. HPI_COBRANET_SEND_PACKET = HPI_CTL_ATTR(COBRANET, 6),
  178. HPI_COBRANET_GET_PACKET = HPI_CTL_ATTR(COBRANET, 7),
  179. HPI_TONEDETECTOR_THRESHOLD = HPI_CTL_ATTR(TONEDETECTOR, 1),
  180. HPI_TONEDETECTOR_STATE = HPI_CTL_ATTR(TONEDETECTOR, 2),
  181. HPI_TONEDETECTOR_FREQUENCY = HPI_CTL_ATTR(TONEDETECTOR, 3),
  182. HPI_SILENCEDETECTOR_THRESHOLD = HPI_CTL_ATTR(SILENCEDETECTOR, 1),
  183. HPI_SILENCEDETECTOR_STATE = HPI_CTL_ATTR(SILENCEDETECTOR, 2),
  184. HPI_SILENCEDETECTOR_DELAY = HPI_CTL_ATTR(SILENCEDETECTOR, 3),
  185. HPI_PAD_CHANNEL_NAME = HPI_CTL_ATTR(PAD, 1),
  186. HPI_PAD_ARTIST = HPI_CTL_ATTR(PAD, 2),
  187. HPI_PAD_TITLE = HPI_CTL_ATTR(PAD, 3),
  188. HPI_PAD_COMMENT = HPI_CTL_ATTR(PAD, 4),
  189. HPI_PAD_PROGRAM_TYPE = HPI_CTL_ATTR(PAD, 5),
  190. HPI_PAD_PROGRAM_ID = HPI_CTL_ATTR(PAD, 6),
  191. HPI_PAD_TA_SUPPORT = HPI_CTL_ATTR(PAD, 7),
  192. HPI_PAD_TA_ACTIVE = HPI_CTL_ATTR(PAD, 8)
  193. };
  194. #define HPI_POLARITY_POSITIVE 0
  195. #define HPI_POLARITY_NEGATIVE 1
  196. /*------------------------------------------------------------
  197. Cobranet Chip Bridge - copied from HMI.H
  198. ------------------------------------------------------------*/
  199. #define HPI_COBRANET_HMI_cobra_bridge 0x20000
  200. #define HPI_COBRANET_HMI_cobra_bridge_tx_pkt_buf \
  201. (HPI_COBRANET_HMI_cobra_bridge + 0x1000)
  202. #define HPI_COBRANET_HMI_cobra_bridge_rx_pkt_buf \
  203. (HPI_COBRANET_HMI_cobra_bridge + 0x2000)
  204. #define HPI_COBRANET_HMI_cobra_if_table1 0x110000
  205. #define HPI_COBRANET_HMI_cobra_if_phy_address \
  206. (HPI_COBRANET_HMI_cobra_if_table1 + 0xd)
  207. #define HPI_COBRANET_HMI_cobra_protocolIP 0x72000
  208. #define HPI_COBRANET_HMI_cobra_ip_mon_currentIP \
  209. (HPI_COBRANET_HMI_cobra_protocolIP + 0x0)
  210. #define HPI_COBRANET_HMI_cobra_ip_mon_staticIP \
  211. (HPI_COBRANET_HMI_cobra_protocolIP + 0x2)
  212. #define HPI_COBRANET_HMI_cobra_sys 0x100000
  213. #define HPI_COBRANET_HMI_cobra_sys_desc \
  214. (HPI_COBRANET_HMI_cobra_sys + 0x0)
  215. #define HPI_COBRANET_HMI_cobra_sys_objectID \
  216. (HPI_COBRANET_HMI_cobra_sys + 0x100)
  217. #define HPI_COBRANET_HMI_cobra_sys_contact \
  218. (HPI_COBRANET_HMI_cobra_sys + 0x200)
  219. #define HPI_COBRANET_HMI_cobra_sys_name \
  220. (HPI_COBRANET_HMI_cobra_sys + 0x300)
  221. #define HPI_COBRANET_HMI_cobra_sys_location \
  222. (HPI_COBRANET_HMI_cobra_sys + 0x400)
  223. /*------------------------------------------------------------
  224. Cobranet Chip Status bits
  225. ------------------------------------------------------------*/
  226. #define HPI_COBRANET_HMI_STATUS_RXPACKET 2
  227. #define HPI_COBRANET_HMI_STATUS_TXPACKET 3
  228. /*------------------------------------------------------------
  229. Ethernet header size
  230. ------------------------------------------------------------*/
  231. #define HPI_ETHERNET_HEADER_SIZE (16)
  232. /* These defines are used to fill in protocol information for an Ethernet packet
  233. sent using HMI on CS18102 */
  234. /** ID supplied by Cirrus for ASI packets. */
  235. #define HPI_ETHERNET_PACKET_ID 0x85
  236. /** Simple packet - no special routing required */
  237. #define HPI_ETHERNET_PACKET_V1 0x01
  238. /** This packet must make its way to the host across the HPI interface */
  239. #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
  240. /** This packet must make its way to the host across the HPI interface */
  241. #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
  242. /** This packet must make its way to the host across the HPI interface */
  243. #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
  244. /** This packet must make its way to the host across the HPI interface */
  245. #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
  246. #define HPI_ETHERNET_UDP_PORT 44600 /**< HPI UDP service */
  247. /** Default network timeout in milli-seconds. */
  248. #define HPI_ETHERNET_TIMEOUT_MS 500
  249. /** Locked memory buffer alloc/free phases */
  250. enum HPI_BUFFER_CMDS {
  251. /** use one message to allocate or free physical memory */
  252. HPI_BUFFER_CMD_EXTERNAL = 0,
  253. /** alloc physical memory */
  254. HPI_BUFFER_CMD_INTERNAL_ALLOC = 1,
  255. /** send physical memory address to adapter */
  256. HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER = 2,
  257. /** notify adapter to stop using physical buffer */
  258. HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER = 3,
  259. /** free physical buffer */
  260. HPI_BUFFER_CMD_INTERNAL_FREE = 4
  261. };
  262. /*****************************************************************************/
  263. /*****************************************************************************/
  264. /******** HPI LOW LEVEL MESSAGES *******/
  265. /*****************************************************************************/
  266. /*****************************************************************************/
  267. /** Pnp ids */
  268. /** "ASI" - actual is "ASX" - need to change */
  269. #define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
  270. /** PCI vendor ID that AudioScience uses */
  271. #define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
  272. /** PCI vendor ID that the DSP56301 has */
  273. #define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
  274. /** PCI vendor ID that TI uses */
  275. #define HPI_PCI_VENDOR_ID_TI 0x104C
  276. #define HPI_PCI_DEV_ID_PCI2040 0xAC60
  277. /** TI's C6205 PCI interface has this ID */
  278. #define HPI_PCI_DEV_ID_DSP6205 0xA106
  279. #define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
  280. #define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
  281. #define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
  282. /** Invalid Adapter index
  283. Used in HPI messages that are not addressed to a specific adapter
  284. Used in DLL to indicate device not present
  285. */
  286. #define HPI_ADAPTER_INDEX_INVALID 0xFFFF
  287. /** First 2 hex digits define the adapter family */
  288. #define HPI_ADAPTER_FAMILY_MASK 0xff00
  289. #define HPI_MODULE_FAMILY_MASK 0xfff0
  290. #define HPI_ADAPTER_FAMILY_ASI(f) (f & HPI_ADAPTER_FAMILY_MASK)
  291. #define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
  292. #define HPI_ADAPTER_ASI(f) (f)
  293. enum HPI_MESSAGE_TYPES {
  294. HPI_TYPE_REQUEST = 1,
  295. HPI_TYPE_RESPONSE = 2,
  296. HPI_TYPE_DATA = 3,
  297. HPI_TYPE_SSX2BYPASS_MESSAGE = 4,
  298. HPI_TYPE_COMMAND = 5,
  299. HPI_TYPE_NOTIFICATION = 6
  300. };
  301. enum HPI_OBJECT_TYPES {
  302. HPI_OBJ_SUBSYSTEM = 1,
  303. HPI_OBJ_ADAPTER = 2,
  304. HPI_OBJ_OSTREAM = 3,
  305. HPI_OBJ_ISTREAM = 4,
  306. HPI_OBJ_MIXER = 5,
  307. HPI_OBJ_NODE = 6,
  308. HPI_OBJ_CONTROL = 7,
  309. HPI_OBJ_NVMEMORY = 8,
  310. HPI_OBJ_GPIO = 9,
  311. HPI_OBJ_WATCHDOG = 10,
  312. HPI_OBJ_CLOCK = 11,
  313. HPI_OBJ_PROFILE = 12,
  314. /* HPI_ OBJ_ CONTROLEX = 13, */
  315. HPI_OBJ_ASYNCEVENT = 14
  316. #define HPI_OBJ_MAXINDEX 14
  317. };
  318. #define HPI_OBJ_FUNCTION_SPACING 0x100
  319. #define HPI_FUNC_ID(obj, i) (HPI_OBJ_##obj * HPI_OBJ_FUNCTION_SPACING + i)
  320. #define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
  321. enum HPI_FUNCTION_IDS {
  322. HPI_SUBSYS_OPEN = HPI_FUNC_ID(SUBSYSTEM, 1),
  323. HPI_SUBSYS_GET_VERSION = HPI_FUNC_ID(SUBSYSTEM, 2),
  324. HPI_SUBSYS_GET_INFO = HPI_FUNC_ID(SUBSYSTEM, 3),
  325. /* HPI_SUBSYS_FIND_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 4), */
  326. HPI_SUBSYS_CREATE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 5),
  327. HPI_SUBSYS_CLOSE = HPI_FUNC_ID(SUBSYSTEM, 6),
  328. /* HPI_SUBSYS_DELETE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 7), */
  329. HPI_SUBSYS_DRIVER_LOAD = HPI_FUNC_ID(SUBSYSTEM, 8),
  330. HPI_SUBSYS_DRIVER_UNLOAD = HPI_FUNC_ID(SUBSYSTEM, 9),
  331. /* HPI_SUBSYS_READ_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 10), */
  332. /* HPI_SUBSYS_WRITE_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 11), */
  333. HPI_SUBSYS_GET_NUM_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 12),
  334. HPI_SUBSYS_GET_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 13),
  335. HPI_SUBSYS_SET_NETWORK_INTERFACE = HPI_FUNC_ID(SUBSYSTEM, 14),
  336. HPI_SUBSYS_OPTION_INFO = HPI_FUNC_ID(SUBSYSTEM, 15),
  337. HPI_SUBSYS_OPTION_GET = HPI_FUNC_ID(SUBSYSTEM, 16),
  338. HPI_SUBSYS_OPTION_SET = HPI_FUNC_ID(SUBSYSTEM, 17),
  339. #define HPI_SUBSYS_FUNCTION_COUNT 17
  340. HPI_ADAPTER_OPEN = HPI_FUNC_ID(ADAPTER, 1),
  341. HPI_ADAPTER_CLOSE = HPI_FUNC_ID(ADAPTER, 2),
  342. HPI_ADAPTER_GET_INFO = HPI_FUNC_ID(ADAPTER, 3),
  343. HPI_ADAPTER_GET_ASSERT = HPI_FUNC_ID(ADAPTER, 4),
  344. HPI_ADAPTER_TEST_ASSERT = HPI_FUNC_ID(ADAPTER, 5),
  345. HPI_ADAPTER_SET_MODE = HPI_FUNC_ID(ADAPTER, 6),
  346. HPI_ADAPTER_GET_MODE = HPI_FUNC_ID(ADAPTER, 7),
  347. HPI_ADAPTER_ENABLE_CAPABILITY = HPI_FUNC_ID(ADAPTER, 8),
  348. HPI_ADAPTER_SELFTEST = HPI_FUNC_ID(ADAPTER, 9),
  349. HPI_ADAPTER_FIND_OBJECT = HPI_FUNC_ID(ADAPTER, 10),
  350. HPI_ADAPTER_QUERY_FLASH = HPI_FUNC_ID(ADAPTER, 11),
  351. HPI_ADAPTER_START_FLASH = HPI_FUNC_ID(ADAPTER, 12),
  352. HPI_ADAPTER_PROGRAM_FLASH = HPI_FUNC_ID(ADAPTER, 13),
  353. HPI_ADAPTER_SET_PROPERTY = HPI_FUNC_ID(ADAPTER, 14),
  354. HPI_ADAPTER_GET_PROPERTY = HPI_FUNC_ID(ADAPTER, 15),
  355. HPI_ADAPTER_ENUM_PROPERTY = HPI_FUNC_ID(ADAPTER, 16),
  356. HPI_ADAPTER_MODULE_INFO = HPI_FUNC_ID(ADAPTER, 17),
  357. HPI_ADAPTER_DEBUG_READ = HPI_FUNC_ID(ADAPTER, 18),
  358. HPI_ADAPTER_IRQ_QUERY_AND_CLEAR = HPI_FUNC_ID(ADAPTER, 19),
  359. HPI_ADAPTER_IRQ_CALLBACK = HPI_FUNC_ID(ADAPTER, 20),
  360. HPI_ADAPTER_DELETE = HPI_FUNC_ID(ADAPTER, 21),
  361. #define HPI_ADAPTER_FUNCTION_COUNT 21
  362. HPI_OSTREAM_OPEN = HPI_FUNC_ID(OSTREAM, 1),
  363. HPI_OSTREAM_CLOSE = HPI_FUNC_ID(OSTREAM, 2),
  364. HPI_OSTREAM_WRITE = HPI_FUNC_ID(OSTREAM, 3),
  365. HPI_OSTREAM_START = HPI_FUNC_ID(OSTREAM, 4),
  366. HPI_OSTREAM_STOP = HPI_FUNC_ID(OSTREAM, 5),
  367. HPI_OSTREAM_RESET = HPI_FUNC_ID(OSTREAM, 6),
  368. HPI_OSTREAM_GET_INFO = HPI_FUNC_ID(OSTREAM, 7),
  369. HPI_OSTREAM_QUERY_FORMAT = HPI_FUNC_ID(OSTREAM, 8),
  370. HPI_OSTREAM_DATA = HPI_FUNC_ID(OSTREAM, 9),
  371. HPI_OSTREAM_SET_VELOCITY = HPI_FUNC_ID(OSTREAM, 10),
  372. HPI_OSTREAM_SET_PUNCHINOUT = HPI_FUNC_ID(OSTREAM, 11),
  373. HPI_OSTREAM_SINEGEN = HPI_FUNC_ID(OSTREAM, 12),
  374. HPI_OSTREAM_ANC_RESET = HPI_FUNC_ID(OSTREAM, 13),
  375. HPI_OSTREAM_ANC_GET_INFO = HPI_FUNC_ID(OSTREAM, 14),
  376. HPI_OSTREAM_ANC_READ = HPI_FUNC_ID(OSTREAM, 15),
  377. HPI_OSTREAM_SET_TIMESCALE = HPI_FUNC_ID(OSTREAM, 16),
  378. HPI_OSTREAM_SET_FORMAT = HPI_FUNC_ID(OSTREAM, 17),
  379. HPI_OSTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(OSTREAM, 18),
  380. HPI_OSTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(OSTREAM, 19),
  381. HPI_OSTREAM_GROUP_ADD = HPI_FUNC_ID(OSTREAM, 20),
  382. HPI_OSTREAM_GROUP_GETMAP = HPI_FUNC_ID(OSTREAM, 21),
  383. HPI_OSTREAM_GROUP_RESET = HPI_FUNC_ID(OSTREAM, 22),
  384. HPI_OSTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(OSTREAM, 23),
  385. HPI_OSTREAM_WAIT_START = HPI_FUNC_ID(OSTREAM, 24),
  386. HPI_OSTREAM_WAIT = HPI_FUNC_ID(OSTREAM, 25),
  387. #define HPI_OSTREAM_FUNCTION_COUNT 25
  388. HPI_ISTREAM_OPEN = HPI_FUNC_ID(ISTREAM, 1),
  389. HPI_ISTREAM_CLOSE = HPI_FUNC_ID(ISTREAM, 2),
  390. HPI_ISTREAM_SET_FORMAT = HPI_FUNC_ID(ISTREAM, 3),
  391. HPI_ISTREAM_READ = HPI_FUNC_ID(ISTREAM, 4),
  392. HPI_ISTREAM_START = HPI_FUNC_ID(ISTREAM, 5),
  393. HPI_ISTREAM_STOP = HPI_FUNC_ID(ISTREAM, 6),
  394. HPI_ISTREAM_RESET = HPI_FUNC_ID(ISTREAM, 7),
  395. HPI_ISTREAM_GET_INFO = HPI_FUNC_ID(ISTREAM, 8),
  396. HPI_ISTREAM_QUERY_FORMAT = HPI_FUNC_ID(ISTREAM, 9),
  397. HPI_ISTREAM_ANC_RESET = HPI_FUNC_ID(ISTREAM, 10),
  398. HPI_ISTREAM_ANC_GET_INFO = HPI_FUNC_ID(ISTREAM, 11),
  399. HPI_ISTREAM_ANC_WRITE = HPI_FUNC_ID(ISTREAM, 12),
  400. HPI_ISTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(ISTREAM, 13),
  401. HPI_ISTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(ISTREAM, 14),
  402. HPI_ISTREAM_GROUP_ADD = HPI_FUNC_ID(ISTREAM, 15),
  403. HPI_ISTREAM_GROUP_GETMAP = HPI_FUNC_ID(ISTREAM, 16),
  404. HPI_ISTREAM_GROUP_RESET = HPI_FUNC_ID(ISTREAM, 17),
  405. HPI_ISTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(ISTREAM, 18),
  406. HPI_ISTREAM_WAIT_START = HPI_FUNC_ID(ISTREAM, 19),
  407. HPI_ISTREAM_WAIT = HPI_FUNC_ID(ISTREAM, 20),
  408. #define HPI_ISTREAM_FUNCTION_COUNT 20
  409. /* NOTE:
  410. GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
  411. HPI_MIXER_OPEN = HPI_FUNC_ID(MIXER, 1),
  412. HPI_MIXER_CLOSE = HPI_FUNC_ID(MIXER, 2),
  413. HPI_MIXER_GET_INFO = HPI_FUNC_ID(MIXER, 3),
  414. HPI_MIXER_GET_NODE_INFO = HPI_FUNC_ID(MIXER, 4),
  415. HPI_MIXER_GET_CONTROL = HPI_FUNC_ID(MIXER, 5),
  416. HPI_MIXER_SET_CONNECTION = HPI_FUNC_ID(MIXER, 6),
  417. HPI_MIXER_GET_CONNECTIONS = HPI_FUNC_ID(MIXER, 7),
  418. HPI_MIXER_GET_CONTROL_BY_INDEX = HPI_FUNC_ID(MIXER, 8),
  419. HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX = HPI_FUNC_ID(MIXER, 9),
  420. HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES = HPI_FUNC_ID(MIXER, 10),
  421. HPI_MIXER_STORE = HPI_FUNC_ID(MIXER, 11),
  422. HPI_MIXER_GET_CACHE_INFO = HPI_FUNC_ID(MIXER, 12),
  423. #define HPI_MIXER_FUNCTION_COUNT 12
  424. HPI_CONTROL_GET_INFO = HPI_FUNC_ID(CONTROL, 1),
  425. HPI_CONTROL_GET_STATE = HPI_FUNC_ID(CONTROL, 2),
  426. HPI_CONTROL_SET_STATE = HPI_FUNC_ID(CONTROL, 3),
  427. #define HPI_CONTROL_FUNCTION_COUNT 3
  428. HPI_NVMEMORY_OPEN = HPI_FUNC_ID(NVMEMORY, 1),
  429. HPI_NVMEMORY_READ_BYTE = HPI_FUNC_ID(NVMEMORY, 2),
  430. HPI_NVMEMORY_WRITE_BYTE = HPI_FUNC_ID(NVMEMORY, 3),
  431. #define HPI_NVMEMORY_FUNCTION_COUNT 3
  432. HPI_GPIO_OPEN = HPI_FUNC_ID(GPIO, 1),
  433. HPI_GPIO_READ_BIT = HPI_FUNC_ID(GPIO, 2),
  434. HPI_GPIO_WRITE_BIT = HPI_FUNC_ID(GPIO, 3),
  435. HPI_GPIO_READ_ALL = HPI_FUNC_ID(GPIO, 4),
  436. HPI_GPIO_WRITE_STATUS = HPI_FUNC_ID(GPIO, 5),
  437. #define HPI_GPIO_FUNCTION_COUNT 5
  438. HPI_ASYNCEVENT_OPEN = HPI_FUNC_ID(ASYNCEVENT, 1),
  439. HPI_ASYNCEVENT_CLOSE = HPI_FUNC_ID(ASYNCEVENT, 2),
  440. HPI_ASYNCEVENT_WAIT = HPI_FUNC_ID(ASYNCEVENT, 3),
  441. HPI_ASYNCEVENT_GETCOUNT = HPI_FUNC_ID(ASYNCEVENT, 4),
  442. HPI_ASYNCEVENT_GET = HPI_FUNC_ID(ASYNCEVENT, 5),
  443. HPI_ASYNCEVENT_SENDEVENTS = HPI_FUNC_ID(ASYNCEVENT, 6),
  444. #define HPI_ASYNCEVENT_FUNCTION_COUNT 6
  445. HPI_WATCHDOG_OPEN = HPI_FUNC_ID(WATCHDOG, 1),
  446. HPI_WATCHDOG_SET_TIME = HPI_FUNC_ID(WATCHDOG, 2),
  447. HPI_WATCHDOG_PING = HPI_FUNC_ID(WATCHDOG, 3),
  448. HPI_CLOCK_OPEN = HPI_FUNC_ID(CLOCK, 1),
  449. HPI_CLOCK_SET_TIME = HPI_FUNC_ID(CLOCK, 2),
  450. HPI_CLOCK_GET_TIME = HPI_FUNC_ID(CLOCK, 3),
  451. HPI_PROFILE_OPEN_ALL = HPI_FUNC_ID(PROFILE, 1),
  452. HPI_PROFILE_START_ALL = HPI_FUNC_ID(PROFILE, 2),
  453. HPI_PROFILE_STOP_ALL = HPI_FUNC_ID(PROFILE, 3),
  454. HPI_PROFILE_GET = HPI_FUNC_ID(PROFILE, 4),
  455. HPI_PROFILE_GET_IDLECOUNT = HPI_FUNC_ID(PROFILE, 5),
  456. HPI_PROFILE_GET_NAME = HPI_FUNC_ID(PROFILE, 6),
  457. HPI_PROFILE_GET_UTILIZATION = HPI_FUNC_ID(PROFILE, 7)
  458. #define HPI_PROFILE_FUNCTION_COUNT 7
  459. };
  460. /* ////////////////////////////////////////////////////////////////////// */
  461. /* STRUCTURES */
  462. #ifndef DISABLE_PRAGMA_PACK1
  463. #pragma pack(push, 1)
  464. #endif
  465. /** PCI bus resource */
  466. struct hpi_pci {
  467. u32 __iomem *ap_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];
  468. struct pci_dev *pci_dev;
  469. };
  470. struct hpi_resource {
  471. union {
  472. const struct hpi_pci *pci;
  473. const char *net_if;
  474. } r;
  475. #ifndef HPI64BIT /* keep structure size constant */
  476. u32 pad_to64;
  477. #endif
  478. u16 bus_type; /* HPI_BUS_PNPISA, _PCI, _USB etc */
  479. u16 padding;
  480. };
  481. /** Format info used inside struct hpi_message
  482. Not the same as public API struct hpi_format */
  483. struct hpi_msg_format {
  484. u32 sample_rate; /**< 11025, 32000, 44100 etc. */
  485. u32 bit_rate; /**< for MPEG */
  486. u32 attributes; /**< stereo/joint_stereo/mono */
  487. u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
  488. u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */
  489. };
  490. /** Buffer+format structure.
  491. Must be kept 7 * 32 bits to match public struct hpi_datastruct */
  492. struct hpi_msg_data {
  493. struct hpi_msg_format format;
  494. u8 *pb_data;
  495. #ifndef HPI64BIT
  496. u32 padding;
  497. #endif
  498. u32 data_size;
  499. };
  500. /** struct hpi_datastructure used up to 3.04 driver */
  501. struct hpi_data_legacy32 {
  502. struct hpi_format format;
  503. u32 pb_data;
  504. u32 data_size;
  505. };
  506. #ifdef HPI64BIT
  507. /* Compatibility version of struct hpi_data*/
  508. struct hpi_data_compat32 {
  509. struct hpi_msg_format format;
  510. u32 pb_data;
  511. u32 padding;
  512. u32 data_size;
  513. };
  514. #endif
  515. struct hpi_buffer {
  516. /** placeholder for backward compatibility (see dwBufferSize) */
  517. struct hpi_msg_format reserved;
  518. u32 command; /**< HPI_BUFFER_CMD_xxx*/
  519. u32 pci_address; /**< PCI physical address of buffer for DSP DMA */
  520. u32 buffer_size; /**< must line up with data_size of HPI_DATA*/
  521. };
  522. /*/////////////////////////////////////////////////////////////////////////// */
  523. /* This is used for background buffer bus mastering stream buffers. */
  524. struct hpi_hostbuffer_status {
  525. u32 samples_processed;
  526. u32 auxiliary_data_available;
  527. u32 stream_state;
  528. /* DSP index in to the host bus master buffer. */
  529. u32 dSP_index;
  530. /* Host index in to the host bus master buffer. */
  531. u32 host_index;
  532. u32 size_in_bytes;
  533. };
  534. struct hpi_streamid {
  535. u16 object_type;
  536. /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
  537. u16 stream_index; /**< outstream or instream index. */
  538. };
  539. struct hpi_punchinout {
  540. u32 punch_in_sample;
  541. u32 punch_out_sample;
  542. };
  543. struct hpi_subsys_msg {
  544. struct hpi_resource resource;
  545. };
  546. struct hpi_subsys_res {
  547. u32 version;
  548. u32 data; /* extended version */
  549. u16 num_adapters;
  550. u16 adapter_index;
  551. u16 adapter_type;
  552. u16 pad16;
  553. };
  554. union hpi_adapterx_msg {
  555. struct {
  556. u32 dsp_address;
  557. u32 count_bytes;
  558. } debug_read;
  559. struct {
  560. u32 adapter_mode;
  561. u16 query_or_set;
  562. } mode;
  563. struct {
  564. u16 index;
  565. } module_info;
  566. struct {
  567. u32 checksum;
  568. u16 sequence;
  569. u16 length;
  570. u16 offset; /**< offset from start of msg to data */
  571. u16 unused;
  572. } program_flash;
  573. struct {
  574. u16 index;
  575. u16 what;
  576. u16 property_index;
  577. } property_enum;
  578. struct {
  579. u16 property;
  580. u16 parameter1;
  581. u16 parameter2;
  582. } property_set;
  583. struct {
  584. u32 offset;
  585. } query_flash;
  586. struct {
  587. u32 pad32;
  588. u16 key1;
  589. u16 key2;
  590. } restart;
  591. struct {
  592. u32 offset;
  593. u32 length;
  594. u32 key;
  595. } start_flash;
  596. struct {
  597. u32 pad32;
  598. u16 value;
  599. } test_assert;
  600. struct {
  601. u32 yes;
  602. } irq_query;
  603. };
  604. struct hpi_adapter_res {
  605. u32 serial_number;
  606. u16 adapter_type;
  607. u16 adapter_index;
  608. u16 num_instreams;
  609. u16 num_outstreams;
  610. u16 num_mixers;
  611. u16 version;
  612. u8 sz_adapter_assert[HPI_STRING_LEN];
  613. };
  614. union hpi_adapterx_res {
  615. struct hpi_adapter_res info;
  616. struct {
  617. u32 p1;
  618. u16 count;
  619. u16 dsp_index;
  620. u32 p2;
  621. u32 dsp_msg_addr;
  622. char sz_message[HPI_STRING_LEN];
  623. } assert;
  624. struct {
  625. u32 adapter_mode;
  626. } mode;
  627. struct {
  628. u16 sequence;
  629. } program_flash;
  630. struct {
  631. u16 parameter1;
  632. u16 parameter2;
  633. } property_get;
  634. struct {
  635. u32 checksum;
  636. u32 length;
  637. u32 version;
  638. } query_flash;
  639. struct {
  640. u32 yes;
  641. } irq_query;
  642. };
  643. struct hpi_stream_msg {
  644. union {
  645. struct hpi_msg_data data;
  646. struct hpi_data_legacy32 data32;
  647. u16 velocity;
  648. struct hpi_punchinout pio;
  649. u32 time_scale;
  650. struct hpi_buffer buffer;
  651. struct hpi_streamid stream;
  652. u32 threshold_bytes;
  653. } u;
  654. };
  655. struct hpi_stream_res {
  656. union {
  657. struct {
  658. /* size of hardware buffer */
  659. u32 buffer_size;
  660. /* OutStream - data to play,
  661. InStream - data recorded */
  662. u32 data_available;
  663. /* OutStream - samples played,
  664. InStream - samples recorded */
  665. u32 samples_transferred;
  666. /* Adapter - OutStream - data to play,
  667. InStream - data recorded */
  668. u32 auxiliary_data_available;
  669. u16 state; /* HPI_STATE_PLAYING, _STATE_STOPPED */
  670. u16 padding;
  671. } stream_info;
  672. struct {
  673. u32 buffer_size;
  674. u32 data_available;
  675. u32 samples_transfered;
  676. u16 state;
  677. u16 outstream_index;
  678. u16 instream_index;
  679. u16 padding;
  680. u32 auxiliary_data_available;
  681. } legacy_stream_info;
  682. struct {
  683. /* bitmap of grouped OutStreams */
  684. u32 outstream_group_map;
  685. /* bitmap of grouped InStreams */
  686. u32 instream_group_map;
  687. } group_info;
  688. struct {
  689. /* pointer to the buffer */
  690. u8 *p_buffer;
  691. /* pointer to the hostbuffer status */
  692. struct hpi_hostbuffer_status *p_status;
  693. } hostbuffer_info;
  694. } u;
  695. };
  696. struct hpi_mixer_msg {
  697. u16 control_index;
  698. u16 control_type; /* = HPI_CONTROL_METER _VOLUME etc */
  699. u16 padding1; /* Maintain alignment of subsequent fields */
  700. u16 node_type1; /* = HPI_SOURCENODE_LINEIN etc */
  701. u16 node_index1; /* = 0..N */
  702. u16 node_type2;
  703. u16 node_index2;
  704. u16 padding2; /* round to 4 bytes */
  705. };
  706. struct hpi_mixer_res {
  707. u16 src_node_type; /* = HPI_SOURCENODE_LINEIN etc */
  708. u16 src_node_index; /* = 0..N */
  709. u16 dst_node_type;
  710. u16 dst_node_index;
  711. /* Also controlType for MixerGetControlByIndex */
  712. u16 control_index;
  713. /* may indicate which DSP the control is located on */
  714. u16 dsp_index;
  715. };
  716. union hpi_mixerx_msg {
  717. struct {
  718. u16 starting_index;
  719. u16 flags;
  720. u32 length_in_bytes; /* length in bytes of p_data */
  721. u32 p_data; /* pointer to a data array */
  722. } gcabi;
  723. struct {
  724. u16 command;
  725. u16 index;
  726. } store; /* for HPI_MIXER_STORE message */
  727. };
  728. union hpi_mixerx_res {
  729. struct {
  730. u32 bytes_returned; /* size of items returned */
  731. u32 p_data; /* pointer to data array */
  732. u16 more_to_do; /* indicates if there is more to do */
  733. } gcabi;
  734. struct {
  735. u32 total_controls; /* count of controls in the mixer */
  736. u32 cache_controls; /* count of controls in the cac */
  737. u32 cache_bytes; /* size of cache */
  738. } cache_info;
  739. };
  740. struct hpi_control_msg {
  741. u16 attribute; /* control attribute or property */
  742. u16 saved_index;
  743. u32 param1; /* generic parameter 1 */
  744. u32 param2; /* generic parameter 2 */
  745. short an_log_value[HPI_MAX_CHANNELS];
  746. };
  747. struct hpi_control_union_msg {
  748. u16 attribute; /* control attribute or property */
  749. u16 saved_index; /* only used in ctrl save/restore */
  750. union {
  751. struct {
  752. u32 param1; /* generic parameter 1 */
  753. u32 param2; /* generic parameter 2 */
  754. short an_log_value[HPI_MAX_CHANNELS];
  755. } old;
  756. union {
  757. u32 frequency;
  758. u32 gain;
  759. u32 band;
  760. u32 deemphasis;
  761. u32 program;
  762. struct {
  763. u32 mode;
  764. u32 value;
  765. } mode;
  766. u32 blend;
  767. } tuner;
  768. } u;
  769. };
  770. struct hpi_control_res {
  771. /* Could make union. dwParam, anLogValue never used in same response */
  772. u32 param1;
  773. u32 param2;
  774. short an_log_value[HPI_MAX_CHANNELS];
  775. };
  776. union hpi_control_union_res {
  777. struct {
  778. u32 param1;
  779. u32 param2;
  780. short an_log_value[HPI_MAX_CHANNELS];
  781. } old;
  782. union {
  783. u32 band;
  784. u32 frequency;
  785. u32 gain;
  786. u32 deemphasis;
  787. struct {
  788. u32 data[2];
  789. u32 bLER;
  790. } rds;
  791. short s_level;
  792. struct {
  793. u16 value;
  794. u16 mask;
  795. } status;
  796. } tuner;
  797. struct {
  798. char sz_data[8];
  799. u32 remaining_chars;
  800. } chars8;
  801. char c_data12[12];
  802. union {
  803. struct {
  804. u32 status;
  805. u32 readable_size;
  806. u32 writeable_size;
  807. } status;
  808. } cobranet;
  809. };
  810. struct hpi_nvmemory_msg {
  811. u16 address;
  812. u16 data;
  813. };
  814. struct hpi_nvmemory_res {
  815. u16 size_in_bytes;
  816. u16 data;
  817. };
  818. struct hpi_gpio_msg {
  819. u16 bit_index;
  820. u16 bit_data;
  821. };
  822. struct hpi_gpio_res {
  823. u16 number_input_bits;
  824. u16 number_output_bits;
  825. u16 bit_data[4];
  826. };
  827. struct hpi_async_msg {
  828. u32 events;
  829. u16 maximum_events;
  830. u16 padding;
  831. };
  832. struct hpi_async_res {
  833. union {
  834. struct {
  835. u16 count;
  836. } count;
  837. struct {
  838. u32 events;
  839. u16 number_returned;
  840. u16 padding;
  841. } get;
  842. struct hpi_async_event event;
  843. } u;
  844. };
  845. struct hpi_watchdog_msg {
  846. u32 time_ms;
  847. };
  848. struct hpi_watchdog_res {
  849. u32 time_ms;
  850. };
  851. struct hpi_clock_msg {
  852. u16 hours;
  853. u16 minutes;
  854. u16 seconds;
  855. u16 milli_seconds;
  856. };
  857. struct hpi_clock_res {
  858. u16 size_in_bytes;
  859. u16 hours;
  860. u16 minutes;
  861. u16 seconds;
  862. u16 milli_seconds;
  863. u16 padding;
  864. };
  865. struct hpi_profile_msg {
  866. u16 bin_index;
  867. u16 padding;
  868. };
  869. struct hpi_profile_res_open {
  870. u16 max_profiles;
  871. };
  872. struct hpi_profile_res_time {
  873. u32 total_tick_count;
  874. u32 call_count;
  875. u32 max_tick_count;
  876. u32 ticks_per_millisecond;
  877. u16 profile_interval;
  878. };
  879. struct hpi_profile_res_name {
  880. u8 sz_name[32];
  881. };
  882. struct hpi_profile_res {
  883. union {
  884. struct hpi_profile_res_open o;
  885. struct hpi_profile_res_time t;
  886. struct hpi_profile_res_name n;
  887. } u;
  888. };
  889. struct hpi_message_header {
  890. u16 size; /* total size in bytes */
  891. u8 type; /* HPI_TYPE_MESSAGE */
  892. u8 version; /* message version */
  893. u16 object; /* HPI_OBJ_* */
  894. u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
  895. u16 adapter_index; /* the adapter index */
  896. u16 obj_index; /* */
  897. };
  898. struct hpi_message {
  899. /* following fields must match HPI_MESSAGE_HEADER */
  900. u16 size; /* total size in bytes */
  901. u8 type; /* HPI_TYPE_MESSAGE */
  902. u8 version; /* message version */
  903. u16 object; /* HPI_OBJ_* */
  904. u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
  905. u16 adapter_index; /* the adapter index */
  906. u16 obj_index; /* */
  907. union {
  908. struct hpi_subsys_msg s;
  909. union hpi_adapterx_msg ax;
  910. struct hpi_stream_msg d;
  911. struct hpi_mixer_msg m;
  912. union hpi_mixerx_msg mx; /* extended mixer; */
  913. struct hpi_control_msg c; /* mixer control; */
  914. /* identical to struct hpi_control_msg,
  915. but field naming is improved */
  916. struct hpi_control_union_msg cu;
  917. struct hpi_nvmemory_msg n;
  918. struct hpi_gpio_msg l; /* digital i/o */
  919. struct hpi_watchdog_msg w;
  920. struct hpi_clock_msg t; /* dsp time */
  921. struct hpi_profile_msg p;
  922. struct hpi_async_msg as;
  923. char fixed_size[32];
  924. } u;
  925. };
  926. #define HPI_MESSAGE_SIZE_BY_OBJECT { \
  927. sizeof(struct hpi_message_header) , /* Default, no object type 0 */ \
  928. sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
  929. sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
  930. sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
  931. sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
  932. sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
  933. sizeof(struct hpi_message_header) , /* no node message */ \
  934. sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
  935. sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
  936. sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
  937. sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
  938. sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
  939. sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
  940. sizeof(struct hpi_message_header), /* controlx obj removed */ \
  941. sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
  942. }
  943. /*
  944. Note that the wSpecificError error field should be inspected and potentially
  945. reported whenever HPI_ERROR_DSP_COMMUNICATION or HPI_ERROR_DSP_BOOTLOAD is
  946. returned in wError.
  947. */
  948. struct hpi_response_header {
  949. u16 size;
  950. u8 type; /* HPI_TYPE_RESPONSE */
  951. u8 version; /* response version */
  952. u16 object; /* HPI_OBJ_* */
  953. u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
  954. u16 error; /* HPI_ERROR_xxx */
  955. u16 specific_error; /* adapter specific error */
  956. };
  957. struct hpi_response {
  958. /* following fields must match HPI_RESPONSE_HEADER */
  959. u16 size;
  960. u8 type; /* HPI_TYPE_RESPONSE */
  961. u8 version; /* response version */
  962. u16 object; /* HPI_OBJ_* */
  963. u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
  964. u16 error; /* HPI_ERROR_xxx */
  965. u16 specific_error; /* adapter specific error */
  966. union {
  967. struct hpi_subsys_res s;
  968. union hpi_adapterx_res ax;
  969. struct hpi_stream_res d;
  970. struct hpi_mixer_res m;
  971. union hpi_mixerx_res mx; /* extended mixer; */
  972. struct hpi_control_res c; /* mixer control; */
  973. /* identical to hpi_control_res, but field naming is improved */
  974. union hpi_control_union_res cu;
  975. struct hpi_nvmemory_res n;
  976. struct hpi_gpio_res l; /* digital i/o */
  977. struct hpi_watchdog_res w;
  978. struct hpi_clock_res t; /* dsp time */
  979. struct hpi_profile_res p;
  980. struct hpi_async_res as;
  981. u8 bytes[52];
  982. } u;
  983. };
  984. #define HPI_RESPONSE_SIZE_BY_OBJECT { \
  985. sizeof(struct hpi_response_header) ,/* Default, no object type 0 */ \
  986. sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
  987. sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
  988. sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
  989. sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
  990. sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
  991. sizeof(struct hpi_response_header) , /* no node response */ \
  992. sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
  993. sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
  994. sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
  995. sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
  996. sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
  997. sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
  998. sizeof(struct hpi_response_header), /* controlx obj removed */ \
  999. sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
  1000. }
  1001. /*********************** version 1 message/response **************************/
  1002. #define HPINET_ETHERNET_DATA_SIZE (1500)
  1003. #define HPINET_IP_HDR_SIZE (20)
  1004. #define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE)
  1005. #define HPINET_UDP_HDR_SIZE (8)
  1006. #define HPINET_UDP_DATA_SIZE (HPINET_IP_DATA_SIZE - HPINET_UDP_HDR_SIZE)
  1007. #define HPINET_ASI_HDR_SIZE (2)
  1008. #define HPINET_ASI_DATA_SIZE (HPINET_UDP_DATA_SIZE - HPINET_ASI_HDR_SIZE)
  1009. #define HPI_MAX_PAYLOAD_SIZE (HPINET_ASI_DATA_SIZE - 2)
  1010. /* New style message/response, but still V0 compatible */
  1011. struct hpi_msg_adapter_get_info {
  1012. struct hpi_message_header h;
  1013. };
  1014. struct hpi_res_adapter_get_info {
  1015. struct hpi_response_header h; /*v0 */
  1016. struct hpi_adapter_res p;
  1017. };
  1018. /* padding is so these are same size as v0 hpi_message */
  1019. struct hpi_msg_adapter_query_flash {
  1020. struct hpi_message_header h;
  1021. u32 offset;
  1022. u8 pad_to_version0_size[sizeof(struct hpi_message) - /* V0 res */
  1023. sizeof(struct hpi_message_header) - 1 * sizeof(u32)];
  1024. };
  1025. /* padding is so these are same size as v0 hpi_response */
  1026. struct hpi_res_adapter_query_flash {
  1027. struct hpi_response_header h;
  1028. u32 checksum;
  1029. u32 length;
  1030. u32 version;
  1031. u8 pad_to_version0_size[sizeof(struct hpi_response) - /* V0 res */
  1032. sizeof(struct hpi_response_header) - 3 * sizeof(u32)];
  1033. };
  1034. struct hpi_msg_adapter_start_flash {
  1035. struct hpi_message_header h;
  1036. u32 offset;
  1037. u32 length;
  1038. u32 key;
  1039. u8 pad_to_version0_size[sizeof(struct hpi_message) - /* V0 res */
  1040. sizeof(struct hpi_message_header) - 3 * sizeof(u32)];
  1041. };
  1042. struct hpi_res_adapter_start_flash {
  1043. struct hpi_response_header h;
  1044. u8 pad_to_version0_size[sizeof(struct hpi_response) - /* V0 res */
  1045. sizeof(struct hpi_response_header)];
  1046. };
  1047. struct hpi_msg_adapter_program_flash_payload {
  1048. u32 checksum;
  1049. u16 sequence;
  1050. u16 length;
  1051. u16 offset; /**< offset from start of msg to data */
  1052. u16 unused;
  1053. /* ensure sizeof(header + payload) == sizeof(hpi_message_V0)
  1054. because old firmware expects data after message of this size */
  1055. u8 pad_to_version0_size[sizeof(struct hpi_message) - /* V0 message */
  1056. sizeof(struct hpi_message_header) - sizeof(u32) -
  1057. 4 * sizeof(u16)];
  1058. };
  1059. struct hpi_msg_adapter_program_flash {
  1060. struct hpi_message_header h;
  1061. struct hpi_msg_adapter_program_flash_payload p;
  1062. u32 data[256];
  1063. };
  1064. struct hpi_res_adapter_program_flash {
  1065. struct hpi_response_header h;
  1066. u16 sequence;
  1067. u8 pad_to_version0_size[sizeof(struct hpi_response) - /* V0 res */
  1068. sizeof(struct hpi_response_header) - sizeof(u16)];
  1069. };
  1070. struct hpi_msg_adapter_debug_read {
  1071. struct hpi_message_header h;
  1072. u32 dsp_address;
  1073. u32 count_bytes;
  1074. };
  1075. struct hpi_res_adapter_debug_read {
  1076. struct hpi_response_header h;
  1077. u8 bytes[256];
  1078. };
  1079. struct hpi_msg_cobranet_hmi {
  1080. u16 attribute;
  1081. u16 padding;
  1082. u32 hmi_address;
  1083. u32 byte_count;
  1084. };
  1085. struct hpi_msg_cobranet_hmiwrite {
  1086. struct hpi_message_header h;
  1087. struct hpi_msg_cobranet_hmi p;
  1088. u8 bytes[256];
  1089. };
  1090. struct hpi_msg_cobranet_hmiread {
  1091. struct hpi_message_header h;
  1092. struct hpi_msg_cobranet_hmi p;
  1093. };
  1094. struct hpi_res_cobranet_hmiread {
  1095. struct hpi_response_header h;
  1096. u32 byte_count;
  1097. u8 bytes[256];
  1098. };
  1099. #if 1
  1100. #define hpi_message_header_v1 hpi_message_header
  1101. #define hpi_response_header_v1 hpi_response_header
  1102. #else
  1103. /* V1 headers in Addition to v0 headers */
  1104. struct hpi_message_header_v1 {
  1105. struct hpi_message_header h0;
  1106. /* struct {
  1107. } h1; */
  1108. };
  1109. struct hpi_response_header_v1 {
  1110. struct hpi_response_header h0;
  1111. struct {
  1112. u16 adapter_index; /* the adapter index */
  1113. u16 obj_index; /* object index */
  1114. } h1;
  1115. };
  1116. #endif
  1117. struct hpi_msg_payload_v0 {
  1118. struct hpi_message_header h;
  1119. union {
  1120. struct hpi_subsys_msg s;
  1121. union hpi_adapterx_msg ax;
  1122. struct hpi_stream_msg d;
  1123. struct hpi_mixer_msg m;
  1124. union hpi_mixerx_msg mx;
  1125. struct hpi_control_msg c;
  1126. struct hpi_control_union_msg cu;
  1127. struct hpi_nvmemory_msg n;
  1128. struct hpi_gpio_msg l;
  1129. struct hpi_watchdog_msg w;
  1130. struct hpi_clock_msg t;
  1131. struct hpi_profile_msg p;
  1132. struct hpi_async_msg as;
  1133. } u;
  1134. };
  1135. struct hpi_res_payload_v0 {
  1136. struct hpi_response_header h;
  1137. union {
  1138. struct hpi_subsys_res s;
  1139. union hpi_adapterx_res ax;
  1140. struct hpi_stream_res d;
  1141. struct hpi_mixer_res m;
  1142. union hpi_mixerx_res mx;
  1143. struct hpi_control_res c;
  1144. union hpi_control_union_res cu;
  1145. struct hpi_nvmemory_res n;
  1146. struct hpi_gpio_res l;
  1147. struct hpi_watchdog_res w;
  1148. struct hpi_clock_res t;
  1149. struct hpi_profile_res p;
  1150. struct hpi_async_res as;
  1151. } u;
  1152. };
  1153. union hpi_message_buffer_v1 {
  1154. struct hpi_message m0; /* version 0 */
  1155. struct hpi_message_header_v1 h;
  1156. u8 buf[HPI_MAX_PAYLOAD_SIZE];
  1157. };
  1158. union hpi_response_buffer_v1 {
  1159. struct hpi_response r0; /* version 0 */
  1160. struct hpi_response_header_v1 h;
  1161. u8 buf[HPI_MAX_PAYLOAD_SIZE];
  1162. };
  1163. compile_time_assert((sizeof(union hpi_message_buffer_v1) <=
  1164. HPI_MAX_PAYLOAD_SIZE), message_buffer_ok);
  1165. compile_time_assert((sizeof(union hpi_response_buffer_v1) <=
  1166. HPI_MAX_PAYLOAD_SIZE), response_buffer_ok);
  1167. /*////////////////////////////////////////////////////////////////////////// */
  1168. /* declarations for compact control calls */
  1169. struct hpi_control_defn {
  1170. u8 type;
  1171. u8 channels;
  1172. u8 src_node_type;
  1173. u8 src_node_index;
  1174. u8 dest_node_type;
  1175. u8 dest_node_index;
  1176. };
  1177. /*////////////////////////////////////////////////////////////////////////// */
  1178. /* declarations for control caching (internal to HPI<->DSP interaction) */
  1179. /** indicates a cached u16 value is invalid. */
  1180. #define HPI_CACHE_INVALID_UINT16 0xFFFF
  1181. /** indicates a cached short value is invalid. */
  1182. #define HPI_CACHE_INVALID_SHORT -32768
  1183. /** A compact representation of (part of) a controls state.
  1184. Used for efficient transfer of the control state
  1185. between DSP and host or across a network
  1186. */
  1187. struct hpi_control_cache_info {
  1188. /** one of HPI_CONTROL_* */
  1189. u8 control_type;
  1190. /** The total size of cached information in 32-bit words. */
  1191. u8 size_in32bit_words;
  1192. /** The original index of the control on the DSP */
  1193. u16 control_index;
  1194. };
  1195. struct hpi_control_cache_vol {
  1196. struct hpi_control_cache_info i;
  1197. short an_log[2];
  1198. unsigned short flags;
  1199. char padding[2];
  1200. };
  1201. struct hpi_control_cache_meter {
  1202. struct hpi_control_cache_info i;
  1203. short an_log_peak[2];
  1204. short an_logRMS[2];
  1205. };
  1206. struct hpi_control_cache_channelmode {
  1207. struct hpi_control_cache_info i;
  1208. u16 mode;
  1209. char temp_padding[6];
  1210. };
  1211. struct hpi_control_cache_mux {
  1212. struct hpi_control_cache_info i;
  1213. u16 source_node_type;
  1214. u16 source_node_index;
  1215. char temp_padding[4];
  1216. };
  1217. struct hpi_control_cache_level {
  1218. struct hpi_control_cache_info i;
  1219. short an_log[2];
  1220. char temp_padding[4];
  1221. };
  1222. struct hpi_control_cache_tuner {
  1223. struct hpi_control_cache_info i;
  1224. u32 freq_ink_hz;
  1225. u16 band;
  1226. short s_level_avg;
  1227. };
  1228. struct hpi_control_cache_aes3rx {
  1229. struct hpi_control_cache_info i;
  1230. u32 error_status;
  1231. u32 format;
  1232. };
  1233. struct hpi_control_cache_aes3tx {
  1234. struct hpi_control_cache_info i;
  1235. u32 format;
  1236. char temp_padding[4];
  1237. };
  1238. struct hpi_control_cache_tonedetector {
  1239. struct hpi_control_cache_info i;
  1240. u16 state;
  1241. char temp_padding[6];
  1242. };
  1243. struct hpi_control_cache_silencedetector {
  1244. struct hpi_control_cache_info i;
  1245. u32 state;
  1246. char temp_padding[4];
  1247. };
  1248. struct hpi_control_cache_sampleclock {
  1249. struct hpi_control_cache_info i;
  1250. u16 source;
  1251. u16 source_index;
  1252. u32 sample_rate;
  1253. };
  1254. struct hpi_control_cache_microphone {
  1255. struct hpi_control_cache_info i;
  1256. u16 phantom_state;
  1257. char temp_padding[6];
  1258. };
  1259. struct hpi_control_cache_single {
  1260. union {
  1261. struct hpi_control_cache_info i;
  1262. struct hpi_control_cache_vol vol;
  1263. struct hpi_control_cache_meter meter;
  1264. struct hpi_control_cache_channelmode mode;
  1265. struct hpi_control_cache_mux mux;
  1266. struct hpi_control_cache_level level;
  1267. struct hpi_control_cache_tuner tuner;
  1268. struct hpi_control_cache_aes3rx aes3rx;
  1269. struct hpi_control_cache_aes3tx aes3tx;
  1270. struct hpi_control_cache_tonedetector tone;
  1271. struct hpi_control_cache_silencedetector silence;
  1272. struct hpi_control_cache_sampleclock clk;
  1273. struct hpi_control_cache_microphone microphone;
  1274. } u;
  1275. };
  1276. struct hpi_control_cache_pad {
  1277. struct hpi_control_cache_info i;
  1278. u32 field_valid_flags;
  1279. u8 c_channel[8];
  1280. u8 c_artist[40];
  1281. u8 c_title[40];
  1282. u8 c_comment[200];
  1283. u32 pTY;
  1284. u32 pI;
  1285. u32 traffic_supported;
  1286. u32 traffic_anouncement;
  1287. };
  1288. /* 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
  1289. struct hpi_fifo_buffer {
  1290. u32 size;
  1291. u32 dSP_index;
  1292. u32 host_index;
  1293. };
  1294. #ifndef DISABLE_PRAGMA_PACK1
  1295. #pragma pack(pop)
  1296. #endif
  1297. /* skip host side function declarations for DSP
  1298. compile and documentation extraction */
  1299. char hpi_handle_object(const u32 handle);
  1300. void hpi_handle_to_indexes(const u32 handle, u16 *pw_adapter_index,
  1301. u16 *pw_object_index);
  1302. u32 hpi_indexes_to_handle(const char c_object, const u16 adapter_index,
  1303. const u16 object_index);
  1304. /*////////////////////////////////////////////////////////////////////////// */
  1305. /* main HPI entry point */
  1306. void hpi_send_recv(struct hpi_message *phm, struct hpi_response *phr);
  1307. /* used in PnP OS/driver */
  1308. u16 hpi_subsys_create_adapter(const struct hpi_resource *p_resource,
  1309. u16 *pw_adapter_index);
  1310. u16 hpi_outstream_host_buffer_get_info(u32 h_outstream, u8 **pp_buffer,
  1311. struct hpi_hostbuffer_status **pp_status);
  1312. u16 hpi_instream_host_buffer_get_info(u32 h_instream, u8 **pp_buffer,
  1313. struct hpi_hostbuffer_status **pp_status);
  1314. u16 hpi_adapter_restart(u16 adapter_index);
  1315. /*
  1316. The following 3 functions were last declared in header files for
  1317. driver 3.10. HPI_ControlQuery() used to be the recommended way
  1318. of getting a volume range. Declared here for binary asihpi32.dll
  1319. compatibility.
  1320. */
  1321. void hpi_format_to_msg(struct hpi_msg_format *pMF,
  1322. const struct hpi_format *pF);
  1323. void hpi_stream_response_to_legacy(struct hpi_stream_res *pSR);
  1324. /*////////////////////////////////////////////////////////////////////////// */
  1325. /* declarations for individual HPI entry points */
  1326. hpi_handler_func HPI_6000;
  1327. hpi_handler_func HPI_6205;
  1328. #endif /* _HPI_INTERNAL_H_ */