drivers/most/configfs.c
Source file repositories/reference/linux-study-clean/drivers/most/configfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/most/configfs.c- Extension
.c- Size
- 17976 bytes
- Lines
- 725
- Domain
- Driver Families
- Bucket
- drivers/most
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hlinux/init.hlinux/configfs.hlinux/most.h
Detected Declarations
struct mdev_linkstruct most_commonstruct most_snd_grpstruct most_soundfunction set_cfg_buffer_sizefunction set_cfg_subbuffer_sizefunction set_cfg_dbr_sizefunction set_cfg_num_buffersfunction set_cfg_packets_xactfunction set_cfg_directionfunction set_cfg_datatypefunction set_config_and_add_linkfunction mdev_link_create_link_storefunction mdev_link_destroy_link_storefunction mdev_link_direction_showfunction mdev_link_direction_storefunction mdev_link_datatype_showfunction mdev_link_datatype_storefunction mdev_link_device_showfunction mdev_link_device_storefunction mdev_link_channel_showfunction mdev_link_channel_storefunction mdev_link_comp_showfunction mdev_link_comp_storefunction mdev_link_comp_params_showfunction mdev_link_comp_params_storefunction mdev_link_num_buffers_showfunction mdev_link_num_buffers_storefunction mdev_link_buffer_size_showfunction mdev_link_buffer_size_storefunction mdev_link_subbuffer_size_showfunction mdev_link_subbuffer_size_storefunction mdev_link_packets_per_xact_showfunction mdev_link_packets_per_xact_storefunction mdev_link_dbr_size_showfunction mdev_link_dbr_size_storefunction mdev_link_releasefunction most_common_releasefunction most_common_disconnectfunction most_snd_grp_create_card_storefunction most_snd_grp_releasefunction list_for_each_entryfunction most_sound_disconnectfunction most_register_configfs_subsysfunction most_interface_register_notifyfunction list_for_each_entryfunction most_deregister_configfs_subsysfunction configfs_init
Annotated Snippet
struct mdev_link {
struct config_item item;
struct list_head list;
bool create_link;
bool destroy_link;
u16 num_buffers;
u16 buffer_size;
u16 subbuffer_size;
u16 packets_per_xact;
u16 dbr_size;
char datatype[MAX_STRING_SIZE];
char direction[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE];
char device[MAX_STRING_SIZE];
char channel[MAX_STRING_SIZE];
char comp[MAX_STRING_SIZE];
char comp_params[MAX_STRING_SIZE];
};
static struct list_head mdev_link_list;
static int set_cfg_buffer_size(struct mdev_link *link)
{
return most_set_cfg_buffer_size(link->device, link->channel,
link->buffer_size);
}
static int set_cfg_subbuffer_size(struct mdev_link *link)
{
return most_set_cfg_subbuffer_size(link->device, link->channel,
link->subbuffer_size);
}
static int set_cfg_dbr_size(struct mdev_link *link)
{
return most_set_cfg_dbr_size(link->device, link->channel,
link->dbr_size);
}
static int set_cfg_num_buffers(struct mdev_link *link)
{
return most_set_cfg_num_buffers(link->device, link->channel,
link->num_buffers);
}
static int set_cfg_packets_xact(struct mdev_link *link)
{
return most_set_cfg_packets_xact(link->device, link->channel,
link->packets_per_xact);
}
static int set_cfg_direction(struct mdev_link *link)
{
return most_set_cfg_direction(link->device, link->channel,
link->direction);
}
static int set_cfg_datatype(struct mdev_link *link)
{
return most_set_cfg_datatype(link->device, link->channel,
link->datatype);
}
static int (*set_config_val[])(struct mdev_link *link) = {
set_cfg_buffer_size,
set_cfg_subbuffer_size,
set_cfg_dbr_size,
set_cfg_num_buffers,
set_cfg_packets_xact,
set_cfg_direction,
set_cfg_datatype,
};
static struct mdev_link *to_mdev_link(struct config_item *item)
{
return container_of(item, struct mdev_link, item);
}
static int set_config_and_add_link(struct mdev_link *mdev_link)
{
int i;
int ret;
for (i = 0; i < ARRAY_SIZE(set_config_val); i++) {
ret = set_config_val[i](mdev_link);
if (ret < 0 && ret != -ENODEV) {
pr_err("Config failed\n");
return ret;
}
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/init.h`, `linux/configfs.h`, `linux/most.h`.
- Detected declarations: `struct mdev_link`, `struct most_common`, `struct most_snd_grp`, `struct most_sound`, `function set_cfg_buffer_size`, `function set_cfg_subbuffer_size`, `function set_cfg_dbr_size`, `function set_cfg_num_buffers`, `function set_cfg_packets_xact`, `function set_cfg_direction`.
- Atlas domain: Driver Families / drivers/most.
- Implementation status: integration 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.