Lines Matching refs:sp

30 static void exec_next_command(struct service_processor *sp);
34 struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_size)
54 cmd->lock = &sp->lock;
77 static void enqueue_command(struct service_processor *sp, struct command *cmd)
79 list_add_tail(&cmd->queue_node, &sp->command_queue);
82 static struct command *dequeue_command(struct service_processor *sp)
87 if (list_empty(&sp->command_queue))
90 next = sp->command_queue.next;
97 static inline void do_exec_command(struct service_processor *sp)
103 if (ibmasm_send_i2o_message(sp)) {
104 sp->current_command->status = IBMASM_CMD_FAILED;
105 wake_up(&sp->current_command->wait);
106 command_put(sp->current_command);
107 exec_next_command(sp);
114 * Commands are executed sequentially. One command (sp->current_command)
119 void ibmasm_exec_command(struct service_processor *sp, struct command *cmd)
126 spin_lock_irqsave(&sp->lock, flags);
128 if (!sp->current_command) {
129 sp->current_command = cmd;
130 command_get(sp->current_command);
131 spin_unlock_irqrestore(&sp->lock, flags);
132 do_exec_command(sp);
134 enqueue_command(sp, cmd);
135 spin_unlock_irqrestore(&sp->lock, flags);
139 static void exec_next_command(struct service_processor *sp)
146 spin_lock_irqsave(&sp->lock, flags);
147 sp->current_command = dequeue_command(sp);
148 if (sp->current_command) {
149 command_get(sp->current_command);
150 spin_unlock_irqrestore(&sp->lock, flags);
151 do_exec_command(sp);
153 spin_unlock_irqrestore(&sp->lock, flags);
175 void ibmasm_receive_command_response(struct service_processor *sp, void *response, size_t size)
177 struct command *cmd = sp->current_command;
179 if (!sp->current_command)
184 wake_up(&sp->current_command->wait);
185 command_put(sp->current_command);
186 exec_next_command(sp);