Lines Matching defs:cmd
22 struct command *cmd;
27 cmd = kzalloc(sizeof(struct command), GFP_KERNEL);
28 if (cmd == NULL)
32 cmd->buffer = kzalloc(buffer_size, GFP_KERNEL);
33 if (cmd->buffer == NULL) {
34 kfree(cmd);
37 cmd->buffer_size = buffer_size;
39 kref_init(&cmd->kref);
40 cmd->lock = &sp->lock;
42 cmd->status = IBMASM_CMD_PENDING;
43 init_waitqueue_head(&cmd->wait);
44 INIT_LIST_HEAD(&cmd->queue_node);
49 return cmd;
54 struct command *cmd = to_command(kref);
56 list_del(&cmd->queue_node);
59 kfree(cmd->buffer);
60 kfree(cmd);
63 static void enqueue_command(struct service_processor *sp, struct command *cmd)
65 list_add_tail(&cmd->queue_node, &sp->command_queue);
70 struct command *cmd;
78 cmd = list_entry(next, struct command, queue_node);
80 return cmd;
105 void ibmasm_exec_command(struct service_processor *sp, struct command *cmd)
115 sp->current_command = cmd;
120 enqueue_command(sp, cmd);
148 void ibmasm_wait_for_response(struct command *cmd, int timeout)
150 wait_event_interruptible_timeout(cmd->wait,
151 cmd->status == IBMASM_CMD_COMPLETE ||
152 cmd->status == IBMASM_CMD_FAILED,
163 struct command *cmd = sp->current_command;
168 memcpy_fromio(cmd->buffer, response, min(size, cmd->buffer_size));
169 cmd->status = IBMASM_CMD_COMPLETE;