drivers/s390/net/qeth_l3_sys.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_l3_sys.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_l3_sys.c- Extension
.c- Size
- 20468 bytes
- Lines
- 788
- 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.
- 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/slab.hasm/ebcdic.hlinux/hashtable.hlinux/inet.hqeth_l3.h
Detected Declarations
function Authorfunction qeth_l3_dev_route_showfunction qeth_l3_dev_route4_showfunction qeth_l3_dev_route_storefunction qeth_l3_dev_route4_storefunction qeth_l3_dev_route6_showfunction qeth_l3_dev_route6_storefunction qeth_l3_dev_sniffer_showfunction qeth_l3_dev_sniffer_storefunction qeth_l3_dev_hsuid_showfunction qeth_l3_dev_hsuid_storefunction qeth_l3_dev_ipato_enable_showfunction qeth_l3_dev_ipato_enable_storefunction qeth_l3_dev_ipato_invert4_showfunction qeth_l3_dev_ipato_invert4_storefunction qeth_l3_dev_ipato_add_showfunction qeth_l3_dev_ipato_add4_showfunction qeth_l3_parse_ipatoefunction qeth_l3_dev_ipato_add_storefunction qeth_l3_dev_ipato_add4_storefunction qeth_l3_dev_ipato_del_storefunction qeth_l3_dev_ipato_del4_storefunction qeth_l3_dev_ipato_invert6_showfunction qeth_l3_dev_ipato_invert6_storefunction qeth_l3_dev_ipato_add6_showfunction qeth_l3_dev_ipato_add6_storefunction qeth_l3_dev_ipato_del6_storefunction qeth_l3_dev_ip_add_showfunction qeth_l3_dev_vipa_add4_showfunction qeth_l3_vipa_storefunction qeth_l3_dev_vipa_add4_storefunction qeth_l3_dev_vipa_del4_storefunction qeth_l3_dev_vipa_add6_showfunction qeth_l3_dev_vipa_add6_storefunction qeth_l3_dev_vipa_del6_storefunction qeth_l3_dev_rxip_add4_showfunction qeth_l3_parse_rxipefunction qeth_l3_rxip_storefunction qeth_l3_dev_rxip_add4_storefunction qeth_l3_dev_rxip_del4_storefunction qeth_l3_dev_rxip_add6_showfunction qeth_l3_dev_rxip_add6_storefunction qeth_l3_dev_rxip_del6_store
Annotated Snippet
if (card->ssqd.qdioac2 & CHSC_AC2_SNIFFER_AVAILABLE) {
card->options.sniffer = i;
qeth_resize_buffer_pool(card, QETH_IN_BUF_COUNT_MAX);
} else {
rc = -EPERM;
}
break;
default:
rc = -EINVAL;
}
out:
mutex_unlock(&card->conf_mutex);
return rc ? rc : count;
}
static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show,
qeth_l3_dev_sniffer_store);
static ssize_t qeth_l3_dev_hsuid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct qeth_card *card = dev_get_drvdata(dev);
char tmp_hsuid[9];
if (!IS_IQD(card))
return -EPERM;
memcpy(tmp_hsuid, card->options.hsuid, sizeof(tmp_hsuid));
EBCASC(tmp_hsuid, 8);
return sysfs_emit(buf, "%s\n", tmp_hsuid);
}
static ssize_t qeth_l3_dev_hsuid_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qeth_card *card = dev_get_drvdata(dev);
int rc = 0;
char *tmp;
if (!IS_IQD(card))
return -EPERM;
mutex_lock(&card->conf_mutex);
if (card->state != CARD_STATE_DOWN) {
rc = -EPERM;
goto out;
}
if (card->options.sniffer) {
rc = -EPERM;
goto out;
}
if (card->options.cq == QETH_CQ_NOTAVAILABLE) {
rc = -EPERM;
goto out;
}
tmp = strsep((char **)&buf, "\n");
if (strlen(tmp) > 8) {
rc = -EINVAL;
goto out;
}
if (card->options.hsuid[0])
/* delete old ip address */
qeth_l3_modify_hsuid(card, false);
if (strlen(tmp) == 0) {
/* delete ip address only */
card->options.hsuid[0] = '\0';
memcpy(card->dev->perm_addr, card->options.hsuid, 9);
qeth_configure_cq(card, QETH_CQ_DISABLED);
goto out;
}
if (qeth_configure_cq(card, QETH_CQ_ENABLED)) {
rc = -EPERM;
goto out;
}
scnprintf(card->options.hsuid, sizeof(card->options.hsuid),
"%-8s", tmp);
ASCEBC(card->options.hsuid, 8);
memcpy(card->dev->perm_addr, card->options.hsuid, 9);
rc = qeth_l3_modify_hsuid(card, true);
out:
Annotation
- Immediate include surface: `linux/slab.h`, `asm/ebcdic.h`, `linux/hashtable.h`, `linux/inet.h`, `qeth_l3.h`.
- Detected declarations: `function Author`, `function qeth_l3_dev_route_show`, `function qeth_l3_dev_route4_show`, `function qeth_l3_dev_route_store`, `function qeth_l3_dev_route4_store`, `function qeth_l3_dev_route6_show`, `function qeth_l3_dev_route6_store`, `function qeth_l3_dev_sniffer_show`, `function qeth_l3_dev_sniffer_store`, `function qeth_l3_dev_hsuid_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.