drivers/s390/net/qeth_l2_sys.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_l2_sys.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_l2_sys.c- Extension
.c- Size
- 10198 bytes
- Lines
- 384
- 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/slab.hasm/ebcdic.hqeth_core.hqeth_l2.h
Detected Declarations
function Authorfunction qeth_bridge_port_role_showfunction qeth_bridge_port_role_storefunction qeth_bridge_port_state_showfunction qeth_bridgeport_hostnotification_showfunction qeth_bridgeport_hostnotification_storefunction qeth_bridgeport_reflect_showfunction qeth_bridgeport_reflect_storefunction qeth_l2_vnicc_sysfs_attr_to_charfunction qeth_vnicc_timeout_showfunction qeth_vnicc_timeout_storefunction qeth_vnicc_char_showfunction qeth_vnicc_char_store
Annotated Snippet
switch (state) {
case QETH_SBP_STATE_INACTIVE:
word = "inactive"; break;
case QETH_SBP_STATE_STANDBY:
word = "standby"; break;
case QETH_SBP_STATE_ACTIVE:
word = "active"; break;
default:
rc = -EIO;
}
else
switch (card->options.sbp.role) {
case QETH_SBP_ROLE_NONE:
word = "none"; break;
case QETH_SBP_ROLE_PRIMARY:
word = "primary"; break;
case QETH_SBP_ROLE_SECONDARY:
word = "secondary"; break;
default:
rc = -EIO;
}
if (rc)
QETH_CARD_TEXT_(card, 2, "SBP%02x:%02x",
card->options.sbp.role, state);
else
rc = sysfs_emit(buf, "%s\n", word);
}
mutex_unlock(&card->sbp_lock);
return rc;
}
static ssize_t qeth_bridge_port_role_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct qeth_card *card = dev_get_drvdata(dev);
if (!qeth_bridgeport_allowed(card))
return sysfs_emit(buf, "n/a (VNIC characteristics)\n");
return qeth_bridge_port_role_state_show(dev, attr, buf, 0);
}
static ssize_t qeth_bridge_port_role_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;
enum qeth_sbp_roles role;
if (sysfs_streq(buf, "primary"))
role = QETH_SBP_ROLE_PRIMARY;
else if (sysfs_streq(buf, "secondary"))
role = QETH_SBP_ROLE_SECONDARY;
else if (sysfs_streq(buf, "none"))
role = QETH_SBP_ROLE_NONE;
else
return -EINVAL;
mutex_lock(&card->conf_mutex);
mutex_lock(&card->sbp_lock);
if (!qeth_bridgeport_allowed(card))
rc = -EBUSY;
else if (card->options.sbp.reflect_promisc)
/* Forbid direct manipulation */
rc = -EPERM;
else if (qeth_card_hw_is_reachable(card)) {
rc = qeth_bridgeport_setrole(card, role);
if (!rc)
card->options.sbp.role = role;
} else
card->options.sbp.role = role;
mutex_unlock(&card->sbp_lock);
mutex_unlock(&card->conf_mutex);
return rc ? rc : count;
}
static DEVICE_ATTR(bridge_role, 0644, qeth_bridge_port_role_show,
qeth_bridge_port_role_store);
static ssize_t qeth_bridge_port_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct qeth_card *card = dev_get_drvdata(dev);
if (!qeth_bridgeport_allowed(card))
return sysfs_emit(buf, "n/a (VNIC characteristics)\n");
Annotation
- Immediate include surface: `linux/slab.h`, `asm/ebcdic.h`, `qeth_core.h`, `qeth_l2.h`.
- Detected declarations: `function Author`, `function qeth_bridge_port_role_show`, `function qeth_bridge_port_role_store`, `function qeth_bridge_port_state_show`, `function qeth_bridgeport_hostnotification_show`, `function qeth_bridgeport_hostnotification_store`, `function qeth_bridgeport_reflect_show`, `function qeth_bridgeport_reflect_store`, `function qeth_l2_vnicc_sysfs_attr_to_char`, `function qeth_vnicc_timeout_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.