Lines Matching refs:sp

16 static void exec_next_command(struct service_processor *sp);
20 struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_size) in ibmasm_new_command() argument
40 cmd->lock = &sp->lock; in ibmasm_new_command()
63 static void enqueue_command(struct service_processor *sp, struct command *cmd) in enqueue_command() argument
65 list_add_tail(&cmd->queue_node, &sp->command_queue); in enqueue_command()
68 static struct command *dequeue_command(struct service_processor *sp) in dequeue_command() argument
73 if (list_empty(&sp->command_queue)) in dequeue_command()
76 next = sp->command_queue.next; in dequeue_command()
83 static inline void do_exec_command(struct service_processor *sp) in do_exec_command() argument
89 if (ibmasm_send_i2o_message(sp)) { in do_exec_command()
90 sp->current_command->status = IBMASM_CMD_FAILED; in do_exec_command()
91 wake_up(&sp->current_command->wait); in do_exec_command()
92 command_put(sp->current_command); in do_exec_command()
93 exec_next_command(sp); in do_exec_command()
105 void ibmasm_exec_command(struct service_processor *sp, struct command *cmd) in ibmasm_exec_command() argument
112 spin_lock_irqsave(&sp->lock, flags); in ibmasm_exec_command()
114 if (!sp->current_command) { in ibmasm_exec_command()
115 sp->current_command = cmd; in ibmasm_exec_command()
116 command_get(sp->current_command); in ibmasm_exec_command()
117 spin_unlock_irqrestore(&sp->lock, flags); in ibmasm_exec_command()
118 do_exec_command(sp); in ibmasm_exec_command()
120 enqueue_command(sp, cmd); in ibmasm_exec_command()
121 spin_unlock_irqrestore(&sp->lock, flags); in ibmasm_exec_command()
125 static void exec_next_command(struct service_processor *sp) in exec_next_command() argument
132 spin_lock_irqsave(&sp->lock, flags); in exec_next_command()
133 sp->current_command = dequeue_command(sp); in exec_next_command()
134 if (sp->current_command) { in exec_next_command()
135 command_get(sp->current_command); in exec_next_command()
136 spin_unlock_irqrestore(&sp->lock, flags); in exec_next_command()
137 do_exec_command(sp); in exec_next_command()
139 spin_unlock_irqrestore(&sp->lock, flags); in exec_next_command()
161 void ibmasm_receive_command_response(struct service_processor *sp, void *response, size_t size) in ibmasm_receive_command_response() argument
163 struct command *cmd = sp->current_command; in ibmasm_receive_command_response()
165 if (!sp->current_command) in ibmasm_receive_command_response()
170 wake_up(&sp->current_command->wait); in ibmasm_receive_command_response()
171 command_put(sp->current_command); in ibmasm_receive_command_response()
172 exec_next_command(sp); in ibmasm_receive_command_response()