This patch replaces uint8_t with u8 that is a preferred kernel type.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return s32Error;
}
#endif /*WILC_AP_EXTERNAL_MLME*/
-uint32_t wilc_get_chipid(uint8_t);
+uint32_t wilc_get_chipid(u8);
s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout)
{
#define IS_MGMT_STATUS_SUCCES 0x040
#define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
-void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size)
+void WILC_WFI_monitor_rx(u8 *buff, uint32_t size)
{
uint32_t header, pkt_offset;
struct sk_buff *skb = NULL;
static int wlan_deinit_locks(linux_wlan_t *nic);
static void wlan_deinitialize_threads(linux_wlan_t *nic);
-extern void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size);
-extern void WILC_WFI_p2p_rx(struct net_device *dev, uint8_t *buff, uint32_t size);
+extern void WILC_WFI_monitor_rx(u8 *buff, uint32_t size);
+extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, uint32_t size);
static void linux_wlan_tx_complete(void *priv, int status);
-void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset);
+void frmw_to_linux(u8 *buff, uint32_t size, uint32_t pkt_offset);
static int mac_init_fn(struct net_device *ndev);
int mac_xmit(struct sk_buff *skb, struct net_device *dev);
int mac_open(struct net_device *ndev);
/*
* OS functions
*/
-static void linux_wlan_dbg(uint8_t *buff)
+static void linux_wlan_dbg(u8 *buff)
{
PRINT_D(INIT_DBG, "%d\n", *buff);
}
}
-struct net_device *GetIfHandler(uint8_t *pMacHeader)
+struct net_device *GetIfHandler(u8 *pMacHeader)
{
- uint8_t *Bssid, *Bssid1;
+ u8 *Bssid, *Bssid1;
int i = 0;
Bssid = pMacHeader + 10;
return NULL;
}
-int linux_wlan_set_bssid(struct net_device *wilc_netdev, uint8_t *pBSSID)
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
{
int i = 0;
int ret = -1;
/*Function to get number of connected interfaces*/
int linux_wlan_get_num_conn_ifcs(void)
{
- uint8_t i = 0;
- uint8_t null_bssid[6] = {0};
- uint8_t ret_val = 0;
+ u8 i = 0;
+ u8 null_bssid[6] = {0};
+ u8 ret_val = 0;
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
if (memcmp(g_linux_wlan->strInterfaceInfo[i].aBSSID, null_bssid, 6))
#ifdef COMPLEMENT_BOOT
extern volatile int probe;
-extern uint8_t core_11b_ready(void);
+extern u8 core_11b_ready(void);
#define READY_CHECK_THRESHOLD 30
extern void wilc_wlan_global_reset(void);
-uint8_t wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, wilc_wlan_oup_t *nwo, linux_wlan_t *nic)
+u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, wilc_wlan_oup_t *nwo, linux_wlan_t *nic)
{
- uint8_t trials = 0;
+ u8 trials = 0;
while ((core_11b_ready() && (READY_CHECK_THRESHOLD > (trials++)))) {
PRINT_D(INIT_DBG, "11b core not ready yet: %u\n", trials);
return s32Error;
}
-void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset)
+void frmw_to_linux(u8 *buff, uint32_t size, uint32_t pkt_offset)
{
unsigned int frame_len = 0;
#endif
}
-void WILC_WFI_mgmt_rx(uint8_t *buff, uint32_t size)
+void WILC_WFI_mgmt_rx(u8 *buff, uint32_t size)
{
int i = 0;
perInterface_wlan_t *nic;
#if defined(TXRX_PHASE_SIZE)
-int linux_spi_write(uint8_t *b, uint32_t len)
+int linux_spi_write(u8 *b, uint32_t len)
{
int ret;
}
#else
-int linux_spi_write(uint8_t *b, uint32_t len)
+int linux_spi_write(u8 *b, uint32_t len)
{
int ret;
int linux_spi_init(void *vp);
void linux_spi_deinit(void *vp);
-int linux_spi_write(uint8_t *b, uint32_t len);
-int linux_spi_read(uint8_t *rb, uint32_t rlen);
+int linux_spi_write(u8 *b, uint32_t len);
+int linux_spi_read(u8 *rb, uint32_t rlen);
int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen);
int linux_spi_set_max_speed(void);
#endif
cmd.function = 0;
cmd.raw = 0;
cmd.address = 0x10c;
- cmd.data = (uint8_t)adr;
+ cmd.data = (u8)adr;
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10c data...\n");
goto _fail_;
}
cmd.address = 0x10d;
- cmd.data = (uint8_t)(adr >> 8);
+ cmd.data = (u8)(adr >> 8);
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10d data...\n");
goto _fail_;
}
cmd.address = 0x10e;
- cmd.data = (uint8_t)(adr >> 16);
+ cmd.data = (u8)(adr >> 16);
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10e data...\n");
goto _fail_;
cmd.function = 0;
cmd.raw = 0;
cmd.address = 0x10c;
- cmd.data = (uint8_t)adr;
+ cmd.data = (u8)adr;
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10c data...\n");
goto _fail_;
cmd.function = 0;
cmd.raw = 0;
cmd.address = 0x10;
- cmd.data = (uint8_t)block_size;
+ cmd.data = (u8)block_size;
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x10 data...\n");
goto _fail_;
}
cmd.address = 0x11;
- cmd.data = (uint8_t)(block_size >> 8);
+ cmd.data = (u8)(block_size >> 8);
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x11 data...\n");
goto _fail_;
cmd.function = 0;
cmd.raw = 0;
cmd.address = 0x110;
- cmd.data = (uint8_t)block_size;
+ cmd.data = (u8)block_size;
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x110 data...\n");
goto _fail_;
}
cmd.address = 0x111;
- cmd.data = (uint8_t)(block_size >> 8);
+ cmd.data = (u8)(block_size >> 8);
if (!g_sdio.sdio_cmd52(&cmd)) {
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd52, set 0x111 data...\n");
goto _fail_;
cmd.block_mode = 0;
cmd.increment = 1;
cmd.count = 4;
- cmd.buffer = (uint8_t *)&data;
+ cmd.buffer = (u8 *)&data;
cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */
if (!g_sdio.sdio_cmd53(&cmd)) {
return 0;
}
-static int sdio_write(uint32_t addr, uint8_t *buf, uint32_t size)
+static int sdio_write(uint32_t addr, u8 *buf, uint32_t size)
{
uint32_t block_size = g_sdio.block_size;
sdio_cmd53_t cmd;
cmd.block_mode = 0;
cmd.increment = 1;
cmd.count = 4;
- cmd.buffer = (uint8_t *)data;
+ cmd.buffer = (u8 *)data;
cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */
return 0;
}
-static int sdio_read(uint32_t addr, uint8_t *buf, uint32_t size)
+static int sdio_read(uint32_t addr, u8 *buf, uint32_t size)
{
uint32_t block_size = g_sdio.block_size;
sdio_cmd53_t cmd;
*/
typedef struct {
void *os_context;
- int (*spi_tx)(uint8_t *, uint32_t);
- int (*spi_rx)(uint8_t *, uint32_t);
- int (*spi_trx)(uint8_t *, uint8_t *, uint32_t);
+ int (*spi_tx)(u8 *, uint32_t);
+ int (*spi_rx)(u8 *, uint32_t);
+ int (*spi_trx)(u8 *, u8 *, uint32_t);
int (*spi_max_speed)(void);
wilc_debug_func dPrint;
int crc_off;
static wilc_spi_t g_spi;
-static int spi_read(uint32_t, uint8_t *, uint32_t);
-static int spi_write(uint32_t, uint8_t *, uint32_t);
+static int spi_read(uint32_t, u8 *, uint32_t);
+static int spi_write(uint32_t, u8 *, uint32_t);
/********************************************
*
*
********************************************/
-static const uint8_t crc7_syndrome_table[256] = {
+static const u8 crc7_syndrome_table[256] = {
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f,
0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77,
0x19, 0x10, 0x0b, 0x02, 0x3d, 0x34, 0x2f, 0x26,
0x46, 0x4f, 0x54, 0x5d, 0x62, 0x6b, 0x70, 0x79
};
-static uint8_t crc7_byte(uint8_t crc, uint8_t data)
+static u8 crc7_byte(u8 crc, u8 data)
{
return crc7_syndrome_table[(crc << 1) ^ data];
}
-static uint8_t crc7(uint8_t crc, const uint8_t *buffer, uint32_t len)
+static u8 crc7(u8 crc, const u8 *buffer, uint32_t len)
{
while (len--)
crc = crc7_byte(crc, *buffer++);
#define DATA_PKT_SZ_8K (8 * 1024)
#define DATA_PKT_SZ DATA_PKT_SZ_8K
-static int spi_cmd(uint8_t cmd, uint32_t adr, uint32_t data, uint32_t sz, uint8_t clockless)
+static int spi_cmd(u8 cmd, uint32_t adr, uint32_t data, uint32_t sz, u8 clockless)
{
- uint8_t bc[9];
+ u8 bc[9];
int len = 5;
int result = N_OK;
bc[0] = cmd;
switch (cmd) {
case CMD_SINGLE_READ: /* single word (4 bytes) read */
- bc[1] = (uint8_t)(adr >> 16);
- bc[2] = (uint8_t)(adr >> 8);
- bc[3] = (uint8_t)adr;
+ bc[1] = (u8)(adr >> 16);
+ bc[2] = (u8)(adr >> 8);
+ bc[3] = (u8)adr;
len = 5;
break;
case CMD_INTERNAL_READ: /* internal register read */
- bc[1] = (uint8_t)(adr >> 8);
+ bc[1] = (u8)(adr >> 8);
if (clockless)
bc[1] |= (1 << 7);
- bc[2] = (uint8_t)adr;
+ bc[2] = (u8)adr;
bc[3] = 0x00;
len = 5;
break;
case CMD_DMA_WRITE: /* dma write */
case CMD_DMA_READ: /* dma read */
- bc[1] = (uint8_t)(adr >> 16);
- bc[2] = (uint8_t)(adr >> 8);
- bc[3] = (uint8_t)adr;
- bc[4] = (uint8_t)(sz >> 8);
- bc[5] = (uint8_t)(sz);
+ bc[1] = (u8)(adr >> 16);
+ bc[2] = (u8)(adr >> 8);
+ bc[3] = (u8)adr;
+ bc[4] = (u8)(sz >> 8);
+ bc[5] = (u8)(sz);
len = 7;
break;
case CMD_DMA_EXT_WRITE: /* dma extended write */
case CMD_DMA_EXT_READ: /* dma extended read */
- bc[1] = (uint8_t)(adr >> 16);
- bc[2] = (uint8_t)(adr >> 8);
- bc[3] = (uint8_t)adr;
- bc[4] = (uint8_t)(sz >> 16);
- bc[5] = (uint8_t)(sz >> 8);
- bc[6] = (uint8_t)(sz);
+ bc[1] = (u8)(adr >> 16);
+ bc[2] = (u8)(adr >> 8);
+ bc[3] = (u8)adr;
+ bc[4] = (u8)(sz >> 16);
+ bc[5] = (u8)(sz >> 8);
+ bc[6] = (u8)(sz);
len = 8;
break;
case CMD_INTERNAL_WRITE: /* internal register write */
- bc[1] = (uint8_t)(adr >> 8);
+ bc[1] = (u8)(adr >> 8);
if (clockless)
bc[1] |= (1 << 7);
- bc[2] = (uint8_t)(adr);
- bc[3] = (uint8_t)(data >> 24);
- bc[4] = (uint8_t)(data >> 16);
- bc[5] = (uint8_t)(data >> 8);
- bc[6] = (uint8_t)(data);
+ bc[2] = (u8)(adr);
+ bc[3] = (u8)(data >> 24);
+ bc[4] = (u8)(data >> 16);
+ bc[5] = (u8)(data >> 8);
+ bc[6] = (u8)(data);
len = 8;
break;
case CMD_SINGLE_WRITE: /* single word write */
- bc[1] = (uint8_t)(adr >> 16);
- bc[2] = (uint8_t)(adr >> 8);
- bc[3] = (uint8_t)(adr);
- bc[4] = (uint8_t)(data >> 24);
- bc[5] = (uint8_t)(data >> 16);
- bc[6] = (uint8_t)(data >> 8);
- bc[7] = (uint8_t)(data);
+ bc[1] = (u8)(adr >> 16);
+ bc[2] = (u8)(adr >> 8);
+ bc[3] = (u8)(adr);
+ bc[4] = (u8)(data >> 24);
+ bc[5] = (u8)(data >> 16);
+ bc[6] = (u8)(data >> 8);
+ bc[7] = (u8)(data);
len = 9;
break;
if (result) {
if (!g_spi.crc_off)
- bc[len - 1] = (crc7(0x7f, (const uint8_t *)&bc[0], len - 1)) << 1;
+ bc[len - 1] = (crc7(0x7f, (const u8 *)&bc[0], len - 1)) << 1;
else
len -= 1;
return result;
}
-static int spi_cmd_rsp(uint8_t cmd)
+static int spi_cmd_rsp(u8 cmd)
{
- uint8_t rsp;
+ u8 rsp;
int result = N_OK;
/**
return result;
}
-static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz, uint8_t clockless)
+static int spi_cmd_complete(u8 cmd, uint32_t adr, u8 *b, uint32_t sz, u8 clockless)
{
- uint8_t wb[32], rb[32];
- uint8_t wix, rix;
+ u8 wb[32], rb[32];
+ u8 wix, rix;
uint32_t len2;
- uint8_t rsp;
+ u8 rsp;
int len = 0;
int result = N_OK;
wb[0] = cmd;
switch (cmd) {
case CMD_SINGLE_READ: /* single word (4 bytes) read */
- wb[1] = (uint8_t)(adr >> 16);
- wb[2] = (uint8_t)(adr >> 8);
- wb[3] = (uint8_t)adr;
+ wb[1] = (u8)(adr >> 16);
+ wb[2] = (u8)(adr >> 8);
+ wb[3] = (u8)adr;
len = 5;
break;
case CMD_INTERNAL_READ: /* internal register read */
- wb[1] = (uint8_t)(adr >> 8);
+ wb[1] = (u8)(adr >> 8);
if (clockless == 1)
wb[1] |= (1 << 7);
- wb[2] = (uint8_t)adr;
+ wb[2] = (u8)adr;
wb[3] = 0x00;
len = 5;
break;
case CMD_DMA_WRITE: /* dma write */
case CMD_DMA_READ: /* dma read */
- wb[1] = (uint8_t)(adr >> 16);
- wb[2] = (uint8_t)(adr >> 8);
- wb[3] = (uint8_t)adr;
- wb[4] = (uint8_t)(sz >> 8);
- wb[5] = (uint8_t)(sz);
+ wb[1] = (u8)(adr >> 16);
+ wb[2] = (u8)(adr >> 8);
+ wb[3] = (u8)adr;
+ wb[4] = (u8)(sz >> 8);
+ wb[5] = (u8)(sz);
len = 7;
break;
case CMD_DMA_EXT_WRITE: /* dma extended write */
case CMD_DMA_EXT_READ: /* dma extended read */
- wb[1] = (uint8_t)(adr >> 16);
- wb[2] = (uint8_t)(adr >> 8);
- wb[3] = (uint8_t)adr;
- wb[4] = (uint8_t)(sz >> 16);
- wb[5] = (uint8_t)(sz >> 8);
- wb[6] = (uint8_t)(sz);
+ wb[1] = (u8)(adr >> 16);
+ wb[2] = (u8)(adr >> 8);
+ wb[3] = (u8)adr;
+ wb[4] = (u8)(sz >> 16);
+ wb[5] = (u8)(sz >> 8);
+ wb[6] = (u8)(sz);
len = 8;
break;
case CMD_INTERNAL_WRITE: /* internal register write */
- wb[1] = (uint8_t)(adr >> 8);
+ wb[1] = (u8)(adr >> 8);
if (clockless == 1)
wb[1] |= (1 << 7);
- wb[2] = (uint8_t)(adr);
+ wb[2] = (u8)(adr);
wb[3] = b[3];
wb[4] = b[2];
wb[5] = b[1];
break;
case CMD_SINGLE_WRITE: /* single word write */
- wb[1] = (uint8_t)(adr >> 16);
- wb[2] = (uint8_t)(adr >> 8);
- wb[3] = (uint8_t)(adr);
+ wb[1] = (u8)(adr >> 16);
+ wb[2] = (u8)(adr >> 8);
+ wb[3] = (u8)(adr);
wb[4] = b[3];
wb[5] = b[2];
wb[6] = b[1];
}
if (!g_spi.crc_off)
- wb[len - 1] = (crc7(0x7f, (const uint8_t *)&wb[0], len - 1)) << 1;
+ wb[len - 1] = (crc7(0x7f, (const u8 *)&wb[0], len - 1)) << 1;
else
len -= 1;
|| (cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) {
int retry;
/* uint16_t crc1, crc2; */
- uint8_t crc[2];
+ u8 crc[2];
/**
* Data Respnose header
**/
return result;
}
-static int spi_data_read(uint8_t *b, uint32_t sz)
+static int spi_data_read(u8 *b, uint32_t sz)
{
int retry, ix, nbytes;
int result = N_OK;
- uint8_t crc[2];
- uint8_t rsp;
+ u8 crc[2];
+ u8 rsp;
/**
* Data
return result;
}
-static int spi_data_write(uint8_t *b, uint32_t sz)
+static int spi_data_write(u8 *b, uint32_t sz)
{
int ix, nbytes;
int result = 1;
- uint8_t cmd, order, crc[2] = {0};
- /* uint8_t rsp; */
+ u8 cmd, order, crc[2] = {0};
+ /* u8 rsp; */
/**
* Data
#ifdef BIG_ENDIAN
dat = BYTE_SWAP(dat);
#endif
- result = spi_cmd_complete(CMD_INTERNAL_WRITE, adr, (uint8_t *)&dat, 4, 0);
+ result = spi_cmd_complete(CMD_INTERNAL_WRITE, adr, (u8 *)&dat, 4, 0);
if (result != N_OK) {
PRINT_ER("[wilc spi]: Failed internal write cmd...\n");
}
/**
* Data
**/
- result = spi_data_read((uint8_t *)data, 4);
+ result = spi_data_read((u8 *)data, 4);
if (result != N_OK) {
PRINT_ER("[wilc spi]: Failed internal read data...\n");
return 0;
}
#else
- result = spi_cmd_complete(CMD_INTERNAL_READ, adr, (uint8_t *)data, 4, 0);
+ result = spi_cmd_complete(CMD_INTERNAL_READ, adr, (u8 *)data, 4, 0);
if (result != N_OK) {
PRINT_ER("[wilc spi]: Failed internal read cmd...\n");
return 0;
static int spi_write_reg(uint32_t addr, uint32_t data)
{
int result = N_OK;
- uint8_t cmd = CMD_SINGLE_WRITE;
- uint8_t clockless = 0;
+ u8 cmd = CMD_SINGLE_WRITE;
+ u8 clockless = 0;
#if defined USE_OLD_SPI_SW
clockless = 1;
}
- result = spi_cmd_complete(cmd, addr, (uint8_t *)&data, 4, clockless);
+ result = spi_cmd_complete(cmd, addr, (u8 *)&data, 4, clockless);
if (result != N_OK) {
PRINT_ER("[wilc spi]: Failed cmd, write reg (%08x)...\n", addr);
}
}
-static int spi_write(uint32_t addr, uint8_t *buf, uint32_t size)
+static int spi_write(uint32_t addr, u8 *buf, uint32_t size)
{
int result;
- uint8_t cmd = CMD_DMA_EXT_WRITE;
+ u8 cmd = CMD_DMA_EXT_WRITE;
/**
* has to be greated than 4
static int spi_read_reg(uint32_t addr, uint32_t *data)
{
int result = N_OK;
- uint8_t cmd = CMD_SINGLE_READ;
- uint8_t clockless = 0;
+ u8 cmd = CMD_SINGLE_READ;
+ u8 clockless = 0;
#if defined USE_OLD_SPI_SW
result = spi_cmd(cmd, addr, 0, 4, 0);
return 0;
}
- result = spi_data_read((uint8_t *)data, 4);
+ result = spi_data_read((u8 *)data, 4);
if (result != N_OK) {
PRINT_ER("[wilc spi]: Failed data read...\n");
return 0;
clockless = 1;
}
- result = spi_cmd_complete(cmd, addr, (uint8_t *)data, 4, clockless);
+ result = spi_cmd_complete(cmd, addr, (u8 *)data, 4, clockless);
if (result != N_OK) {
PRINT_ER("[wilc spi]: Failed cmd, read reg (%08x)...\n", addr);
return 0;
return 1;
}
-static int spi_read(uint32_t addr, uint8_t *buf, uint32_t size)
+static int spi_read(uint32_t addr, u8 *buf, uint32_t size)
{
- uint8_t cmd = CMD_DMA_EXT_READ;
+ u8 cmd = CMD_DMA_EXT_READ;
int result;
if (size <= 4)
uint32_t get_rssi_avg(tstrNetworkInfo *pstrNetworkInfo)
{
- uint8_t i;
+ u8 i;
int rssi_v = 0;
- uint8_t num_rssi = (pstrNetworkInfo->strRssi.u8Full) ? NUM_RSSI : (pstrNetworkInfo->strRssi.u8Index);
+ u8 num_rssi = (pstrNetworkInfo->strRssi.u8Full) ? NUM_RSSI : (pstrNetworkInfo->strRssi.u8Index);
for (i = 0; i < num_rssi; i++)
rssi_v += pstrNetworkInfo->strRssi.as8RSSI[i];
return rssi_v;
}
-void refresh_scan(void *pUserVoid, uint8_t all, bool bDirectScan)
+void refresh_scan(void *pUserVoid, u8 all, bool bDirectScan)
{
struct wilc_priv *priv;
struct wiphy *wiphy;
{
int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
uint32_t ap_index = 0;
- uint8_t rssi_index = 0;
+ u8 rssi_index = 0;
if (u32LastScannedNtwrksCountShadow >= MAX_NUM_SCANNED_NETWORKS_SHADOW) {
PRINT_D(CFG80211_DBG, "Shadow network reached its maximum limit\n");
}
-int linux_wlan_set_bssid(struct net_device *wilc_netdev, uint8_t *pBSSID);
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID);
/**
#ifdef WILC_P2P
tstrWILC_WFIDrv *pstrWFIDrv;
#endif
- uint8_t NullBssid[ETH_ALEN] = {0};
+ u8 NullBssid[ETH_ALEN] = {0};
connecting = 0;
priv = wiphy_priv(wiphy);
* @version 1.0
*/
-void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t *buff, uint32_t size)
+void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, uint32_t size)
{
struct wilc_priv *priv;
int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed);
int WILC_WFI_DeInitHostInt(struct net_device *net);
int WILC_WFI_InitHostInt(struct net_device *net);
-void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size);
+void WILC_WFI_monitor_rx(u8 *buff, uint32_t size);
int WILC_WFI_deinit_mon_interface(void);
struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
} struct_frame_reg;
typedef struct {
- uint8_t aSrcAddress[ETH_ALEN];
- uint8_t aBSSID[ETH_ALEN];
+ u8 aSrcAddress[ETH_ALEN];
+ u8 aBSSID[ETH_ALEN];
tstrWILC_WFIDrv *drvHandler;
struct net_device *wilc_netdev;
} tstrInterfaceInfo;
#endif
wilc_wlan_oup_t oup;
int close;
- uint8_t u8NoIfcs;
+ u8 u8NoIfcs;
tstrInterfaceInfo strInterfaceInfo[NUM_CONCURRENT_IFC];
- uint8_t open_ifcs;
+ u8 open_ifcs;
struct mutex txq_cs;
/*Added by Amr - BugID_4720*/
} linux_wlan_t;
typedef struct {
- uint8_t u8IfIdx;
+ u8 u8IfIdx;
u8 iftype;
int monitor_flag;
int mac_opened;
extern wilc_hif_func_t hif_sdio;
extern wilc_hif_func_t hif_spi;
extern wilc_cfg_func_t mac_cfg;
-extern void WILC_WFI_mgmt_rx(uint8_t *buff, uint32_t size);
-uint32_t wilc_get_chipid(uint8_t update);
+extern void WILC_WFI_mgmt_rx(u8 *buff, uint32_t size);
+uint32_t wilc_get_chipid(u8 update);
u16 Set_machw_change_vir_if(bool bValue);
**/
#ifdef MEMORY_STATIC
uint32_t rx_buffer_size;
- uint8_t *rx_buffer;
+ u8 *rx_buffer;
uint32_t rx_buffer_offset;
#endif
/**
* TX buffer
**/
uint32_t tx_buffer_size;
- uint8_t *tx_buffer;
+ u8 *tx_buffer;
uint32_t tx_buffer_offset;
/**
static __inline int tcp_process(struct txq_entry_t *tqe)
{
int ret;
- uint8_t *eth_hdr_ptr;
- uint8_t *buffer = tqe->buffer;
+ u8 *eth_hdr_ptr;
+ u8 *buffer = tqe->buffer;
unsigned short h_proto;
int i;
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
eth_hdr_ptr = &buffer[0];
h_proto = ntohs(*((unsigned short *)ð_hdr_ptr[12]));
if (h_proto == 0x0800) { /* IP */
- uint8_t *ip_hdr_ptr;
- uint8_t protocol;
+ u8 *ip_hdr_ptr;
+ u8 protocol;
ip_hdr_ptr = &buffer[ETHERNET_HDR_LEN];
protocol = ip_hdr_ptr[9];
if (protocol == 0x06) {
- uint8_t *tcp_hdr_ptr;
+ u8 *tcp_hdr_ptr;
uint32_t IHL, Total_Length, Data_offset;
tcp_hdr_ptr = &ip_hdr_ptr[IP_HDR_LEN];
}
#endif
-static int wilc_wlan_txq_add_cfg_pkt(uint8_t *buffer, uint32_t buffer_size)
+static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, uint32_t buffer_size)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
struct txq_entry_t *tqe;
return 1;
}
-static int wilc_wlan_txq_add_net_pkt(void *priv, uint8_t *buffer, uint32_t buffer_size, wilc_tx_complete_func_t func)
+static int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, uint32_t buffer_size, wilc_tx_complete_func_t func)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
struct txq_entry_t *tqe;
}
/*Bug3959: transmitting mgmt frames received from host*/
#if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P)
-int wilc_wlan_txq_add_mgmt_pkt(void *priv, uint8_t *buffer, uint32_t buffer_size, wilc_tx_complete_func_t func)
+int wilc_wlan_txq_add_mgmt_pkt(void *priv, u8 *buffer, uint32_t buffer_size, wilc_tx_complete_func_t func)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
int i, entries = 0;
uint32_t sum;
uint32_t reg;
- uint8_t *txb = p->tx_buffer;
+ u8 *txb = p->tx_buffer;
uint32_t offset = 0;
int vmm_sz = 0;
struct txq_entry_t *tqe;
/**
* write to vmm table
**/
- ret = p->hif_func.hif_block_tx(WILC_VMM_TBL_RX_SHADOW_BASE, (uint8_t *)vmm_table, ((i + 1) * 4)); /* Bug 4477 fix */
+ ret = p->hif_func.hif_block_tx(WILC_VMM_TBL_RX_SHADOW_BASE, (u8 *)vmm_table, ((i + 1) * 4)); /* Bug 4477 fix */
if (!ret) {
wilc_debug(N_ERR, "ERR block TX of VMM table.\n");
break;
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
int offset = 0, size, has_packet = 0;
- uint8_t *buffer;
+ u8 *buffer;
struct rxq_entry_t *rqe;
p->rxq_exit = 0;
#ifdef MEMORY_STATIC
uint32_t offset = p->rx_buffer_offset;
#endif
- uint8_t *buffer = NULL;
+ u8 *buffer = NULL;
uint32_t size;
uint32_t retries = 0;
int ret = 0;
* Firmware download
*
********************************************/
-static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_size)
+static int wilc_wlan_firmware_download(const u8 *buffer, uint32_t buffer_size)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
uint32_t offset;
uint32_t addr, size, size2, blksz;
- uint8_t *dma_buffer;
+ u8 *dma_buffer;
int ret = 0;
blksz = (1ul << 12); /* Bug 4703: 4KB Good enough size for most platforms = PAGE_SIZE. */
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
uint32_t reg = 0;
int ret;
- uint8_t timeout = 10;
+ u8 timeout = 10;
/**
* TODO: stop the firmware, need a re-download
**/
cfg->wid_header[0] = 'Q';
}
cfg->wid_header[1] = seq_no; /* sequence number */
- cfg->wid_header[2] = (uint8_t)total_len;
- cfg->wid_header[3] = (uint8_t)(total_len >> 8);
- cfg->wid_header[4] = (uint8_t)driver_handler;
- cfg->wid_header[5] = (uint8_t)(driver_handler >> 8);
- cfg->wid_header[6] = (uint8_t)(driver_handler >> 16);
- cfg->wid_header[7] = (uint8_t)(driver_handler >> 24);
+ cfg->wid_header[2] = (u8)total_len;
+ cfg->wid_header[3] = (u8)(total_len >> 8);
+ cfg->wid_header[4] = (u8)driver_handler;
+ cfg->wid_header[5] = (u8)(driver_handler >> 8);
+ cfg->wid_header[6] = (u8)(driver_handler >> 16);
+ cfg->wid_header[7] = (u8)(driver_handler >> 24);
p->cfg_seq_no = seq_no;
/**
return 0;
}
-static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t buffer_size, int commit, uint32_t drvHandler)
+static int wilc_wlan_cfg_set(int start, uint32_t wid, u8 *buffer, uint32_t buffer_size, int commit, uint32_t drvHandler)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
uint32_t offset;
return ret_size;
}
-static int wilc_wlan_cfg_get_val(uint32_t wid, uint8_t *buffer, uint32_t buffer_size)
+static int wilc_wlan_cfg_get_val(uint32_t wid, u8 *buffer, uint32_t buffer_size)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
int ret;
}
-uint32_t wilc_get_chipid(uint8_t update)
+uint32_t wilc_get_chipid(u8 update)
{
static uint32_t chipid;
/* SDIO can't read into global variables */
}
#ifdef COMPLEMENT_BOOT
-uint8_t core_11b_ready(void)
+u8 core_11b_ready(void)
{
uint32_t reg_val;
struct txq_entry_t *prev;
int type;
int tcp_PendingAck_index;
- uint8_t *buffer;
+ u8 *buffer;
int buffer_size;
void *priv;
int status;
struct rxq_entry_t {
struct rxq_entry_t *next;
- uint8_t *buffer;
+ u8 *buffer;
int buffer_size;
};
int (*hif_deinit)(void *);
int (*hif_read_reg)(uint32_t, uint32_t *);
int (*hif_write_reg)(uint32_t, uint32_t);
- int (*hif_block_rx)(uint32_t, uint8_t *, uint32_t);
- int (*hif_block_tx)(uint32_t, uint8_t *, uint32_t);
+ int (*hif_block_rx)(uint32_t, u8 *, uint32_t);
+ int (*hif_block_tx)(uint32_t, u8 *, uint32_t);
int (*hif_sync)(void);
int (*hif_clear_int)(void);
int (*hif_read_int)(uint32_t *);
int (*hif_clear_int_ext)(uint32_t);
int (*hif_read_size)(uint32_t *);
- int (*hif_block_tx_ext)(uint32_t, uint8_t *, uint32_t);
- int (*hif_block_rx_ext)(uint32_t, uint8_t *, uint32_t);
+ int (*hif_block_tx_ext)(uint32_t, u8 *, uint32_t);
+ int (*hif_block_rx_ext)(uint32_t, u8 *, uint32_t);
int (*hif_sync_ext)(int);
void (*hif_set_max_bus_speed)(void);
void (*hif_set_default_bus_speed)(void);
#define MAX_CFG_FRAME_SIZE 1468
typedef struct {
- uint8_t ether_header[14];
- uint8_t ip_header[20];
- uint8_t udp_header[8];
- uint8_t wid_header[8];
- uint8_t frame[MAX_CFG_FRAME_SIZE];
+ u8 ether_header[14];
+ u8 ip_header[20];
+ u8 udp_header[8];
+ u8 wid_header[8];
+ u8 frame[MAX_CFG_FRAME_SIZE];
} wilc_cfg_frame_t;
typedef struct {
- int (*wlan_tx)(uint8_t *, uint32_t, wilc_tx_complete_func_t);
+ int (*wlan_tx)(u8 *, uint32_t, wilc_tx_complete_func_t);
} wilc_wlan_cfg_func_t;
typedef struct {
} wilc_cfg_rsp_t;
typedef struct {
- int (*cfg_wid_set)(uint8_t *, uint32_t, uint16_t, uint8_t *, int);
- int (*cfg_wid_get)(uint8_t *, uint32_t, uint16_t);
- int (*cfg_wid_get_val)(uint16_t, uint8_t *, uint32_t);
- int (*rx_indicate)(uint8_t *, int, wilc_cfg_rsp_t *);
+ int (*cfg_wid_set)(u8 *, uint32_t, uint16_t, u8 *, int);
+ int (*cfg_wid_get)(u8 *, uint32_t, uint16_t);
+ int (*cfg_wid_get_val)(uint16_t, u8 *, uint32_t);
+ int (*rx_indicate)(u8 *, int, wilc_cfg_rsp_t *);
int (*cfg_init)(wilc_debug_func);
} wilc_cfg_func_t;
wilc_debug_func dPrint;
int mac_status;
- uint8_t mac_address[7];
- uint8_t ip_address[5];
- uint8_t bssid[7];
- uint8_t ssid[34];
- uint8_t firmware_version[129];
- uint8_t supp_rate[24];
- uint8_t wep_key[28];
- uint8_t i_psk[66];
- uint8_t hardwareProductVersion[33];
- uint8_t phyversion[17];
- uint8_t supp_username[21];
- uint8_t supp_password[64];
- uint8_t assoc_req[256];
- uint8_t assoc_rsp[256];
- uint8_t firmware_info[8];
- uint8_t scan_result[256];
- uint8_t scan_result1[256];
+ u8 mac_address[7];
+ u8 ip_address[5];
+ u8 bssid[7];
+ u8 ssid[34];
+ u8 firmware_version[129];
+ u8 supp_rate[24];
+ u8 wep_key[28];
+ u8 i_psk[66];
+ u8 hardwareProductVersion[33];
+ u8 phyversion[17];
+ u8 supp_username[21];
+ u8 supp_password[64];
+ u8 assoc_req[256];
+ u8 assoc_rsp[256];
+ u8 firmware_info[8];
+ u8 scan_result[256];
+ u8 scan_result1[256];
} wilc_mac_cfg_t;
static wilc_mac_cfg_t g_mac;
*
********************************************/
-static int wilc_wlan_cfg_set_byte(uint8_t *frame, uint32_t offset, uint16_t id, uint8_t val8)
+static int wilc_wlan_cfg_set_byte(u8 *frame, uint32_t offset, uint16_t id, u8 val8)
{
- uint8_t *buf;
+ u8 *buf;
if ((offset + 4) >= MAX_CFG_FRAME_SIZE)
return 0;
buf = &frame[offset];
- buf[0] = (uint8_t)id;
- buf[1] = (uint8_t)(id >> 8);
+ buf[0] = (u8)id;
+ buf[1] = (u8)(id >> 8);
buf[2] = 1;
buf[3] = val8;
return 4;
}
-static int wilc_wlan_cfg_set_hword(uint8_t *frame, uint32_t offset, uint16_t id, uint16_t val16)
+static int wilc_wlan_cfg_set_hword(u8 *frame, uint32_t offset, uint16_t id, uint16_t val16)
{
- uint8_t *buf;
+ u8 *buf;
if ((offset + 5) >= MAX_CFG_FRAME_SIZE)
return 0;
buf = &frame[offset];
- buf[0] = (uint8_t)id;
- buf[1] = (uint8_t)(id >> 8);
+ buf[0] = (u8)id;
+ buf[1] = (u8)(id >> 8);
buf[2] = 2;
- buf[3] = (uint8_t)val16;
- buf[4] = (uint8_t)(val16 >> 8);
+ buf[3] = (u8)val16;
+ buf[4] = (u8)(val16 >> 8);
return 5;
}
-static int wilc_wlan_cfg_set_word(uint8_t *frame, uint32_t offset, uint16_t id, uint32_t val32)
+static int wilc_wlan_cfg_set_word(u8 *frame, uint32_t offset, uint16_t id, uint32_t val32)
{
- uint8_t *buf;
+ u8 *buf;
if ((offset + 7) >= MAX_CFG_FRAME_SIZE)
return 0;
buf = &frame[offset];
- buf[0] = (uint8_t)id;
- buf[1] = (uint8_t)(id >> 8);
+ buf[0] = (u8)id;
+ buf[1] = (u8)(id >> 8);
buf[2] = 4;
- buf[3] = (uint8_t)val32;
- buf[4] = (uint8_t)(val32 >> 8);
- buf[5] = (uint8_t)(val32 >> 16);
- buf[6] = (uint8_t)(val32 >> 24);
+ buf[3] = (u8)val32;
+ buf[4] = (u8)(val32 >> 8);
+ buf[5] = (u8)(val32 >> 16);
+ buf[6] = (u8)(val32 >> 24);
return 7;
}
-static int wilc_wlan_cfg_set_str(uint8_t *frame, uint32_t offset, uint16_t id, uint8_t *str, uint32_t size)
+static int wilc_wlan_cfg_set_str(u8 *frame, uint32_t offset, uint16_t id, u8 *str, uint32_t size)
{
- uint8_t *buf;
+ u8 *buf;
if ((offset + size + 3) >= MAX_CFG_FRAME_SIZE)
return 0;
buf = &frame[offset];
- buf[0] = (uint8_t)id;
- buf[1] = (uint8_t)(id >> 8);
- buf[2] = (uint8_t)size;
+ buf[0] = (u8)id;
+ buf[1] = (u8)(id >> 8);
+ buf[2] = (u8)size;
if ((str != NULL) && (size != 0))
memcpy(&buf[3], str, size);
return (size + 3);
}
-static int wilc_wlan_cfg_set_bin(uint8_t *frame, uint32_t offset, uint16_t id, uint8_t *b, uint32_t size)
+static int wilc_wlan_cfg_set_bin(u8 *frame, uint32_t offset, uint16_t id, u8 *b, uint32_t size)
{
- uint8_t *buf;
+ u8 *buf;
uint32_t i;
- uint8_t checksum = 0;
+ u8 checksum = 0;
if ((offset + size + 5) >= MAX_CFG_FRAME_SIZE)
return 0;
buf = &frame[offset];
- buf[0] = (uint8_t)id;
- buf[1] = (uint8_t)(id >> 8);
- buf[2] = (uint8_t)size;
- buf[3] = (uint8_t)(size >> 8);
+ buf[0] = (u8)id;
+ buf[1] = (u8)(id >> 8);
+ buf[2] = (u8)size;
+ buf[3] = (u8)(size >> 8);
if ((b != NULL) && (size != 0)) {
memcpy(&buf[4], b, size);
*
********************************************/
-static void wilc_wlan_parse_response_frame(uint8_t *info, int size)
+static void wilc_wlan_parse_response_frame(u8 *info, int size)
{
uint32_t wid, len = 0, i = 0;
static int seq;
}
}
-static int wilc_wlan_parse_info_frame(uint8_t *info, int size)
+static int wilc_wlan_parse_info_frame(u8 *info, int size)
{
wilc_mac_cfg_t *pd = (wilc_mac_cfg_t *)&g_mac;
uint32_t wid, len;
*
********************************************/
-static int wilc_wlan_cfg_set_wid(uint8_t *frame, uint32_t offset, uint16_t id, uint8_t *buf, int size)
+static int wilc_wlan_cfg_set_wid(u8 *frame, uint32_t offset, uint16_t id, u8 *buf, int size)
{
- uint8_t type = (id >> 12) & 0xf;
+ u8 type = (id >> 12) & 0xf;
int ret = 0;
if (type == 0) { /* byte command */
return ret;
}
-static int wilc_wlan_cfg_get_wid(uint8_t *frame, uint32_t offset, uint16_t id)
+static int wilc_wlan_cfg_get_wid(u8 *frame, uint32_t offset, uint16_t id)
{
- uint8_t *buf;
+ u8 *buf;
if ((offset + 2) >= MAX_CFG_FRAME_SIZE)
return 0;
buf = &frame[offset];
- buf[0] = (uint8_t)id;
- buf[1] = (uint8_t)(id >> 8);
+ buf[0] = (u8)id;
+ buf[1] = (u8)(id >> 8);
return 2;
}
-static int wilc_wlan_cfg_get_wid_value(uint16_t wid, uint8_t *buffer, uint32_t buffer_size)
+static int wilc_wlan_cfg_get_wid_value(uint16_t wid, u8 *buffer, uint32_t buffer_size)
{
uint32_t type = (wid >> 12) & 0xf;
int i, ret = 0;
return ret;
}
-static int wilc_wlan_cfg_indicate_rx(uint8_t *frame, int size, wilc_cfg_rsp_t *rsp)
+static int wilc_wlan_cfg_indicate_rx(u8 *frame, int size, wilc_cfg_rsp_t *rsp)
{
int ret = 1;
- uint8_t msg_type;
- uint8_t msg_id;
+ u8 msg_type;
+ u8 msg_id;
msg_type = frame[0];
msg_id = frame[1]; /* seq no */
typedef struct {
uint32_t id;
- uint8_t *str;
+ u8 *str;
} wilc_cfg_str_t;
#endif
uint32_t address: 17;
uint32_t count: 9;
/* } bit; */
- uint8_t *buffer;
+ u8 *buffer;
uint32_t block_size;
} sdio_cmd53_t;
typedef struct {
- void (*os_debug)(uint8_t *);
+ void (*os_debug)(u8 *);
int (*os_wait)(void *, u32);
} wilc_wlan_os_func_t;
} sdio;
struct {
int (*spi_max_speed)(void);
- int (*spi_tx)(uint8_t *, uint32_t);
- int (*spi_rx)(uint8_t *, uint32_t);
- int (*spi_trx)(uint8_t *, uint8_t *, uint32_t);
+ int (*spi_tx)(u8 *, uint32_t);
+ int (*spi_rx)(u8 *, uint32_t);
+ int (*spi_trx)(u8 *, u8 *, uint32_t);
} spi;
} u;
} wilc_wlan_io_func_t;
typedef struct {
- void (*rx_indicate)(uint8_t *, uint32_t, uint32_t);
+ void (*rx_indicate)(u8 *, uint32_t, uint32_t);
void (*rx_complete)(void);
} wilc_wlan_net_func_t;
struct tx_complete_data {
int size;
void *buff;
- uint8_t *pBssid;
+ u8 *pBssid;
struct sk_buff *skb;
};
#define WILC_TX_ERR_NO_BUF (-2)
typedef struct {
- int (*wlan_firmware_download)(const uint8_t *, uint32_t);
+ int (*wlan_firmware_download)(const u8 *, uint32_t);
int (*wlan_start)(void);
int (*wlan_stop)(void);
- int (*wlan_add_to_tx_que)(void *, uint8_t *, uint32_t, wilc_tx_complete_func_t);
+ int (*wlan_add_to_tx_que)(void *, u8 *, uint32_t, wilc_tx_complete_func_t);
int (*wlan_handle_tx_que)(uint32_t *);
void (*wlan_handle_rx_que)(void);
void (*wlan_handle_rx_isr)(void);
void (*wlan_cleanup)(void);
- int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, uint32_t);
+ int (*wlan_cfg_set)(int, uint32_t, u8 *, uint32_t, int, uint32_t);
int (*wlan_cfg_get)(int, uint32_t, int, uint32_t);
- int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t);
+ int (*wlan_cfg_get_value)(uint32_t, u8 *, uint32_t);
/*Bug3959: transmitting mgmt frames received from host*/
#if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P)
- int (*wlan_add_mgmt_to_tx_que)(void *, uint8_t *, uint32_t, wilc_tx_complete_func_t);
+ int (*wlan_add_mgmt_to_tx_que)(void *, u8 *, uint32_t, wilc_tx_complete_func_t);
#endif
} wilc_wlan_oup_t;
void wilc_bus_set_max_speed(void);
void wilc_bus_set_default_speed(void);
-uint32_t wilc_get_chipid(uint8_t update);
+uint32_t wilc_get_chipid(u8 update);
#endif