Lines Matching full:sh
22 const struct shell *sh; member
28 static int cmd_reg(const struct shell *sh, size_t argc, char **argv) in cmd_reg() argument
33 shell_print(sh, "Mailbox client already registered"); in cmd_reg()
39 shell_error(sh, "Arm SiP service %s not found", argv[1]); in cmd_reg()
46 shell_error(sh, "Mailbox client register fail"); in cmd_reg()
49 shell_print(sh, "Mailbox client register success (token %08x)", mb_c_token); in cmd_reg()
56 static int cmd_unreg(const struct shell *sh, size_t argc, char **argv) in cmd_unreg() argument
61 shell_print(sh, "Mailbox client is not registered"); in cmd_unreg()
67 shell_error(sh, "Mailbox client unregister fail (%d)", err); in cmd_unreg()
69 shell_print(sh, "Mailbox client unregister success"); in cmd_unreg()
77 static int cmd_open(const struct shell *sh, size_t argc, char **argv) in cmd_open() argument
85 shell_print(sh, "Mailbox client is not registered"); in cmd_open()
93 shell_error(sh, "out of range value"); in cmd_open()
101 shell_error(sh, "Setting timeout value to %lu milliseconds", in cmd_open()
108 shell_error(sh, "Mailbox client open fail (%d)", err); in cmd_open()
110 shell_print(sh, "Mailbox client open success"); in cmd_open()
116 static int cmd_close(const struct shell *sh, size_t argc, char **argv) in cmd_close() argument
123 shell_print(sh, "Mailbox client is not registered"); in cmd_close()
151 shell_error(sh, "Mailbox client close fail (%d)", err); in cmd_close()
153 shell_print(sh, "Mailbox client close success"); in cmd_close()
166 const struct shell *sh = priv->sh; in cmd_send_callback() local
172 shell_print(sh, "\n\rsip_svc send command callback\n"); in cmd_send_callback()
173 shell_print(sh, "\theader=%08x\n", response->header); in cmd_send_callback()
174 shell_print(sh, "\ta0=%016lx\n", response->a0); in cmd_send_callback()
175 shell_print(sh, "\ta1=%016lx\n", response->a1); in cmd_send_callback()
176 shell_print(sh, "\ta2=%016lx\n", response->a2); in cmd_send_callback()
177 shell_print(sh, "\ta3=%016lx\n", response->a3); in cmd_send_callback()
178 shell_print(sh, "\tresponse data=\n"); in cmd_send_callback()
184 shell_print(sh, "\t\t[%4d] %08x\n", i, resp_data[i]); in cmd_send_callback()
187 shell_error(sh, "\t\tInvalid addr (%p) or len (%d)\n", resp_data, resp_len); in cmd_send_callback()
194 shell_print(sh, "response data %p is freed\n", resp_data); in cmd_send_callback()
201 static int parse_mb_data(const struct shell *sh, char *hex_list, char **cmd_addr, in parse_mb_data() argument
217 shell_error(sh, "Fail to allocate command memory"); in parse_mb_data()
227 shell_error(sh, "Mailbox length too long"); in parse_mb_data()
233 shell_error(sh, " Value is out of range value"); in parse_mb_data()
238 shell_error(sh, " Invalid argument"); in parse_mb_data()
253 static int cmd_send(const struct shell *sh, size_t argc, char **argv) in cmd_send() argument
266 shell_print(sh, "Mailbox client is not registered"); in cmd_send()
270 err = parse_mb_data(sh, argv[1], &cmd_addr, &cmd_size); in cmd_send()
279 shell_error(sh, "Out of range value"); in cmd_send()
282 shell_error(sh, "Invalid argument"); in cmd_send()
288 shell_error(sh, "Setting timeout value to %lu seconds", MAX_TIMEOUT_MSECS); in cmd_send()
295 shell_error(sh, "Fail to allocate response memory"); in cmd_send()
298 shell_print(sh, "\tResponse memory %p\n", (char *)resp_addr); in cmd_send()
301 priv.sh = sh; in cmd_send()
319 shell_error(sh, "Mailbox send fail (no open or no free trans_id)"); in cmd_send()
326 shell_print(sh, "Mailbox send success: trans_id %d", trans_id); in cmd_send()
329 shell_error(sh, "Mailbox send timeout: trans_id %d", trans_id); in cmd_send()
330 cmd_close(sh, 0, NULL); in cmd_send()