Back to home page

OSCL-LXR

 
 

    


0001 /* Broadcom NetXtreme-C/E network driver.
0002  *
0003  * Copyright (c) 2016-2017 Broadcom Limited
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation.
0008  */
0009 
0010 #ifndef BNXT_VFR_H
0011 #define BNXT_VFR_H
0012 
0013 #ifdef CONFIG_BNXT_SRIOV
0014 
0015 #define MAX_CFA_CODE            65536
0016 
0017 void bnxt_vf_reps_destroy(struct bnxt *bp);
0018 void bnxt_vf_reps_close(struct bnxt *bp);
0019 void bnxt_vf_reps_open(struct bnxt *bp);
0020 void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb);
0021 struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code);
0022 int bnxt_vf_reps_alloc(struct bnxt *bp);
0023 void bnxt_vf_reps_free(struct bnxt *bp);
0024 
0025 static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
0026 {
0027     struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
0028     struct bnxt *bp = vf_rep->bp;
0029 
0030     return bp->pf.vf[vf_rep->vf_idx].fw_fid;
0031 }
0032 
0033 bool bnxt_dev_is_vf_rep(struct net_device *dev);
0034 int bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode);
0035 int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
0036                  struct netlink_ext_ack *extack);
0037 
0038 #else
0039 
0040 static inline void bnxt_vf_reps_close(struct bnxt *bp)
0041 {
0042 }
0043 
0044 static inline void bnxt_vf_reps_open(struct bnxt *bp)
0045 {
0046 }
0047 
0048 static inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
0049 {
0050 }
0051 
0052 static inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
0053 {
0054     return NULL;
0055 }
0056 
0057 static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
0058 {
0059     return 0;
0060 }
0061 
0062 static inline bool bnxt_dev_is_vf_rep(struct net_device *dev)
0063 {
0064     return false;
0065 }
0066 
0067 static inline int bnxt_vf_reps_alloc(struct bnxt *bp)
0068 {
0069     return 0;
0070 }
0071 
0072 static inline void bnxt_vf_reps_free(struct bnxt *bp)
0073 {
0074 }
0075 
0076 #endif /* CONFIG_BNXT_SRIOV */
0077 #endif /* BNXT_VFR_H */