drivers/s390/block/dasd_devmap.c
Source file repositories/reference/linux-study-clean/drivers/s390/block/dasd_devmap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/block/dasd_devmap.c- Extension
.c- Size
- 63888 bytes
- Lines
- 2623
- 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/ctype.hlinux/init.hlinux/module.hlinux/slab.hasm/machine.hasm/debug.hlinux/uaccess.hasm/ipl.hdasd_int.h
Detected Declarations
struct dasd_devmapfunction dasd_hash_busidfunction dasd_call_setupfunction dasd_busidfunction dasd_feature_listfunction dasd_parse_keywordfunction dasd_evaluate_range_paramfunction dasd_parse_rangefunction dasd_parsefunction existsfunction dasd_find_busid_lockedfunction dasd_find_busidfunction dasd_busid_knownfunction dasd_forget_rangesfunction list_for_each_entry_safefunction dasd_device_from_devindexfunction list_for_each_entryfunction dasd_devmap_from_cdevfunction dasd_create_devicefunction dasd_devmap_get_pprc_statusfunction dasd_devmap_entry_from_pprc_datafunction dasd_devmap_check_copy_relationfunction dasd_devmap_delete_copy_relation_devicefunction dasd_devmap_set_device_copy_relationfunction dasd_delete_devicefunction dasd_put_device_wakefunction dasd_device_from_cdev_lockedfunction dasd_device_from_cdevfunction dasd_add_link_to_gendiskfunction dasd_ff_showfunction dasd_ff_storefunction dasd_ro_showfunction dasd_ro_storefunction dasd_erplog_showfunction dasd_erplog_storefunction dasd_use_diag_showfunction dasd_use_diag_storefunction dasd_use_raw_showfunction dasd_use_raw_storefunction dasd_safe_offline_storefunction dasd_access_showfunction dasd_discipline_showfunction dasd_device_status_showfunction dasd_alias_showfunction dasd_vendor_showfunction dasd_uid_showfunction dasd_eer_showfunction dasd_eer_store
Annotated Snippet
struct dasd_devmap {
struct list_head list;
char bus_id[DASD_BUS_ID_SIZE];
unsigned int devindex;
unsigned short features;
struct dasd_device *device;
struct dasd_copy_relation *copy;
unsigned int aq_mask;
};
/*
* Parameter parsing functions for dasd= parameter. The syntax is:
* <devno> : (0x)?[0-9a-fA-F]+
* <busid> : [0-0a-f]\.[0-9a-f]\.(0x)?[0-9a-fA-F]+
* <feature> : ro
* <feature_list> : \(<feature>(:<feature>)*\)
* <devno-range> : <devno>(-<devno>)?<feature_list>?
* <busid-range> : <busid>(-<busid>)?<feature_list>?
* <devices> : <devno-range>|<busid-range>
* <dasd_module> : dasd_diag_mod|dasd_eckd_mod|dasd_fba_mod
*
* <dasd> : autodetect|probeonly|<devices>(,<devices>)*
*/
int dasd_probeonly = 0; /* is true, when probeonly mode is active */
int dasd_autodetect = 0; /* is true, when autodetection is active */
int dasd_nopav = 0; /* is true, when PAV is disabled */
EXPORT_SYMBOL_GPL(dasd_nopav);
int dasd_nofcx; /* disable High Performance Ficon */
EXPORT_SYMBOL_GPL(dasd_nofcx);
/*
* char *dasd[] is intended to hold the ranges supplied by the dasd= statement
* it is named 'dasd' to directly be filled by insmod with the comma separated
* strings when running as a module.
*/
static char *dasd[DASD_MAX_PARAMS];
module_param_array(dasd, charp, NULL, S_IRUGO);
/*
* Single spinlock to protect devmap and servermap structures and lists.
*/
static DEFINE_SPINLOCK(dasd_devmap_lock);
/*
* Hash lists for devmap structures.
*/
static struct list_head dasd_hashlists[256];
int dasd_max_devindex;
static struct dasd_devmap *dasd_add_busid(const char *, int);
static inline int
dasd_hash_busid(const char *bus_id)
{
int hash, i;
hash = 0;
for (i = 0; (i < DASD_BUS_ID_SIZE) && *bus_id; i++, bus_id++)
hash += *bus_id;
return hash & 0xff;
}
#ifndef MODULE
static int __init dasd_call_setup(char *opt)
{
static int i __initdata;
char *tmp;
while (i < DASD_MAX_PARAMS) {
tmp = strsep(&opt, ",");
if (!tmp)
break;
dasd[i++] = tmp;
}
return 1;
}
__setup ("dasd=", dasd_call_setup);
#endif /* #ifndef MODULE */
#define DASD_IPLDEV "ipldev"
/*
* Read a device busid/devno from a string.
*/
static int dasd_busid(char *str, int *id0, int *id1, int *devno)
{
Annotation
- Immediate include surface: `linux/export.h`, `linux/ctype.h`, `linux/init.h`, `linux/module.h`, `linux/slab.h`, `asm/machine.h`, `asm/debug.h`, `linux/uaccess.h`.
- Detected declarations: `struct dasd_devmap`, `function dasd_hash_busid`, `function dasd_call_setup`, `function dasd_busid`, `function dasd_feature_list`, `function dasd_parse_keyword`, `function dasd_evaluate_range_param`, `function dasd_parse_range`, `function dasd_parse`, `function exists`.
- 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.