Lines Matching refs:cmd
33 struct creg_cmd *cmd,
112 static void creg_issue_cmd(struct rsxx_cardinfo *card, struct creg_cmd *cmd) in creg_issue_cmd() argument
119 iowrite32(cmd->addr, card->regmap + CREG_ADD); in creg_issue_cmd()
120 iowrite32(cmd->cnt8, card->regmap + CREG_CNT); in creg_issue_cmd()
122 if (cmd->op == CREG_OP_WRITE) { in creg_issue_cmd()
123 if (cmd->buf) { in creg_issue_cmd()
124 st = copy_to_creg_data(card, cmd->cnt8, in creg_issue_cmd()
125 cmd->buf, cmd->stream); in creg_issue_cmd()
135 iowrite32(cmd->op, card->regmap + CREG_CMD); in creg_issue_cmd()
170 struct creg_cmd *cmd; in creg_queue_cmd() local
182 cmd = kmem_cache_alloc(creg_cmd_pool, GFP_KERNEL); in creg_queue_cmd()
183 if (!cmd) in creg_queue_cmd()
186 INIT_LIST_HEAD(&cmd->list); in creg_queue_cmd()
188 cmd->op = op; in creg_queue_cmd()
189 cmd->addr = addr; in creg_queue_cmd()
190 cmd->cnt8 = cnt8; in creg_queue_cmd()
191 cmd->buf = buf; in creg_queue_cmd()
192 cmd->stream = stream; in creg_queue_cmd()
193 cmd->cb = callback; in creg_queue_cmd()
194 cmd->cb_private = cb_private; in creg_queue_cmd()
195 cmd->status = 0; in creg_queue_cmd()
198 list_add_tail(&cmd->list, &card->creg_ctrl.queue); in creg_queue_cmd()
209 struct creg_cmd *cmd; in creg_cmd_timed_out() local
212 cmd = card->creg_ctrl.active_cmd; in creg_cmd_timed_out()
216 if (cmd == NULL) { in creg_cmd_timed_out()
223 if (cmd->cb) in creg_cmd_timed_out()
224 cmd->cb(card, cmd, -ETIMEDOUT); in creg_cmd_timed_out()
226 kmem_cache_free(creg_cmd_pool, cmd); in creg_cmd_timed_out()
239 struct creg_cmd *cmd; in creg_cmd_done() local
253 cmd = card->creg_ctrl.active_cmd; in creg_cmd_done()
257 if (cmd == NULL) { in creg_cmd_done()
264 cmd->status = card->creg_ctrl.creg_stats.stat; in creg_cmd_done()
265 if ((cmd->status & CREG_STAT_STATUS_MASK) == 0) { in creg_cmd_done()
275 } else if (cmd->status & CREG_STAT_ERROR) { in creg_cmd_done()
279 if ((cmd->op == CREG_OP_READ)) { in creg_cmd_done()
283 if (!cmd->buf) { in creg_cmd_done()
289 if (cnt8 != cmd->cnt8) { in creg_cmd_done()
296 st = copy_from_creg_data(card, cnt8, cmd->buf, cmd->stream); in creg_cmd_done()
300 if (cmd->cb) in creg_cmd_done()
301 cmd->cb(card, cmd, st); in creg_cmd_done()
303 kmem_cache_free(creg_cmd_pool, cmd); in creg_cmd_done()
313 struct creg_cmd *cmd = NULL; in creg_reset() local
334 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) { in creg_reset()
335 list_del(&cmd->list); in creg_reset()
337 if (cmd->cb) in creg_reset()
338 cmd->cb(card, cmd, -ECANCELED); in creg_reset()
339 kmem_cache_free(creg_cmd_pool, cmd); in creg_reset()
342 cmd = card->creg_ctrl.active_cmd; in creg_reset()
344 if (cmd) { in creg_reset()
348 if (cmd->cb) in creg_reset()
349 cmd->cb(card, cmd, -ECANCELED); in creg_reset()
350 kmem_cache_free(creg_cmd_pool, cmd); in creg_reset()
372 struct creg_cmd *cmd, in creg_cmd_done_cb() argument
377 cmd_completion = cmd->cb_private; in creg_cmd_done_cb()
381 cmd_completion->creg_status = cmd->status; in creg_cmd_done_cb()
535 int rsxx_issue_card_cmd(struct rsxx_cardinfo *card, u32 cmd) in rsxx_issue_card_cmd() argument
538 sizeof(cmd), &cmd, 0); in rsxx_issue_card_cmd()
610 struct creg_cmd *cmd, in read_hw_log_done() argument
619 buf = cmd->buf; in read_hw_log_done()
626 while (off < cmd->cnt8) { in read_hw_log_done()
628 cnt = min(cmd->cnt8 - off, LOG_BUF_SIZE8 - card->log.buf_len); in read_hw_log_done()
648 if (cmd->status & CREG_STAT_LOG_PENDING) in read_hw_log_done()
668 struct rsxx_reg_access *cmd, in issue_reg_cmd() argument
673 return __issue_creg_rw(card, op, cmd->addr, cmd->cnt, cmd->data, in issue_reg_cmd()
674 cmd->stream, &cmd->stat); in issue_reg_cmd()
681 struct rsxx_reg_access cmd; in rsxx_reg_access() local
684 st = copy_from_user(&cmd, ucmd, sizeof(cmd)); in rsxx_reg_access()
688 if (cmd.cnt > RSXX_MAX_REG_CNT) in rsxx_reg_access()
691 st = issue_reg_cmd(card, &cmd, read); in rsxx_reg_access()
695 st = put_user(cmd.stat, &ucmd->stat); in rsxx_reg_access()
700 st = copy_to_user(ucmd->data, cmd.data, cmd.cnt); in rsxx_reg_access()
710 struct creg_cmd *cmd = NULL; in rsxx_eeh_save_issued_creg() local
712 cmd = card->creg_ctrl.active_cmd; in rsxx_eeh_save_issued_creg()
715 if (cmd) { in rsxx_eeh_save_issued_creg()
719 list_add(&cmd->list, &card->creg_ctrl.queue); in rsxx_eeh_save_issued_creg()
756 struct creg_cmd *cmd; in rsxx_creg_destroy() local
762 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) { in rsxx_creg_destroy()
763 list_del(&cmd->list); in rsxx_creg_destroy()
764 if (cmd->cb) in rsxx_creg_destroy()
765 cmd->cb(card, cmd, -ECANCELED); in rsxx_creg_destroy()
766 kmem_cache_free(creg_cmd_pool, cmd); in rsxx_creg_destroy()
774 cmd = card->creg_ctrl.active_cmd; in rsxx_creg_destroy()
776 if (cmd) { in rsxx_creg_destroy()
780 if (cmd->cb) in rsxx_creg_destroy()
781 cmd->cb(card, cmd, -ECANCELED); in rsxx_creg_destroy()
784 kmem_cache_free(creg_cmd_pool, cmd); in rsxx_creg_destroy()