drivers/s390/net/qeth_l3.h
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_l3.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_l3.h- Extension
.h- Size
- 3102 bytes
- Lines
- 119
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
qeth_core.hlinux/hashtable.h
Detected Declarations
struct qeth_ipaddrstruct qeth_ipato_entryenum qeth_ip_typesfunction qeth_l3_init_ipaddrfunction qeth_l3_addr_match_ipfunction qeth_l3_addr_match_allfunction qeth_l3_ipaddr_hash
Annotated Snippet
struct qeth_ipaddr {
struct hlist_node hnode;
enum qeth_ip_types type;
u8 is_multicast:1;
u8 disp_flag:2;
u8 ipato:1; /* ucast only */
/* is changed only for normal ip addresses
* for non-normal addresses it always is 1
*/
int ref_counter;
enum qeth_prot_versions proto;
union {
struct {
__be32 addr;
__be32 mask;
} a4;
struct {
struct in6_addr addr;
unsigned int pfxlen;
} a6;
} u;
};
static inline void qeth_l3_init_ipaddr(struct qeth_ipaddr *addr,
enum qeth_ip_types type,
enum qeth_prot_versions proto)
{
memset(addr, 0, sizeof(*addr));
addr->type = type;
addr->proto = proto;
addr->disp_flag = QETH_DISP_ADDR_DO_NOTHING;
addr->ref_counter = 1;
}
static inline bool qeth_l3_addr_match_ip(struct qeth_ipaddr *a1,
struct qeth_ipaddr *a2)
{
if (a1->proto != a2->proto)
return false;
if (a1->proto == QETH_PROT_IPV6)
return ipv6_addr_equal(&a1->u.a6.addr, &a2->u.a6.addr);
return a1->u.a4.addr == a2->u.a4.addr;
}
static inline bool qeth_l3_addr_match_all(struct qeth_ipaddr *a1,
struct qeth_ipaddr *a2)
{
/* Assumes that the pair was obtained via qeth_l3_addr_find_by_ip(),
* so 'proto' and 'addr' match for sure.
*
* For ucast:
* - 'mask'/'pfxlen' for RXIP/VIPA is always 0. For NORMAL, matching
* values are required to avoid mixups in takeover eligibility.
*
* For mcast,
* - 'mask'/'pfxlen' is always 0.
*/
if (a1->type != a2->type)
return false;
if (a1->proto == QETH_PROT_IPV6)
return a1->u.a6.pfxlen == a2->u.a6.pfxlen;
return a1->u.a4.mask == a2->u.a4.mask;
}
static inline u32 qeth_l3_ipaddr_hash(struct qeth_ipaddr *addr)
{
if (addr->proto == QETH_PROT_IPV6)
return ipv6_addr_hash(&addr->u.a6.addr);
else
return ipv4_addr_hash(addr->u.a4.addr);
}
struct qeth_ipato_entry {
struct list_head entry;
enum qeth_prot_versions proto;
char addr[16];
unsigned int mask_bits;
};
extern const struct attribute_group *qeth_l3_attr_groups[];
int qeth_l3_ipaddr_to_string(enum qeth_prot_versions proto, const u8 *addr,
char *buf);
int qeth_l3_setrouting_v4(struct qeth_card *);
int qeth_l3_setrouting_v6(struct qeth_card *);
int qeth_l3_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
int qeth_l3_del_ipato_entry(struct qeth_card *card,
enum qeth_prot_versions proto, u8 *addr,
unsigned int mask_bits);
Annotation
- Immediate include surface: `qeth_core.h`, `linux/hashtable.h`.
- Detected declarations: `struct qeth_ipaddr`, `struct qeth_ipato_entry`, `enum qeth_ip_types`, `function qeth_l3_init_ipaddr`, `function qeth_l3_addr_match_ip`, `function qeth_l3_addr_match_all`, `function qeth_l3_ipaddr_hash`.
- 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.