drivers/net/ethernet/meta/fbnic/fbnic_csr.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/meta/fbnic/fbnic_csr.h- Extension
.h- Size
- 51976 bytes
- Lines
- 1257
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.h
Detected Declarations
struct fbnic_devenum fbnic_reg_self_test_codes
Annotated Snippet
#ifndef _FBNIC_CSR_H_
#define _FBNIC_CSR_H_
#include <linux/bitops.h>
struct fbnic_dev;
#define CSR_BIT(nr) (1u << (nr))
#define CSR_GENMASK(h, l) GENMASK(h, l)
#define DESC_BIT(nr) BIT_ULL(nr)
#define DESC_GENMASK(h, l) GENMASK_ULL(h, l)
#define FW_VER_CODE(_major, _minor, _patch, _build) ( \
FIELD_PREP(FBNIC_FW_CAP_RESP_VERSION_MAJOR, _major) | \
FIELD_PREP(FBNIC_FW_CAP_RESP_VERSION_MINOR, _minor) | \
FIELD_PREP(FBNIC_FW_CAP_RESP_VERSION_PATCH, _patch) | \
FIELD_PREP(FBNIC_FW_CAP_RESP_VERSION_BUILD, _build))
/* Defines the minimum firmware version required by the driver */
#define MIN_FW_VER_CODE FW_VER_CODE(0, 10, 6, 0)
/* Defines the minimum firmware version required for firmware logs */
#define MIN_FW_VER_CODE_LOG FW_VER_CODE(0, 12, 9, 0)
/* Driver can request that firmware sends all cached logs in bulk. This
* feature was enabled on older firmware however firmware has a bug
* which attempted to send 30 messages per mbx message which caused an
* overflow flooding the mailbox. This results in a kernel warning
* related to corrupt mailbox messages.
*
* If firmware is new enough only request sending historical logs when
* the log buffer is empty to prevent duplicate logs.
*/
#define MIN_FW_VER_CODE_HIST FW_VER_CODE(25, 5, 7, 0)
#define PCI_DEVICE_ID_META_FBNIC_ASIC 0x0013
#define FBNIC_CLOCK_FREQ (600 * (1000 * 1000))
/* Transmit Work Descriptor Format */
/* Length, Type, Offset Masks and Shifts */
#define FBNIC_TWD_L2_HLEN_MASK DESC_GENMASK(5, 0)
#define FBNIC_TWD_L3_TYPE_MASK DESC_GENMASK(7, 6)
enum {
FBNIC_TWD_L3_TYPE_OTHER = 0,
FBNIC_TWD_L3_TYPE_IPV4 = 1,
FBNIC_TWD_L3_TYPE_IPV6 = 2,
FBNIC_TWD_L3_TYPE_V6V6 = 3,
};
#define FBNIC_TWD_L3_OHLEN_MASK DESC_GENMASK(15, 8)
#define FBNIC_TWD_L3_IHLEN_MASK DESC_GENMASK(23, 16)
enum {
FBNIC_TWD_L4_TYPE_OTHER = 0,
FBNIC_TWD_L4_TYPE_TCP = 1,
FBNIC_TWD_L4_TYPE_UDP = 2,
};
#define FBNIC_TWD_CSUM_OFFSET_MASK DESC_GENMASK(27, 24)
#define FBNIC_TWD_L4_HLEN_MASK DESC_GENMASK(31, 28)
/* Flags and Type */
#define FBNIC_TWD_L4_TYPE_MASK DESC_GENMASK(33, 32)
#define FBNIC_TWD_FLAG_REQ_TS DESC_BIT(34)
#define FBNIC_TWD_FLAG_REQ_LSO DESC_BIT(35)
#define FBNIC_TWD_FLAG_REQ_CSO DESC_BIT(36)
#define FBNIC_TWD_FLAG_REQ_COMPLETION DESC_BIT(37)
#define FBNIC_TWD_FLAG_DEST_MAC DESC_BIT(43)
#define FBNIC_TWD_FLAG_DEST_BMC DESC_BIT(44)
#define FBNIC_TWD_FLAG_DEST_FW DESC_BIT(45)
#define FBNIC_TWD_TYPE_MASK DESC_GENMASK(47, 46)
enum {
FBNIC_TWD_TYPE_META = 0,
FBNIC_TWD_TYPE_OPT_META = 1,
FBNIC_TWD_TYPE_AL = 2,
FBNIC_TWD_TYPE_LAST_AL = 3,
};
/* MSS and Completion Req */
#define FBNIC_TWD_MSS_MASK DESC_GENMASK(61, 48)
#define FBNIC_TWD_TS_MASK DESC_GENMASK(39, 0)
#define FBNIC_TWD_ADDR_MASK DESC_GENMASK(45, 0)
#define FBNIC_TWD_LEN_MASK DESC_GENMASK(63, 48)
/* Tx Completion Descriptor Format */
#define FBNIC_TCD_TYPE0_HEAD0_MASK DESC_GENMASK(15, 0)
Annotation
- Immediate include surface: `linux/bitops.h`.
- Detected declarations: `struct fbnic_dev`, `enum fbnic_reg_self_test_codes`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.