MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / dsl_secuCheck

Function dsl_secuCheck

libsigrok4DSL/hardware/DSL/dsl.c:2683–2706  ·  view source on GitHub ↗

* security API interface */

Source from the content-addressed store, hash-verified

2681 * security API interface
2682 */
2683SR_PRIV int dsl_secuCheck(const struct sr_dev_inst *sdi, uint16_t* encryption, int steps)
2684{
2685 int tryCnt = SECU_TRY_CNT;
2686
2687 dsl_secuReset(sdi);
2688 if (dsl_isSecuPass(sdi))
2689 return SR_ERR;
2690 dsl_secuWrite(sdi, SECU_START, 0);
2691 while(steps--) {
2692 if (dsl_isSecuPass(sdi))
2693 return SR_ERR;
2694 while(!dsl_isSecuReady(sdi)) {
2695 if (tryCnt-- == 0) {
2696 sr_err("Get security ready failed.");
2697 return SR_ERR;
2698 }
2699 }
2700 if (dsl_secuRead(sdi) != 0)
2701 return SR_ERR;
2702 dsl_secuWrite(sdi, SECU_CHECK, encryption[steps]);
2703 }
2704
2705 return SR_OK;
2706}

Callers 1

dsl_dev_openFunction · 0.85

Calls 5

dsl_secuResetFunction · 0.85
dsl_isSecuPassFunction · 0.85
dsl_secuWriteFunction · 0.85
dsl_isSecuReadyFunction · 0.85
dsl_secuReadFunction · 0.85

Tested by

no test coverage detected