drivers/s390/cio/blacklist.c
Source file repositories/reference/linux-study-clean/drivers/s390/cio/blacklist.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/cio/blacklist.c- Extension
.c- Size
- 9328 bytes
- Lines
- 430
- 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.
- 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/hex.hlinux/init.hlinux/vmalloc.hlinux/proc_fs.hlinux/seq_file.hlinux/ctype.hlinux/device.hlinux/uaccess.hasm/cio.hasm/ipl.hblacklist.hcio.hcio_debug.hcss.hdevice.h
Detected Declarations
struct ccwdev_iterfunction blacklist_rangefunction pure_hexfunction parse_busidfunction blacklist_parse_parametersfunction blacklist_setupfunction validate_subchannelfunction blacklist_parse_proc_parametersfunction cio_ignore_proc_seq_startfunction cio_ignore_proc_seq_stopfunction cio_ignore_proc_seq_showfunction cio_ignore_writefunction cio_ignore_proc_openfunction cio_ignore_proc_init
Annotated Snippet
struct ccwdev_iter {
int devno;
int ssid;
int in_range;
};
static void *
cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset)
{
struct ccwdev_iter *iter = s->private;
if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
return NULL;
memset(iter, 0, sizeof(*iter));
iter->ssid = *offset / (__MAX_SUBCHANNEL + 1);
iter->devno = *offset % (__MAX_SUBCHANNEL + 1);
return iter;
}
static void
cio_ignore_proc_seq_stop(struct seq_file *s, void *it)
{
}
static void *
cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset)
{
struct ccwdev_iter *iter;
loff_t p = *offset;
(*offset)++;
if (p >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
return NULL;
iter = it;
if (iter->devno == __MAX_SUBCHANNEL) {
iter->devno = 0;
iter->ssid++;
if (iter->ssid > __MAX_SSID)
return NULL;
} else
iter->devno++;
return iter;
}
static int
cio_ignore_proc_seq_show(struct seq_file *s, void *it)
{
struct ccwdev_iter *iter;
iter = it;
if (!is_blacklisted(iter->ssid, iter->devno))
/* Not blacklisted, nothing to output. */
return 0;
if (!iter->in_range) {
/* First device in range. */
if ((iter->devno == __MAX_SUBCHANNEL) ||
!is_blacklisted(iter->ssid, iter->devno + 1)) {
/* Singular device. */
seq_printf(s, "0.%x.%04x\n", iter->ssid, iter->devno);
return 0;
}
iter->in_range = 1;
seq_printf(s, "0.%x.%04x-", iter->ssid, iter->devno);
return 0;
}
if ((iter->devno == __MAX_SUBCHANNEL) ||
!is_blacklisted(iter->ssid, iter->devno + 1)) {
/* Last device in range. */
iter->in_range = 0;
seq_printf(s, "0.%x.%04x\n", iter->ssid, iter->devno);
}
return 0;
}
static ssize_t
cio_ignore_write(struct file *file, const char __user *user_buf,
size_t user_len, loff_t *offset)
{
char *buf;
ssize_t rc, ret, i;
if (*offset)
return -EINVAL;
if (user_len > 65536)
user_len = 65536;
buf = vzalloc(user_len + 1); /* maybe better use the stack? */
if (buf == NULL)
return -ENOMEM;
if (strncpy_from_user (buf, user_buf, user_len) < 0) {
Annotation
- Immediate include surface: `linux/hex.h`, `linux/init.h`, `linux/vmalloc.h`, `linux/proc_fs.h`, `linux/seq_file.h`, `linux/ctype.h`, `linux/device.h`, `linux/uaccess.h`.
- Detected declarations: `struct ccwdev_iter`, `function blacklist_range`, `function pure_hex`, `function parse_busid`, `function blacklist_parse_parameters`, `function blacklist_setup`, `function validate_subchannel`, `function blacklist_parse_proc_parameters`, `function cio_ignore_proc_seq_start`, `function cio_ignore_proc_seq_stop`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: source implementation candidate.
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.