drivers/s390/crypto/ap_bus.c
Source file repositories/reference/linux-study-clean/drivers/s390/crypto/ap_bus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/crypto/ap_bus.c- Extension
.c- Size
- 69393 bytes
- Lines
- 2682
- Domain
- Driver Families
- Bucket
- drivers/s390
- 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/kernel_stat.hlinux/moduleparam.hlinux/export.hlinux/hex.hlinux/init.hlinux/delay.hlinux/err.hlinux/freezer.hlinux/interrupt.hlinux/workqueue.hlinux/slab.hlinux/notifier.hlinux/kthread.hlinux/mutex.hasm/machine.hasm/airq.hasm/tpi.hlinux/atomic.hasm/isc.hlinux/hrtimer.hlinux/ktime.hasm/facility.hlinux/crypto.hlinux/mod_devicetable.hlinux/debugfs.hlinux/ctype.hlinux/module.hasm/uv.hasm/chsc.hlinux/mempool.hap_bus.hap_debug.h
Detected Declarations
struct __ap_calc_ctrsfunction ap_airq_ptrfunction ap_interrupts_availablefunction ap_qci_availablefunction ap_apft_availablefunction ap_qact_availablefunction ap_sb_availablefunction ap_is_se_guestfunction ap_init_qci_infofunction ap_test_configfunction ap_test_config_card_idfunction ap_test_config_usage_domainfunction ap_test_config_ctrl_domainfunction ap_queue_infofunction ap_waitfunction ap_request_timeoutfunction ap_poll_timeoutfunction ap_interrupt_handlerfunction ap_tasklet_fnfunction ap_pending_requestsfunction ap_poll_threadfunction ap_poll_thread_startfunction ap_poll_thread_stopfunction ap_init_apmsgfunction ap_release_apmsgfunction ap_bus_matchfunction ap_ueventfunction ap_send_init_scan_done_ueventfunction ap_send_bindings_complete_ueventfunction ap_send_config_ueventfunction ap_send_online_ueventfunction ap_send_se_bind_ueventfunction ap_send_se_assoc_ueventfunction ap_send_mask_changed_ueventfunction __ap_calc_helperfunction ap_calc_bound_apqnsfunction ap_check_bindings_completefunction wait_for_completion_interruptible_timeoutfunction __ap_queue_devices_with_id_unregisterfunction __ap_revise_reservedfunction ap_bus_revise_bindingsfunction notfunction notfunction ap_device_probefunction ap_device_removefunction ap_driver_registerfunction ap_driver_unregisterfunction ap_bus_force_rescan
Annotated Snippet
static const struct bus_type ap_bus_type;
/* Adapter interrupt definitions */
static void ap_interrupt_handler(struct airq_struct *airq,
struct tpi_info *tpi_info);
static bool ap_irq_flag;
static struct airq_struct ap_airq = {
.handler = ap_interrupt_handler,
.isc = AP_ISC,
};
/**
* ap_airq_ptr() - Get the address of the adapter interrupt indicator
*
* Returns the address of the local-summary-indicator of the adapter
* interrupt handler for AP, or NULL if adapter interrupts are not
* available.
*/
void *ap_airq_ptr(void)
{
if (ap_irq_flag)
return ap_airq.lsi_ptr;
return NULL;
}
/**
* ap_interrupts_available(): Test if AP interrupts are available.
*
* Returns 1 if AP interrupts are available.
*/
static int ap_interrupts_available(void)
{
return test_facility(65);
}
/**
* ap_qci_available(): Test if AP configuration
* information can be queried via QCI subfunction.
*
* Returns 1 if subfunction PQAP(QCI) is available.
*/
static int ap_qci_available(void)
{
return test_facility(12);
}
/**
* ap_apft_available(): Test if AP facilities test (APFT)
* facility is available.
*
* Returns 1 if APFT is available.
*/
static int ap_apft_available(void)
{
return test_facility(15);
}
/*
* ap_qact_available(): Test if the PQAP(QACT) subfunction is available.
*
* Returns 1 if the QACT subfunction is available.
*/
static inline int ap_qact_available(void)
{
return ap_qci_info->qact;
}
/*
* ap_sb_available(): Test if the AP secure binding facility is available.
*
* Returns 1 if secure binding facility is available.
*/
int ap_sb_available(void)
{
return ap_qci_info->apsb;
}
/*
* ap_is_se_guest(): Check for SE guest with AP pass-through support.
*/
bool ap_is_se_guest(void)
{
return is_prot_virt_guest() && ap_sb_available();
}
EXPORT_SYMBOL(ap_is_se_guest);
/**
* ap_init_qci_info(): Allocate and query qci config info.
Annotation
- Immediate include surface: `linux/kernel_stat.h`, `linux/moduleparam.h`, `linux/export.h`, `linux/hex.h`, `linux/init.h`, `linux/delay.h`, `linux/err.h`, `linux/freezer.h`.
- Detected declarations: `struct __ap_calc_ctrs`, `function ap_airq_ptr`, `function ap_interrupts_available`, `function ap_qci_available`, `function ap_apft_available`, `function ap_qact_available`, `function ap_sb_available`, `function ap_is_se_guest`, `function ap_init_qci_info`, `function ap_test_config`.
- Atlas domain: Driver Families / drivers/s390.
- 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.