include/soc/fsl/qman.h
Source file repositories/reference/linux-study-clean/include/soc/fsl/qman.h
File Facts
- System
- Linux kernel
- Corpus path
include/soc/fsl/qman.h- Extension
.h- Size
- 43779 bytes
- Lines
- 1260
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/device.h
Detected Declarations
struct qm_fdstruct qm_sg_entrystruct qm_dqrr_entrystruct qm_fqd_stashingstruct qm_fqd_oacstruct qm_fqdstruct qm_cgr_wr_parmstruct qm_cgr_cs_thresstruct __qm_mc_cgrstruct qm_mcc_initfqstruct qm_mcc_initcgrstruct qman_portalstruct qman_fqstruct qman_cgrstruct qman_fq_cbstruct qman_fqstruct qman_cgrstruct qm_mcr_queryfq_npenum qm_fd_formatenum qman_cb_dqrr_resultenum qman_fq_stateenum qm_mcr_queryfq_np_masksfunction QM_SDQCR_CHANNELS_POOL_CONVfunction qm_fd_addrfunction qm_fd_addr_get64function qm_fd_addr_set64function qm_fd_get_formatfunction qm_fd_get_offsetfunction qm_fd_get_lengthfunction qm_fd_get_len_bigfunction qm_fd_set_paramfunction qm_fd_clear_fdfunction qm_sg_addrfunction qm_sg_entry_get64function qm_sg_entry_set64function qm_sg_entry_is_finalfunction qm_sg_entry_is_extfunction qm_sg_entry_get_lenfunction qm_sg_entry_set_lenfunction qm_sg_entry_set_ffunction qm_sg_entry_get_offfunction qm_fqd_stashing_get64function qm_fqd_stashing_addrfunction qm_fqd_context_a_get64function qm_fqd_stashing_set64function qm_fqd_context_a_set64function qm_fqd_set_taildropfunction qm_fqd_get_taildrop
Annotated Snippet
struct qm_fd {
union {
struct {
u8 cfg8b_w1;
u8 bpid; /* Buffer Pool ID */
u8 cfg8b_w3;
u8 addr_hi; /* high 8-bits of 40-bit address */
__be32 addr_lo; /* low 32-bits of 40-bit address */
} __packed;
__be64 data;
};
__be32 cfg; /* format, offset, length / congestion */
union {
__be32 cmd;
__be32 status;
};
} __aligned(8);
#define QM_FD_FORMAT_SG BIT(31)
#define QM_FD_FORMAT_LONG BIT(30)
#define QM_FD_FORMAT_COMPOUND BIT(29)
#define QM_FD_FORMAT_MASK GENMASK(31, 29)
#define QM_FD_OFF_SHIFT 20
#define QM_FD_OFF_MASK GENMASK(28, 20)
#define QM_FD_LEN_MASK GENMASK(19, 0)
#define QM_FD_LEN_BIG_MASK GENMASK(28, 0)
enum qm_fd_format {
/*
* 'contig' implies a contiguous buffer, whereas 'sg' implies a
* scatter-gather table. 'big' implies a 29-bit length with no offset
* field, otherwise length is 20-bit and offset is 9-bit. 'compound'
* implies a s/g-like table, where each entry itself represents a frame
* (contiguous or scatter-gather) and the 29-bit "length" is
* interpreted purely for congestion calculations, ie. a "congestion
* weight".
*/
qm_fd_contig = 0,
qm_fd_contig_big = QM_FD_FORMAT_LONG,
qm_fd_sg = QM_FD_FORMAT_SG,
qm_fd_sg_big = QM_FD_FORMAT_SG | QM_FD_FORMAT_LONG,
qm_fd_compound = QM_FD_FORMAT_COMPOUND
};
static inline dma_addr_t qm_fd_addr(const struct qm_fd *fd)
{
return be64_to_cpu(fd->data) & 0xffffffffffLLU;
}
static inline u64 qm_fd_addr_get64(const struct qm_fd *fd)
{
return be64_to_cpu(fd->data) & 0xffffffffffLLU;
}
static inline void qm_fd_addr_set64(struct qm_fd *fd, u64 addr)
{
fd->addr_hi = upper_32_bits(addr);
fd->addr_lo = cpu_to_be32(lower_32_bits(addr));
}
/*
* The 'format' field indicates the interpretation of the remaining
* 29 bits of the 32-bit word.
* If 'format' is _contig or _sg, 20b length and 9b offset.
* If 'format' is _contig_big or _sg_big, 29b length.
* If 'format' is _compound, 29b "congestion weight".
*/
static inline enum qm_fd_format qm_fd_get_format(const struct qm_fd *fd)
{
return be32_to_cpu(fd->cfg) & QM_FD_FORMAT_MASK;
}
static inline int qm_fd_get_offset(const struct qm_fd *fd)
{
return (be32_to_cpu(fd->cfg) & QM_FD_OFF_MASK) >> QM_FD_OFF_SHIFT;
}
static inline int qm_fd_get_length(const struct qm_fd *fd)
{
return be32_to_cpu(fd->cfg) & QM_FD_LEN_MASK;
}
static inline int qm_fd_get_len_big(const struct qm_fd *fd)
{
return be32_to_cpu(fd->cfg) & QM_FD_LEN_BIG_MASK;
}
static inline void qm_fd_set_param(struct qm_fd *fd, enum qm_fd_format fmt,
int off, int len)
{
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/device.h`.
- Detected declarations: `struct qm_fd`, `struct qm_sg_entry`, `struct qm_dqrr_entry`, `struct qm_fqd_stashing`, `struct qm_fqd_oac`, `struct qm_fqd`, `struct qm_cgr_wr_parm`, `struct qm_cgr_cs_thres`, `struct __qm_mc_cgr`, `struct qm_mcc_initfq`.
- Atlas domain: Repository Root And Misc / include.
- 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.