drivers/scsi/fcoe/fcoe_sysfs.c
Source file repositories/reference/linux-study-clean/drivers/scsi/fcoe/fcoe_sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/fcoe/fcoe_sysfs.c- Extension
.c- Size
- 28667 bytes
- Lines
- 1043
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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.
- 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/module.hlinux/types.hlinux/kernel.hlinux/etherdevice.hlinux/ctype.hlinux/string.hscsi/fcoe_sysfs.hscsi/libfcoe.hlibfcoe.h
Detected Declarations
function fcoe_str_to_dev_lossfunction fcoe_fcf_set_dev_loss_tmofunction show_fcf_statefunction show_ctlr_modefunction store_ctlr_modefunction store_ctlr_enabledfunction show_ctlr_enabled_statefunction store_ctlr_fip_respfunction show_ctlr_fip_respfunction fcoe_ctlr_var_storefunction store_ctlr_r_a_tovfunction show_ctlr_r_a_tovfunction store_ctlr_e_d_tovfunction show_ctlr_e_d_tovfunction store_private_fcoe_ctlr_fcf_dev_loss_tmofunction store_fcoe_fcf_dev_loss_tmofunction fcoe_bus_matchfunction fcoe_ctlr_device_releasefunction fcoe_fcf_device_releasefunction ctlr_create_storefunction ctlr_destroy_storefunction fcoe_ctlr_device_flush_workfunction fcoe_ctlr_device_queue_workfunction fcoe_ctlr_device_flush_devlossfunction fcoe_ctlr_device_queue_devloss_workfunction fcoe_fcf_device_matchfunction fcoe_ctlr_device_addfunction fcoe_ctlr_device_deletefunction fcoe_fcf_device_final_deletefunction fip_timeout_deleted_fcffunction fcoe_fcf_device_deletefunction fcoe_fcf_device_addfunction list_for_each_entryfunction fcoe_sysfs_setupfunction fcoe_sysfs_teardownexport fcoe_ctlr_device_addexport fcoe_ctlr_device_deleteexport fcoe_fcf_device_deleteexport fcoe_fcf_device_add
Annotated Snippet
static const struct bus_type fcoe_bus_type;
static int fcoe_bus_match(struct device *dev,
const struct device_driver *drv)
{
if (dev->bus == &fcoe_bus_type)
return 1;
return 0;
}
/**
* fcoe_ctlr_device_release() - Release the FIP ctlr memory
* @dev: Pointer to the FIP ctlr's embedded device
*
* Called when the last FIP ctlr reference is released.
*/
static void fcoe_ctlr_device_release(struct device *dev)
{
struct fcoe_ctlr_device *ctlr = dev_to_ctlr(dev);
kfree(ctlr);
}
/**
* fcoe_fcf_device_release() - Release the FIP fcf memory
* @dev: Pointer to the fcf's embedded device
*
* Called when the last FIP fcf reference is released.
*/
static void fcoe_fcf_device_release(struct device *dev)
{
struct fcoe_fcf_device *fcf = dev_to_fcf(dev);
kfree(fcf);
}
static const struct device_type fcoe_ctlr_device_type = {
.name = "fcoe_ctlr",
.groups = fcoe_ctlr_attr_groups,
.release = fcoe_ctlr_device_release,
};
static const struct device_type fcoe_fcf_device_type = {
.name = "fcoe_fcf",
.groups = fcoe_fcf_attr_groups,
.release = fcoe_fcf_device_release,
};
static ssize_t ctlr_create_store(const struct bus_type *bus, const char *buf,
size_t count)
{
return fcoe_ctlr_create_store(buf, count);
}
static BUS_ATTR_WO(ctlr_create);
static ssize_t ctlr_destroy_store(const struct bus_type *bus, const char *buf,
size_t count)
{
return fcoe_ctlr_destroy_store(buf, count);
}
static BUS_ATTR_WO(ctlr_destroy);
static struct attribute *fcoe_bus_attrs[] = {
&bus_attr_ctlr_create.attr,
&bus_attr_ctlr_destroy.attr,
NULL,
};
ATTRIBUTE_GROUPS(fcoe_bus);
static const struct bus_type fcoe_bus_type = {
.name = "fcoe",
.match = &fcoe_bus_match,
.bus_groups = fcoe_bus_groups,
};
/**
* fcoe_ctlr_device_flush_work() - Flush a FIP ctlr's workqueue
* @ctlr: Pointer to the FIP ctlr whose workqueue is to be flushed
*/
static void fcoe_ctlr_device_flush_work(struct fcoe_ctlr_device *ctlr)
{
if (!fcoe_ctlr_work_q(ctlr)) {
printk(KERN_ERR
"ERROR: FIP Ctlr '%d' attempted to flush work, "
"when no workqueue created.\n", ctlr->id);
dump_stack();
return;
}
flush_workqueue(fcoe_ctlr_work_q(ctlr));
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/kernel.h`, `linux/etherdevice.h`, `linux/ctype.h`, `linux/string.h`, `scsi/fcoe_sysfs.h`, `scsi/libfcoe.h`.
- Detected declarations: `function fcoe_str_to_dev_loss`, `function fcoe_fcf_set_dev_loss_tmo`, `function show_fcf_state`, `function show_ctlr_mode`, `function store_ctlr_mode`, `function store_ctlr_enabled`, `function show_ctlr_enabled_state`, `function store_ctlr_fip_resp`, `function show_ctlr_fip_resp`, `function fcoe_ctlr_var_store`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: pattern implementation candidate.
- 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.