Lines Matching +full:charge +full:- +full:delay

9  * Copyright (c) 2014-2016 Advanced Micro Devices, Inc.
34 * granted, free of charge, to any person obtaining a copy of this software
59 * Copyright (c) 2014-2016 Advanced Micro Devices, Inc.
94 * granted, free of charge, to any person obtaining a copy of this software
121 #include "xgbe-common.h"
129 ets->ets_cap = pdata->hw_feat.tc_cnt; in xgbe_dcb_ieee_getets()
131 if (pdata->ets) { in xgbe_dcb_ieee_getets()
132 ets->cbs = pdata->ets->cbs; in xgbe_dcb_ieee_getets()
133 memcpy(ets->tc_tx_bw, pdata->ets->tc_tx_bw, in xgbe_dcb_ieee_getets()
134 sizeof(ets->tc_tx_bw)); in xgbe_dcb_ieee_getets()
135 memcpy(ets->tc_tsa, pdata->ets->tc_tsa, in xgbe_dcb_ieee_getets()
136 sizeof(ets->tc_tsa)); in xgbe_dcb_ieee_getets()
137 memcpy(ets->prio_tc, pdata->ets->prio_tc, in xgbe_dcb_ieee_getets()
138 sizeof(ets->prio_tc)); in xgbe_dcb_ieee_getets()
156 ets->tc_tx_bw[i], ets->tc_rx_bw[i], in xgbe_dcb_ieee_setets()
157 ets->tc_tsa[i]); in xgbe_dcb_ieee_setets()
159 ets->prio_tc[i]); in xgbe_dcb_ieee_setets()
161 max_tc = max_t(u8, max_tc, ets->prio_tc[i]); in xgbe_dcb_ieee_setets()
162 if ((ets->tc_tx_bw[i] || ets->tc_tsa[i])) in xgbe_dcb_ieee_setets()
165 switch (ets->tc_tsa[i]) { in xgbe_dcb_ieee_setets()
170 tc_ets_weight += ets->tc_tx_bw[i]; in xgbe_dcb_ieee_setets()
175 ets->tc_tsa[i]); in xgbe_dcb_ieee_setets()
176 return -EINVAL; in xgbe_dcb_ieee_setets()
181 if (max_tc >= pdata->hw_feat.tc_cnt) { in xgbe_dcb_ieee_setets()
184 return -EINVAL; in xgbe_dcb_ieee_setets()
192 return -EINVAL; in xgbe_dcb_ieee_setets()
195 if (!pdata->ets) { in xgbe_dcb_ieee_setets()
196 pdata->ets = devm_kzalloc(pdata->dev, sizeof(*pdata->ets), in xgbe_dcb_ieee_setets()
198 if (!pdata->ets) in xgbe_dcb_ieee_setets()
199 return -ENOMEM; in xgbe_dcb_ieee_setets()
202 pdata->num_tcs = max_tc + 1; in xgbe_dcb_ieee_setets()
203 memcpy(pdata->ets, ets, sizeof(*pdata->ets)); in xgbe_dcb_ieee_setets()
205 pdata->hw_if.config_dcb_tc(pdata); in xgbe_dcb_ieee_setets()
216 pfc->pfc_cap = pdata->hw_feat.tc_cnt; in xgbe_dcb_ieee_getpfc()
218 if (pdata->pfc) { in xgbe_dcb_ieee_getpfc()
219 pfc->pfc_en = pdata->pfc->pfc_en; in xgbe_dcb_ieee_getpfc()
220 pfc->mbc = pdata->pfc->mbc; in xgbe_dcb_ieee_getpfc()
221 pfc->delay = pdata->pfc->delay; in xgbe_dcb_ieee_getpfc()
233 "cap=%d, en=%#x, mbc=%d, delay=%d\n", in xgbe_dcb_ieee_setpfc()
234 pfc->pfc_cap, pfc->pfc_en, pfc->mbc, pfc->delay); in xgbe_dcb_ieee_setpfc()
237 if (pfc->pfc_en & ~((1 << pdata->hw_feat.tc_cnt) - 1)) { in xgbe_dcb_ieee_setpfc()
240 return -EINVAL; in xgbe_dcb_ieee_setpfc()
243 if (!pdata->pfc) { in xgbe_dcb_ieee_setpfc()
244 pdata->pfc = devm_kzalloc(pdata->dev, sizeof(*pdata->pfc), in xgbe_dcb_ieee_setpfc()
246 if (!pdata->pfc) in xgbe_dcb_ieee_setpfc()
247 return -ENOMEM; in xgbe_dcb_ieee_setpfc()
250 memcpy(pdata->pfc, pfc, sizeof(*pdata->pfc)); in xgbe_dcb_ieee_setpfc()
252 pdata->hw_if.config_dcb_pfc(pdata); in xgbe_dcb_ieee_setpfc()