drivers/net/ethernet/freescale/fman/fman_mac.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/fman/fman_mac.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/fman/fman_mac.h- Extension
.h- Size
- 7452 bytes
- Lines
- 246
- Domain
- Driver Families
- Bucket
- drivers/net
- 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
fman.hlinux/slab.hlinux/phy.hlinux/if_ether.h
Detected Declarations
struct fman_macstruct mac_devicestruct eth_hash_entrystruct fman_mac_paramsstruct eth_hash_tenum fman_mac_exceptionsfunction free_hash_table
Annotated Snippet
struct eth_hash_entry {
u64 addr; /* Ethernet Address */
struct list_head node;
};
typedef void (fman_mac_exception_cb)(struct mac_device *dev_id,
enum fman_mac_exceptions exceptions);
/* FMan MAC config input */
struct fman_mac_params {
/* MAC ID; numbering of dTSEC and 1G-mEMAC:
* 0 - FM_MAX_NUM_OF_1G_MACS;
* numbering of 10G-MAC (TGEC) and 10G-mEMAC:
* 0 - FM_MAX_NUM_OF_10G_MACS
*/
u8 mac_id;
/* A handle to the FM object this port related to */
void *fm;
fman_mac_exception_cb *event_cb; /* MDIO Events Callback Routine */
fman_mac_exception_cb *exception_cb;/* Exception Callback Routine */
};
struct eth_hash_t {
u16 size;
struct list_head *lsts;
};
static inline struct eth_hash_entry
*dequeue_addr_from_hash_entry(struct list_head *addr_lst)
{
struct eth_hash_entry *hash_entry = NULL;
if (!list_empty(addr_lst)) {
hash_entry = ETH_HASH_ENTRY_OBJ(addr_lst->next);
list_del_init(&hash_entry->node);
}
return hash_entry;
}
static inline void free_hash_table(struct eth_hash_t *hash)
{
struct eth_hash_entry *hash_entry;
int i = 0;
if (hash) {
if (hash->lsts) {
for (i = 0; i < hash->size; i++) {
hash_entry =
dequeue_addr_from_hash_entry(&hash->lsts[i]);
while (hash_entry) {
kfree(hash_entry);
hash_entry =
dequeue_addr_from_hash_entry(&hash->
lsts[i]);
}
}
kfree(hash->lsts);
}
kfree(hash);
}
}
static inline struct eth_hash_t *alloc_hash_table(u16 size)
{
u32 i;
struct eth_hash_t *hash;
/* Allocate address hash table */
hash = kmalloc_obj(*hash);
if (!hash)
return NULL;
hash->size = size;
hash->lsts = kmalloc_objs(struct list_head, hash->size);
if (!hash->lsts) {
kfree(hash);
return NULL;
}
for (i = 0; i < hash->size; i++)
INIT_LIST_HEAD(&hash->lsts[i]);
return hash;
}
#endif /* __FM_MAC_H */
Annotation
- Immediate include surface: `fman.h`, `linux/slab.h`, `linux/phy.h`, `linux/if_ether.h`.
- Detected declarations: `struct fman_mac`, `struct mac_device`, `struct eth_hash_entry`, `struct fman_mac_params`, `struct eth_hash_t`, `enum fman_mac_exceptions`, `function free_hash_table`.
- Atlas domain: Driver Families / drivers/net.
- 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.