drivers/net/ethernet/ti/icssg/icssg_queues.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/icssg/icssg_queues.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/icssg/icssg_queues.c- Extension
.c- Size
- 1152 bytes
- Lines
- 53
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/regmap.hicssg_prueth.h
Detected Declarations
function Copyrightfunction icssg_queue_pushfunction icssg_queue_levelexport icssg_queue_popexport icssg_queue_push
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* ICSSG Buffer queue helpers
*
* Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com
*/
#include <linux/regmap.h>
#include "icssg_prueth.h"
#define ICSSG_QUEUES_MAX 64
#define ICSSG_QUEUE_OFFSET 0xd00
#define ICSSG_QUEUE_PEEK_OFFSET 0xe00
#define ICSSG_QUEUE_CNT_OFFSET 0xe40
#define ICSSG_QUEUE_RESET_OFFSET 0xf40
int icssg_queue_pop(struct prueth *prueth, u8 queue)
{
u32 val, cnt;
if (queue >= ICSSG_QUEUES_MAX)
return -EINVAL;
regmap_read(prueth->miig_rt, ICSSG_QUEUE_CNT_OFFSET + 4 * queue, &cnt);
if (!cnt)
return -EINVAL;
regmap_read(prueth->miig_rt, ICSSG_QUEUE_OFFSET + 4 * queue, &val);
return val;
}
EXPORT_SYMBOL_GPL(icssg_queue_pop);
void icssg_queue_push(struct prueth *prueth, int queue, u16 addr)
{
if (queue >= ICSSG_QUEUES_MAX)
return;
regmap_write(prueth->miig_rt, ICSSG_QUEUE_OFFSET + 4 * queue, addr);
}
EXPORT_SYMBOL_GPL(icssg_queue_push);
u32 icssg_queue_level(struct prueth *prueth, int queue)
{
u32 reg;
if (queue >= ICSSG_QUEUES_MAX)
return 0;
regmap_read(prueth->miig_rt, ICSSG_QUEUE_CNT_OFFSET + 4 * queue, ®);
return reg;
}
Annotation
- Immediate include surface: `linux/regmap.h`, `icssg_prueth.h`.
- Detected declarations: `function Copyright`, `function icssg_queue_push`, `function icssg_queue_level`, `export icssg_queue_pop`, `export icssg_queue_push`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.