typedef struct {
void *os_context;
- int (*spi_rx)(u8 *, u32);
int (*spi_trx)(u8 *, u8 *, u32);
int (*spi_max_speed)(void);
wilc_debug_func dPrint;
if ((cmd == CMD_RESET) ||
(cmd == CMD_TERMINATE) ||
(cmd == CMD_REPEAT)) {
- if (!g_spi.spi_rx(&rsp, 1)) {
+ if (!linux_spi_read(&rsp, 1)) {
result = N_FAIL;
goto _fail_;
}
}
- if (!g_spi.spi_rx(&rsp, 1)) {
+ if (!linux_spi_read(&rsp, 1)) {
PRINT_ER("[wilc spi]: Failed cmd response read, bus error...\n");
result = N_FAIL;
goto _fail_;
/**
* State response
**/
- if (!g_spi.spi_rx(&rsp, 1)) {
+ if (!linux_spi_read(&rsp, 1)) {
PRINT_ER("[wilc spi]: Failed cmd state read, bus error...\n");
result = N_FAIL;
goto _fail_;
/**
* Read bytes
**/
- if (!g_spi.spi_rx(&b[ix], nbytes)) {
+ if (!linux_spi_read(&b[ix], nbytes)) {
PRINT_ER("[wilc spi]: Failed data block read, bus error...\n");
result = N_FAIL;
goto _error_;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!g_spi.spi_rx(crc, 2)) {
+ if (!linux_spi_read(crc, 2)) {
PRINT_ER("[wilc spi]: Failed data block crc read, bus error...\n");
result = N_FAIL;
goto _error_;
**/
retry = 10;
do {
- if (!g_spi.spi_rx(&rsp, 1)) {
+ if (!linux_spi_read(&rsp, 1)) {
PRINT_ER("[wilc spi]: Failed data response read, bus error...\n");
result = N_FAIL;
break;
/**
* Read bytes
**/
- if (!g_spi.spi_rx(&b[ix], nbytes)) {
+ if (!linux_spi_read(&b[ix], nbytes)) {
PRINT_ER("[wilc spi]: Failed data block read, bus error...\n");
result = N_FAIL;
break;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!g_spi.spi_rx(crc, 2)) {
+ if (!linux_spi_read(crc, 2)) {
PRINT_ER("[wilc spi]: Failed data block crc read, bus error...\n");
result = N_FAIL;
break;
**/
retry = 10;
do {
- if (!g_spi.spi_rx(&rsp, 1)) {
+ if (!linux_spi_read(&rsp, 1)) {
PRINT_ER("[wilc spi]: Failed data response read, bus error...\n");
result = N_FAIL;
break;
/**
* Read bytes
**/
- if (!g_spi.spi_rx(&b[ix], nbytes)) {
+ if (!linux_spi_read(&b[ix], nbytes)) {
PRINT_ER("[wilc spi]: Failed data block read, bus error...\n");
result = N_FAIL;
break;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!g_spi.spi_rx(crc, 2)) {
+ if (!linux_spi_read(crc, 2)) {
PRINT_ER("[wilc spi]: Failed data block crc read, bus error...\n");
result = N_FAIL;
break;
} else {
return 0;
}
- g_spi.spi_rx = inp->io_func.u.spi.spi_rx;
g_spi.spi_trx = inp->io_func.u.spi.spi_trx;
g_spi.spi_max_speed = inp->io_func.u.spi.spi_max_speed;