Lines Matching refs:rc
92 int rc; in UpdateFirmware() local
95 rc = FindUpdateFunctions(); in UpdateFirmware()
96 if (rc != UPDATE_SUCCESS) in UpdateFirmware()
97 return rc; in UpdateFirmware()
99 rc = m_device.QueryBasicProperties(); in UpdateFirmware()
100 if (rc < 0) in UpdateFirmware()
107 rc = UPDATE_FAIL_FIRMWARE_IMAGE_IS_OLDER; in UpdateFirmware()
108 return rc; in UpdateFirmware()
115 rc = DisableNonessentialInterupts(); in UpdateFirmware()
116 if (rc != UPDATE_SUCCESS) in UpdateFirmware()
117 return rc; in UpdateFirmware()
119 rc = ReadF34Queries(); in UpdateFirmware()
120 if (rc != UPDATE_SUCCESS) in UpdateFirmware()
121 return rc; in UpdateFirmware()
123 rc = m_firmwareImage.VerifyImageMatchesDevice(GetFirmwareSize(), GetConfigSize()); in UpdateFirmware()
124 if (rc != UPDATE_SUCCESS) in UpdateFirmware()
125 return rc; in UpdateFirmware()
127 rc = EnterFlashProgramming(); in UpdateFirmware()
128 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
129 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
137 rc = WriteBlocks(m_firmwareImage.GetLockdownData(), in UpdateFirmware()
140 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
141 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
149 rc = EnterFlashProgramming(); in UpdateFirmware()
150 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
151 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
157 rc = WriteBootloaderID(); in UpdateFirmware()
158 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
159 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
165 rc = m_device.Write(m_f34StatusAddr, &eraseAll, 1); in UpdateFirmware()
166 if (rc != 1) { in UpdateFirmware()
168 rc = UPDATE_FAIL_ERASE_ALL; in UpdateFirmware()
172 rc = WaitForIdle(RMI_F34_ERASE_WAIT_MS); in UpdateFirmware()
173 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
174 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
184 rc = WriteBlocks(m_firmwareImage.GetFirmwareData(), m_fwBlockCount, in UpdateFirmware()
186 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
187 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
198 rc = WriteBlocks(m_firmwareImage.GetConfigData(), m_configBlockCount, in UpdateFirmware()
200 if (rc != UPDATE_SUCCESS) { in UpdateFirmware()
201 fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); in UpdateFirmware()
212 return rc; in UpdateFirmware()
218 int rc; in DisableNonessentialInterupts() local
221 rc = m_device.Write(m_f01.GetControlBase() + 1, &interruptEnabeMask, 1); in DisableNonessentialInterupts()
222 if (rc != 1) in DisableNonessentialInterupts()
223 return rc; in DisableNonessentialInterupts()
244 int rc; in ReadF34Queries() local
256 rc = m_device.Read(queryAddr, m_bootloaderID, RMI_BOOTLOADER_ID_SIZE); in ReadF34Queries()
257 if (rc != RMI_BOOTLOADER_ID_SIZE) in ReadF34Queries()
266 rc = m_device.Read(queryAddr, buf, 1); in ReadF34Queries()
267 if (rc != 1) in ReadF34Queries()
276 rc = m_device.Read(queryAddr, buf, 2); in ReadF34Queries()
277 if (rc != 2) in ReadF34Queries()
284 rc = m_device.Read(queryAddr, buf, 8); in ReadF34Queries()
285 if (rc != 8) in ReadF34Queries()
291 rc = m_device.Read(queryAddr, buf, RMI_F34_QUERY_SIZE); in ReadF34Queries()
292 if (rc != RMI_F34_QUERY_SIZE) in ReadF34Queries()
327 int rc; in ReadF34Controls() local
331 rc = m_device.Read(m_f34StatusAddr, buf, 2); in ReadF34Controls()
332 if (rc != 2) in ReadF34Controls()
340 rc = m_device.Read(m_f34StatusAddr, buf, 1); in ReadF34Controls()
341 if (rc != 1) in ReadF34Controls()
354 int rc; in WriteBootloaderID() local
360 rc = m_device.Write(m_f34.GetDataBase() + blockDataOffset, in WriteBootloaderID()
362 if (rc != RMI_BOOTLOADER_ID_SIZE) in WriteBootloaderID()
370 int rc; in EnterFlashProgramming() local
374 rc = WriteBootloaderID(); in EnterFlashProgramming()
375 if (rc != UPDATE_SUCCESS) in EnterFlashProgramming()
376 return rc; in EnterFlashProgramming()
379 rc = m_device.Write(m_f34StatusAddr, &enableProg, 1); in EnterFlashProgramming()
380 if (rc != 1) in EnterFlashProgramming()
385 rc = WaitForIdle(0); in EnterFlashProgramming()
386 if (rc != UPDATE_SUCCESS) in EnterFlashProgramming()
393 rc = FindUpdateFunctions(); in EnterFlashProgramming()
394 if (rc != UPDATE_SUCCESS) in EnterFlashProgramming()
395 return rc; in EnterFlashProgramming()
397 rc = m_device.Read(m_f01.GetDataBase(), &m_deviceStatus, 1); in EnterFlashProgramming()
398 if (rc != 1) in EnterFlashProgramming()
404 rc = ReadF34Queries(); in EnterFlashProgramming()
405 if (rc != UPDATE_SUCCESS) in EnterFlashProgramming()
406 return rc; in EnterFlashProgramming()
408 rc = m_device.Read(m_f01.GetControlBase(), &f01Control_0, 1); in EnterFlashProgramming()
409 if (rc != 1) in EnterFlashProgramming()
415 rc = m_device.Write(m_f01.GetControlBase(), &f01Control_0, 1); in EnterFlashProgramming()
416 if (rc != 1) in EnterFlashProgramming()
426 int rc; in WriteBlocks() local
435 rc = m_device.Write(m_f34.GetDataBase(), zeros, 2); in WriteBlocks()
436 if (rc != 2) in WriteBlocks()
444 rc = m_device.Write(addr, blockWithCmd, m_blockSize + 1); in WriteBlocks()
445 if (rc != m_blockSize + 1) { in WriteBlocks()
450 rc = m_device.Write(addr, block, m_blockSize); in WriteBlocks()
451 if (rc != m_blockSize) { in WriteBlocks()
456 rc = m_device.Write(m_f34StatusAddr, &cmd, 1); in WriteBlocks()
457 if (rc != 1) { in WriteBlocks()
463 rc = WaitForIdle(RMI_F34_IDLE_WAIT_MS, !m_writeBlockWithCmd); in WriteBlocks()
464 if (rc != UPDATE_SUCCESS) { in WriteBlocks()
482 int rc = 0; in WaitForIdle() local
489 rc = m_device.WaitForAttention(&tv, m_f34.GetInterruptMask()); in WaitForIdle()
490 if (rc == -ETIMEDOUT) in WaitForIdle()
501 if (rc <= 0 || readF34OnSucess) { in WaitForIdle()
502 rc = ReadF34Controls(); in WaitForIdle()
503 if (rc != UPDATE_SUCCESS) in WaitForIdle()
504 return rc; in WaitForIdle()