Lines Matching refs:ese
42 static int fake_open(struct EseInterface *ese, in fake_open() argument
44 ese->pad[0] = 1; /* rx complete */ in fake_open()
45 ese->pad[1] = 1; /* tx complete */ in fake_open()
49 static void fake_close(struct EseInterface *ese) { in fake_close() argument
50 if (!ese->pad[0] || !ese->pad[1]) { in fake_close()
52 ese_set_error(ese, kEseFakeHwErrorEarlyClose); in fake_close()
57 static uint32_t fake_receive(struct EseInterface *ese, uint8_t *buf, in fake_receive() argument
59 if (!ese->pad[1]) { in fake_receive()
60 ese_set_error(ese, kEseFakeHwErrorReceiveDuringTransmit); in fake_receive()
63 ese->pad[0] = complete; in fake_receive()
65 ese_set_error(ese, kEseFakeHwErrorInvalidReceiveSize); in fake_receive()
74 static uint32_t fake_transmit(struct EseInterface *ese, const uint8_t *buf, in fake_transmit() argument
76 if (!ese->pad[0]) { in fake_transmit()
77 ese_set_error(ese, kEseFakeHwErrorTransmitDuringReceive); in fake_transmit()
80 ese->pad[1] = complete; in fake_transmit()
82 ese_set_error(ese, kEseFakeHwErrorInvalidTransmitSize); in fake_transmit()
91 static int fake_poll(struct EseInterface *ese, uint8_t poll_for, float timeout, in fake_poll() argument
94 if (!ese->pad[1]) { in fake_poll()
95 ese_set_error(ese, kEseFakeHwErrorReceiveDuringTransmit); in fake_poll()
106 ese->pad[0] = complete; in fake_poll()
110 uint32_t fake_transceive(struct EseInterface *ese, in fake_transceive() argument
118 if (!ese->pad[0] || !ese->pad[1]) { in fake_transceive()
119 ese_set_error(ese, kEseFakeHwErrorTranscieveWhileBusy); in fake_transceive()
124 fake_transmit(ese, tx_buf->base + offset, tx_buf->len - offset, 0); in fake_transceive()
131 if (ese_error(ese)) { in fake_transceive()
134 ese_set_error(ese, kEseFakeHwErrorEmptyTransmit); in fake_transceive()
141 fake_transmit(ese, NULL, 0, 1); /* Complete. */ in fake_transceive()
142 if (fake_poll(ese, 0xad, 10, 0) != 1) { in fake_transceive()
143 ese_set_error(ese, kEseGlobalErrorPollTimedOut); in fake_transceive()
149 processed += fake_receive(ese, rx_buf->base, rx_buf->len, 1); in fake_transceive()