/* SPDX-License-Identifier: GPL-2.0-or-later *//* * include/net/devlink.h - Network physical device Netlink interface * Copyright (c) 2016 Mellanox Technologies. All rights reserved. * Copyright (c) 2016 Jiri Pirko <jiri@mellanox.com> */#ifndef _NET_DEVLINK_H_#define _NET_DEVLINK_H_#include<linux/device.h>#include<linux/slab.h>#include<linux/gfp.h>#include<linux/list.h>#include<linux/netdevice.h>#include<linux/spinlock.h>#include<linux/workqueue.h>#include<linux/refcount.h>#include<net/net_namespace.h>#include<net/flow_offload.h>#include<uapi/linux/devlink.h>#include<linux/xarray.h>structdevlink_ops;structdevlink{structlist_headlist;structlist_headport_list;structlist_headsb_list;structlist_headdpipe_table_list;structlist_headresource_list;structlist_headparam_list;structlist_headregion_list;structlist_headreporter_list;structmutexreporters_lock;/* protects reporter_list */structdevlink_dpipe_headers*dpipe_headers;structlist_headtrap_list;structlist_headtrap_group_list;structlist_headtrap_policer_list;conststructdevlink_ops*ops;structxarraysnapshot_ids;structdevice*dev;possible_net_t_net;structmutexlock;u8reload_failed:1,reload_enabled:1,registered:1;charpriv[0]__aligned(NETDEV_ALIGN);};structdevlink_port_phys_attrs{u32port_number;/* Same value as "split group". * A physical port which is visible to the user * for a given port flavour. */u32split_subport_number;};structdevlink_port_pci_pf_attrs{u16pf;/* Associated PCI PF for this port. */};structdevlink_port_pci_vf_attrs{u16pf;/* Associated PCI PF for this port. */u16vf;/* Associated PCI VF for of the PCI PF for this port. */};structdevlink_port_attrs{u8set:1,split:1,switch_port:1;enumdevlink_port_flavourflavour;structnetdev_phys_item_idswitch_id;union{structdevlink_port_phys_attrsphys;structdevlink_port_pci_pf_attrspci_pf;structdevlink_port_pci_vf_attrspci_vf;};};structdevlink_po