18c2ecf20Sopenharmony_ci/* Broadcom NetXtreme-C/E network driver. 28c2ecf20Sopenharmony_ci * 38c2ecf20Sopenharmony_ci * Copyright (c) 2016-2017 Broadcom Limited 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 68c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by 78c2ecf20Sopenharmony_ci * the Free Software Foundation. 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#ifndef BNXT_VFR_H 118c2ecf20Sopenharmony_ci#define BNXT_VFR_H 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#ifdef CONFIG_BNXT_SRIOV 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define MAX_CFA_CODE 65536 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_civoid bnxt_vf_reps_destroy(struct bnxt *bp); 188c2ecf20Sopenharmony_civoid bnxt_vf_reps_close(struct bnxt *bp); 198c2ecf20Sopenharmony_civoid bnxt_vf_reps_open(struct bnxt *bp); 208c2ecf20Sopenharmony_civoid bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb); 218c2ecf20Sopenharmony_cistruct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code); 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_cistatic inline u16 bnxt_vf_rep_get_fid(struct net_device *dev) 248c2ecf20Sopenharmony_ci{ 258c2ecf20Sopenharmony_ci struct bnxt_vf_rep *vf_rep = netdev_priv(dev); 268c2ecf20Sopenharmony_ci struct bnxt *bp = vf_rep->bp; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci return bp->pf.vf[vf_rep->vf_idx].fw_fid; 298c2ecf20Sopenharmony_ci} 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_cibool bnxt_dev_is_vf_rep(struct net_device *dev); 328c2ecf20Sopenharmony_ciint bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode); 338c2ecf20Sopenharmony_ciint bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode, 348c2ecf20Sopenharmony_ci struct netlink_ext_ack *extack); 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#else 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_cistatic inline void bnxt_vf_reps_close(struct bnxt *bp) 398c2ecf20Sopenharmony_ci{ 408c2ecf20Sopenharmony_ci} 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_cistatic inline void bnxt_vf_reps_open(struct bnxt *bp) 438c2ecf20Sopenharmony_ci{ 448c2ecf20Sopenharmony_ci} 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_cistatic inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb) 478c2ecf20Sopenharmony_ci{ 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistatic inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code) 518c2ecf20Sopenharmony_ci{ 528c2ecf20Sopenharmony_ci return NULL; 538c2ecf20Sopenharmony_ci} 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_cistatic inline u16 bnxt_vf_rep_get_fid(struct net_device *dev) 568c2ecf20Sopenharmony_ci{ 578c2ecf20Sopenharmony_ci return 0; 588c2ecf20Sopenharmony_ci} 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_cistatic inline bool bnxt_dev_is_vf_rep(struct net_device *dev) 618c2ecf20Sopenharmony_ci{ 628c2ecf20Sopenharmony_ci return false; 638c2ecf20Sopenharmony_ci} 648c2ecf20Sopenharmony_ci#endif /* CONFIG_BNXT_SRIOV */ 658c2ecf20Sopenharmony_ci#endif /* BNXT_VFR_H */ 66