sound/pci/asihpi/hpi_internal.h

Source file repositories/reference/linux-study-clean/sound/pci/asihpi/hpi_internal.h

File Facts

System
Linux kernel
Corpus path
sound/pci/asihpi/hpi_internal.h
Extension
.h
Size
42184 bytes
Lines
1420
Domain
Driver Families
Bucket
sound/pci
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hpi_pci {
	u32 __iomem *ap_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];
	struct pci_dev *pci_dev;
};

/** Adapter specification resource */
struct hpi_adapter_specification {
	u32 type;
	u8 modules[4];
};

struct hpi_resource {
	union {
		const struct hpi_pci *pci;
		const char *net_if;
		struct hpi_adapter_specification adapter_spec;
		const void *sw_if;
	} r;
	u16 bus_type;		/* HPI_BUS_PNPISA, _PCI, _USB etc */
	u16 padding;
};

/** Format info used inside struct hpi_message
    Not the same as public API struct hpi_format */
struct hpi_msg_format {
	u32 sample_rate; /**< 11025, 32000, 44100 etc. */
	u32 bit_rate; /**< for MPEG */
	u32 attributes;	/**< stereo/joint_stereo/mono */
	u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
	u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */
};

/**  Buffer+format structure.
	 Must be kept 7 * 32 bits to match public struct hpi_datastruct */
struct hpi_msg_data {
	struct hpi_msg_format format;
	u8 *pb_data;
#ifndef CONFIG_64BIT
	u32 padding;
#endif
	u32 data_size;
};

/** struct hpi_datastructure used up to 3.04 driver */
struct hpi_data_legacy32 {
	struct hpi_format format;
	u32 pb_data;
	u32 data_size;
};

#ifdef CONFIG_64BIT
/* Compatibility version of struct hpi_data*/
struct hpi_data_compat32 {
	struct hpi_msg_format format;
	u32 pb_data;
	u32 padding;
	u32 data_size;
};
#endif

struct hpi_buffer {
  /** placeholder for backward compatibility (see dwBufferSize) */
	struct hpi_msg_format reserved;
	u32 command; /**< HPI_BUFFER_CMD_xxx*/
	u32 pci_address; /**< PCI physical address of buffer for DSP DMA */
	u32 buffer_size; /**< must line up with data_size of HPI_DATA*/
};

/*/////////////////////////////////////////////////////////////////////////// */
/* This is used for background buffer bus mastering stream buffers.           */
struct hpi_hostbuffer_status {
	u32 samples_processed;
	u32 auxiliary_data_available;
	u32 stream_state;
	/* DSP index in to the host bus master buffer. */
	u32 dsp_index;
	/* Host index in to the host bus master buffer. */
	u32 host_index;
	u32 size_in_bytes;
};

struct hpi_streamid {
	u16 object_type;
		    /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
	u16 stream_index; /**< outstream or instream index. */
};

struct hpi_punchinout {
	u32 punch_in_sample;
	u32 punch_out_sample;

Annotation

Implementation Notes