drivers/s390/scsi/zfcp_ccw.c
Source file repositories/reference/linux-study-clean/drivers/s390/scsi/zfcp_ccw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/scsi/zfcp_ccw.c- Extension
.c- Size
- 8284 bytes
- Lines
- 291
- Domain
- Driver Families
- Bucket
- drivers/s390
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hzfcp_ext.hzfcp_reqlist.h
Detected Declarations
function zfcp_ccw_adapter_putfunction zfcp_ccw_activatefunction zfcp_ccw_probefunction zfcp_ccw_removefunction zfcp_ccw_set_onlinefunction zfcp_ccw_set_offlinefunction zfcp_ccw_notifyfunction zfcp_ccw_shutdown
Annotated Snippet
if (IS_ERR(adapter)) {
dev_err(&cdev->dev,
"Setting up data structures for the "
"FCP adapter failed\n");
return PTR_ERR(adapter);
}
kref_get(&adapter->ref);
}
/* initialize request counter */
BUG_ON(!zfcp_reqlist_isempty(adapter->req_list));
adapter->req_no = 0;
zfcp_ccw_activate(cdev, 0, "ccsonl1");
/*
* We want to scan ports here, always, with some random delay and
* without rate limit - basically what zfcp_ccw_activate() has
* achieved for us. Not quite! That port scan depended on
* !no_auto_port_rescan. So let's cover the no_auto_port_rescan
* case here to make sure a port scan is done unconditionally.
* Since zfcp_ccw_activate() has waited the desired random time,
* we can immediately schedule and flush a port scan for the
* remaining cases.
*/
zfcp_fc_inverse_conditional_port_scan(adapter);
flush_delayed_work(&adapter->scan_work);
zfcp_ccw_adapter_put(adapter);
return 0;
}
/**
* zfcp_ccw_set_offline - set_offline function of zfcp driver
* @cdev: pointer to belonging ccw device
*
* This function gets called by the common i/o layer and sets an adapter
* into state offline.
*/
static int zfcp_ccw_set_offline(struct ccw_device *cdev)
{
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
if (!adapter)
return 0;
zfcp_erp_set_adapter_status(adapter, 0);
zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1");
zfcp_erp_wait(adapter);
zfcp_ccw_adapter_put(adapter);
return 0;
}
/**
* zfcp_ccw_notify - ccw notify function
* @cdev: pointer to belonging ccw device
* @event: indicates if adapter was detached or attached
*
* This function gets called by the common i/o layer if an adapter has gone
* or reappeared.
*/
static int zfcp_ccw_notify(struct ccw_device *cdev, int event)
{
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
if (!adapter)
return 1;
switch (event) {
case CIO_GONE:
dev_warn(&cdev->dev, "The FCP device has been detached\n");
zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti1");
break;
case CIO_NO_PATH:
dev_warn(&cdev->dev,
"The CHPID for the FCP device is offline\n");
zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti2");
break;
case CIO_OPER:
dev_info(&cdev->dev, "The FCP device is operational again\n");
zfcp_erp_set_adapter_status(adapter,
ZFCP_STATUS_COMMON_RUNNING);
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED,
"ccnoti4");
break;
case CIO_BOXED:
dev_warn(&cdev->dev, "The FCP device did not respond within "
"the specified time\n");
zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5");
break;
Annotation
- Immediate include surface: `linux/module.h`, `zfcp_ext.h`, `zfcp_reqlist.h`.
- Detected declarations: `function zfcp_ccw_adapter_put`, `function zfcp_ccw_activate`, `function zfcp_ccw_probe`, `function zfcp_ccw_remove`, `function zfcp_ccw_set_online`, `function zfcp_ccw_set_offline`, `function zfcp_ccw_notify`, `function zfcp_ccw_shutdown`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: source 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.