include/linux/can/can-ml.h

Source file repositories/reference/linux-study-clean/include/linux/can/can-ml.h

File Facts

System
Linux kernel
Corpus path
include/linux/can/can-ml.h
Extension
.h
Size
3646 bytes
Lines
105
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct can_dev_rcv_lists {
	struct hlist_head rx[RX_MAX];
	struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ];
	struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ];
	int entries;
};

struct can_ml_priv {
	struct can_dev_rcv_lists dev_rcv_lists;
#ifdef CAN_J1939
	struct j1939_priv *j1939_priv;
#endif
	u32 can_cap;
};

static inline struct can_ml_priv *can_get_ml_priv(struct net_device *dev)
{
	return netdev_get_ml_priv(dev, ML_PRIV_CAN);
}

static inline void can_set_ml_priv(struct net_device *dev,
				   struct can_ml_priv *ml_priv)
{
	netdev_set_ml_priv(dev, ml_priv, ML_PRIV_CAN);
}

static inline bool can_cap_enabled(struct net_device *dev, u32 cap)
{
	struct can_ml_priv *can_ml = can_get_ml_priv(dev);

	if (!can_ml)
		return false;

	return (can_ml->can_cap & cap);
}

static inline void can_set_cap(struct net_device *dev, u32 cap)
{
	struct can_ml_priv *can_ml = can_get_ml_priv(dev);

	can_ml->can_cap = cap;
}

#endif /* CAN_ML_H */

Annotation

Implementation Notes