// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2023 Intel Corporation. */ #include <net/devlink.h> #include "i40e.h" #include "i40e_devlink.h" static void i40e_info_get_dsn(struct i40e_pf *pf, char *buf, size_t len) { … } static void i40e_info_fw_mgmt(struct i40e_hw *hw, char *buf, size_t len) { … } static void i40e_info_fw_mgmt_build(struct i40e_hw *hw, char *buf, size_t len) { … } static void i40e_info_fw_api(struct i40e_hw *hw, char *buf, size_t len) { … } static void i40e_info_pba(struct i40e_hw *hw, char *buf, size_t len) { … } enum i40e_devlink_version_type { … }; static int i40e_devlink_info_put(struct devlink_info_req *req, enum i40e_devlink_version_type type, const char *key, const char *value) { … } static int i40e_devlink_info_get(struct devlink *dl, struct devlink_info_req *req, struct netlink_ext_ack *extack) { … } static const struct devlink_ops i40e_devlink_ops = …; /** * i40e_alloc_pf - Allocate devlink and return i40e_pf structure pointer * @dev: the device to allocate for * * Allocate a devlink instance for this device and return the private * area as the i40e_pf structure. **/ struct i40e_pf *i40e_alloc_pf(struct device *dev) { … } /** * i40e_free_pf - Free i40e_pf structure and associated devlink * @pf: the PF structure * * Free i40e_pf structure and devlink allocated by devlink_alloc. **/ void i40e_free_pf(struct i40e_pf *pf) { … } /** * i40e_devlink_register - Register devlink interface for this PF * @pf: the PF to register the devlink for. * * Register the devlink instance associated with this physical function. **/ void i40e_devlink_register(struct i40e_pf *pf) { … } /** * i40e_devlink_unregister - Unregister devlink resources for this PF. * @pf: the PF structure to cleanup * * Releases resources used by devlink and cleans up associated memory. **/ void i40e_devlink_unregister(struct i40e_pf *pf) { … } /** * i40e_devlink_set_switch_id - Set unique switch id based on pci dsn * @pf: the PF to create a devlink port for * @ppid: struct with switch id information */ static void i40e_devlink_set_switch_id(struct i40e_pf *pf, struct netdev_phys_item_id *ppid) { … } /** * i40e_devlink_create_port - Create a devlink port for this PF * @pf: the PF to create a port for * * Create and register a devlink_port for this PF. Note that although each * physical function is connected to a separate devlink instance, the port * will still be numbered according to the physical function id. * * Return: zero on success or an error code on failure. **/ int i40e_devlink_create_port(struct i40e_pf *pf) { … } /** * i40e_devlink_destroy_port - Destroy the devlink_port for this PF * @pf: the PF to cleanup * * Unregisters the devlink_port structure associated with this PF. **/ void i40e_devlink_destroy_port(struct i40e_pf *pf) { … }