xref: /linux/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx.h (revision 24f171c7e145f43b9f187578e89b0982ce87e54c)
1*4543534cSDong Yibo /* SPDX-License-Identifier: GPL-2.0 */
2*4543534cSDong Yibo /* Copyright(c) 2020 - 2025 Mucse Corporation. */
3*4543534cSDong Yibo 
4*4543534cSDong Yibo #ifndef _RNPGBE_MBX_H
5*4543534cSDong Yibo #define _RNPGBE_MBX_H
6*4543534cSDong Yibo 
7*4543534cSDong Yibo #include "rnpgbe.h"
8*4543534cSDong Yibo 
9*4543534cSDong Yibo #define MUCSE_MBX_FW2PF_CNT       0
10*4543534cSDong Yibo #define MUCSE_MBX_PF2FW_CNT       4
11*4543534cSDong Yibo #define MUCSE_MBX_FWPF_SHM        8
12*4543534cSDong Yibo #define MUCSE_MBX_PF2FW_CTRL(mbx) ((mbx)->pf2fw_mbx_ctrl)
13*4543534cSDong Yibo #define MUCSE_MBX_FWPF_MASK(mbx)  ((mbx)->fwpf_mbx_mask)
14*4543534cSDong Yibo #define MUCSE_MBX_REQ             BIT(0) /* Request a req to mailbox */
15*4543534cSDong Yibo #define MUCSE_MBX_PFU             BIT(3) /* PF owns the mailbox buffer */
16*4543534cSDong Yibo 
17*4543534cSDong Yibo int mucse_write_and_wait_ack_mbx(struct mucse_hw *hw, u32 *msg, u16 size);
18*4543534cSDong Yibo void mucse_init_mbx_params_pf(struct mucse_hw *hw);
19*4543534cSDong Yibo int mucse_poll_and_read_mbx(struct mucse_hw *hw, u32 *msg, u16 size);
20*4543534cSDong Yibo #endif /* _RNPGBE_MBX_H */
21