~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/pci/asihpi/hpidspcd.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /***********************************************************************/
  3 /*
  4 
  5     AudioScience HPI driver
  6     Copyright (C) 1997-2011  AudioScience Inc. <support@audioscience.com>
  7 
  8 
  9 \file
 10 Functions for reading DSP code to load into DSP
 11 
 12 */
 13 /***********************************************************************/
 14 #ifndef _HPIDSPCD_H_
 15 #define _HPIDSPCD_H_
 16 
 17 #include "hpi_internal.h"
 18 
 19 /** Header structure for dsp firmware file
 20  This structure must match that used in s2bin.c for generation of asidsp.bin
 21  */
 22 /*#ifndef DISABLE_PRAGMA_PACK1 */
 23 /*#pragma pack(push, 1) */
 24 /*#endif */
 25 struct code_header {
 26         /** Size in bytes including header */
 27         u32 size;
 28         /** File type tag "CODE" == 0x45444F43 */
 29         u32 type;
 30         /** Adapter model number */
 31         u32 adapter;
 32         /** Firmware version*/
 33         u32 version;
 34         /** Data checksum */
 35         u32 checksum;
 36 };
 37 /*#ifndef DISABLE_PRAGMA_PACK1 */
 38 /*#pragma pack(pop) */
 39 /*#endif */
 40 
 41 /*? Don't need the pragmas? */
 42 compile_time_assert((sizeof(struct code_header) == 20), code_header_size);
 43 
 44 /** Descriptor for dspcode from firmware loader */
 45 struct dsp_code {
 46         /** copy of  file header */
 47         struct code_header header;
 48         /** Expected number of words in the whole dsp code,INCL header */
 49         u32 block_length;
 50         /** Number of words read so far */
 51         u32 word_count;
 52 
 53         /** internal state of DSP code reader */
 54         struct dsp_code_private *pvt;
 55 };
 56 
 57 /** Prepare *psDspCode to refer to the requested adapter's firmware.
 58 Code file name is obtained from HpiOs_GetDspCodePath
 59 
 60 \return 0 for success, or error code if requested code is not available
 61 */
 62 short hpi_dsp_code_open(
 63         /** Code identifier, usually adapter family */
 64         u32 adapter, void *pci_dev,
 65         /** Pointer to DSP code control structure */
 66         struct dsp_code *ps_dsp_code,
 67         /** Pointer to dword to receive OS specific error code */
 68         u32 *pos_error_code);
 69 
 70 /** Close the DSP code file */
 71 void hpi_dsp_code_close(struct dsp_code *ps_dsp_code);
 72 
 73 /** Rewind to the beginning of the DSP code file (for verify) */
 74 void hpi_dsp_code_rewind(struct dsp_code *ps_dsp_code);
 75 
 76 /** Read one word from the dsp code file
 77         \return 0 for success, or error code if eof, or block length exceeded
 78 */
 79 short hpi_dsp_code_read_word(struct dsp_code *ps_dsp_code,
 80                                       /**< DSP code descriptor */
 81         u32 *pword /**< Where to store the read word */
 82         );
 83 
 84 /** Get a block of dsp code into an internal buffer, and provide a pointer to
 85 that buffer. (If dsp code is already an array in memory, it is referenced,
 86 not copied.)
 87 
 88 \return Error if requested number of words are not available
 89 */
 90 short hpi_dsp_code_read_block(size_t words_requested,
 91         struct dsp_code *ps_dsp_code,
 92         /* Pointer to store (Pointer to code buffer) */
 93         u32 **ppblock);
 94 
 95 #endif
 96 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php