Lines Matching refs:qtop
55 ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) in ocs_hw_init_queues() argument
118 ocs_hw_assert(qtop != NULL); in ocs_hw_init_queues()
120 for (i = 0, qt = qtop->entries; i < qtop->inuse_count; i++, qt++) { in ocs_hw_init_queues()
121 if (i == qtop->inuse_count - 1) in ocs_hw_init_queues()
1022 return hw->qtop->entry_counts[QTOP_EQ]; in ocs_hw_qtop_eq_count()
1373 tok_getnumber(ocs_hw_t *hw, ocs_hw_qtop_t *qtop, tok_t *tok) in tok_getnumber() argument
1392 } else if ((qtop->rptcount_idx > 0) && ocs_strcmp(tok->string, "$rpt0") == 0) { in tok_getnumber()
1393 rval = qtop->rptcount[qtop->rptcount_idx-1]; in tok_getnumber()
1394 } else if ((qtop->rptcount_idx > 1) && ocs_strcmp(tok->string, "$rpt1") == 0) { in tok_getnumber()
1395 rval = qtop->rptcount[qtop->rptcount_idx-2]; in tok_getnumber()
1396 } else if ((qtop->rptcount_idx > 2) && ocs_strcmp(tok->string, "$rpt2") == 0) { in tok_getnumber()
1397 rval = qtop->rptcount[qtop->rptcount_idx-3]; in tok_getnumber()
1398 } else if ((qtop->rptcount_idx > 3) && ocs_strcmp(tok->string, "$rpt3") == 0) { in tok_getnumber()
1399 rval = qtop->rptcount[qtop->rptcount_idx-4]; in tok_getnumber()
1425 parse_topology(ocs_hw_t *hw, tokarray_t *tokarray, ocs_hw_qtop_t *qtop) in parse_topology() argument
1427 ocs_hw_qtop_entry_t *qt = qtop->entries + qtop->inuse_count; in parse_topology()
1432 if (qtop->inuse_count >= qtop->alloc_count) { in parse_topology()
1436 qt = qtop->entries + qtop->inuse_count; in parse_topology()
1445 qtop->inuse_count++; in parse_topology()
1460 qt->len = tok_getnumber(hw, qtop, &tok[3]); in parse_topology()
1464 qt->class = tok_getnumber(hw, qtop, &tok[3]); in parse_topology()
1468 qt->ulp = tok_getnumber(hw, qtop, &tok[3]); in parse_topology()
1491 qt->filter_mask = (1U << tok_getnumber(hw, qtop, &tok[3])); in parse_topology()
1503 qtop->entry_counts[qt->entry]++; in parse_topology()
1516 qt->len = tok_getnumber(hw, qtop, &tok[4]); in parse_topology()
1519 qt->class = tok_getnumber(hw, qtop, &tok[4]); in parse_topology()
1522 qt->ulp = tok_getnumber(hw, qtop, &tok[4]); in parse_topology()
1527 qtop->inuse_count++; in parse_topology()
1540 rpt_count = tok_getnumber(hw, qtop, tok); in parse_topology()
1551 uint32_t rptcount_idx = qtop->rptcount_idx; in parse_topology()
1553 if (qtop->rptcount_idx < ARRAY_SIZE(qtop->rptcount)) { in parse_topology()
1554 qtop->rptcount[qtop->rptcount_idx++] = i; in parse_topology()
1561 parse_topology(hw, tokarray, qtop); in parse_topology()
1563 qtop->rptcount_idx = rptcount_idx; in parse_topology()
1595 ocs_hw_qtop_t *qtop; in ocs_hw_qtop_parse() local
1621 qtop = ocs_malloc(hw->os, sizeof(*qtop), OCS_M_ZERO | OCS_M_NOWAIT); in ocs_hw_qtop_parse()
1622 if (qtop == NULL) { in ocs_hw_qtop_parse()
1627 qtop->os = hw->os; in ocs_hw_qtop_parse()
1630 …qtop->entries = ocs_malloc(hw->os, OCS_HW_MAX_QTOP_ENTRIES*sizeof(*qtop->entries), OCS_M_ZERO | OC… in ocs_hw_qtop_parse()
1631 if (qtop->entries == NULL) { in ocs_hw_qtop_parse()
1633 ocs_free(hw->os, qtop, sizeof(*qtop)); in ocs_hw_qtop_parse()
1637 qtop->alloc_count = OCS_HW_MAX_QTOP_ENTRIES; in ocs_hw_qtop_parse()
1638 qtop->inuse_count = 0; in ocs_hw_qtop_parse()
1641 parse_topology(hw, &tokarray, qtop); in ocs_hw_qtop_parse()
1643 for (i = 0, qt = qtop->entries; i < qtop->inuse_count; i++, qt++) { in ocs_hw_qtop_parse()
1652 return qtop; in ocs_hw_qtop_parse()
1663 ocs_hw_qtop_free(ocs_hw_qtop_t *qtop) in ocs_hw_qtop_free() argument
1665 if (qtop != NULL) { in ocs_hw_qtop_free()
1666 if (qtop->entries != NULL) { in ocs_hw_qtop_free()
1667 ocs_free(qtop->os, qtop->entries, qtop->alloc_count*sizeof(*qtop->entries)); in ocs_hw_qtop_free()
1669 ocs_free(qtop->os, qtop, sizeof(*qtop)); in ocs_hw_qtop_free()