Lines Matching refs:cmd

19 			    struct creg_cmd *cmd,
98 static void creg_issue_cmd(struct rsxx_cardinfo *card, struct creg_cmd *cmd) in creg_issue_cmd() argument
105 iowrite32(cmd->addr, card->regmap + CREG_ADD); in creg_issue_cmd()
106 iowrite32(cmd->cnt8, card->regmap + CREG_CNT); in creg_issue_cmd()
108 if (cmd->op == CREG_OP_WRITE) { in creg_issue_cmd()
109 if (cmd->buf) { in creg_issue_cmd()
110 st = copy_to_creg_data(card, cmd->cnt8, in creg_issue_cmd()
111 cmd->buf, cmd->stream); in creg_issue_cmd()
121 iowrite32(cmd->op, card->regmap + CREG_CMD); in creg_issue_cmd()
156 struct creg_cmd *cmd; in creg_queue_cmd() local
168 cmd = kmem_cache_alloc(creg_cmd_pool, GFP_KERNEL); in creg_queue_cmd()
169 if (!cmd) in creg_queue_cmd()
172 INIT_LIST_HEAD(&cmd->list); in creg_queue_cmd()
174 cmd->op = op; in creg_queue_cmd()
175 cmd->addr = addr; in creg_queue_cmd()
176 cmd->cnt8 = cnt8; in creg_queue_cmd()
177 cmd->buf = buf; in creg_queue_cmd()
178 cmd->stream = stream; in creg_queue_cmd()
179 cmd->cb = callback; in creg_queue_cmd()
180 cmd->cb_private = cb_private; in creg_queue_cmd()
181 cmd->status = 0; in creg_queue_cmd()
184 list_add_tail(&cmd->list, &card->creg_ctrl.queue); in creg_queue_cmd()
195 struct creg_cmd *cmd; in creg_cmd_timed_out() local
198 cmd = card->creg_ctrl.active_cmd; in creg_cmd_timed_out()
202 if (cmd == NULL) { in creg_cmd_timed_out()
209 if (cmd->cb) in creg_cmd_timed_out()
210 cmd->cb(card, cmd, -ETIMEDOUT); in creg_cmd_timed_out()
212 kmem_cache_free(creg_cmd_pool, cmd); in creg_cmd_timed_out()
225 struct creg_cmd *cmd; in creg_cmd_done() local
239 cmd = card->creg_ctrl.active_cmd; in creg_cmd_done()
243 if (cmd == NULL) { in creg_cmd_done()
250 cmd->status = card->creg_ctrl.creg_stats.stat; in creg_cmd_done()
251 if ((cmd->status & CREG_STAT_STATUS_MASK) == 0) { in creg_cmd_done()
261 } else if (cmd->status & CREG_STAT_ERROR) { in creg_cmd_done()
265 if (cmd->op == CREG_OP_READ) { in creg_cmd_done()
269 if (!cmd->buf) { in creg_cmd_done()
275 if (cnt8 != cmd->cnt8) { in creg_cmd_done()
282 st = copy_from_creg_data(card, cnt8, cmd->buf, cmd->stream); in creg_cmd_done()
286 if (cmd->cb) in creg_cmd_done()
287 cmd->cb(card, cmd, st); in creg_cmd_done()
289 kmem_cache_free(creg_cmd_pool, cmd); in creg_cmd_done()
299 struct creg_cmd *cmd = NULL; in creg_reset() local
320 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) { in creg_reset()
321 list_del(&cmd->list); in creg_reset()
323 if (cmd->cb) in creg_reset()
324 cmd->cb(card, cmd, -ECANCELED); in creg_reset()
325 kmem_cache_free(creg_cmd_pool, cmd); in creg_reset()
328 cmd = card->creg_ctrl.active_cmd; in creg_reset()
330 if (cmd) { in creg_reset()
334 if (cmd->cb) in creg_reset()
335 cmd->cb(card, cmd, -ECANCELED); in creg_reset()
336 kmem_cache_free(creg_cmd_pool, cmd); in creg_reset()
358 struct creg_cmd *cmd, in creg_cmd_done_cb() argument
363 cmd_completion = cmd->cb_private; in creg_cmd_done_cb()
367 cmd_completion->creg_status = cmd->status; in creg_cmd_done_cb()
521 int rsxx_issue_card_cmd(struct rsxx_cardinfo *card, u32 cmd) in rsxx_issue_card_cmd() argument
524 sizeof(cmd), &cmd, 0); in rsxx_issue_card_cmd()
596 struct creg_cmd *cmd, in read_hw_log_done() argument
605 buf = cmd->buf; in read_hw_log_done()
612 while (off < cmd->cnt8) { in read_hw_log_done()
614 cnt = min(cmd->cnt8 - off, LOG_BUF_SIZE8 - card->log.buf_len); in read_hw_log_done()
634 if (cmd->status & CREG_STAT_LOG_PENDING) in read_hw_log_done()
654 struct rsxx_reg_access *cmd, in issue_reg_cmd() argument
659 return __issue_creg_rw(card, op, cmd->addr, cmd->cnt, cmd->data, in issue_reg_cmd()
660 cmd->stream, &cmd->stat); in issue_reg_cmd()
667 struct rsxx_reg_access cmd; in rsxx_reg_access() local
670 st = copy_from_user(&cmd, ucmd, sizeof(cmd)); in rsxx_reg_access()
674 if (cmd.cnt > RSXX_MAX_REG_CNT) in rsxx_reg_access()
677 st = issue_reg_cmd(card, &cmd, read); in rsxx_reg_access()
681 st = put_user(cmd.stat, &ucmd->stat); in rsxx_reg_access()
686 st = copy_to_user(ucmd->data, cmd.data, cmd.cnt); in rsxx_reg_access()
696 struct creg_cmd *cmd = NULL; in rsxx_eeh_save_issued_creg() local
698 cmd = card->creg_ctrl.active_cmd; in rsxx_eeh_save_issued_creg()
701 if (cmd) { in rsxx_eeh_save_issued_creg()
705 list_add(&cmd->list, &card->creg_ctrl.queue); in rsxx_eeh_save_issued_creg()
741 struct creg_cmd *cmd; in rsxx_creg_destroy() local
747 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) { in rsxx_creg_destroy()
748 list_del(&cmd->list); in rsxx_creg_destroy()
749 if (cmd->cb) in rsxx_creg_destroy()
750 cmd->cb(card, cmd, -ECANCELED); in rsxx_creg_destroy()
751 kmem_cache_free(creg_cmd_pool, cmd); in rsxx_creg_destroy()
759 cmd = card->creg_ctrl.active_cmd; in rsxx_creg_destroy()
761 if (cmd) { in rsxx_creg_destroy()
765 if (cmd->cb) in rsxx_creg_destroy()
766 cmd->cb(card, cmd, -ECANCELED); in rsxx_creg_destroy()
769 kmem_cache_free(creg_cmd_pool, cmd); in rsxx_creg_destroy()