1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /****************************************************************************
3  * Driver for AMD network controllers and boards
4  * Copyright (C) 2023, Advanced Micro Devices, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published
8  * by the Free Software Foundation, incorporated herein by reference.
9  */
10 
11 #ifndef _EFX_DEVLINK_H
12 #define _EFX_DEVLINK_H
13 
14 #include "net_driver.h"
15 #include <net/devlink.h>
16 
17 /* Custom devlink-info version object names for details that do not map to the
18  * generic standardized names.
19  */
20 #define EFX_DEVLINK_INFO_VERSION_FW_MGMT_SUC	"fw.mgmt.suc"
21 #define EFX_DEVLINK_INFO_VERSION_FW_MGMT_CMC	"fw.mgmt.cmc"
22 #define EFX_DEVLINK_INFO_VERSION_FPGA_REV	"fpga.rev"
23 #define EFX_DEVLINK_INFO_VERSION_DATAPATH_HW	"fpga.app"
24 #define EFX_DEVLINK_INFO_VERSION_DATAPATH_FW	DEVLINK_INFO_VERSION_GENERIC_FW_APP
25 #define EFX_DEVLINK_INFO_VERSION_SOC_BOOT	"coproc.boot"
26 #define EFX_DEVLINK_INFO_VERSION_SOC_UBOOT	"coproc.uboot"
27 #define EFX_DEVLINK_INFO_VERSION_SOC_MAIN	"coproc.main"
28 #define EFX_DEVLINK_INFO_VERSION_SOC_RECOVERY	"coproc.recovery"
29 #define EFX_DEVLINK_INFO_VERSION_FW_EXPROM	"fw.exprom"
30 #define EFX_DEVLINK_INFO_VERSION_FW_UEFI	"fw.uefi"
31 
32 #define EFX_MAX_VERSION_INFO_LEN	64
33 
34 int efx_probe_devlink_and_lock(struct efx_nic *efx);
35 void efx_probe_devlink_unlock(struct efx_nic *efx);
36 void efx_fini_devlink_lock(struct efx_nic *efx);
37 void efx_fini_devlink_and_unlock(struct efx_nic *efx);
38 
39 #ifdef CONFIG_SFC_SRIOV
40 struct efx_rep;
41 
42 void ef100_pf_set_devlink_port(struct efx_nic *efx);
43 void ef100_rep_set_devlink_port(struct efx_rep *efv);
44 void ef100_pf_unset_devlink_port(struct efx_nic *efx);
45 void ef100_rep_unset_devlink_port(struct efx_rep *efv);
46 #endif
47 #endif	/* _EFX_DEVLINK_H */
48