#include <linux/string.h>
#include "wilc_wlan_if.h"
#include "wilc_wlan.h"
+#include "linux_wlan_sdio.h"
#define WILC_SDIO_BLOCK_SIZE 512
typedef struct {
void *os_context;
u32 block_size;
- int (*sdio_cmd52)(sdio_cmd52_t *);
int (*sdio_cmd53)(sdio_cmd53_t *);
int (*sdio_set_max_speed)(void);
int (*sdio_set_default_speed)(void);
cmd.raw = 0;
cmd.address = 0x10c;
cmd.data = (u8)adr;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10c data...\n");
goto _fail_;
}
cmd.address = 0x10d;
cmd.data = (u8)(adr >> 8);
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10d data...\n");
goto _fail_;
}
cmd.address = 0x10e;
cmd.data = (u8)(adr >> 16);
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10e data...\n");
goto _fail_;
}
cmd.raw = 0;
cmd.address = 0x10;
cmd.data = (u8)block_size;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10 data...\n");
goto _fail_;
}
cmd.address = 0x11;
cmd.data = (u8)(block_size >> 8);
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x11 data...\n");
goto _fail_;
}
cmd.raw = 0;
cmd.address = 0x110;
cmd.data = (u8)block_size;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x110 data...\n");
goto _fail_;
}
cmd.address = 0x111;
cmd.data = (u8)(block_size >> 8);
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x111 data...\n");
goto _fail_;
}
cmd.raw = 0;
cmd.address = 0x4;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
return cmd.data;
#else
cmd.raw = 0;
cmd.address = 0x1C;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
cnt = cmd.data;
cmd.read_write = 0;
cmd.raw = 0;
cmd.address = 0x1D;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
cnt |= (cmd.data << 8);
cmd.read_write = 0;
cmd.raw = 0;
cmd.address = 0x1E;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
cnt |= (cmd.data << 16);
return cnt;
cmd.raw = 0;
cmd.address = 0xc;
cmd.data = 0;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Fail cmd 52, get BS register...\n");
goto _fail_;
}
cmd.raw = 0;
cmd.address = addr;
cmd.data = data;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd 52, read reg (%08x) ...\n", addr);
goto _fail_;
}
cmd.function = 0;
cmd.raw = 0;
cmd.address = addr;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd 52, read reg (%08x) ...\n", addr);
goto _fail_;
}
return 0;
}
- g_sdio.sdio_cmd52 = inp->io_func.u.sdio.sdio_cmd52;
g_sdio.sdio_cmd53 = inp->io_func.u.sdio.sdio_cmd53;
g_sdio.sdio_set_max_speed = inp->io_func.u.sdio.sdio_set_max_speed;
g_sdio.sdio_set_default_speed = inp->io_func.u.sdio.sdio_set_default_speed;
cmd.raw = 1;
cmd.address = 0x100;
cmd.data = 0x80;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Fail cmd 52, enable csa...\n");
goto _fail_;
}
cmd.raw = 1;
cmd.address = 0x2;
cmd.data = 0x2;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio] Fail cmd 52, set IOE register...\n");
goto _fail_;
}
loop = 3;
do {
cmd.data = 0;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Fail cmd 52, get IOR register...\n");
goto _fail_;
}
cmd.raw = 1;
cmd.address = 0x4;
cmd.data = 0x3;
- if (!g_sdio.sdio_cmd52(&cmd)) {
+ if (!linux_sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Fail cmd 52, set IEN register...\n");
goto _fail_;
}
cmd.raw = 0;
cmd.address = 0xf2;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
tmp = cmd.data;
/* cmd.read_write = 0; */
/* cmd.raw = 0; */
cmd.address = 0xf3;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
tmp |= (cmd.data << 8);
*size = tmp;
cmd.function = 1;
cmd.address = 0x04;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
if (cmd.data & BIT(0))
tmp |= INT_0;
cmd.raw = 0;
cmd.address = 0xf7;
cmd.data = 0;
- g_sdio.sdio_cmd52(&cmd);
+ linux_sdio_cmd52(&cmd);
irq_flags = cmd.data & 0x1f;
tmp |= ((irq_flags >> 0) << IRG_FLAGS_OFFSET);
}
cmd.address = 0xf8;
cmd.data = reg;
- ret = g_sdio.sdio_cmd52(&cmd);
+ ret = linux_sdio_cmd52(&cmd);
if (!ret) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0xf8 data (%d) ...\n", __LINE__);
goto _fail_;
cmd.address = 0xf8;
cmd.data = BIT(i);
- ret = g_sdio.sdio_cmd52(&cmd);
+ ret = linux_sdio_cmd52(&cmd);
if (!ret) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0xf8 data (%d) ...\n", __LINE__);
goto _fail_;
cmd.raw = 0;
cmd.address = 0xf6;
cmd.data = vmm_ctl;
- ret = g_sdio.sdio_cmd52(&cmd);
+ ret = linux_sdio_cmd52(&cmd);
if (!ret) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0xf6 data (%d) ...\n", __LINE__);
goto _fail_;