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