Lines Matching refs:devlink
33 struct devlink { struct
89 #define devlinks_xa_for_each_registered_get(net, index, devlink) \ argument
90 for (index = 0; (devlink = devlinks_xa_find_get(net, &index)); index++)
92 struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp);
94 static inline bool __devl_is_registered(struct devlink *devlink) in __devl_is_registered() argument
96 return xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED); in __devl_is_registered()
99 static inline bool devl_is_registered(struct devlink *devlink) in devl_is_registered() argument
101 devl_assert_locked(devlink); in devl_is_registered()
102 return __devl_is_registered(devlink); in devl_is_registered()
105 static inline void devl_dev_lock(struct devlink *devlink, bool dev_lock) in devl_dev_lock() argument
108 device_lock(devlink->dev); in devl_dev_lock()
109 devl_lock(devlink); in devl_dev_lock()
112 static inline void devl_dev_unlock(struct devlink *devlink, bool dev_lock) in devl_dev_unlock() argument
114 devl_unlock(devlink); in devl_dev_unlock()
116 device_unlock(devlink->dev); in devl_dev_unlock()
119 typedef void devlink_rel_notify_cb_t(struct devlink *devlink, u32 obj_index);
120 typedef void devlink_rel_cleanup_cb_t(struct devlink *devlink, u32 obj_index,
127 struct devlink *devlink);
128 void devlink_rel_nested_in_notify(struct devlink *devlink);
129 int devlink_rel_devlink_handle_put(struct sk_buff *msg, struct devlink *devlink,
155 struct devlink *devlink,
159 struct devlink *
175 devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink) in devlink_nl_put_handle() argument
177 if (nla_put_string(msg, DEVLINK_ATTR_BUS_NAME, devlink->dev->bus->name)) in devlink_nl_put_handle()
179 if (nla_put_string(msg, DEVLINK_ATTR_DEV_NAME, dev_name(devlink->dev))) in devlink_nl_put_handle()
185 struct devlink *devlink, int attrtype);
188 static inline bool devlink_nl_notify_need(struct devlink *devlink) in devlink_nl_notify_need() argument
190 return genl_has_listeners(&devlink_nl_family, devlink_net(devlink), in devlink_nl_notify_need()
204 struct devlink *devlink) in devlink_nl_obj_desc_init() argument
207 desc->bus_name = devlink->dev->bus->name; in devlink_nl_obj_desc_init()
208 desc->dev_name = dev_name(devlink->dev); in devlink_nl_obj_desc_init()
220 static inline void devlink_nl_notify_send_desc(struct devlink *devlink, in devlink_nl_notify_send_desc() argument
225 devlink_net(devlink), in devlink_nl_notify_send_desc()
231 static inline void devlink_nl_notify_send(struct devlink *devlink, in devlink_nl_notify_send() argument
236 devlink_nl_obj_desc_init(&desc, devlink); in devlink_nl_notify_send()
237 devlink_nl_notify_send_desc(devlink, msg, &desc); in devlink_nl_notify_send()
241 void devlink_notify_register(struct devlink *devlink);
242 void devlink_notify_unregister(struct devlink *devlink);
243 void devlink_ports_notify_register(struct devlink *devlink);
244 void devlink_ports_notify_unregister(struct devlink *devlink);
245 void devlink_params_notify_register(struct devlink *devlink);
246 void devlink_params_notify_unregister(struct devlink *devlink);
247 void devlink_regions_notify_register(struct devlink *devlink);
248 void devlink_regions_notify_unregister(struct devlink *devlink);
249 void devlink_trap_policers_notify_register(struct devlink *devlink);
250 void devlink_trap_policers_notify_unregister(struct devlink *devlink);
251 void devlink_trap_groups_notify_register(struct devlink *devlink);
252 void devlink_trap_groups_notify_unregister(struct devlink *devlink);
253 void devlink_traps_notify_register(struct devlink *devlink);
254 void devlink_traps_notify_unregister(struct devlink *devlink);
255 void devlink_rates_notify_register(struct devlink *devlink);
256 void devlink_rates_notify_unregister(struct devlink *devlink);
257 void devlink_linecards_notify_register(struct devlink *devlink);
258 void devlink_linecards_notify_unregister(struct devlink *devlink);
264 struct devlink_port *devlink_port_get_by_index(struct devlink *devlink,
269 devlink_port_get_from_info(struct devlink *devlink, struct genl_info *info);
270 struct devlink_port *devlink_port_get_from_attrs(struct devlink *devlink,
275 int devlink_reload(struct devlink *devlink, struct net *dest_net,
286 void devlink_params_driverinit_load_new(struct devlink *devlink);
290 int devlink_resources_validate(struct devlink *devlink,
295 int devlink_rate_nodes_check(struct devlink *devlink, u16 mode,