drivers/fpga/dfl-fme-main.c
Source file repositories/reference/linux-study-clean/drivers/fpga/dfl-fme-main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/fpga/dfl-fme-main.c- Extension
.c- Size
- 19678 bytes
- Lines
- 762
- Domain
- Driver Families
- Bucket
- drivers/fpga
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/hwmon.hlinux/hwmon-sysfs.hlinux/kernel.hlinux/module.hlinux/uaccess.hlinux/units.hlinux/fpga-dfl.hdfl.hdfl-fme.h
Detected Declarations
function Enginefunction Bitstreamfunction Bitstreamfunction cache_size_showfunction fabric_version_showfunction socket_id_showfunction fme_hdr_ioctl_release_portfunction fme_hdr_ioctl_assign_portfunction fme_hdr_ioctlfunction fme_thermal_throttle_supportfunction thermal_hwmon_attrs_visiblefunction thermal_hwmon_readfunction temp1_max_policy_showfunction thermal_extra_attrs_visiblefunction fme_thermal_mgmt_initfunction power_hwmon_readfunction power_hwmon_writefunction power_hwmon_attrs_visiblefunction power1_xeon_limit_showfunction power1_fpga_limit_showfunction power1_ltr_showfunction fme_power_mgmt_initfunction fme_ioctl_check_extensionfunction fme_openfunction fme_releasefunction fme_ioctlfunction dfl_fpga_dev_for_each_featurefunction fme_dev_initfunction fme_dev_destroyfunction fme_probefunction fme_remove
Annotated Snippet
static const struct file_operations fme_fops = {
.owner = THIS_MODULE,
.open = fme_open,
.release = fme_release,
.unlocked_ioctl = fme_ioctl,
};
static int fme_probe(struct platform_device *pdev)
{
int ret;
ret = fme_dev_init(pdev);
if (ret)
goto exit;
ret = dfl_fpga_dev_feature_init(pdev, fme_feature_drvs);
if (ret)
goto dev_destroy;
ret = dfl_fpga_dev_ops_register(pdev, &fme_fops, THIS_MODULE);
if (ret)
goto feature_uinit;
return 0;
feature_uinit:
dfl_fpga_dev_feature_uinit(pdev);
dev_destroy:
fme_dev_destroy(pdev);
exit:
return ret;
}
static void fme_remove(struct platform_device *pdev)
{
dfl_fpga_dev_ops_unregister(pdev);
dfl_fpga_dev_feature_uinit(pdev);
fme_dev_destroy(pdev);
}
static const struct attribute_group *fme_dev_groups[] = {
&fme_hdr_group,
&fme_global_err_group,
NULL
};
static struct platform_driver fme_driver = {
.driver = {
.name = DFL_FPGA_FEATURE_DEV_FME,
.dev_groups = fme_dev_groups,
},
.probe = fme_probe,
.remove = fme_remove,
};
module_platform_driver(fme_driver);
MODULE_DESCRIPTION("FPGA Management Engine driver");
MODULE_AUTHOR("Intel Corporation");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:dfl-fme");
Annotation
- Immediate include surface: `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `linux/kernel.h`, `linux/module.h`, `linux/uaccess.h`, `linux/units.h`, `linux/fpga-dfl.h`, `dfl.h`.
- Detected declarations: `function Engine`, `function Bitstream`, `function Bitstream`, `function cache_size_show`, `function fabric_version_show`, `function socket_id_show`, `function fme_hdr_ioctl_release_port`, `function fme_hdr_ioctl_assign_port`, `function fme_hdr_ioctl`, `function fme_thermal_throttle_support`.
- Atlas domain: Driver Families / drivers/fpga.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.