drivers/net/ethernet/intel/igc/igc_tsn.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/igc/igc_tsn.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/igc/igc_tsn.h- Extension
.h- Size
- 1995 bytes
- Lines
- 70
- 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
net/pkt_sched.h
Detected Declarations
enum igc_txd_popts_typefunction igc_fpe_is_pmac_enabledfunction igc_fpe_handle_mpacketfunction igc_fpe_transmitted_smd_v
Annotated Snippet
#ifndef _IGC_TSN_H_
#define _IGC_TSN_H_
#include <net/pkt_sched.h>
#define IGC_RX_MIN_FRAG_SIZE 60
#define SMD_FRAME_SIZE 60
enum igc_txd_popts_type {
SMD_V = 0x01,
SMD_R = 0x02,
};
DECLARE_STATIC_KEY_FALSE(igc_fpe_enabled);
void igc_fpe_init(struct igc_adapter *adapter);
void igc_fpe_clear_preempt_queue(struct igc_adapter *adapter);
void igc_fpe_save_preempt_queue(struct igc_adapter *adapter,
const struct tc_mqprio_qopt_offload *mqprio);
u32 igc_fpe_get_supported_frag_size(u32 frag_size);
int igc_tsn_offload_apply(struct igc_adapter *adapter);
int igc_tsn_reset(struct igc_adapter *adapter);
void igc_tsn_adjust_txtime_offset(struct igc_adapter *adapter);
bool igc_tsn_is_taprio_activated_by_user(struct igc_adapter *adapter);
static inline bool igc_fpe_is_pmac_enabled(struct igc_adapter *adapter)
{
return static_branch_unlikely(&igc_fpe_enabled) &&
adapter->fpe.mmsv.pmac_enabled;
}
static inline bool igc_fpe_handle_mpacket(struct igc_adapter *adapter,
union igc_adv_rx_desc *rx_desc,
unsigned int size, void *pktbuf)
{
u32 status_error = le32_to_cpu(rx_desc->wb.upper.status_error);
int smd;
smd = FIELD_GET(IGC_RXDADV_STAT_SMD_TYPE_MASK, status_error);
if (smd != IGC_RXD_STAT_SMD_TYPE_V && smd != IGC_RXD_STAT_SMD_TYPE_R)
return false;
if (size == SMD_FRAME_SIZE && mem_is_zero(pktbuf, SMD_FRAME_SIZE)) {
struct ethtool_mmsv *mmsv = &adapter->fpe.mmsv;
enum ethtool_mmsv_event event;
if (smd == IGC_RXD_STAT_SMD_TYPE_V)
event = ETHTOOL_MMSV_LP_SENT_VERIFY_MPACKET;
else
event = ETHTOOL_MMSV_LP_SENT_RESPONSE_MPACKET;
ethtool_mmsv_event_handle(mmsv, event);
}
return true;
}
static inline bool igc_fpe_transmitted_smd_v(union igc_adv_tx_desc *tx_desc)
{
u32 olinfo_status = le32_to_cpu(tx_desc->read.olinfo_status);
u8 smd = FIELD_GET(IGC_TXD_POPTS_SMD_MASK, olinfo_status);
return smd == SMD_V;
}
#endif /* _IGC_BASE_H */
Annotation
- Immediate include surface: `net/pkt_sched.h`.
- Detected declarations: `enum igc_txd_popts_type`, `function igc_fpe_is_pmac_enabled`, `function igc_fpe_handle_mpacket`, `function igc_fpe_transmitted_smd_v`.
- 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.