drivers/net/ethernet/chelsio/cxgb4/sched.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb4/sched.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb4/sched.h- Extension
.h- Size
- 3425 bytes
- Lines
- 120
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/spinlock.hlinux/atomic.h
Detected Declarations
struct sched_queue_entrystruct sched_flowc_entrystruct ch_sched_classstruct sched_tableenum sched_fw_opsenum sched_bind_typefunction can_schedfunction valid_class_id
Annotated Snippet
struct sched_queue_entry {
struct list_head list;
unsigned int cntxt_id;
struct ch_sched_queue param;
};
struct sched_flowc_entry {
struct list_head list;
struct ch_sched_flowc param;
};
struct ch_sched_class {
u8 state;
u8 idx;
struct ch_sched_params info;
enum sched_bind_type bind_type;
struct list_head entry_list;
atomic_t refcnt;
};
struct sched_table { /* per port scheduling table */
u8 sched_size;
struct ch_sched_class tab[] __counted_by(sched_size);
};
static inline bool can_sched(struct net_device *dev)
{
struct port_info *pi = netdev2pinfo(dev);
return !pi->sched_tbl ? false : true;
}
static inline bool valid_class_id(struct net_device *dev, u8 class_id)
{
struct port_info *pi = netdev2pinfo(dev);
if ((class_id > pi->sched_tbl->sched_size - 1) &&
(class_id != SCHED_CLS_NONE))
return false;
return true;
}
struct ch_sched_class *cxgb4_sched_queue_lookup(struct net_device *dev,
struct ch_sched_queue *p);
int cxgb4_sched_class_bind(struct net_device *dev, void *arg,
enum sched_bind_type type);
int cxgb4_sched_class_unbind(struct net_device *dev, void *arg,
enum sched_bind_type type);
struct ch_sched_class *cxgb4_sched_class_alloc(struct net_device *dev,
struct ch_sched_params *p);
void cxgb4_sched_class_free(struct net_device *dev, u8 classid);
struct sched_table *t4_init_sched(unsigned int size);
void t4_cleanup_sched(struct adapter *adap);
#endif /* __CXGB4_SCHED_H */
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/atomic.h`.
- Detected declarations: `struct sched_queue_entry`, `struct sched_flowc_entry`, `struct ch_sched_class`, `struct sched_table`, `enum sched_fw_ops`, `enum sched_bind_type`, `function can_sched`, `function valid_class_id`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.