Lines Matching refs:queue

50  * zip_cmd_queue_consumed - Calculates the space consumed in the command queue.
53 * @queue: Queue number
55 * Return: Bytes consumed in the command queue buffer.
57 static inline u32 zip_cmd_queue_consumed(struct zip_device *zip_dev, int queue)
59 return ((zip_dev->iq[queue].sw_head - zip_dev->iq[queue].sw_tail) *
64 * zip_load_instr - Submits the instruction into the ZIP command queue
69 * This function copies the ZIP instruction to the command queue and rings the
71 * queue is maintained in a circular fashion. When there is space for exactly
72 * one instruction in the queue, next chunk pointer of the queue is made to
73 * point to the head of the queue, thus maintaining a circular queue.
81 u32 queue = 0;
91 queue = 0;
93 queue = 1;
95 zip_dbg("CPU Core: %d Queue number:%d", raw_smp_processor_id(), queue);
98 spin_lock(&zip_dev->iq[queue].lock);
109 zip_dbg("sw_head : %lx", zip_dev->iq[queue].sw_head);
110 zip_dbg("sw_tail : %lx", zip_dev->iq[queue].sw_tail);
112 consumed = zip_cmd_queue_consumed(zip_dev, queue);
115 zip_dbg("Cmd queue space available for single command");
116 /* Space for one cmd, pust it and make it circular queue */
117 memcpy((u8 *)zip_dev->iq[queue].sw_head, (u8 *)instr,
119 zip_dev->iq[queue].sw_head += 16; /* 16 64_bit words = 128B */
122 ncb_ptr = zip_dev->iq[queue].sw_head;
125 ncb_ptr, zip_dev->iq[queue].sw_head - 16);
127 /* Using Circular command queue */
128 zip_dev->iq[queue].sw_head = zip_dev->iq[queue].sw_tail;
130 zip_dev->iq[queue].free_flag = 1;
134 ncp.s.addr = __pa(zip_dev->iq[queue].sw_head);
137 *ncb_ptr, __pa(zip_dev->iq[queue].sw_head));
139 zip_dev->iq[queue].pend_cnt++;
143 /* Push this cmd to cmd queue buffer */
144 memcpy((u8 *)zip_dev->iq[queue].sw_head, (u8 *)instr,
146 zip_dev->iq[queue].sw_head += 16; /* 16 64_bit words = 128B */
148 zip_dev->iq[queue].pend_cnt++;
151 zip_dev->iq[queue].sw_head, zip_dev->iq[queue].sw_tail,
152 zip_dev->iq[queue].hw_tail);
155 zip_dev->iq[queue].pend_cnt);
161 (zip_dev->reg_base + ZIP_QUEX_DOORBELL(queue)));
164 spin_unlock(&zip_dev->iq[queue].lock);
166 return queue;
170 * zip_update_cmd_bufs - Updates the queue statistics after posting the
173 * @queue: Queue number
175 void zip_update_cmd_bufs(struct zip_device *zip_dev, u32 queue)
178 spin_lock(&zip_dev->iq[queue].lock);
181 if (zip_dev->iq[queue].free_flag == 1) {
184 zip_dev->iq[queue].free_flag = 0;
187 zip_dev->iq[queue].hw_tail = zip_dev->iq[queue].sw_head;
190 zip_dev->iq[queue].hw_tail += 16; /* 16 64_bit words = 128B */
193 zip_dev->iq[queue].done_cnt++;
194 zip_dev->iq[queue].pend_cnt--;
197 zip_dev->iq[queue].sw_head, zip_dev->iq[queue].sw_tail,
198 zip_dev->iq[queue].hw_tail);
199 zip_dbg(" Got CC : pend_cnt : %d\n", zip_dev->iq[queue].pend_cnt);
201 spin_unlock(&zip_dev->iq[queue].lock);