Allocate dedicated async completion ring. */
| 772 | |
| 773 | /* Allocate dedicated async completion ring. */ |
| 774 | int bnxt_alloc_async_cp_ring(struct bnxt *bp) |
| 775 | { |
| 776 | struct bnxt_cp_ring_info *cpr = bp->async_cp_ring; |
| 777 | struct bnxt_ring *cp_ring; |
| 778 | uint8_t ring_type; |
| 779 | int rc; |
| 780 | |
| 781 | if (BNXT_NUM_ASYNC_CPR(bp) == 0 || cpr == NULL) |
| 782 | return 0; |
| 783 | |
| 784 | cp_ring = cpr->cp_ring_struct; |
| 785 | |
| 786 | if (BNXT_HAS_NQ(bp)) |
| 787 | ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ; |
| 788 | else |
| 789 | ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL; |
| 790 | |
| 791 | rc = bnxt_hwrm_ring_alloc(bp, cp_ring, ring_type, 0, |
| 792 | HWRM_NA_SIGNATURE, HWRM_NA_SIGNATURE, 0); |
| 793 | |
| 794 | if (rc) |
| 795 | return rc; |
| 796 | |
| 797 | cpr->cp_raw_cons = 0; |
| 798 | bnxt_set_db(bp, &cpr->cp_db, ring_type, 0, |
| 799 | cp_ring->fw_ring_id, cp_ring->ring_mask); |
| 800 | |
| 801 | if (BNXT_HAS_NQ(bp)) |
| 802 | bnxt_db_nq(cpr); |
| 803 | else |
| 804 | bnxt_db_cq(cpr); |
| 805 | |
| 806 | return bnxt_hwrm_set_async_event_cr(bp); |
| 807 | } |
| 808 | |
| 809 | /* Free dedicated async completion ring. */ |
| 810 | void bnxt_free_async_cp_ring(struct bnxt *bp) |
no test coverage detected