1// include/linux/netdevice.h
2/*
3 * This structure defines the management hooks for network devices.
4 * The following hooks can be defined; unless noted otherwise, they are
5 * optional and can be filled with a null pointer.
6 *
7 * int (*ndo_init)(struct net_device *dev);
8 * This function is called once when a network device is registered.
9 * The network device can use this for any late stage initialization
10 * or semantic validation. It can fail with an error code which will
11 * be propagated back to register_netdev.
12 *
13 * void (*ndo_uninit)(struct net_device *dev);
14 * This function is called when device is unregistered or when registration
15 * fails. It is not called if init fails.
16 *
17 * int (*ndo_open)(struct net_device *dev);
18 * This function is called when a network device transitions to the up
19 * state.
20 *
21 * int (*ndo_stop)(struct net_device *dev);
22 * This function is called when a network device transitions to the down
23 * state.
24 *
25 * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
26 * struct net_device *dev);
27 * Called when a packet needs to be transmitted.
28 * Returns NETDEV_TX_OK. Can return NETDEV_TX_BUSY, but you should stop
29 * the queue before that can happen; it's for obsolete devices and weird
30 * corner cases, but the stack really does a non-trivial amount
31 * of useless work if you return NETDEV_TX_BUSY.
32 * Required; cannot be NULL.
33 *
34 * netdev_features_t (*ndo_features_check)(struct sk_buff *skb,
35 * struct net_device *dev
36 * netdev_features_t features);
37 * Called by core transmit path to determine if device is capable of
38 * performing offload operations on a given packet. This is to give
39 * the device an opportunity to implement any restrictions that cannot
40 * be otherwise expressed by feature flags. The check is called with
41 * the set of features that the stack has calculated and it returns
42 * those the driver believes to be appropriate.
43 *
44 * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb,
45 * struct net_device *sb_dev);
46 * Called to decide which queue to use when device supports multiple
47 * transmit queues.
48 *
49 * void (*ndo_change_rx_flags)(struct net_device *dev, int flags);
50 * This function is called to allow device receiver to make
51 * changes to configuration when multicast or promiscuous is enabled.
52 *
53 * void (*ndo_set_rx_mode)(struct net_device *dev);
54 * This function is called device changes address list filtering.
55 * If driver handles unicast address filtering, it should set
56 * IFF_UNICAST_FLT in its priv_flags.
57 *
58 * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
59 * This function is called when the Media Access Control address
60 * needs to be changed. If this interface is not defined, the
61 * MAC address can not be changed.
62 *
63 * int (*ndo_validate_addr)(struct net_device *dev);
64 * Test if Media Access Control address is valid for the device.
65 *
66 * int (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
67 * Old-style ioctl entry point. This is used internally by the
68 * appletalk and ieee802154 subsystems but is no longer called by
69 * the device ioctl handler.
70 *
71 * int (*ndo_siocbond)(struct net_device *dev, struct ifreq *ifr, int cmd);
72 * Used by the bonding driver for its device specific ioctls:
73 * SIOCBONDENSLAVE, SIOCBONDRELEASE, SIOCBONDSETHWADDR, SIOCBONDCHANGEACTIVE,
74 * SIOCBONDSLAVEINFOQUERY, and SIOCBONDINFOQUERY
75 *
76 * * int (*ndo_eth_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
77 * Called for ethernet specific ioctls: SIOCGMIIPHY, SIOCGMIIREG,
78 * SIOCSMIIREG, SIOCSHWTSTAMP and SIOCGHWTSTAMP.
79 *
80 * int (*ndo_set_config)(struct net_device *dev, struct ifmap *map);
81 * Used to set network devices bus interface parameters. This interface
82 * is retained for legacy reasons; new devices should use the bus
83 * interface (PCI) for low level management.
84 *
85 * int (*ndo_change_mtu)(struct net_device *dev, int new_mtu);
86 * Called when a user wants to change the Maximum Transfer Unit
87 * of a device.
88 *
89 * void (*ndo_tx_timeout)(struct net_device *dev, unsigned int txqueue);
90 * Callback used when the transmitter has not made any progress
91 * for dev->watchdog ticks.
92 *
93 * void (*ndo_get_stats64)(struct net_device *dev,
94 * struct rtnl_link_stats64 *storage);
95 * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
96 * Called when a user wants to get the network device usage
97 * statistics. Drivers must do one of the following:
98 * 1. Define @ndo_get_stats64 to fill in a zero-initialised
99 * rtnl_link_stats64 structure passed by the caller.
100 * 2. Define @ndo_get_stats to update a net_device_stats structure
101 * (which should normally be dev->stats) and return a pointer to
102 * it. The structure may be changed asynchronously only if each
103 * field is written atomically.
104 * 3. Update dev->stats asynchronously and atomically, and define
105 * neither operation.
106 *
107 * bool (*ndo_has_offload_stats)(const struct net_device *dev, int attr_id)
108 * Return true if this device supports offload stats of this attr_id.
109 *
110 * int (*ndo_get_offload_stats)(int attr_id, const struct net_device *dev,
111 * void *attr_data)
112 * Get statistics for offload operations by attr_id. Write it into the
113 * attr_data pointer.
114 *
115 * int (*ndo_vlan_rx_add_vid)(struct net_device *dev, __be16 proto, u16 vid);
116 * If device supports VLAN filtering this function is called when a
117 * VLAN id is registered.
118 *
119 * int (*ndo_vlan_rx_kill_vid)(struct net_device *dev, __be16 proto, u16 vid);
120 * If device supports VLAN filtering this function is called when a
121 * VLAN id is unregistered.
122 *
123 * void (*ndo_poll_controller)(struct net_device *dev);
124 *
125 * SR-IOV management functions.
126 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
127 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan,
128 * u8 qos, __be16 proto);
129 * int (*ndo_set_vf_rate)(struct net_device *dev, int vf, int min_tx_rate,
130 * int max_tx_rate);
131 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting);
132 * int (*ndo_set_vf_trust)(struct net_device *dev, int vf, bool setting);
133 * int (*ndo_get_vf_config)(struct net_device *dev,
134 * int vf, struct ifla_vf_info *ivf);
135 * int (*ndo_set_vf_link_state)(struct net_device *dev, int vf, int link_state);
136 * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
137 * struct nlattr *port[]);
138 *
139 * Enable or disable the VF ability to query its RSS Redirection Table and
140 * Hash Key. This is needed since on some devices VF share this information
141 * with PF and querying it may introduce a theoretical security risk.
142 * int (*ndo_set_vf_rss_query_en)(struct net_device *dev, int vf, bool setting);
143 * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
144 * int (*ndo_setup_tc)(struct net_device *dev, enum tc_setup_type type,
145 * void *type_data);
146 * Called to setup any 'tc' scheduler, classifier or action on @dev.
147 * This is always called from the stack with the rtnl lock held and netif
148 * tx queues stopped. This allows the netdevice to perform queue
149 * management safely.
150 *
151 * Fiber Channel over Ethernet (FCoE) offload functions.
152 * int (*ndo_fcoe_enable)(struct net_device *dev);
153 * Called when the FCoE protocol stack wants to start using LLD for FCoE
154 * so the underlying device can perform whatever needed configuration or
155 * initialization to support acceleration of FCoE traffic.
156 *
157 * int (*ndo_fcoe_disable)(struct net_device *dev);
158 * Called when the FCoE protocol stack wants to stop using LLD for FCoE
159 * so the underlying device can perform whatever needed clean-ups to
160 * stop supporting acceleration of FCoE traffic.
161 *
162 * int (*ndo_fcoe_ddp_setup)(struct net_device *dev, u16 xid,
163 * struct scatterlist *sgl, unsigned int sgc);
164 * Called when the FCoE Initiator wants to initialize an I/O that
165 * is a possible candidate for Direct Data Placement (DDP). The LLD can
166 * perform necessary setup and returns 1 to indicate the device is set up
167 * successfully to perform DDP on this I/O, otherwise this returns 0.
168 *
169 * int (*ndo_fcoe_ddp_done)(struct net_device *dev, u16 xid);
170 * Called when the FCoE Initiator/Target is done with the DDPed I/O as
171 * indicated by the FC exchange id 'xid', so the underlying device can
172 * clean up and reuse resources for later DDP requests.
173 *
174 * int (*ndo_fcoe_ddp_target)(struct net_device *dev, u16 xid,
175 * struct scatterlist *sgl, unsigned int sgc);
176 * Called when the FCoE Target wants to initialize an I/O that
177 * is a possible candidate for Direct Data Placement (DDP). The LLD can
178 * perform necessary setup and returns 1 to indicate the device is set up
179 * successfully to perform DDP on this I/O, otherwise this returns 0.
180 *
181 * int (*ndo_fcoe_get_hbainfo)(struct net_device *dev,
182 * struct netdev_fcoe_hbainfo *hbainfo);
183 * Called when the FCoE Protocol stack wants information on the underlying
184 * device. This information is utilized by the FCoE protocol stack to
185 * register attributes with Fiber Channel management service as per the
186 * FC-GS Fabric Device Management Information(FDMI) specification.
187 *
188 * int (*ndo_fcoe_get_wwn)(struct net_device *dev, u64 *wwn, int type);
189 * Called when the underlying device wants to override default World Wide
190 * Name (WWN) generation mechanism in FCoE protocol stack to pass its own
191 * World Wide Port Name (WWPN) or World Wide Node Name (WWNN) to the FCoE
192 * protocol stack to use.
193 *
194 * RFS acceleration.
195 * int (*ndo_rx_flow_steer)(struct net_device *dev, const struct sk_buff *skb,
196 * u16 rxq_index, u32 flow_id);
197 * Set hardware filter for RFS. rxq_index is the target queue index;
198 * flow_id is a flow ID to be passed to rps_may_expire_flow() later.
199 * Return the filter ID on success, or a negative error code.
200 *
201 * Slave management functions (for bridge, bonding, etc).
202 * int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev);
203 * Called to make another netdev an underling.
204 *
205 * int (*ndo_del_slave)(struct net_device *dev, struct net_device *slave_dev);
206 * Called to release previously enslaved netdev.
207 *
208 * struct net_device *(*ndo_get_xmit_slave)(struct net_device *dev,
209 * struct sk_buff *skb,
210 * bool all_slaves);
211 * Get the xmit slave of master device. If all_slaves is true, function
212 * assume all the slaves can transmit.
213 *
214 * Feature/offload setting functions.
215 * netdev_features_t (*ndo_fix_features)(struct net_device *dev,
216 * netdev_features_t features);
217 * Adjusts the requested feature flags according to device-specific
218 * constraints, and returns the resulting flags. Must not modify
219 * the device state.
220 *
221 * int (*ndo_set_features)(struct net_device *dev, netdev_features_t features);
222 * Called to update device configuration to new features. Passed
223 * feature set might be less than what was returned by ndo_fix_features()).
224 * Must return >0 or -errno if it changed dev->features itself.
225 *
226 * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[],
227 * struct net_device *dev,
228 * const unsigned char *addr, u16 vid, u16 flags,
229 * struct netlink_ext_ack *extack);
230 * Adds an FDB entry to dev for addr.
231 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[],
232 * struct net_device *dev,
233 * const unsigned char *addr, u16 vid)
234 * Deletes the FDB entry from dev coresponding to addr.
235 * int (*ndo_fdb_del_bulk)(struct ndmsg *ndm, struct nlattr *tb[],
236 * struct net_device *dev,
237 * u16 vid,
238 * struct netlink_ext_ack *extack);
239 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
240 * struct net_device *dev, struct net_device *filter_dev,
241 * int *idx)
242 * Used to add FDB entries to dump requests. Implementers should add
243 * entries to skb and update idx with the number of entries.
244 *
245 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh,
246 * u16 flags, struct netlink_ext_ack *extack)
247 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
248 * struct net_device *dev, u32 filter_mask,
249 * int nlflags)
250 * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh,
251 * u16 flags);
252 *
253 * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);
254 * Called to change device carrier. Soft-devices (like dummy, team, etc)
255 * which do not represent real hardware may define this to allow their
256 * userspace components to manage their virtual carrier state. Devices
257 * that determine carrier state from physical hardware properties (eg
258 * network cables) or protocol-dependent mechanisms (eg
259 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function.
260 *
261 * int (*ndo_get_phys_port_id)(struct net_device *dev,
262 * struct netdev_phys_item_id *ppid);
263 * Called to get ID of physical port of this device. If driver does
264 * not implement this, it is assumed that the hw is not able to have
265 * multiple net devices on single physical port.
266 *
267 * int (*ndo_get_port_parent_id)(struct net_device *dev,
268 * struct netdev_phys_item_id *ppid)
269 * Called to get the parent ID of the physical port of this device.
270 *
271 * void* (*ndo_dfwd_add_station)(struct net_device *pdev,
272 * struct net_device *dev)
273 * Called by upper layer devices to accelerate switching or other
274 * station functionality into hardware. 'pdev is the lowerdev
275 * to use for the offload and 'dev' is the net device that will
276 * back the offload. Returns a pointer to the private structure
277 * the upper layer will maintain.
278 * void (*ndo_dfwd_del_station)(struct net_device *pdev, void *priv)
279 * Called by upper layer device to delete the station created
280 * by 'ndo_dfwd_add_station'. 'pdev' is the net device backing
281 * the station and priv is the structure returned by the add
282 * operation.
283 * int (*ndo_set_tx_maxrate)(struct net_device *dev,
284 * int queue_index, u32 maxrate);
285 * Called when a user wants to set a max-rate limitation of specific
286 * TX queue.
287 * int (*ndo_get_iflink)(const struct net_device *dev);
288 * Called to get the iflink value of this device.
289 * int (*ndo_fill_metadata_dst)(struct net_device *dev, struct sk_buff *skb);
290 * This function is used to get egress tunnel information for given skb.
291 * This is useful for retrieving outer tunnel header parameters while
292 * sampling packet.
293 * void (*ndo_set_rx_headroom)(struct net_device *dev, int needed_headroom);
294 * This function is used to specify the headroom that the skb must
295 * consider when allocation skb during packet reception. Setting
296 * appropriate rx headroom value allows avoiding skb head copy on
297 * forward. Setting a negative value resets the rx headroom to the
298 * default value.
299 * int (*ndo_bpf)(struct net_device *dev, struct netdev_bpf *bpf);
300 * This function is used to set or query state related to XDP on the
301 * netdevice and manage BPF offload. See definition of
302 * enum bpf_netdev_command for details.
303 * int (*ndo_xdp_xmit)(struct net_device *dev, int n, struct xdp_frame **xdp,
304 * u32 flags);
305 * This function is used to submit @n XDP packets for transmit on a
306 * netdevice. Returns number of frames successfully transmitted, frames
307 * that got dropped are freed/returned via xdp_return_frame().
308 * Returns negative number, means general error invoking ndo, meaning
309 * no frames were xmit'ed and core-caller will free all frames.
310 * struct net_device *(*ndo_xdp_get_xmit_slave)(struct net_device *dev,
311 * struct xdp_buff *xdp);
312 * Get the xmit slave of master device based on the xdp_buff.
313 * int (*ndo_xsk_wakeup)(struct net_device *dev, u32 queue_id, u32 flags);
314 * This function is used to wake up the softirq, ksoftirqd or kthread
315 * responsible for sending and/or receiving packets on a specific
316 * queue id bound to an AF_XDP socket. The flags field specifies if
317 * only RX, only Tx, or both should be woken up using the flags
318 * XDP_WAKEUP_RX and XDP_WAKEUP_TX.
319 * struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);
320 * Get devlink port instance associated with a given netdev.
321 * Called with a reference on the netdevice and devlink locks only,
322 * rtnl_lock is not held.
323 * int (*ndo_tunnel_ctl)(struct net_device *dev, struct ip_tunnel_parm *p,
324 * int cmd);
325 * Add, change, delete or get information on an IPv4 tunnel.
326 * struct net_device *(*ndo_get_peer_dev)(struct net_device *dev);
327 * If a device is paired with a peer device, return the peer instance.
328 * The caller must be under RCU read context.
329 * int (*ndo_fill_forward_path)(struct net_device_path_ctx *ctx, struct net_device_path *path);
330 * Get the forwarding path to reach the real device from the HW destination address
331 * ktime_t (*ndo_get_tstamp)(struct net_device *dev,
332 * const struct skb_shared_hwtstamps *hwtstamps,
333 * bool cycles);
334 * Get hardware timestamp based on normal/adjustable time or free running
335 * cycle counter. This function is required if physical clock supports a
336 * free running cycle counter.
337 */
338struct net_device_ops {
339 int (*ndo_init)(struct net_device *dev);
340 void (*ndo_uninit)(struct net_device *dev);
341 int (*ndo_open)(struct net_device *dev);
342 int (*ndo_stop)(struct net_device *dev);
343 netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
344 struct net_device *dev);
345 netdev_features_t (*ndo_features_check)(struct sk_buff *skb,
346 struct net_device *dev,
347 netdev_features_t features);
348 u16 (*ndo_select_queue)(struct net_device *dev,
349 struct sk_buff *skb,
350 struct net_device *sb_dev);
351 void (*ndo_change_rx_flags)(struct net_device *dev,
352 int flags);
353 void (*ndo_set_rx_mode)(struct net_device *dev);
354 int (*ndo_set_mac_address)(struct net_device *dev,
355 void *addr);
356 int (*ndo_validate_addr)(struct net_device *dev);
357 int (*ndo_do_ioctl)(struct net_device *dev,
358 struct ifreq *ifr, int cmd);
359 int (*ndo_eth_ioctl)(struct net_device *dev,
360 struct ifreq *ifr, int cmd);
361 int (*ndo_siocbond)(struct net_device *dev,
362 struct ifreq *ifr, int cmd);
363 int (*ndo_siocwandev)(struct net_device *dev,
364 struct if_settings *ifs);
365 int (*ndo_siocdevprivate)(struct net_device *dev,
366 struct ifreq *ifr,
367 void __user *data, int cmd);
368 int (*ndo_set_config)(struct net_device *dev,
369 struct ifmap *map);
370 int (*ndo_change_mtu)(struct net_device *dev,
371 int new_mtu);
372 int (*ndo_neigh_setup)(struct net_device *dev,
373 struct neigh_parms *);
374 void (*ndo_tx_timeout) (struct net_device *dev,
375 unsigned int txqueue);
376
377 void (*ndo_get_stats64)(struct net_device *dev,
378 struct rtnl_link_stats64 *storage);
379 bool (*ndo_has_offload_stats)(const struct net_device *dev, int attr_id);
380 int (*ndo_get_offload_stats)(int attr_id,
381 const struct net_device *dev,
382 void *attr_data);
383 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
384
385 int (*ndo_vlan_rx_add_vid)(struct net_device *dev,
386 __be16 proto, u16 vid);
387 int (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
388 __be16 proto, u16 vid);
389#ifdef CONFIG_NET_POLL_CONTROLLER
390 void (*ndo_poll_controller)(struct net_device *dev);
391 int (*ndo_netpoll_setup)(struct net_device *dev,
392 struct netpoll_info *info);
393 void (*ndo_netpoll_cleanup)(struct net_device *dev);
394#endif
395 int (*ndo_set_vf_mac)(struct net_device *dev,
396 int queue, u8 *mac);
397 int (*ndo_set_vf_vlan)(struct net_device *dev,
398 int queue, u16 vlan,
399 u8 qos, __be16 proto);
400 int (*ndo_set_vf_rate)(struct net_device *dev,
401 int vf, int min_tx_rate,
402 int max_tx_rate);
403 int (*ndo_set_vf_spoofchk)(struct net_device *dev,
404 int vf, bool setting);
405 int (*ndo_set_vf_trust)(struct net_device *dev,
406 int vf, bool setting);
407 int (*ndo_get_vf_config)(struct net_device *dev,
408 int vf,
409 struct ifla_vf_info *ivf);
410 int (*ndo_set_vf_link_state)(struct net_device *dev,
411 int vf, int link_state);
412 int (*ndo_get_vf_stats)(struct net_device *dev,
413 int vf,
414 struct ifla_vf_stats
415 *vf_stats);
416 int (*ndo_set_vf_port)(struct net_device *dev,
417 int vf,
418 struct nlattr *port[]);
419 int (*ndo_get_vf_port)(struct net_device *dev,
420 int vf, struct sk_buff *skb);
421 int (*ndo_get_vf_guid)(struct net_device *dev,
422 int vf,
423 struct ifla_vf_guid *node_guid,
424 struct ifla_vf_guid *port_guid);
425 int (*ndo_set_vf_guid)(struct net_device *dev,
426 int vf, u64 guid,
427 int guid_type);
428 int (*ndo_set_vf_rss_query_en)(
429 struct net_device *dev,
430 int vf, bool setting);
431 int (*ndo_setup_tc)(struct net_device *dev,
432 enum tc_setup_type type,
433 void *type_data);
434#if IS_ENABLED(CONFIG_FCOE)
435 int (*ndo_fcoe_enable)(struct net_device *dev);
436 int (*ndo_fcoe_disable)(struct net_device *dev);
437 int (*ndo_fcoe_ddp_setup)(struct net_device *dev,
438 u16 xid,
439 struct scatterlist *sgl,
440 unsigned int sgc);
441 int (*ndo_fcoe_ddp_done)(struct net_device *dev,
442 u16 xid);
443 int (*ndo_fcoe_ddp_target)(struct net_device *dev,
444 u16 xid,
445 struct scatterlist *sgl,
446 unsigned int sgc);
447 int (*ndo_fcoe_get_hbainfo)(struct net_device *dev,
448 struct netdev_fcoe_hbainfo *hbainfo);
449#endif
450
451#if IS_ENABLED(CONFIG_LIBFCOE)
452#define NETDEV_FCOE_WWNN 0
453#define NETDEV_FCOE_WWPN 1
454 int (*ndo_fcoe_get_wwn)(struct net_device *dev,
455 u64 *wwn, int type);
456#endif
457
458#ifdef CONFIG_RFS_ACCEL
459 int (*ndo_rx_flow_steer)(struct net_device *dev,
460 const struct sk_buff *skb,
461 u16 rxq_index,
462 u32 flow_id);
463#endif
464 int (*ndo_add_slave)(struct net_device *dev,
465 struct net_device *slave_dev,
466 struct netlink_ext_ack *extack);
467 int (*ndo_del_slave)(struct net_device *dev,
468 struct net_device *slave_dev);
469 struct net_device* (*ndo_get_xmit_slave)(struct net_device *dev,
470 struct sk_buff *skb,
471 bool all_slaves);
472 struct net_device* (*ndo_sk_get_lower_dev)(struct net_device *dev,
473 struct sock *sk);
474 netdev_features_t (*ndo_fix_features)(struct net_device *dev,
475 netdev_features_t features);
476 int (*ndo_set_features)(struct net_device *dev,
477 netdev_features_t features);
478 int (*ndo_neigh_construct)(struct net_device *dev,
479 struct neighbour *n);
480 void (*ndo_neigh_destroy)(struct net_device *dev,
481 struct neighbour *n);
482
483 int (*ndo_fdb_add)(struct ndmsg *ndm,
484 struct nlattr *tb[],
485 struct net_device *dev,
486 const unsigned char *addr,
487 u16 vid,
488 u16 flags,
489 struct netlink_ext_ack *extack);
490 int (*ndo_fdb_del)(struct ndmsg *ndm,
491 struct nlattr *tb[],
492 struct net_device *dev,
493 const unsigned char *addr,
494 u16 vid, struct netlink_ext_ack *extack);
495 int (*ndo_fdb_del_bulk)(struct ndmsg *ndm,
496 struct nlattr *tb[],
497 struct net_device *dev,
498 u16 vid,
499 struct netlink_ext_ack *extack);
500 int (*ndo_fdb_dump)(struct sk_buff *skb,
501 struct netlink_callback *cb,
502 struct net_device *dev,
503 struct net_device *filter_dev,
504 int *idx);
505 int (*ndo_fdb_get)(struct sk_buff *skb,
506 struct nlattr *tb[],
507 struct net_device *dev,
508 const unsigned char *addr,
509 u16 vid, u32 portid, u32 seq,
510 struct netlink_ext_ack *extack);
511 int (*ndo_bridge_setlink)(struct net_device *dev,
512 struct nlmsghdr *nlh,
513 u16 flags,
514 struct netlink_ext_ack *extack);
515 int (*ndo_bridge_getlink)(struct sk_buff *skb,
516 u32 pid, u32 seq,
517 struct net_device *dev,
518 u32 filter_mask,
519 int nlflags);
520 int (*ndo_bridge_dellink)(struct net_device *dev,
521 struct nlmsghdr *nlh,
522 u16 flags);
523 int (*ndo_change_carrier)(struct net_device *dev,
524 bool new_carrier);
525 int (*ndo_get_phys_port_id)(struct net_device *dev,
526 struct netdev_phys_item_id *ppid);
527 int (*ndo_get_port_parent_id)(struct net_device *dev,
528 struct netdev_phys_item_id *ppid);
529 int (*ndo_get_phys_port_name)(struct net_device *dev,
530 char *name, size_t len);
531 void* (*ndo_dfwd_add_station)(struct net_device *pdev,
532 struct net_device *dev);
533 void (*ndo_dfwd_del_station)(struct net_device *pdev,
534 void *priv);
535
536 int (*ndo_set_tx_maxrate)(struct net_device *dev,
537 int queue_index,
538 u32 maxrate);
539 int (*ndo_get_iflink)(const struct net_device *dev);
540 int (*ndo_fill_metadata_dst)(struct net_device *dev,
541 struct sk_buff *skb);
542 void (*ndo_set_rx_headroom)(struct net_device *dev,
543 int needed_headroom);
544 int (*ndo_bpf)(struct net_device *dev,
545 struct netdev_bpf *bpf);
546 int (*ndo_xdp_xmit)(struct net_device *dev, int n,
547 struct xdp_frame **xdp,
548 u32 flags);
549 struct net_device * (*ndo_xdp_get_xmit_slave)(struct net_device *dev,
550 struct xdp_buff *xdp);
551 int (*ndo_xsk_wakeup)(struct net_device *dev,
552 u32 queue_id, u32 flags);
553 struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
554 int (*ndo_tunnel_ctl)(struct net_device *dev,
555 struct ip_tunnel_parm *p, int cmd);
556 struct net_device * (*ndo_get_peer_dev)(struct net_device *dev);
557 int (*ndo_fill_forward_path)(struct net_device_path_ctx *ctx,
558 struct net_device_path *path);
559 ktime_t (*ndo_get_tstamp)(struct net_device *dev,
560 const struct skb_shared_hwtstamps *hwtstamps,
561 bool cycles);
562};