Lines Matching refs:command
36 esp_command_req_t *command; /* Pointer to buf_a or buf_b as latest command received */ member
160 ub.command = (esp_command_req_t *)ub.buf_a; in stub_handle_rx_byte()
163 ub.command = (esp_command_req_t *)ub.buf_b; in stub_handle_rx_byte()
170 static esp_command_error verify_data_len(esp_command_req_t *command, uint8_t len) in verify_data_len() argument
172 return (command->data_len == len) ? ESP_OK : ESP_BAD_DATA_LEN; in verify_data_len()
178 while(ub.command == NULL) { in cmd_loop()
181 esp_command_req_t *command = ub.command; in cmd_loop() local
182 ub.command = NULL; in cmd_loop()
184 uint32_t *data_words = (uint32_t *)command->data_buf; in cmd_loop()
189 .op_ret = command->op, in cmd_loop()
195 switch(command->op) { in cmd_loop()
197 if (command->data_len == 4) { in cmd_loop()
217 if(command->data_len > MAX_WRITE_BLOCK+16) { in cmd_loop()
232 switch (command->op) { in cmd_loop()
237 error = verify_data_len(command, 36); in cmd_loop()
256 error = verify_data_len(command, 0) || handle_get_security_info(); in cmd_loop()
260 error = verify_data_len(command, 0) || SPIEraseChip(); in cmd_loop()
264 error = verify_data_len(command, 8) || handle_flash_erase(data_words[0], data_words[1]); in cmd_loop()
268 error = verify_data_len(command, 8); in cmd_loop()
272 error = verify_data_len(command, 16); in cmd_loop()
279 error = verify_data_len(command, 16) || handle_flash_get_md5sum(data_words[0], data_words[1]); in cmd_loop()
288 if (command->data_len == 16 && data_words[2] > MAX_WRITE_BLOCK) { in cmd_loop()
291 … error = verify_data_len(command, 16) || handle_flash_begin(data_words[0], data_words[3]); in cmd_loop()
301 if (command->data_len == 16 && data_words[2] > MAX_WRITE_BLOCK) { in cmd_loop()
304 …error = verify_data_len(command, 16) || handle_flash_deflated_begin(data_words[0], data_words[1] *… in cmd_loop()
317 int payload_len = command->data_len - 16; in cmd_loop()
322 uint8_t data_checksum = calculate_checksum(command->data_buf + 16, payload_len); in cmd_loop()
323 if (data_checksum != command->checksum) { in cmd_loop()
337 error = verify_data_len(command, 24) || handle_spi_set_params(data_words, &status); in cmd_loop()
341 error = verify_data_len(command, 4) || handle_spi_attach(data_words[0]); in cmd_loop()
345 if (command->data_len % sizeof(write_reg_args_t) != 0) { in cmd_loop()
348 …error = handle_write_reg((const write_reg_args_t *)data_words, command->data_len/sizeof(write_reg_… in cmd_loop()
353 error = verify_data_len(command, 4); in cmd_loop()
356 error = verify_data_len(command, 16) || handle_mem_begin(data_words[0], data_words[3]); in cmd_loop()
359 error = handle_mem_data(command->data_buf + 16, command->data_len - 16); in cmd_loop()
362 error = verify_data_len(command, 8) || handle_mem_finish(); in cmd_loop()
378 switch(command->op) { in cmd_loop()
389 handle_flash_data(command->data_buf + 16, command->data_len - 16); in cmd_loop()
394 handle_flash_encrypt_data(command->data_buf + 16, command->data_len -16); in cmd_loop()
398 handle_flash_deflated_data(command->data_buf + 16, command->data_len - 16); in cmd_loop()