drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.h- Extension
.h- Size
- 1100 bytes
- Lines
- 45
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hhbg_hw.h
Detected Declarations
function hbg_spec_max_frame_lenfunction hbg_get_spec_fifo_max_numfunction hbg_fifo_is_fullfunction hbg_get_queue_used_num
Annotated Snippet
#ifndef __HBG_TXRX_H
#define __HBG_TXRX_H
#include <linux/etherdevice.h>
#include "hbg_hw.h"
static inline u32 hbg_spec_max_frame_len(struct hbg_priv *priv,
enum hbg_dir dir)
{
return (dir == HBG_DIR_TX) ? priv->dev_specs.max_frame_len :
priv->dev_specs.rx_buf_size;
}
static inline u32 hbg_get_spec_fifo_max_num(struct hbg_priv *priv,
enum hbg_dir dir)
{
return (dir == HBG_DIR_TX) ? priv->dev_specs.tx_fifo_num :
priv->dev_specs.rx_fifo_num;
}
static inline bool hbg_fifo_is_full(struct hbg_priv *priv, enum hbg_dir dir)
{
return hbg_hw_get_fifo_used_num(priv, dir) >=
hbg_get_spec_fifo_max_num(priv, dir);
}
static inline u32 hbg_get_queue_used_num(struct hbg_ring *ring)
{
u32 len = READ_ONCE(ring->len);
if (!len)
return 0;
return (READ_ONCE(ring->ntu) + len - READ_ONCE(ring->ntc)) % len;
}
netdev_tx_t hbg_net_start_xmit(struct sk_buff *skb, struct net_device *netdev);
int hbg_txrx_init(struct hbg_priv *priv);
void hbg_txrx_uninit(struct hbg_priv *priv);
#endif
Annotation
- Immediate include surface: `linux/etherdevice.h`, `hbg_hw.h`.
- Detected declarations: `function hbg_spec_max_frame_len`, `function hbg_get_spec_fifo_max_num`, `function hbg_fifo_is_full`, `function hbg_get_queue_used_num`.
- 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.