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