Lines Matching defs:cmd_q

19 static u32 ccp_alloc_ksb(struct ccp_cmd_queue *cmd_q, unsigned int count)
22 struct ccp_device *ccp = cmd_q->ccp;
50 static void ccp_free_ksb(struct ccp_cmd_queue *cmd_q, unsigned int start,
53 struct ccp_device *ccp = cmd_q->ccp;
69 static unsigned int ccp_get_free_slots(struct ccp_cmd_queue *cmd_q)
71 return CMD_Q_DEPTH(ioread32(cmd_q->reg_status));
76 struct ccp_cmd_queue *cmd_q = op->cmd_q;
77 struct ccp_device *ccp = cmd_q->ccp;
87 cmd_q->free_slots--;
89 cr0 = (cmd_q->id << REQ0_CMD_Q_SHIFT)
97 if (op->ioc || !cmd_q->free_slots)
117 ret = wait_event_interruptible(cmd_q->int_queue,
118 cmd_q->int_rcvd);
119 if (ret || cmd_q->cmd_error) {
121 cmd = (cmd_q->id << DEL_Q_ID_SHIFT)
123 if (cmd_q->cmd_error)
124 ccp_log_error(cmd_q->ccp,
125 cmd_q->cmd_error);
134 | (cmd_q->id << DEL_Q_ID_SHIFT)
140 cmd_q->free_slots = CMD_Q_DEPTH(cmd_q->q_status);
142 cmd_q->int_rcvd = 0;
327 struct ccp_cmd_queue *cmd_q;
334 cmd_q = &ccp->cmd_q[i];
336 q_int = status & (cmd_q->int_ok | cmd_q->int_err);
338 cmd_q->int_status = status;
339 cmd_q->q_status = ioread32(cmd_q->reg_status);
340 cmd_q->q_int_status = ioread32(cmd_q->reg_int_status);
343 if ((q_int & cmd_q->int_err) && !cmd_q->cmd_error)
344 cmd_q->cmd_error = CMD_Q_ERROR(cmd_q->q_status);
346 cmd_q->int_rcvd = 1;
350 wake_up_interruptible(&cmd_q->int_queue);
372 struct ccp_cmd_queue *cmd_q;
397 cmd_q = &ccp->cmd_q[ccp->cmd_q_count];
400 cmd_q->ccp = ccp;
401 cmd_q->id = i;
402 cmd_q->dma_pool = dma_pool;
405 cmd_q->sb_key = KSB_START + ccp->sb_start++;
406 cmd_q->sb_ctx = KSB_START + ccp->sb_start++;
412 cmd_q->reg_status = ccp->io_regs + CMD_Q_STATUS_BASE +
414 cmd_q->reg_int_status = ccp->io_regs + CMD_Q_INT_STATUS_BASE +
416 cmd_q->int_ok = 1 << (i * 2);
417 cmd_q->int_err = 1 << ((i * 2) + 1);
419 cmd_q->free_slots = ccp_get_free_slots(cmd_q);
421 init_waitqueue_head(&cmd_q->int_queue);
424 ccp->qim |= cmd_q->int_ok | cmd_q->int_err;
444 cmd_q = &ccp->cmd_q[i];
446 ioread32(cmd_q->reg_int_status);
447 ioread32(cmd_q->reg_status);
468 cmd_q = &ccp->cmd_q[i];
470 kthread = kthread_run(ccp_cmd_queue_thread, cmd_q,
471 "%s-q%u", ccp->name, cmd_q->id);
479 cmd_q->kthread = kthread;
505 if (ccp->cmd_q[i].kthread)
506 kthread_stop(ccp->cmd_q[i].kthread);
512 dma_pool_destroy(ccp->cmd_q[i].dma_pool);
519 struct ccp_cmd_queue *cmd_q;
535 cmd_q = &ccp->cmd_q[i];
537 ioread32(cmd_q->reg_int_status);
538 ioread32(cmd_q->reg_status);
544 if (ccp->cmd_q[i].kthread)
545 kthread_stop(ccp->cmd_q[i].kthread);
550 dma_pool_destroy(ccp->cmd_q[i].dma_pool);