treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / ethernet / broadcom / bnxt / bnxt_vfr.h
blobd7287651422f34c2c94eb37195e8a9326197f6b8
1 /* Broadcom NetXtreme-C/E network driver.
3 * Copyright (c) 2016-2017 Broadcom Limited
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
8 */
10 #ifndef BNXT_VFR_H
11 #define BNXT_VFR_H
13 #ifdef CONFIG_BNXT_SRIOV
15 #define MAX_CFA_CODE 65536
17 void bnxt_vf_reps_destroy(struct bnxt *bp);
18 void bnxt_vf_reps_close(struct bnxt *bp);
19 void bnxt_vf_reps_open(struct bnxt *bp);
20 void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb);
21 struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code);
23 static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
25 struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
26 struct bnxt *bp = vf_rep->bp;
28 return bp->pf.vf[vf_rep->vf_idx].fw_fid;
31 bool bnxt_dev_is_vf_rep(struct net_device *dev);
32 int bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode);
33 int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
34 struct netlink_ext_ack *extack);
36 #else
38 static inline void bnxt_vf_reps_close(struct bnxt *bp)
42 static inline void bnxt_vf_reps_open(struct bnxt *bp)
46 static inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
50 static inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
52 return NULL;
55 static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
57 return 0;
60 static inline bool bnxt_dev_is_vf_rep(struct net_device *dev)
62 return false;
64 #endif /* CONFIG_BNXT_SRIOV */
65 #endif /* BNXT_VFR_H */