drivers/net/wireless/broadcom/brcm80211/include/brcmu_utils.h
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/include/brcmu_utils.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/include/brcmu_utils.h- Extension
.h- Size
- 5857 bytes
- Lines
- 217
- 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
linux/skbuff.h
Detected Declarations
struct pktq_precstruct pktqstruct ipv4_addrfunction Copyrightfunction pktq_plenfunction pktq_pavailfunction pktq_pfullfunction pktq_pemptyfunction pktq_lenfunction pktq_maxfunction pktq_availfunction pktq_fullfunction pktq_emptyfunction brcmu_maskset32function brcmu_maskget32function brcmu_maskset16function brcmu_maskget16function brcmu_dbg_hex_dump
Annotated Snippet
struct pktq_prec {
struct sk_buff_head skblist;
u16 max; /* maximum number of queued packets */
};
/* multi-priority pkt queue */
struct pktq {
u16 num_prec; /* number of precedences in use */
u16 hi_prec; /* rapid dequeue hint (>= highest non-empty prec) */
u16 max; /* total max packets */
u16 len; /* total number of packets */
/*
* q array must be last since # of elements can be either
* PKTQ_MAX_PREC or 1
*/
struct pktq_prec q[PKTQ_MAX_PREC];
};
/* operations on a specific precedence in packet queue */
static inline int pktq_plen(struct pktq *pq, int prec)
{
return pq->q[prec].skblist.qlen;
}
static inline int pktq_pavail(struct pktq *pq, int prec)
{
return pq->q[prec].max - pq->q[prec].skblist.qlen;
}
static inline bool pktq_pfull(struct pktq *pq, int prec)
{
return pq->q[prec].skblist.qlen >= pq->q[prec].max;
}
static inline bool pktq_pempty(struct pktq *pq, int prec)
{
return skb_queue_empty(&pq->q[prec].skblist);
}
static inline struct sk_buff *pktq_ppeek(struct pktq *pq, int prec)
{
return skb_peek(&pq->q[prec].skblist);
}
static inline struct sk_buff *pktq_ppeek_tail(struct pktq *pq, int prec)
{
return skb_peek_tail(&pq->q[prec].skblist);
}
struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec, struct sk_buff *p);
struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
struct sk_buff *p);
struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
bool (*match_fn)(struct sk_buff *p,
void *arg),
void *arg);
/* packet primitives */
struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
/* Empty the queue at particular precedence level */
/* callback function fn(pkt, arg) returns true if pkt belongs to if */
void brcmu_pktq_pflush(struct pktq *pq, int prec, bool dir,
bool (*fn)(struct sk_buff *, void *), void *arg);
/* operations on a set of precedences in packet queue */
int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
/* operations on packet queue as a whole */
static inline int pktq_len(struct pktq *pq)
{
return (int)pq->len;
}
static inline int pktq_max(struct pktq *pq)
{
return (int)pq->max;
}
static inline int pktq_avail(struct pktq *pq)
{
return (int)(pq->max - pq->len);
}
Annotation
- Immediate include surface: `linux/skbuff.h`.
- Detected declarations: `struct pktq_prec`, `struct pktq`, `struct ipv4_addr`, `function Copyright`, `function pktq_plen`, `function pktq_pavail`, `function pktq_pfull`, `function pktq_pempty`, `function pktq_len`, `function pktq_max`.
- 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.