drivers/s390/net/qeth_core_sys.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_core_sys.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_core_sys.c- Extension
.c- Size
- 17548 bytes
- Lines
- 685
- 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/list.hlinux/rwsem.hasm/ebcdic.hqeth_core.h
Detected Declarations
function Authorfunction qeth_dev_chpid_showfunction qeth_dev_if_name_showfunction qeth_dev_card_type_showfunction qeth_dev_inbuf_size_showfunction qeth_dev_portno_showfunction qeth_dev_portno_storefunction qeth_dev_portname_showfunction qeth_dev_portname_storefunction qeth_dev_prioqing_showfunction qeth_dev_prioqing_storefunction qeth_dev_bufcnt_showfunction qeth_dev_bufcnt_storefunction qeth_dev_recover_storefunction qeth_dev_performance_stats_showfunction qeth_dev_performance_stats_storefunction qeth_dev_layer2_showfunction qeth_dev_layer2_storefunction qeth_dev_isolation_showfunction qeth_dev_isolation_storefunction qeth_dev_switch_attrs_showfunction qeth_hw_trap_showfunction qeth_hw_trap_storefunction qeth_dev_blkt_storefunction qeth_dev_blkt_total_showfunction qeth_dev_blkt_total_storefunction qeth_dev_blkt_inter_showfunction qeth_dev_blkt_inter_storefunction qeth_dev_blkt_inter_jumbo_showfunction qeth_dev_blkt_inter_jumbo_store
Annotated Snippet
if (IS_LAYER3(card)) {
rc = -EOPNOTSUPP;
goto out;
}
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_VLAN;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else if (sysfs_streq(buf, "no_prio_queueing:0")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
card->qdio.default_out_queue = 0;
} else if (sysfs_streq(buf, "no_prio_queueing:1")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
card->qdio.default_out_queue = 1;
} else if (sysfs_streq(buf, "no_prio_queueing:2")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
card->qdio.default_out_queue = 2;
} else if (sysfs_streq(buf, "no_prio_queueing:3")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
card->qdio.default_out_queue = 3;
} else if (sysfs_streq(buf, "no_prio_queueing")) {
card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else
rc = -EINVAL;
out:
mutex_unlock(&card->conf_mutex);
return rc ? rc : count;
}
static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show,
qeth_dev_prioqing_store);
static ssize_t qeth_dev_bufcnt_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct qeth_card *card = dev_get_drvdata(dev);
return sysfs_emit(buf, "%i\n", card->qdio.in_buf_pool.buf_count);
}
static ssize_t qeth_dev_bufcnt_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qeth_card *card = dev_get_drvdata(dev);
unsigned int cnt;
int rc = 0;
rc = kstrtouint(buf, 10, &cnt);
if (rc)
return rc;
mutex_lock(&card->conf_mutex);
if (card->state != CARD_STATE_DOWN) {
rc = -EPERM;
goto out;
}
cnt = clamp(cnt, QETH_IN_BUF_COUNT_MIN, QETH_IN_BUF_COUNT_MAX);
rc = qeth_resize_buffer_pool(card, cnt);
out:
mutex_unlock(&card->conf_mutex);
return rc ? rc : count;
}
static DEVICE_ATTR(buffer_count, 0644, qeth_dev_bufcnt_show,
qeth_dev_bufcnt_store);
static ssize_t qeth_dev_recover_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qeth_card *card = dev_get_drvdata(dev);
bool reset;
int rc;
rc = kstrtobool(buf, &reset);
if (rc)
return rc;
if (!qeth_card_hw_is_reachable(card))
return -EPERM;
if (reset)
rc = qeth_schedule_recovery(card);
return rc ? rc : count;
}
static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store);
static ssize_t qeth_dev_performance_stats_show(struct device *dev,
Annotation
- Immediate include surface: `linux/list.h`, `linux/rwsem.h`, `asm/ebcdic.h`, `qeth_core.h`.
- Detected declarations: `function Author`, `function qeth_dev_chpid_show`, `function qeth_dev_if_name_show`, `function qeth_dev_card_type_show`, `function qeth_dev_inbuf_size_show`, `function qeth_dev_portno_show`, `function qeth_dev_portno_store`, `function qeth_dev_portname_show`, `function qeth_dev_portname_store`, `function qeth_dev_prioqing_show`.
- 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.