1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
11 #include <linux/types.h>
12 #include <linux/slab.h>
17 #include "qed_reg_addr.h"
19 #define DCBX_CONFIG_MAX_APP_PROTOCOL 4
21 enum qed_mib_read_type {
22 QED_DCBX_OPERATIONAL_MIB,
25 QED_DCBX_REMOTE_LLDP_MIB,
26 QED_DCBX_LOCAL_LLDP_MIB
29 struct qed_dcbx_app_data {
30 bool enable; /* DCB enabled */
31 bool update; /* Update indication */
32 u8 priority; /* Priority */
33 u8 tc; /* Traffic Class */
36 struct qed_dcbx_results {
39 struct qed_dcbx_app_data arr[DCBX_MAX_PROTOCOL_TYPE];
42 struct qed_dcbx_app_metadata {
43 enum dcbx_protocol_type id;
45 enum qed_pci_personality personality;
48 #define QED_MFW_GET_FIELD(name, field) \
49 (((name) & (field ## _MASK)) >> (field ## _SHIFT))
51 struct qed_dcbx_info {
52 struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS];
53 struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS];
54 struct dcbx_local_params local_admin;
55 struct qed_dcbx_results results;
56 struct dcbx_mib operational;
57 struct dcbx_mib remote;
61 struct qed_dcbx_mib_meta_data {
62 struct lldp_config_params_s *lldp_local;
63 struct lldp_status_params_s *lldp_remote;
64 struct dcbx_local_params *local_admin;
70 /* QED local interface routines */
72 qed_dcbx_mib_update_event(struct qed_hwfn *,
73 struct qed_ptt *, enum qed_mib_read_type);
75 int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn);
76 void qed_dcbx_info_free(struct qed_hwfn *, struct qed_dcbx_info *);
77 void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
78 struct pf_update_ramrod_data *p_dest);