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.

Dependency Surface

Detected Declarations

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

Implementation Notes