drivers/net/ipa/ipa_endpoint.c
Source file repositories/reference/linux-study-clean/drivers/net/ipa/ipa_endpoint.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ipa/ipa_endpoint.c- Extension
.c- Size
- 63883 bytes
- Lines
- 2199
- 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.
- 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/bitfield.hlinux/bits.hlinux/device.hlinux/dma-direction.hlinux/if_rmnet.hlinux/types.hgsi.hgsi_trans.hipa.hipa_cmd.hipa_data.hipa_endpoint.hipa_gsi.hipa_interrupt.hipa_mem.hipa_modem.hipa_power.hipa_reg.hipa_table.hipa_version.h
Detected Declarations
enum ipa_status_opcodeenum ipa_status_exceptionenum ipa_status_maskenum ipa_status_field_idfunction ipa_status_extractfunction ipa_aggr_size_kbfunction ipa_endpoint_data_valid_onefunction ipa_endpoint_maxfunction ipa_endpoint_init_ctrlfunction ipa_endpoint_program_delayfunction ipa_endpoint_aggr_activefunction ipa_endpoint_force_closefunction ipa_endpoint_suspend_aggrfunction ipa_endpoint_program_suspendfunction ipa_endpoint_modem_pause_allfunction ipa_endpoint_modem_exception_reset_allfunction for_each_set_bitfunction ipa_endpoint_init_cfgfunction ipa_endpoint_init_natfunction ipa_qmap_header_sizefunction ipa_header_size_encodefunction ipa_metadata_offset_encodefunction ipa_endpoint_init_hdrfunction ipa_endpoint_init_hdr_extfunction HDRfunction ipa_endpoint_init_hdr_metadata_maskfunction ipa_endpoint_init_modefunction ipa_qtime_valfunction aggr_time_limit_encodefunction ipa_endpoint_init_aggrfunction hol_block_timer_encodefunction ipa_endpoint_init_hol_block_timerfunction ipa_endpoint_init_hol_block_enfunction ipa_endpoint_init_hol_block_enablefunction ipa_endpoint_init_hol_block_disablefunction ipa_endpoint_modem_hol_block_clear_allfunction ipa_endpoint_init_deaggrfunction ipa_endpoint_init_rsrc_grpfunction ipa_endpoint_init_seqfunction ipa_endpoint_skb_txfunction ipa_endpoint_statusfunction ipa_endpoint_replenish_onefunction ipa_endpoint_replenishfunction ipa_endpoint_replenish_enablefunction ipa_endpoint_replenish_disablefunction ipa_endpoint_replenish_workfunction ipa_endpoint_skb_copyfunction ipa_endpoint_skb_build
Annotated Snippet
if (data->endpoint.filter_support) {
dev_err(dev, "filtering not supported for "
"RX endpoint %u\n",
data->endpoint_id);
return false;
}
/* Nothing more to check for non-AP RX */
if (data->ee_id != GSI_EE_AP)
return true;
rx_config = &data->endpoint.config.rx;
/* The buffer size must hold an MTU plus overhead */
buffer_size = rx_config->buffer_size;
limit = IPA_MTU + IPA_RX_BUFFER_OVERHEAD;
if (buffer_size < limit) {
dev_err(dev, "RX buffer size too small for RX endpoint %u (%u < %u)\n",
data->endpoint_id, buffer_size, limit);
return false;
}
if (!data->endpoint.config.aggregation) {
bool result = true;
/* No aggregation; check for bogus aggregation data */
if (rx_config->aggr_time_limit) {
dev_err(dev,
"time limit with no aggregation for RX endpoint %u\n",
data->endpoint_id);
result = false;
}
if (rx_config->aggr_hard_limit) {
dev_err(dev, "hard limit with no aggregation for RX endpoint %u\n",
data->endpoint_id);
result = false;
}
if (rx_config->aggr_close_eof) {
dev_err(dev, "close EOF with no aggregation for RX endpoint %u\n",
data->endpoint_id);
result = false;
}
return result; /* Nothing more to check */
}
/* For an endpoint supporting receive aggregation, the byte
* limit defines the point at which aggregation closes. This
* check ensures the receive buffer size doesn't result in a
* limit that exceeds what's representable in the aggregation
* byte limit field.
*/
aggr_size = ipa_aggr_size_kb(buffer_size - NET_SKB_PAD,
rx_config->aggr_hard_limit);
reg = ipa_reg(ipa, ENDP_INIT_AGGR);
limit = reg_field_max(reg, BYTE_LIMIT);
if (aggr_size > limit) {
dev_err(dev, "aggregated size too large for RX endpoint %u (%u KB > %u KB)\n",
data->endpoint_id, aggr_size, limit);
return false;
}
return true; /* Nothing more to check for RX */
}
/* Starting with IPA v4.5 sequencer replication is obsolete */
if (ipa->version >= IPA_VERSION_4_5) {
if (data->endpoint.config.tx.seq_rep_type) {
dev_err(dev, "no-zero seq_rep_type TX endpoint %u\n",
data->endpoint_id);
return false;
}
}
if (data->endpoint.config.status_enable) {
other_name = data->endpoint.config.tx.status_endpoint;
if (other_name >= count) {
dev_err(dev, "status endpoint name %u out of range "
"for endpoint %u\n",
other_name, data->endpoint_id);
return false;
}
/* Status endpoint must be defined... */
other_data = &all_data[other_name];
if (ipa_gsi_endpoint_data_empty(other_data)) {
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/device.h`, `linux/dma-direction.h`, `linux/if_rmnet.h`, `linux/types.h`, `gsi.h`, `gsi_trans.h`.
- Detected declarations: `enum ipa_status_opcode`, `enum ipa_status_exception`, `enum ipa_status_mask`, `enum ipa_status_field_id`, `function ipa_status_extract`, `function ipa_aggr_size_kb`, `function ipa_endpoint_data_valid_one`, `function ipa_endpoint_max`, `function ipa_endpoint_init_ctrl`, `function ipa_endpoint_program_delay`.
- 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.