/* Setup any additional SG pages needed.Inline SG element is setup at queuing time.  */
static bfa_boolean_t bfa_ioim_sge_setup(struct bfa_ioim_s *ioim)
/* Setup any additional SG pages needed.Inline SG element is setup at queuing time.  */
static bfa_boolean_t bfa_ioim_sge_setup(struct bfa_ioim_s *ioim)
{
	u16        nsgpgs;
	bfa_assert(ioim->nsges > BFI_SGE_INLINE);
	nsgpgs = BFA_SGPG_NPAGE(ioim->nsges);
	if (!nsgpgs)
		return BFA_TRUE;
	if (bfa_sgpg_malloc(ioim->bfa, &ioim->sgpg_q, nsgpgs)
	    != BFA_STATUS_OK) {
		bfa_sgpg_wait(ioim->bfa, &ioim->iosp->sgpg_wqe, nsgpgs);
		return BFA_FALSE;
	}
	ioim->nsgpgs = nsgpgs;
	bfa_ioim_sgpg_setup(ioim);
	return BFA_TRUE;
}