1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Marvell RVU REPRESENTOR driver 3 * 4 * Copyright (C) 2024 Marvell. 5 * 6 */ 7 8 #ifndef REP_H 9 #define REP_H 10 11 #include <linux/pci.h> 12 13 #include "otx2_reg.h" 14 #include "otx2_txrx.h" 15 #include "otx2_common.h" 16 17 #define PCI_DEVID_RVU_REP 0xA0E0 18 19 #define RVU_MAX_REP OTX2_MAX_CQ_CNT 20 21 struct rep_stats { 22 u64 rx_bytes; 23 u64 rx_frames; 24 u64 rx_drops; 25 u64 rx_mcast_frames; 26 27 u64 tx_bytes; 28 u64 tx_frames; 29 u64 tx_drops; 30 }; 31 32 struct rep_dev { 33 struct otx2_nic *mdev; 34 struct net_device *netdev; 35 struct rep_stats stats; 36 struct delayed_work stats_wrk; 37 struct devlink_port dl_port; 38 struct otx2_flow_config *flow_cfg; 39 #define RVU_REP_VF_INITIALIZED BIT_ULL(0) 40 u64 flags; 41 u16 rep_id; 42 u16 pcifunc; 43 u8 mac[ETH_ALEN]; 44 }; 45 46 static inline bool otx2_rep_dev(struct pci_dev *pdev) 47 { 48 return pdev->device == PCI_DEVID_RVU_REP; 49 } 50 51 int rvu_rep_create(struct otx2_nic *priv, struct netlink_ext_ack *extack); 52 void rvu_rep_destroy(struct otx2_nic *priv); 53 int rvu_event_up_notify(struct otx2_nic *pf, struct rep_event *info); 54 #endif /* REP_H */ 55