drivers/s390/cio/device_ops.c
Source file repositories/reference/linux-study-clean/drivers/s390/cio/device_ops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/cio/device_ops.c- Extension
.c- Size
- 27659 bytes
- Lines
- 871
- Domain
- Driver Families
- Bucket
- drivers/s390
- 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.
- 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/export.hlinux/init.hlinux/errno.hlinux/slab.hlinux/list.hlinux/device.hlinux/delay.hlinux/completion.hasm/ccwdev.hasm/idals.hasm/chpid.hasm/fcx.hcio.hcio_debug.hcss.hchsc.hdevice.hchp.h
Detected Declarations
function Authorfunction ccw_device_set_optionsfunction ccw_device_clear_optionsfunction ccw_device_is_pathgroupfunction ccw_device_is_multipathfunction ccw_device_clearfunction ccw_device_start_timeout_keyfunction ccw_device_start_keyfunction ccw_device_startfunction ccw_device_start_timeoutfunction ccw_device_haltfunction ccw_device_resumefunction ccw_device_get_ciwfunction ccw_device_get_path_maskfunction ccw_device_get_chp_descfunction ccw_device_get_util_strfunction ccw_device_get_idfunction ccw_device_tm_start_timeout_keyfunction ccw_device_tm_start_keyfunction ccw_device_tm_startfunction ccw_device_tm_start_timeoutfunction ccw_device_get_mdcfunction ccw_device_tm_intrgfunction ccw_device_get_schidfunction ccw_device_pnsofunction ccw_device_get_cssidfunction ccw_device_get_iidfunction ccw_device_get_chpidfunction ccw_device_get_chidfunction ccw_device_dma_freeexport ccw_device_is_pathgroupexport ccw_device_is_multipathexport ccw_device_get_idexport ccw_device_tm_start_timeout_keyexport ccw_device_tm_start_keyexport ccw_device_tm_startexport ccw_device_tm_start_timeoutexport ccw_device_get_mdcexport ccw_device_tm_intrgexport ccw_device_get_schidexport ccw_device_pnsoexport ccw_device_get_cssidexport ccw_device_get_iidexport ccw_device_get_chpidexport ccw_device_get_chidexport ccw_device_dma_zallocexport ccw_device_dma_freeexport ccw_device_set_options_mask
Annotated Snippet
if (!cdev->private->flags.fake_irb) {
cdev->private->flags.fake_irb = FAKE_CMD_IRB;
cdev->private->intparm = intparm;
CIO_MSG_EVENT(2, "fakeirb: queue device 0.%x.%04x intparm %lx type=%d\n",
cdev->private->dev_id.ssid,
cdev->private->dev_id.devno, intparm,
cdev->private->flags.fake_irb);
return 0;
} else
/* There's already a fake I/O around. */
return -EBUSY;
}
if (cdev->private->state != DEV_STATE_ONLINE ||
((sch->schib.scsw.cmd.stctl & SCSW_STCTL_PRIM_STATUS) &&
!(sch->schib.scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS)))
return -EBUSY;
ret = cio_set_options (sch, flags);
if (ret)
return ret;
/* Adjust requested path mask to exclude unusable paths. */
if (lpm) {
lpm &= sch->lpm;
if (lpm == 0)
return -EACCES;
}
ret = cio_start_key (sch, cpa, lpm, key);
switch (ret) {
case 0:
cdev->private->intparm = intparm;
if (expires)
ccw_device_set_timeout(cdev, expires);
break;
case -EACCES:
case -ENODEV:
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
break;
}
return ret;
}
/**
* ccw_device_start_key() - start a s390 channel program with key
* @cdev: target ccw device
* @cpa: logical start address of channel program
* @intparm: user specific interruption parameter; will be presented back to
* @cdev's interrupt handler. Allows a device driver to associate
* the interrupt with a particular I/O request.
* @lpm: defines the channel path to be used for a specific I/O request. A
* value of 0 will make cio use the opm.
* @key: storage key to be used for the I/O
* @flags: additional flags; defines the action to be performed for I/O
* processing.
*
* Start a S/390 channel program. When the interrupt arrives, the
* IRQ handler is called, either immediately, delayed (dev-end missing,
* or sense required) or never (no IRQ handler registered).
* The interruption handler will echo back the @intparm specified here, unless
* another interruption parameter is specified by a subsequent invocation of
* ccw_device_halt() or ccw_device_clear().
* Returns:
* %0, if the operation was successful;
* -%EBUSY, if the device is busy, or status pending;
* -%EACCES, if no path specified in @lpm is operational;
* -%ENODEV, if the device is not operational.
* Context:
* Interrupts disabled, ccw device lock held
*/
int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
unsigned long intparm, __u8 lpm, __u8 key,
unsigned long flags)
{
return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm, key,
flags, 0);
}
/**
* ccw_device_start() - start a s390 channel program
* @cdev: target ccw device
* @cpa: logical start address of channel program
* @intparm: user specific interruption parameter; will be presented back to
* @cdev's interrupt handler. Allows a device driver to associate
* the interrupt with a particular I/O request.
* @lpm: defines the channel path to be used for a specific I/O request. A
* value of 0 will make cio use the opm.
* @flags: additional flags; defines the action to be performed for I/O
* processing.
*
* Start a S/390 channel program. When the interrupt arrives, the
* IRQ handler is called, either immediately, delayed (dev-end missing,
* or sense required) or never (no IRQ handler registered).
Annotation
- Immediate include surface: `linux/export.h`, `linux/init.h`, `linux/errno.h`, `linux/slab.h`, `linux/list.h`, `linux/device.h`, `linux/delay.h`, `linux/completion.h`.
- Detected declarations: `function Author`, `function ccw_device_set_options`, `function ccw_device_clear_options`, `function ccw_device_is_pathgroup`, `function ccw_device_is_multipath`, `function ccw_device_clear`, `function ccw_device_start_timeout_key`, `function ccw_device_start_key`, `function ccw_device_start`, `function ccw_device_start_timeout`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: integration 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.