Lines Matching refs:wqe
148 struct bfa_sgpg_wqe_s *wqe;
164 wqe = bfa_q_first(&mod->sgpg_wait_q);
165 if (mod->free_sgpgs < wqe->nsgpg)
168 nsgpg = wqe->nsgpg;
169 bfa_sgpg_malloc(bfa, &wqe->sgpg_q, nsgpg);
170 wqe->nsgpg -= nsgpg;
171 if (wqe->nsgpg == 0) {
172 list_del(&wqe->qe);
173 wqe->cbfn(wqe->cbarg);
179 bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpg)
186 wqe->nsgpg_total = wqe->nsgpg = nsgpg;
196 list_splice_tail_init(&mod->sgpg_q, &wqe->sgpg_q);
197 wqe->nsgpg -= mod->free_sgpgs;
201 list_add_tail(&wqe->qe, &mod->sgpg_wait_q);
205 bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe)
209 bfa_assert(bfa_q_is_on_q(&mod->sgpg_wait_q, wqe));
210 list_del(&wqe->qe);
212 if (wqe->nsgpg_total != wqe->nsgpg)
213 bfa_sgpg_mfree(bfa, &wqe->sgpg_q,
214 wqe->nsgpg_total - wqe->nsgpg);
218 bfa_sgpg_winit(struct bfa_sgpg_wqe_s *wqe, void (*cbfn) (void *cbarg),
221 INIT_LIST_HEAD(&wqe->sgpg_q);
222 wqe->cbfn = cbfn;
223 wqe->cbarg = cbarg;