* idpf_ctlq_shutdown - shutdown the CQ * @hw: pointer to hw struct * @cq: pointer to the specific Control queue * * The main shutdown routine for any controq queue */
| 95 | * The main shutdown routine for any controq queue |
| 96 | */ |
| 97 | static void idpf_ctlq_shutdown(struct idpf_hw *hw, struct idpf_ctlq_info *cq) |
| 98 | { |
| 99 | idpf_acquire_lock(&cq->cq_lock); |
| 100 | |
| 101 | if (!cq->ring_size) |
| 102 | goto shutdown_sq_out; |
| 103 | |
| 104 | #ifdef SIMICS_BUILD |
| 105 | wr32(hw, cq->reg.head, 0); |
| 106 | wr32(hw, cq->reg.tail, 0); |
| 107 | wr32(hw, cq->reg.len, 0); |
| 108 | wr32(hw, cq->reg.bal, 0); |
| 109 | wr32(hw, cq->reg.bah, 0); |
| 110 | #endif /* SIMICS_BUILD */ |
| 111 | |
| 112 | /* free ring buffers and the ring itself */ |
| 113 | idpf_ctlq_dealloc_ring_res(hw, cq); |
| 114 | |
| 115 | /* Set ring_size to 0 to indicate uninitialized queue */ |
| 116 | cq->ring_size = 0; |
| 117 | |
| 118 | shutdown_sq_out: |
| 119 | idpf_release_lock(&cq->cq_lock); |
| 120 | idpf_destroy_lock(&cq->cq_lock); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * idpf_ctlq_add - add one control queue |
no test coverage detected