Back to home page

OSCL-LXR

 
 

    


0001 /* Broadcom NetXtreme-C/E network driver.
0002  *
0003  * Copyright (c) 2017 Broadcom Limited
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation.
0008  */
0009 
0010 #ifndef BNXT_DEVLINK_H
0011 #define BNXT_DEVLINK_H
0012 
0013 /* Struct to hold housekeeping info needed by devlink interface */
0014 struct bnxt_dl {
0015     struct bnxt *bp;    /* back ptr to the controlling dev */
0016     bool remote_reset;
0017 };
0018 
0019 static inline struct bnxt *bnxt_get_bp_from_dl(struct devlink *dl)
0020 {
0021     return ((struct bnxt_dl *)devlink_priv(dl))->bp;
0022 }
0023 
0024 static inline void bnxt_dl_remote_reload(struct bnxt *bp)
0025 {
0026     devlink_remote_reload_actions_performed(bp->dl, 0,
0027                         BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT) |
0028                         BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE));
0029 }
0030 
0031 static inline bool bnxt_dl_get_remote_reset(struct devlink *dl)
0032 {
0033     return ((struct bnxt_dl *)devlink_priv(dl))->remote_reset;
0034 }
0035 
0036 static inline void bnxt_dl_set_remote_reset(struct devlink *dl, bool value)
0037 {
0038     ((struct bnxt_dl *)devlink_priv(dl))->remote_reset = value;
0039 }
0040 
0041 #define NVM_OFF_MSIX_VEC_PER_PF_MAX 108
0042 #define NVM_OFF_MSIX_VEC_PER_PF_MIN 114
0043 #define NVM_OFF_IGNORE_ARI      164
0044 #define NVM_OFF_DIS_GRE_VER_CHECK   171
0045 #define NVM_OFF_ENABLE_SRIOV        401
0046 #define NVM_OFF_NVM_CFG_VER     602
0047 
0048 #define BNXT_NVM_CFG_VER_BITS       8
0049 #define BNXT_NVM_CFG_VER_BYTES      1
0050 
0051 #define BNXT_MSIX_VEC_MAX   512
0052 #define BNXT_MSIX_VEC_MIN_MAX   128
0053 
0054 enum bnxt_nvm_dir_type {
0055     BNXT_NVM_SHARED_CFG = 40,
0056     BNXT_NVM_PORT_CFG,
0057     BNXT_NVM_FUNC_CFG,
0058 };
0059 
0060 struct bnxt_dl_nvm_param {
0061     u16 id;
0062     u16 offset;
0063     u16 dir_type;
0064     u16 nvm_num_bits;
0065     u8 dl_num_bytes;
0066 };
0067 
0068 enum bnxt_dl_version_type {
0069     BNXT_VERSION_FIXED,
0070     BNXT_VERSION_RUNNING,
0071     BNXT_VERSION_STORED,
0072 };
0073 
0074 void bnxt_devlink_health_fw_report(struct bnxt *bp);
0075 void bnxt_dl_health_fw_status_update(struct bnxt *bp, bool healthy);
0076 void bnxt_dl_health_fw_recovery_done(struct bnxt *bp);
0077 void bnxt_dl_fw_reporters_create(struct bnxt *bp);
0078 void bnxt_dl_fw_reporters_destroy(struct bnxt *bp);
0079 int bnxt_dl_register(struct bnxt *bp);
0080 void bnxt_dl_unregister(struct bnxt *bp);
0081 
0082 #endif /* BNXT_DEVLINK_H */