/* SPDX-License-Identifier: GPL-2.0 */ /* Marvell CN10K RPM driver * * Copyright (C) 2020 Marvell. * */ #ifndef LMAC_COMMON_H #define LMAC_COMMON_H #include "rvu.h" #include "cgx.h" /** * struct lmac - per lmac locks and properties * @wq_cmd_cmplt: waitq to keep the process blocked until cmd completion * @cmd_lock: Lock to serialize the command interface * @resp: command response * @link_info: link related information * @mac_to_index_bmap: Mac address to CGX table index mapping * @rx_fc_pfvf_bmap: Receive flow control enabled netdev mapping * @tx_fc_pfvf_bmap: Transmit flow control enabled netdev mapping * @event_cb: callback for linkchange events * @event_cb_lock: lock for serializing callback with unregister * @cgx: parent cgx port * @mcast_filters_count: Number of multicast filters installed * @lmac_id: lmac port id * @lmac_type: lmac type like SGMII/XAUI * @cmd_pend: flag set before new command is started * flag cleared after command response is received * @name: lmac port name */ struct lmac { … }; /* CGX & RPM has different feature set * update the structure fields with different one */ struct mac_ops { … }; struct cgx { … }; rpm_t; /* Function Declarations */ void cgx_write(struct cgx *cgx, u64 lmac, u64 offset, u64 val); u64 cgx_read(struct cgx *cgx, u64 lmac, u64 offset); struct lmac *lmac_pdata(u8 lmac_id, struct cgx *cgx); int cgx_fwi_cmd_send(u64 req, u64 *resp, struct lmac *lmac); int cgx_fwi_cmd_generic(u64 req, u64 *resp, struct cgx *cgx, int lmac_id); bool is_lmac_valid(struct cgx *cgx, int lmac_id); struct mac_ops *rpm_get_mac_ops(struct cgx *cgx); #endif /* LMAC_COMMON_H */