drivers/net/ethernet/freescale/fman/fman_keygen.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/fman/fman_keygen.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/fman/fman_keygen.c- Extension
.c- Size
- 21236 bytes
- Lines
- 758
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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.hfman_keygen.h
Detected Declarations
struct fman_kg_scheme_regsstruct fman_kg_pe_regsstruct fman_kg_regsstruct keygen_schemestruct fman_keygenfunction keygen_write_ar_waitfunction build_ar_schemefunction build_ar_bind_schemefunction keygen_write_spfunction build_ar_bind_cls_planfunction keygen_write_cppfunction keygen_write_schemefunction get_free_scheme_idfunction keygen_bind_port_to_schemesfunction keygen_scheme_setupfunction keygen_port_hashing_initexport keygen_initexport keygen_port_hashing_init
Annotated Snippet
struct fman_kg_scheme_regs {
u32 kgse_mode; /* 0x100: MODE */
u32 kgse_ekfc; /* 0x104: Extract Known Fields Command */
u32 kgse_ekdv; /* 0x108: Extract Known Default Value */
u32 kgse_bmch; /* 0x10C: Bit Mask Command High */
u32 kgse_bmcl; /* 0x110: Bit Mask Command Low */
u32 kgse_fqb; /* 0x114: Frame Queue Base */
u32 kgse_hc; /* 0x118: Hash Command */
u32 kgse_ppc; /* 0x11C: Policer Profile Command */
u32 kgse_gec[FM_KG_NUM_OF_GENERIC_REGS];
/* 0x120: Generic Extract Command */
u32 kgse_spc;
/* 0x140: KeyGen Scheme Entry Statistic Packet Counter */
u32 kgse_dv0; /* 0x144: KeyGen Scheme Entry Default Value 0 */
u32 kgse_dv1; /* 0x148: KeyGen Scheme Entry Default Value 1 */
u32 kgse_ccbs;
/* 0x14C: KeyGen Scheme Entry Coarse Classification Bit*/
u32 kgse_mv; /* 0x150: KeyGen Scheme Entry Match vector */
u32 kgse_om; /* 0x154: KeyGen Scheme Entry Operation Mode bits */
u32 kgse_vsp;
/* 0x158: KeyGen Scheme Entry Virtual Storage Profile */
};
/* Port Partition Configuration Registers */
struct fman_kg_pe_regs {
u32 fmkg_pe_sp; /* 0x100: KeyGen Port entry Scheme Partition */
u32 fmkg_pe_cpp;
/* 0x104: KeyGen Port Entry Classification Plan Partition */
};
/* General Configuration and Status Registers
* Global Statistic Counters
* KeyGen Global Registers
*/
struct fman_kg_regs {
u32 fmkg_gcr; /* 0x000: KeyGen General Configuration Register */
u32 res004; /* 0x004: Reserved */
u32 res008; /* 0x008: Reserved */
u32 fmkg_eer; /* 0x00C: KeyGen Error Event Register */
u32 fmkg_eeer; /* 0x010: KeyGen Error Event Enable Register */
u32 res014; /* 0x014: Reserved */
u32 res018; /* 0x018: Reserved */
u32 fmkg_seer; /* 0x01C: KeyGen Scheme Error Event Register */
u32 fmkg_seeer; /* 0x020: KeyGen Scheme Error Event Enable Register */
u32 fmkg_gsr; /* 0x024: KeyGen Global Status Register */
u32 fmkg_tpc; /* 0x028: Total Packet Counter Register */
u32 fmkg_serc; /* 0x02C: Soft Error Capture Register */
u32 res030[4]; /* 0x030: Reserved */
u32 fmkg_fdor; /* 0x034: Frame Data Offset Register */
u32 fmkg_gdv0r; /* 0x038: Global Default Value Register 0 */
u32 fmkg_gdv1r; /* 0x03C: Global Default Value Register 1 */
u32 res04c[6]; /* 0x040: Reserved */
u32 fmkg_feer; /* 0x044: Force Error Event Register */
u32 res068[38]; /* 0x048: Reserved */
union {
u32 fmkg_indirect[63]; /* 0x100: Indirect Access Registers */
struct fman_kg_scheme_regs fmkg_sch; /* Scheme Registers */
struct fman_kg_pe_regs fmkg_pe; /* Port Partition Registers */
};
u32 fmkg_ar; /* 0x1FC: KeyGen Action Register */
};
/* KeyGen Scheme data */
struct keygen_scheme {
bool used; /* Specifies if this scheme is used */
u8 hw_port_id;
/* Hardware port ID
* schemes sharing between multiple ports is not
* currently supported
* so we have only one port id bound to a scheme
*/
u32 base_fqid;
/* Base FQID:
* Must be between 1 and 2^24-1
* If hash is used and an even distribution is
* expected according to hash_fqid_count,
* base_fqid must be aligned to hash_fqid_count
*/
u32 hash_fqid_count;
/* FQ range for hash distribution:
* Must be a power of 2
* Represents the range of queues for spreading
*/
bool use_hashing; /* Usage of Hashing and spreading over FQ */
bool symmetric_hash; /* Symmetric Hash option usage */
u8 hashShift;
/* Hash result right shift.
* Select the 24 bits out of the 64 hash result.
* 0 means using the 24 LSB's, otherwise
* use the 24 LSB's after shifting right
Annotation
- Immediate include surface: `linux/slab.h`, `fman_keygen.h`.
- Detected declarations: `struct fman_kg_scheme_regs`, `struct fman_kg_pe_regs`, `struct fman_kg_regs`, `struct keygen_scheme`, `struct fman_keygen`, `function keygen_write_ar_wait`, `function build_ar_scheme`, `function build_ar_bind_scheme`, `function keygen_write_sp`, `function build_ar_bind_cls_plan`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.