Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright (c) 2018, Intel Corporation. */
0003 
0004 #ifndef _ICE_VF_MBX_H_
0005 #define _ICE_VF_MBX_H_
0006 
0007 #include "ice_type.h"
0008 #include "ice_controlq.h"
0009 
0010 /* Defining the mailbox message threshold as 63 asynchronous
0011  * pending messages. Normal VF functionality does not require
0012  * sending more than 63 asynchronous pending message.
0013  */
0014 #define ICE_ASYNC_VF_MSG_THRESHOLD  63
0015 
0016 #ifdef CONFIG_PCI_IOV
0017 int
0018 ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval,
0019               u8 *msg, u16 msglen, struct ice_sq_cd *cd);
0020 
0021 u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 link_speed);
0022 int
0023 ice_mbx_vf_state_handler(struct ice_hw *hw, struct ice_mbx_data *mbx_data,
0024              u16 vf_id, bool *is_mal_vf);
0025 int
0026 ice_mbx_clear_malvf(struct ice_mbx_snapshot *snap, unsigned long *all_malvfs,
0027             u16 bitmap_len, u16 vf_id);
0028 int ice_mbx_init_snapshot(struct ice_hw *hw, u16 vf_count);
0029 void ice_mbx_deinit_snapshot(struct ice_hw *hw);
0030 int
0031 ice_mbx_report_malvf(struct ice_hw *hw, unsigned long *all_malvfs,
0032              u16 bitmap_len, u16 vf_id, bool *report_malvf);
0033 #else /* CONFIG_PCI_IOV */
0034 static inline int
0035 ice_aq_send_msg_to_vf(struct ice_hw __always_unused *hw,
0036               u16 __always_unused vfid, u32 __always_unused v_opcode,
0037               u32 __always_unused v_retval, u8 __always_unused *msg,
0038               u16 __always_unused msglen,
0039               struct ice_sq_cd __always_unused *cd)
0040 {
0041     return 0;
0042 }
0043 
0044 static inline u32
0045 ice_conv_link_speed_to_virtchnl(bool __always_unused adv_link_support,
0046                 u16 __always_unused link_speed)
0047 {
0048     return 0;
0049 }
0050 
0051 #endif /* CONFIG_PCI_IOV */
0052 #endif /* _ICE_VF_MBX_H_ */