提交 a1d8d8a5 编写于 作者: S Sudarsana Reddy Kalluru 提交者: David S. Miller

qed: Add dcbnl support.

This patch adds the implementation for both cee/ieee dcbnl callbacks by
using the qed query/config APIs.
Signed-off-by: NSudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6ad8c632
......@@ -2166,10 +2166,17 @@ static int qed_fp_cqe_completion(struct qed_dev *dev,
extern const struct qed_iov_hv_ops qed_iov_ops_pass;
#endif
#ifdef CONFIG_DCB
extern const struct qed_eth_dcbnl_ops qed_dcbnl_ops_pass;
#endif
static const struct qed_eth_ops qed_eth_ops_pass = {
.common = &qed_common_ops_pass,
#ifdef CONFIG_QED_SRIOV
.iov = &qed_iov_ops_pass,
#endif
#ifdef CONFIG_DCB
.dcb = &qed_dcbnl_ops_pass,
#endif
.fill_dev_info = &qed_fill_eth_dev_info,
.register_ops = &qed_register_eth_ops,
......
......@@ -128,11 +128,73 @@ struct qed_eth_cb_ops {
void (*force_mac) (void *dev, u8 *mac);
};
#ifdef CONFIG_DCB
/* Prototype declaration of qed_eth_dcbnl_ops should match with the declaration
* of dcbnl_rtnl_ops structure.
*/
struct qed_eth_dcbnl_ops {
/* IEEE 802.1Qaz std */
int (*ieee_getpfc)(struct qed_dev *cdev, struct ieee_pfc *pfc);
int (*ieee_setpfc)(struct qed_dev *cdev, struct ieee_pfc *pfc);
int (*ieee_getets)(struct qed_dev *cdev, struct ieee_ets *ets);
int (*ieee_setets)(struct qed_dev *cdev, struct ieee_ets *ets);
int (*ieee_peer_getets)(struct qed_dev *cdev, struct ieee_ets *ets);
int (*ieee_peer_getpfc)(struct qed_dev *cdev, struct ieee_pfc *pfc);
int (*ieee_getapp)(struct qed_dev *cdev, struct dcb_app *app);
int (*ieee_setapp)(struct qed_dev *cdev, struct dcb_app *app);
/* CEE std */
u8 (*getstate)(struct qed_dev *cdev);
u8 (*setstate)(struct qed_dev *cdev, u8 state);
void (*getpgtccfgtx)(struct qed_dev *cdev, int prio, u8 *prio_type,
u8 *pgid, u8 *bw_pct, u8 *up_map);
void (*getpgbwgcfgtx)(struct qed_dev *cdev, int pgid, u8 *bw_pct);
void (*getpgtccfgrx)(struct qed_dev *cdev, int prio, u8 *prio_type,
u8 *pgid, u8 *bw_pct, u8 *up_map);
void (*getpgbwgcfgrx)(struct qed_dev *cdev, int pgid, u8 *bw_pct);
void (*getpfccfg)(struct qed_dev *cdev, int prio, u8 *setting);
void (*setpfccfg)(struct qed_dev *cdev, int prio, u8 setting);
u8 (*getcap)(struct qed_dev *cdev, int capid, u8 *cap);
int (*getnumtcs)(struct qed_dev *cdev, int tcid, u8 *num);
u8 (*getpfcstate)(struct qed_dev *cdev);
int (*getapp)(struct qed_dev *cdev, u8 idtype, u16 id);
u8 (*getfeatcfg)(struct qed_dev *cdev, int featid, u8 *flags);
/* DCBX configuration */
u8 (*getdcbx)(struct qed_dev *cdev);
void (*setpgtccfgtx)(struct qed_dev *cdev, int prio,
u8 pri_type, u8 pgid, u8 bw_pct, u8 up_map);
void (*setpgtccfgrx)(struct qed_dev *cdev, int prio,
u8 pri_type, u8 pgid, u8 bw_pct, u8 up_map);
void (*setpgbwgcfgtx)(struct qed_dev *cdev, int pgid, u8 bw_pct);
void (*setpgbwgcfgrx)(struct qed_dev *cdev, int pgid, u8 bw_pct);
u8 (*setall)(struct qed_dev *cdev);
int (*setnumtcs)(struct qed_dev *cdev, int tcid, u8 num);
void (*setpfcstate)(struct qed_dev *cdev, u8 state);
int (*setapp)(struct qed_dev *cdev, u8 idtype, u16 idval, u8 up);
u8 (*setdcbx)(struct qed_dev *cdev, u8 state);
u8 (*setfeatcfg)(struct qed_dev *cdev, int featid, u8 flags);
/* Peer apps */
int (*peer_getappinfo)(struct qed_dev *cdev,
struct dcb_peer_app_info *info,
u16 *app_count);
int (*peer_getapptable)(struct qed_dev *cdev, struct dcb_app *table);
/* CEE peer */
int (*cee_peer_getpfc)(struct qed_dev *cdev, struct cee_pfc *pfc);
int (*cee_peer_getpg)(struct qed_dev *cdev, struct cee_pg *pg);
};
#endif
struct qed_eth_ops {
const struct qed_common_ops *common;
#ifdef CONFIG_QED_SRIOV
const struct qed_iov_hv_ops *iov;
#endif
#ifdef CONFIG_DCB
const struct qed_eth_dcbnl_ops *dcb;
#endif
int (*fill_dev_info)(struct qed_dev *cdev,
struct qed_dev_eth_info *info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册