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
124 ets->ets_cap = pdata->hw_feat.tc_cnt;
126 if (pdata->ets) {
127 ets->cbs = pdata->ets->cbs;
128 memcpy(ets->tc_tx_bw, pdata->ets->tc_tx_bw,
129 sizeof(ets->tc_tx_bw));
130 memcpy(ets->tc_tsa, pdata->ets->tc_tsa,
131 sizeof(ets->tc_tsa));
132 memcpy(ets->prio_tc, pdata->ets->prio_tc,
133 sizeof(ets->prio_tc));
150 ets->tc_tx_bw[i], ets->tc_rx_bw[i],
151 ets->tc_tsa[i]);
153 ets->prio_tc[i]);
155 max_tc = max_t(u8, max_tc, ets->prio_tc[i]);
156 if ((ets->tc_tx_bw[i] || ets->tc_tsa[i]))
159 switch (ets->tc_tsa[i]) {
164 tc_ets_weight += ets->tc_tx_bw[i];
169 ets->tc_tsa[i]);
170 return (-EINVAL);
175 if (max_tc >= pdata->hw_feat.tc_cnt) {
178 return (-EINVAL);
186 return (-EINVAL);
189 if (!pdata->ets) {
190 pdata->ets = (struct ieee_ets *)malloc(sizeof(struct ieee_ets),
191 M_AXGBE, M_NOWAIT); //TODO - when to free?
193 if (!pdata->ets)
194 return (-ENOMEM);
197 pdata->num_tcs = max_tc + 1;
198 memcpy(pdata->ets, ets, sizeof(*pdata->ets));
200 pdata->hw_if.config_dcb_tc(pdata);
210 pfc->pfc_cap = pdata->hw_feat.tc_cnt;
212 if (pdata->pfc) {
213 pfc->pfc_en = pdata->pfc->pfc_en;
214 pfc->mbc = pdata->pfc->mbc;
215 pfc->delay = pdata->pfc->delay;
226 "cap=%hhu, en=%#hhx, mbc=%hhu, delay=%d\n",
227 pfc->pfc_cap, pfc->pfc_en, pfc->mbc, pfc->delay);
230 if (pfc->pfc_en & ~((1 << pdata->hw_feat.tc_cnt) - 1)) {
233 return (-EINVAL);
236 if (!pdata->pfc) {
237 pdata->pfc = (struct ieee_pfc *)malloc(sizeof(struct ieee_pfc),
238 M_AXGBE, M_NOWAIT); //TODO - when to free?
240 if (!pdata->pfc)
241 return (-ENOMEM);
244 memcpy(pdata->pfc, pfc, sizeof(*pdata->pfc));
246 pdata->hw_if.config_dcb_pfc(pdata);