1 /* Broadcom NetXtreme-C/E network driver.
3 * Copyright (c) 2017 Broadcom Limited
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
10 #ifndef BNXT_DEVLINK_H
11 #define BNXT_DEVLINK_H
13 /* Struct to hold housekeeping info needed by devlink interface */
15 struct bnxt *bp; /* back ptr to the controlling dev */
18 static inline struct bnxt *bnxt_get_bp_from_dl(struct devlink *dl)
20 return ((struct bnxt_dl *)devlink_priv(dl))->bp;
23 /* To clear devlink pointer from bp, pass NULL dl */
24 static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)
28 /* add a back pointer in dl to bp */
30 struct bnxt_dl *bp_dl = devlink_priv(dl);
36 #define NVM_OFF_MSIX_VEC_PER_PF_MAX 108
37 #define NVM_OFF_MSIX_VEC_PER_PF_MIN 114
38 #define NVM_OFF_IGNORE_ARI 164
39 #define NVM_OFF_DIS_GRE_VER_CHECK 171
40 #define NVM_OFF_ENABLE_SRIOV 401
41 #define NVM_OFF_NVM_CFG_VER 602
43 #define BNXT_NVM_CFG_VER_BITS 24
44 #define BNXT_NVM_CFG_VER_BYTES 4
46 #define BNXT_MSIX_VEC_MAX 512
47 #define BNXT_MSIX_VEC_MIN_MAX 128
49 enum bnxt_nvm_dir_type {
50 BNXT_NVM_SHARED_CFG = 40,
55 struct bnxt_dl_nvm_param {
63 enum bnxt_dl_version_type {
69 void bnxt_devlink_health_report(struct bnxt *bp, unsigned long event);
70 void bnxt_dl_health_status_update(struct bnxt *bp, bool healthy);
71 void bnxt_dl_health_recovery_done(struct bnxt *bp);
72 void bnxt_dl_fw_reporters_create(struct bnxt *bp);
73 void bnxt_dl_fw_reporters_destroy(struct bnxt *bp, bool all);
74 int bnxt_dl_register(struct bnxt *bp);
75 void bnxt_dl_unregister(struct bnxt *bp);
77 #endif /* BNXT_DEVLINK_H */