Lines Matching full:response
76 char response[FASTBOOT_RESPONSE_LEN] = {0}; in fastboot_send_info() local
91 /* Write response */ in fastboot_send_info()
92 write_fb_response("INFO", msg, response); in fastboot_send_info()
93 memcpy(packet, response, strlen(response)); in fastboot_send_info()
94 packet += strlen(response); in fastboot_send_info()
107 * Constructs and sends a packet in response to received fastboot packet
109 * @param fb_header Header for response packet
123 char response[FASTBOOT_RESPONSE_LEN] = {0}; in fastboot_send() local
171 fb_getvar(response); in fastboot_send()
173 fb_download(fastboot_data, fastboot_data_len, response); in fastboot_send()
175 fb_flash(response); in fastboot_send()
177 fb_erase(response); in fastboot_send()
179 write_fb_response("OKAY", "", response); in fastboot_send()
181 fb_continue(response); in fastboot_send()
183 fb_reboot(response); in fastboot_send()
186 write_fb_response("OKAY", "", response); in fastboot_send()
189 write_fb_response("FAIL", "unrecognized command", response); in fastboot_send()
196 /* Write response to packet */ in fastboot_send()
197 memcpy(packet, response, strlen(response)); in fastboot_send()
198 packet += strlen(response); in fastboot_send()
214 /* Continue boot process after sending response */ in fastboot_send()
215 if (!strncmp("OKAY", response, 4)) { in fastboot_send()
227 if (!strncmp("OKAY", response, 4) || in fastboot_send()
228 !strncmp("FAIL", response, 4)) { in fastboot_send()
234 * Writes ascii string specified by cmd_parameter to response.
236 * @param repsonse Pointer to fastboot response buffer
238 static void fb_getvar(char *response) in fb_getvar() argument
242 write_fb_response("FAIL", "missing var", response); in fb_getvar()
244 write_fb_response("OKAY", FASTBOOT_VERSION, response); in fb_getvar()
247 write_fb_response("OKAY", U_BOOT_VERSION, response); in fb_getvar()
252 write_fb_response("OKAY", buf_size_str, response); in fb_getvar()
256 write_fb_response("OKAY", tmp, response); in fb_getvar()
258 write_fb_response("FAIL", "Value not set", response); in fb_getvar()
261 write_fb_response("OKAY", "N/A", response); in fb_getvar()
265 write_fb_response("OKAY", board, response); in fb_getvar()
267 write_fb_response("FAIL", "Board not set", response); in fb_getvar()
271 write_fb_response("OKAY", "_a", response); in fb_getvar()
273 write_fb_response("OKAY", "_a,_b", response); in fb_getvar()
279 write_fb_response("OKAY", "yes", response); in fb_getvar()
281 write_fb_response("OKAY", "no", response); in fb_getvar()
293 write_fb_response("FAIL", "block device not found", response); in fb_getvar()
295 write_fb_response("FAIL", "partition not found", response); in fb_getvar()
297 write_fb_response("OKAY", (char*)part_info.type, response); in fb_getvar()
300 write_fb_response("OKAY", part_size_str, response); in fb_getvar()
304 write_fb_response("FAIL", "Variable not implemented", response); in fb_getvar()
310 * Writes to response.
314 * @param repsonse Pointer to fastboot response buffer
317 char *response) in fb_download() argument
323 write_fb_response("FAIL", "Expected command parameter", response); in fb_download()
328 write_fb_response("FAIL", "Expected nonzero image size", response); in fb_download()
333 /* Nothing to download yet. Response is of the form: in fb_download()
339 write_fb_response("FAIL", cmd_parameter, response); in fb_download()
341 write_fb_response("DATA", cmd_parameter, response); in fb_download()
345 write_fb_response("OKAY", "", response); in fb_download()
351 write_fb_response("FAIL", "Received invalid data length", response); in fb_download()
363 * cmd_parameter. Writes to response.
365 * @param repsonse Pointer to fastboot response buffer
367 static void fb_flash(char *response) in fb_flash() argument
370 image_size, response); in fb_flash()
375 * to response.
377 * @param repsonse Pointer to fastboot response buffer
379 static void fb_erase(char *response) in fb_erase() argument
381 fb_mmc_erase(cmd_parameter, response); in fb_erase()
386 * to response.
388 * @param repsonse Pointer to fastboot response buffer
390 static void fb_continue(char *response) in fb_continue() argument
395 write_fb_response("OKAY", "", response); in fb_continue()
397 write_fb_response("FAIL", "bootcmd not set", response); in fb_continue()
402 * Sets reboot bootloader flag if requested. Writes to response.
404 * @param repsonse Pointer to fastboot response buffer
406 static void fb_reboot(char *response) in fb_reboot() argument
408 write_fb_response("OKAY", "", response); in fb_reboot()
434 * Writes a response to response buffer of the form "$tag$reason".
436 * @param tag The first part of the response
437 * @param reason The second part of the response
438 * @param repsonse Pointer to fastboot response buffer
441 char *response) in write_fb_response() argument
443 strncpy(response, tag, strlen(tag)); in write_fb_response()
444 strncat(response, reason, FASTBOOT_RESPONSE_LEN - strlen(tag) - 1); in write_fb_response()