drivers/net/ethernet/brocade/bna/bnad.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/brocade/bna/bnad.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/brocade/bna/bnad.h- Extension
.h- Size
- 9850 bytes
- Lines
- 422
- 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/rtnetlink.hlinux/workqueue.hlinux/ipv6.hlinux/etherdevice.hlinux/mutex.hlinux/firmware.hlinux/if_vlan.hasm/checksum.hnet/ip6_checksum.hnet/ip.hnet/tcp.hbna.h
Detected Declarations
struct bnad_rx_ctrlstruct bnad_iocmd_compstruct bnad_completionstruct bnad_drv_statsstruct bnad_statsstruct bnad_tx_res_infostruct bnad_rx_res_infostruct bnad_tx_infostruct bnad_rx_infostruct bnad_tx_vectorstruct bnad_tx_unmapstruct bnad_rx_vectorstruct bnad_rx_unmapstruct bnad_rx_unmap_qstruct bnadstruct bnad_drvinfoenum bnad_intr_sourceenum bnad_link_stateenum bnad_rxbuf_type
Annotated Snippet
struct bnad_rx_ctrl {
struct bna_ccb *ccb;
struct bnad *bnad;
unsigned long flags;
struct napi_struct napi;
u64 rx_intr_ctr;
u64 rx_poll_ctr;
u64 rx_schedule;
u64 rx_keep_poll;
u64 rx_complete;
};
#define BNAD_RXMODE_PROMISC_DEFAULT BNA_RXMODE_PROMISC
/*
* GLOBAL #defines (CONSTANTS)
*/
#define BNAD_NAME "bna"
#define BNAD_NAME_LEN 64
#define BNAD_MAILBOX_MSIX_INDEX 0
#define BNAD_MAILBOX_MSIX_VECTORS 1
#define BNAD_INTX_TX_IB_BITMASK 0x1
#define BNAD_INTX_RX_IB_BITMASK 0x2
#define BNAD_STATS_TIMER_FREQ 1000 /* in msecs */
#define BNAD_DIM_TIMER_FREQ 1000 /* in msecs */
#define BNAD_IOCETH_TIMEOUT 10000
#define BNAD_MIN_Q_DEPTH 512
#define BNAD_MAX_RXQ_DEPTH 16384
#define BNAD_MAX_TXQ_DEPTH 2048
#define BNAD_JUMBO_MTU 9000
#define BNAD_NETIF_WAKE_THRESHOLD 8
#define BNAD_RXQ_REFILL_THRESHOLD_SHIFT 3
/* Bit positions for tcb->flags */
#define BNAD_TXQ_FREE_SENT 0
#define BNAD_TXQ_TX_STARTED 1
/* Bit positions for rcb->flags */
#define BNAD_RXQ_STARTED 0
#define BNAD_RXQ_POST_OK 1
/* Resource limits */
#define BNAD_NUM_TXQ (bnad->num_tx * bnad->num_txq_per_tx)
#define BNAD_NUM_RXP (bnad->num_rx * bnad->num_rxp_per_rx)
#define BNAD_FRAME_SIZE(_mtu) \
(ETH_HLEN + VLAN_HLEN + (_mtu) + ETH_FCS_LEN)
/*
* DATA STRUCTURES
*/
/* enums */
enum bnad_intr_source {
BNAD_INTR_TX = 1,
BNAD_INTR_RX = 2
};
enum bnad_link_state {
BNAD_LS_DOWN = 0,
BNAD_LS_UP = 1
};
struct bnad_iocmd_comp {
struct bnad *bnad;
struct completion comp;
int comp_status;
};
struct bnad_completion {
struct completion ioc_comp;
struct completion ucast_comp;
struct completion mcast_comp;
struct completion tx_comp;
struct completion rx_comp;
struct completion stats_comp;
struct completion enet_comp;
struct completion mtu_comp;
u8 ioc_comp_status;
u8 ucast_comp_status;
u8 mcast_comp_status;
u8 tx_comp_status;
Annotation
- Immediate include surface: `linux/rtnetlink.h`, `linux/workqueue.h`, `linux/ipv6.h`, `linux/etherdevice.h`, `linux/mutex.h`, `linux/firmware.h`, `linux/if_vlan.h`, `asm/checksum.h`.
- Detected declarations: `struct bnad_rx_ctrl`, `struct bnad_iocmd_comp`, `struct bnad_completion`, `struct bnad_drv_stats`, `struct bnad_stats`, `struct bnad_tx_res_info`, `struct bnad_rx_res_info`, `struct bnad_tx_info`, `struct bnad_rx_info`, `struct bnad_tx_vector`.
- 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.