Lines Matching refs:rings
9 bool ice_fwlog_ring_full(struct ice_fwlog_ring *rings)
13 head = rings->head;
14 tail = rings->tail;
16 if (head < tail && (tail - head == (rings->size - 1)))
24 bool ice_fwlog_ring_empty(struct ice_fwlog_ring *rings)
26 return rings->head == rings->tail;
34 static int ice_fwlog_alloc_ring_buffs(struct ice_fwlog_ring *rings)
39 nr_bytes = rings->size * ICE_AQ_MAX_BUF_LEN;
44 for (i = 0; i < rings->size; i++) {
45 struct ice_fwlog_data *ring = &rings->rings[i];
55 static void ice_fwlog_free_ring_buffs(struct ice_fwlog_ring *rings)
59 for (i = 0; i < rings->size; i++) {
60 struct ice_fwlog_data *ring = &rings->rings[i];
75 * ice_fwlog_realloc_rings - reallocate the FW log rings
98 /* allocate space for the new rings and buffers then release the
99 * old rings and buffers. that way if we don't have enough
102 ring.rings = kcalloc(ring_size, sizeof(*ring.rings), GFP_KERNEL);
103 if (!ring.rings)
112 kfree(ring.rings);
117 kfree(hw->fwlog_ring.rings);
119 hw->fwlog_ring.rings = ring.rings;
149 hw->fwlog_ring.rings = kcalloc(ICE_FWLOG_RING_SIZE_DFLT,
150 sizeof(*hw->fwlog_ring.rings),
152 if (!hw->fwlog_ring.rings) {
153 dev_warn(ice_hw_to_dev(hw), "Unable to allocate memory for FW log rings\n");
164 kfree(hw->fwlog_ring.rings);
211 if (hw->fwlog_ring.rings) {
213 kfree(hw->fwlog_ring.rings);