18c2ecf20Sopenharmony_ci/* Broadcom NetXtreme-C/E network driver.
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * Copyright (c) 2014-2016 Broadcom Corporation
48c2ecf20Sopenharmony_ci * Copyright (c) 2016-2018 Broadcom Limited
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
78c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by
88c2ecf20Sopenharmony_ci * the Free Software Foundation.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef BNXT_DCB_H
128c2ecf20Sopenharmony_ci#define BNXT_DCB_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <net/dcbnl.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cistruct bnxt_dcb {
178c2ecf20Sopenharmony_ci	u8			max_tc;
188c2ecf20Sopenharmony_ci	struct ieee_pfc		*ieee_pfc;
198c2ecf20Sopenharmony_ci	struct ieee_ets		*ieee_ets;
208c2ecf20Sopenharmony_ci	u8			dcbx_cap;
218c2ecf20Sopenharmony_ci	u8			default_pri;
228c2ecf20Sopenharmony_ci};
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistruct bnxt_cos2bw_cfg {
258c2ecf20Sopenharmony_ci	u8			pad[3];
268c2ecf20Sopenharmony_ci	u8			queue_id;
278c2ecf20Sopenharmony_ci	__le32			min_bw;
288c2ecf20Sopenharmony_ci	__le32			max_bw;
298c2ecf20Sopenharmony_ci#define BW_VALUE_UNIT_PERCENT1_100		(0x1UL << 29)
308c2ecf20Sopenharmony_ci	u8			tsa;
318c2ecf20Sopenharmony_ci	u8			pri_lvl;
328c2ecf20Sopenharmony_ci	u8			bw_weight;
338c2ecf20Sopenharmony_ci	u8			unused;
348c2ecf20Sopenharmony_ci};
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistruct bnxt_dscp2pri_entry {
378c2ecf20Sopenharmony_ci	u8	dscp;
388c2ecf20Sopenharmony_ci	u8	mask;
398c2ecf20Sopenharmony_ci	u8	pri;
408c2ecf20Sopenharmony_ci};
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define BNXT_LLQ(q_profile)	\
438c2ecf20Sopenharmony_ci	((q_profile) ==		\
448c2ecf20Sopenharmony_ci	 QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE)
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define BNXT_CNPQ(q_profile)	\
478c2ecf20Sopenharmony_ci	((q_profile) ==		\
488c2ecf20Sopenharmony_ci	 QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL	0x0300
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_civoid bnxt_dcb_init(struct bnxt *bp);
538c2ecf20Sopenharmony_civoid bnxt_dcb_free(struct bnxt *bp);
548c2ecf20Sopenharmony_ci#endif
55