s32 CoreConfiguratorInit(void)
{
s32 s32Error = WILC_SUCCESS;
+
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n");
sema_init(&SemHandleSendPkt, 1);
u8 *pu8val = (u8 *)ps8WidVal;
u8 u8val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set CHAR val 0x%x ,NULL structure\n", u8val);
return;
u16 *pu16val = (u16 *)ps8WidVal;
u16 u16val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set SHORT val 0x%x ,NULL structure\n", u16val);
return;
u32 *pu32val = (u32 *)ps8WidVal;
u32 u32val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set INT val 0x%x , NULL structure\n", u32val);
return;
u16 u16MsgLen = 0;
u16 idx = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set STR val, NULL structure\n");
return;
case WID_SHORT:
{
u16 *pu16val = (u16 *)(pstrWIDresult->ps8WidVal);
+
cfg_sht = MAKE_WORD16(resp[idx], resp[idx + 1]);
/*Set local copy of WID*/
/* pstrWIDresult->ps8WidVal = (s8*)(s32)cfg_sht; */
case WID_INT:
{
u32 *pu32val = (u32 *)(pstrWIDresult->ps8WidVal);
+
cfg_int = MAKE_WORD32(
MAKE_WORD16(resp[idx], resp[idx + 1]),
MAKE_WORD16(resp[idx + 2], resp[idx + 3])
u32 u32WIDsCount, bool bRespRequired, u32 drvHandler)
{
s32 counter = 0, ret = 0;
+
if (gpstrWlanOps == NULL) {
PRINT_D(CORECONFIG_DBG, "Net Dev is still not initialized\n");
return 1;
void printk_later(const char *format, ...)
{
va_list args;
+
va_start(args, format);
ps8current += vsprintf(ps8current, format, args);
va_end(args);
irqreturn_t isr_bh_routine(int irq, void *userdata)
{
linux_wlan_t *nic;
+
nic = (linux_wlan_t *)userdata;
#else
static void isr_bh_routine(struct work_struct *work)
{
perInterface_wlan_t *nic;
+
nic = (perInterface_wlan_t *)container_of(work, linux_wlan_t, rx_work_queue);
#endif
{
if (msc <= 4000000) {
u32 u32Temp = msc * 1000;
+
usleep_range(u32Temp, u32Temp);
} else {
msleep(msc);
static void *linux_wlan_malloc_atomic(uint32_t sz)
{
char *pntr = NULL;
+
pntr = kmalloc(sz, GFP_ATOMIC);
PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr);
return (void *)pntr;
static void *linux_wlan_malloc(uint32_t sz)
{
char *pntr = NULL;
+
pntr = kmalloc(sz, GFP_KERNEL);
PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr);
return (void *)pntr;
static void *internal_alloc(uint32_t size, uint32_t flag)
{
char *pntr = NULL;
+
pntr = kmalloc(size, flag);
PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", size, pntr);
return (void *)pntr;
static int linux_wlan_lock_timeout(void *vp, u32 timeout)
{
int error = -1;
+
PRINT_D(LOCK_DBG, "Locking %p\n", vp);
if (vp != NULL)
error = down_timeout((struct semaphore *)vp, msecs_to_jiffies(timeout));
static void linux_wlan_spin_lock(void *vp, unsigned long *flags)
{
unsigned long lflags;
+
PRINT_D(SPIN_DEBUG, "Lock spin %p\n", vp);
if (vp != NULL) {
spin_lock_irqsave((spinlock_t *)vp, lflags);
static void linux_wlan_spin_unlock(void *vp, unsigned long *flags)
{
unsigned long lflags = *flags;
+
PRINT_D(SPIN_DEBUG, "Unlock spin %p\n", vp);
if (vp != NULL) {
spin_unlock_irqrestore((spinlock_t *)vp, lflags);
{
int ret = 0;
+
PRINT_D(INIT_DBG, "Initializing Threads ...\n");
#if (RX_BH_TYPE == RX_BH_WORK_QUEUE)
uint8_t wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, wilc_wlan_oup_t *nwo, linux_wlan_t *nic)
{
uint8_t trials = 0;
+
while ((core_11b_ready() && (READY_CHECK_THRESHOLD > (trials++)))) {
PRINT_D(INIT_DBG, "11b core not ready yet: %u\n", trials);
wilc_wlan_deinit(nic);
int ret = 0;
wilc_wlan_inp_t nwi;
wilc_wlan_oup_t nwo;
+
sdio_unregister_driver(&wilc_bus);
linux_wlan_device_detection(0);
if (g_linux_wlan->oup.wlan_cfg_get(1, WID_FIRMWARE_VERSION, 1, 0)) {
int size;
char Firmware_ver[20];
+
size = g_linux_wlan->oup.wlan_cfg_get_value(
WID_FIRMWARE_VERSION,
Firmware_ver, sizeof(Firmware_ver));
{
linux_wlan_t *nic;
+
nic = netdev_priv(ndev);
/*initialize platform*/
struct WILC_WFI_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
int i = 0;
+
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
{
struct tx_complete_data *pv_data = (struct tx_complete_data *)priv;
+
if (status == 1)
PRINT_D(TX_DBG, "Packet sent successfully - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
else
char *pu8UdpBuffer;
struct iphdr *ih;
struct ethhdr *eth_h;
+
nic = netdev_priv(ndev);
PRINT_D(INT_DBG, "\n========\n IntUH: %d - IntBH: %d - IntCld: %d\n========\n", int_rcvdU, int_rcvdB, int_clrd);
static int linux_sdio_set_speed(int speed)
{
struct mmc_ios ios;
+
sdio_claim_host(local_sdio_func);
memcpy((void *)&ios, (void *)&local_sdio_func->card->host->ios, sizeof(struct mmc_ios));
if (len > 0 && b != NULL) {
struct spi_message msg;
+
PRINT_D(BUS_DBG, "Request writing %d bytes\n", len);
struct spi_transfer tr = {
.tx_buf = b,
int linux_spi_write(uint8_t *b, uint32_t len)
{
int ret;
+
if (len > 0 && b != NULL) {
int i = 0;
int blk = len / TXRX_PHASE_SIZE;
int remainder = len % TXRX_PHASE_SIZE;
char *r_buffer = kzalloc(TXRX_PHASE_SIZE, GFP_KERNEL);
+
if (!r_buffer) {
PRINT_ER("Failed to allocate memory for r_buffer\n");
}
.delay_usecs = 0,
};
char *r_buffer = kzalloc(len, GFP_KERNEL);
+
if (!r_buffer) {
PRINT_ER("Failed to allocate memory for r_buffer\n");
}
int remainder = rlen % TXRX_PHASE_SIZE;
char *t_buffer = kzalloc(TXRX_PHASE_SIZE, GFP_KERNEL);
+
if (!t_buffer) {
PRINT_ER("Failed to allocate memory for t_buffer\n");
}
};
char *t_buffer = kzalloc(rlen, GFP_KERNEL);
+
if (!t_buffer) {
PRINT_ER("Failed to allocate memory for t_buffer\n");
}
while (pHandle->pstrMessageList != NULL) {
Message *pstrMessge = pHandle->pstrMessageList->pstrNext;
+
kfree(pHandle->pstrMessageList);
pHandle->pstrMessageList = pstrMessge;
}
pHandle->pstrMessageList = pstrMessage;
} else {
Message *pstrTailMsg = pHandle->pstrMessageList;
+
while (pstrTailMsg->pstrNext != NULL) {
pstrTailMsg = pstrTailMsg->pstrNext;
}
Message *pstrMessage;
WILC_ErrNo s32RetStatus = WILC_SUCCESS;
unsigned long flags;
+
if ((pHandle == NULL) || (u32RecvBufferSize == 0)
|| (pvRecvBuffer == NULL) || (pu32ReceivedLength == NULL)) {
WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
static int spi_clear_int(void)
{
uint32_t reg;
+
if (!spi_read_reg(WILC_HOST_RX_CTRL_0, ®)) {
PRINT_ER("[wilc spi]: Failed read reg (%08x)...\n", WILC_HOST_RX_CTRL_0);
return 0;
static int spi_read_size(uint32_t *size)
{
int ret;
+
if (g_spi.has_thrpt_enh) {
ret = spi_internal_read(0xe840 - WILC_SPI_REG_BASE, size);
*size = *size & IRQ_DMA_WD_CNT_MASK;
static int spi_read_int(uint32_t *int_status)
{
int ret;
+
if (g_spi.has_thrpt_enh) {
ret = spi_internal_read(0xe840 - WILC_SPI_REG_BASE, int_status);
} else {
ret = spi_internal_write(0xe844 - WILC_SPI_REG_BASE, val);
} else {
uint32_t flags;
+
flags = val & ((1 << MAX_NUM_INT) - 1);
if (flags) {
int i;
void clear_shadow_scan(void *pUserVoid)
{
int i;
+
if (op_ifcs == 0) {
del_timer_sync(&hAgingTimer);
PRINT_INFO(CORECONFIG_DBG, "destroy aging timer\n");
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) {
tstrNetworkInfo *pstrNetworkInfo;
+
pstrNetworkInfo = &(astrLastScannedNtwrksShadow[i]);
void reset_shadow_found(void *pUserVoid)
{
int i;
+
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) {
astrLastScannedNtwrksShadow[i].u8Found = 0;
void update_scan_time(void *pUserVoid)
{
int i;
+
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) {
astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan = jiffies;
}
tstrWILC_WFIDrv *pstrWFIDrv;
#endif
u8 NullBssid[ETH_ALEN] = {0};
+
connecting = 0;
priv = (struct WILC_WFI_priv *)pUserVoid;
u32 channelnum = 0;
struct WILC_WFI_priv *priv;
s32 s32Error = WILC_SUCCESS;
+
priv = wiphy_priv(wiphy);
channelnum = ieee80211_frequency_to_channel(chandef->chan->center_freq);
tstrWILC_WFIDrv *pstrWFIDrv;
#endif
uint8_t NullBssid[ETH_ALEN] = {0};
+
connecting = 0;
priv = wiphy_priv(wiphy);
struct WILC_WFI_priv *priv;
struct key_params key_params;
u32 i;
+
priv = wiphy_priv(wiphy);
if (nic->iftype == STATION_MODE) {
tstrStatistics strStatistics;
+
host_int_get_statistics(priv->hWILCWFIDrv, &strStatistics);
/*
tstrWILC_WFIDrv *pstrWFIDrv;
u32 i = 0;
s32 s32Freq;
+
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
static void WILC_WFI_RemainOnChannelReady(void *pUserVoid)
{
struct WILC_WFI_priv *priv;
+
priv = (struct WILC_WFI_priv *)pUserVoid;
PRINT_D(HOSTINF_DBG, "Remain on channel ready\n");
static void WILC_WFI_RemainOnChannelExpired(void *pUserVoid, u32 u32SessionID)
{
struct WILC_WFI_priv *priv;
+
priv = (struct WILC_WFI_priv *)pUserVoid;
/*BugID_5477*/
{
s32 s32Error = WILC_SUCCESS;
struct WILC_WFI_priv *priv;
+
priv = wiphy_priv(wiphy);
PRINT_D(GENERIC_DBG, "Remaining on channel %d\n", chan->hw_value);
{
s32 s32Error = WILC_SUCCESS;
struct WILC_WFI_priv *priv;
+
priv = wiphy_priv(wiphy);
PRINT_D(CFG80211_DBG, "Cancel remain on channel\n");
{
struct WILC_WFI_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
+
priv = wiphy_priv(wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
int idx, u8 *mac, struct station_info *sinfo)
{
struct WILC_WFI_priv *priv;
+
PRINT_D(CFG80211_DBG, "Dumping station information\n");
if (idx != 0)
bool enabled, int timeout)
{
struct WILC_WFI_priv *priv;
+
PRINT_D(CFG80211_DBG, " Power save Enabled= %d , TimeOut = %d\n", enabled, timeout);
if (wiphy == NULL)
s32 s32Error = WILC_SUCCESS;
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
+
WILC_NULLCHECK(s32Error, wiphy);
priv = wiphy_priv(wiphy);
perInterface_wlan_t *nic;
struct WILC_WFI_priv *priv;
struct net_device *new_ifc = NULL;
+
priv = wiphy_priv(wiphy);
s32 s32Error = WILC_SUCCESS;
struct WILC_WFI_priv *priv;
+
priv = wdev_priv(net->ieee80211_ptr);
priv->gbAutoRateAdjusted = false;
struct txq_entry_t *tqe;
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
unsigned long flags;
+
p->os_func.os_spin_lock(p->txq_spinlock, &flags);
if (p->txq_head) {
tqe = p->txq_head;
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
unsigned long flags;
+
p->os_func.os_spin_lock(p->txq_spinlock, &flags);
p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
int i;
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
unsigned long flags;
+
p->os_func.os_spin_lock(p->txq_spinlock, &flags);
eth_hdr_ptr = &buffer[0];
if (protocol == 0x06) {
uint8_t *tcp_hdr_ptr;
uint32_t IHL, Total_Length, Data_offset;
+
tcp_hdr_ptr = &ip_hdr_ptr[IP_HDR_LEN];
IHL = (ip_hdr_ptr[0] & 0xf) << 2;
Total_Length = (((uint32_t)ip_hdr_ptr[2]) << 8) + ((uint32_t)ip_hdr_ptr[3]);
Data_offset = (((uint32_t)tcp_hdr_ptr[12] & 0xf0) >> 2);
if (Total_Length == (IHL + Data_offset)) { /*we want to recognize the clear Acks(packet only carry Ack infos not with data) so data size must be equal zero*/
uint32_t seq_no, Ack_no;
+
seq_no = (((uint32_t)tcp_hdr_ptr[4]) << 24) + (((uint32_t)tcp_hdr_ptr[5]) << 16) + (((uint32_t)tcp_hdr_ptr[6]) << 8) + ((uint32_t)tcp_hdr_ptr[7]);
Ack_no = (((uint32_t)tcp_hdr_ptr[8]) << 24) + (((uint32_t)tcp_hdr_ptr[9]) << 16) + (((uint32_t)tcp_hdr_ptr[10]) << 8) + ((uint32_t)tcp_hdr_ptr[11]);
for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].Bigger_Ack_num) {
struct txq_entry_t *tqe;
+
PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num);
tqe = Pending_Acks_info[i].txqe;
if (tqe) {
if (wilc_get_chipid(false) >= 0x1002b0) {
/* Enable PALDO back right after wakeup */
uint32_t val32;
+
g_wlan.hif_func.hif_read_reg(0x1e1c, &val32);
val32 |= (1 << 6);
g_wlan.hif_func.hif_write_reg(0x1e1c, val32);
INLINE void chip_wakeup(void)
{
uint32_t reg, trials = 0;
+
do {
if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
g_wlan.hif_func.hif_read_reg(1, ®);
if (wilc_get_chipid(false) >= 0x1002b0) {
/* Enable PALDO back right after wakeup */
uint32_t val32;
+
g_wlan.hif_func.hif_read_reg(0x1e1c, &val32);
val32 |= (1 << 6);
g_wlan.hif_func.hif_write_reg(0x1e1c, val32);
int counter;
int timeout;
uint32_t vmm_table[WILC_VMM_TBL_SIZE];
+
p->txq_exit = 0;
do {
if (p->quit)
/* and WILC_DATA_PKT_MAC_HDR*/
else if (tqe->type == WILC_NET_PKT) {
char *pBSSID = ((struct tx_complete_data *)(tqe->priv))->pBssid;
+
buffer_offset = ETH_ETHERNET_HDR_OFFSET;
/* copy the bssid at the sart of the buffer */
memcpy(&txb[offset + 4], pBSSID, 6);
uint32_t header;
uint32_t pkt_len, pkt_offset, tp_len;
int is_cfg_packet;
+
PRINT_D(RX_DBG, "In the 2nd do-while\n");
memcpy(&header, &buffer[offset], 4);
#ifdef BIG_ENDIAN
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+
acquire_bus(ACQUIRE_AND_WAKEUP);
p->hif_func.hif_write_reg(WILC_GLB_RESET_0, 0x0);
release_bus(RELEASE_ONLY);
if (g_cfg_str[i].id == wid) {
if (wid == WID_SITE_SURVEY_RESULTS) {
static int toggle;
+
PRINT_INFO(GENERIC_DBG, "Site survey results received[%d]\n",
size);
if (g_cfg_str[i].id == wid) {
uint32_t size = g_cfg_str[i].str[0];
+
if (buffer_size >= size) {
if (g_cfg_str[i].id == WID_SITE_SURVEY_RESULTS) {
static int toggle;
+
PRINT_INFO(GENERIC_DBG, "Site survey results value[%d]\n",
size);
i += toggle;