drivers/net/ethernet/chelsio/cxgb4/srq.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb4/srq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb4/srq.c- Extension
.c- Size
- 2492 bytes
- Lines
- 80
- 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
cxgb4.ht4_msg.hsrq.h
Detected Declarations
function Copyrightfunction do_srq_table_rpl
Annotated Snippet
#include "cxgb4.h"
#include "t4_msg.h"
#include "srq.h"
struct srq_data *t4_init_srq(int srq_size)
{
struct srq_data *s;
s = kvzalloc_obj(*s);
if (!s)
return NULL;
s->srq_size = srq_size;
init_completion(&s->comp);
mutex_init(&s->lock);
return s;
}
void do_srq_table_rpl(struct adapter *adap,
const struct cpl_srq_table_rpl *rpl)
{
unsigned int idx = TID_TID_G(GET_TID(rpl));
struct srq_data *s = adap->srq;
struct srq_entry *e;
if (unlikely(rpl->status != CPL_CONTAINS_READ_RPL)) {
dev_err(adap->pdev_dev,
"Unexpected SRQ_TABLE_RPL status %u for entry %u\n",
rpl->status, idx);
goto out;
}
/* Store the read entry */
e = s->entryp;
e->valid = 1;
e->idx = idx;
e->pdid = SRQT_PDID_G(be64_to_cpu(rpl->rsvd_pdid));
e->qlen = SRQT_QLEN_G(be32_to_cpu(rpl->qlen_qbase));
e->qbase = SRQT_QBASE_G(be32_to_cpu(rpl->qlen_qbase));
e->cur_msn = be16_to_cpu(rpl->cur_msn);
e->max_msn = be16_to_cpu(rpl->max_msn);
out:
complete(&s->comp);
}
Annotation
- Immediate include surface: `cxgb4.h`, `t4_msg.h`, `srq.h`.
- Detected declarations: `function Copyright`, `function do_srq_table_rpl`.
- 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.