sound/xen/xen_snd_front_cfg.c
Source file repositories/reference/linux-study-clean/sound/xen/xen_snd_front_cfg.c
File Facts
- System
- Linux kernel
- Corpus path
sound/xen/xen_snd_front_cfg.c- Extension
.c- Size
- 13029 bytes
- Lines
- 520
- Domain
- Driver Families
- Bucket
- sound/xen
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xen/xenbus.hxen/interface/io/sndif.hxen_snd_front.hxen_snd_front_cfg.h
Detected Declarations
struct cfg_hw_sample_ratestruct cfg_hw_sample_formatfunction cfg_hw_ratesfunction cfg_formatsfunction cfg_read_pcm_hwfunction cfg_get_stream_typefunction cfg_streamfunction cfg_devicefunction xen_snd_front_cfg_card
Annotated Snippet
struct cfg_hw_sample_rate {
const char *name;
unsigned int mask;
unsigned int value;
};
static const struct cfg_hw_sample_rate CFG_HW_SUPPORTED_RATES[] = {
{ .name = "5512", .mask = SNDRV_PCM_RATE_5512, .value = 5512 },
{ .name = "8000", .mask = SNDRV_PCM_RATE_8000, .value = 8000 },
{ .name = "11025", .mask = SNDRV_PCM_RATE_11025, .value = 11025 },
{ .name = "16000", .mask = SNDRV_PCM_RATE_16000, .value = 16000 },
{ .name = "22050", .mask = SNDRV_PCM_RATE_22050, .value = 22050 },
{ .name = "32000", .mask = SNDRV_PCM_RATE_32000, .value = 32000 },
{ .name = "44100", .mask = SNDRV_PCM_RATE_44100, .value = 44100 },
{ .name = "48000", .mask = SNDRV_PCM_RATE_48000, .value = 48000 },
{ .name = "64000", .mask = SNDRV_PCM_RATE_64000, .value = 64000 },
{ .name = "96000", .mask = SNDRV_PCM_RATE_96000, .value = 96000 },
{ .name = "176400", .mask = SNDRV_PCM_RATE_176400, .value = 176400 },
{ .name = "192000", .mask = SNDRV_PCM_RATE_192000, .value = 192000 },
};
struct cfg_hw_sample_format {
const char *name;
u64 mask;
};
static const struct cfg_hw_sample_format CFG_HW_SUPPORTED_FORMATS[] = {
{
.name = XENSND_PCM_FORMAT_U8_STR,
.mask = SNDRV_PCM_FMTBIT_U8
},
{
.name = XENSND_PCM_FORMAT_S8_STR,
.mask = SNDRV_PCM_FMTBIT_S8
},
{
.name = XENSND_PCM_FORMAT_U16_LE_STR,
.mask = SNDRV_PCM_FMTBIT_U16_LE
},
{
.name = XENSND_PCM_FORMAT_U16_BE_STR,
.mask = SNDRV_PCM_FMTBIT_U16_BE
},
{
.name = XENSND_PCM_FORMAT_S16_LE_STR,
.mask = SNDRV_PCM_FMTBIT_S16_LE
},
{
.name = XENSND_PCM_FORMAT_S16_BE_STR,
.mask = SNDRV_PCM_FMTBIT_S16_BE
},
{
.name = XENSND_PCM_FORMAT_U24_LE_STR,
.mask = SNDRV_PCM_FMTBIT_U24_LE
},
{
.name = XENSND_PCM_FORMAT_U24_BE_STR,
.mask = SNDRV_PCM_FMTBIT_U24_BE
},
{
.name = XENSND_PCM_FORMAT_S24_LE_STR,
.mask = SNDRV_PCM_FMTBIT_S24_LE
},
{
.name = XENSND_PCM_FORMAT_S24_BE_STR,
.mask = SNDRV_PCM_FMTBIT_S24_BE
},
{
.name = XENSND_PCM_FORMAT_U32_LE_STR,
.mask = SNDRV_PCM_FMTBIT_U32_LE
},
{
.name = XENSND_PCM_FORMAT_U32_BE_STR,
.mask = SNDRV_PCM_FMTBIT_U32_BE
},
{
.name = XENSND_PCM_FORMAT_S32_LE_STR,
.mask = SNDRV_PCM_FMTBIT_S32_LE
},
{
.name = XENSND_PCM_FORMAT_S32_BE_STR,
.mask = SNDRV_PCM_FMTBIT_S32_BE
},
{
.name = XENSND_PCM_FORMAT_A_LAW_STR,
.mask = SNDRV_PCM_FMTBIT_A_LAW
},
{
.name = XENSND_PCM_FORMAT_MU_LAW_STR,
.mask = SNDRV_PCM_FMTBIT_MU_LAW
Annotation
- Immediate include surface: `xen/xenbus.h`, `xen/interface/io/sndif.h`, `xen_snd_front.h`, `xen_snd_front_cfg.h`.
- Detected declarations: `struct cfg_hw_sample_rate`, `struct cfg_hw_sample_format`, `function cfg_hw_rates`, `function cfg_formats`, `function cfg_read_pcm_hw`, `function cfg_get_stream_type`, `function cfg_stream`, `function cfg_device`, `function xen_snd_front_cfg_card`.
- Atlas domain: Driver Families / sound/xen.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.