static int wlan_deinit_locks(linux_wlan_t *nic);
static void wlan_deinitialize_threads(linux_wlan_t *nic);
-static void linux_wlan_lock(void *vp);
-void linux_wlan_unlock(void *vp);
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);
schedule_work(&g_linux_wlan->rx_work_queue);
return IRQ_HANDLED;
#elif (RX_BH_TYPE == RX_BH_KTHREAD)
- linux_wlan_unlock(&g_linux_wlan->rx_sem);
+ up(&g_linux_wlan->rx_sem);
return IRQ_HANDLED;
#elif (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_WAKE_THREAD;
nic = (linux_wlan_t *)vp;
while (1) {
- linux_wlan_lock(&nic->rx_sem);
+ down(&nic->rx_sem);
if (g_linux_wlan->close) {
while (!kthread_should_stop())
PRINT_D(INIT_DBG, "%d\n", *buff);
}
-static void linux_wlan_lock(void *vp)
-{
- PRINT_D(LOCK_DBG, "Locking %p\n", vp);
- if (vp != NULL) {
- while (down_interruptible((struct semaphore *) vp))
- ;
- } else {
- PRINT_ER("Failed, mutex is NULL\n");
- }
-}
-
static int linux_wlan_lock_timeout(void *vp, u32 timeout)
{
int error = -1;
return error;
}
-void linux_wlan_unlock(void *vp)
-{
- PRINT_D(LOCK_DBG, "Unlocking %p\n", vp);
- if (vp != NULL)
- up((struct semaphore *)vp);
- else
- PRINT_ER("Failed, mutex is NULL\n");
-}
-
static void linux_wlan_spin_lock(void *vp, unsigned long *flags)
{
unsigned long lflags;
pd->oup.wlan_cfg_get_value(WID_STATUS, (unsigned char *)&status, 4);
if (pd->mac_status == WILC_MAC_STATUS_INIT) {
pd->mac_status = status;
- linux_wlan_unlock(&pd->sync_event);
+ up(&pd->sync_event);
} else {
pd->mac_status = status;
}
{
/* inform wilc1000_wlan_init that RXQ task is started. */
- linux_wlan_unlock(&g_linux_wlan->rxq_thread_started);
+ up(&g_linux_wlan->rxq_thread_started);
while (1) {
- linux_wlan_lock(&g_linux_wlan->rxq_event);
+ down(&g_linux_wlan->rxq_event);
/* wait_for_completion(&g_linux_wlan->rxq_event); */
if (g_linux_wlan->close) {
/*Unlock the mutex in the mac_close function to indicate the exiting of the RX thread */
- linux_wlan_unlock(&g_linux_wlan->rxq_thread_started);
+ up(&g_linux_wlan->rxq_thread_started);
while (!kthread_should_stop())
schedule();
#endif
/* inform wilc1000_wlan_init that TXQ task is started. */
- linux_wlan_unlock(&g_linux_wlan->txq_thread_started);
+ up(&g_linux_wlan->txq_thread_started);
while (1) {
PRINT_D(TX_DBG, "txq_task Taking a nap :)\n");
- linux_wlan_lock(&g_linux_wlan->txq_event);
+ down(&g_linux_wlan->txq_event);
/* wait_for_completion(&pd->txq_event); */
PRINT_D(TX_DBG, "txq_task Who waked me up :$\n");
if (g_linux_wlan->close) {
/*Unlock the mutex in the mac_close function to indicate the exiting of the TX thread */
- linux_wlan_unlock(&g_linux_wlan->txq_thread_started);
+ up(&g_linux_wlan->txq_thread_started);
while (!kthread_should_stop())
schedule();
/* not sure if the following unlocks are needed or not*/
if (&g_linux_wlan->rxq_event != NULL)
- linux_wlan_unlock(&g_linux_wlan->rxq_event);
+ up(&g_linux_wlan->rxq_event);
if (&g_linux_wlan->txq_event != NULL)
- linux_wlan_unlock(&g_linux_wlan->txq_event);
+ up(&g_linux_wlan->txq_event);
#if (RX_BH_TYPE == RX_BH_WORK_QUEUE)
/*Removing the work struct from the linux kernel workqueue*/
#elif (RX_BH_TYPE == RX_BH_KTHREAD)
/* if(&nic->rx_sem != NULL) */
- /* linux_wlan_unlock(&nic->rx_sem); */
+ /* up(&nic->rx_sem); */
#endif
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
nwi->os_func.os_sleep = linux_wlan_msleep;
nwi->os_func.os_debug = linux_wlan_dbg;
- nwi->os_func.os_lock = linux_wlan_lock;
- nwi->os_func.os_unlock = linux_wlan_unlock;
nwi->os_func.os_wait = linux_wlan_lock_timeout;
- nwi->os_func.os_signal = linux_wlan_unlock;
/*Added by Amr - BugID_4720*/
nwi->os_func.os_spin_lock = linux_wlan_spin_lock;
}
/* wait for RXQ task to start. */
- linux_wlan_lock(&g_linux_wlan->rxq_thread_started);
+ down(&g_linux_wlan->rxq_thread_started);
#endif
}
#endif
/* wait for TXQ task to start. */
- linux_wlan_lock(&g_linux_wlan->txq_thread_started);
+ down(&g_linux_wlan->txq_thread_started);
return 0;
_fail_2:
/*De-Initialize 2nd thread*/
g_linux_wlan->close = 1;
- linux_wlan_unlock(&g_linux_wlan->rxq_event);
+ up(&g_linux_wlan->rxq_event);
kthread_stop(g_linux_wlan->rxq_thread);
#ifndef TCP_ENHANCEMENTS
#if (RX_BH_TYPE == RX_BH_KTHREAD)
/*De-Initialize 1st thread*/
g_linux_wlan->close = 1;
- linux_wlan_unlock(&g_linux_wlan->rx_sem);
+ up(&g_linux_wlan->rx_sem);
kthread_stop(g_linux_wlan->rx_bh_thread);
_fail_:
#endif
g_linux_wlan->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
if (&g_linux_wlan->rxq_event != NULL)
- linux_wlan_unlock(&g_linux_wlan->rxq_event);
+ up(&g_linux_wlan->rxq_event);
if (g_linux_wlan->rxq_thread != NULL) {
kthread_stop(g_linux_wlan->rxq_thread);
}
if (&g_linux_wlan->txq_event != NULL)
- linux_wlan_unlock(&g_linux_wlan->txq_event);
+ up(&g_linux_wlan->txq_event);
if (g_linux_wlan->txq_thread != NULL) {
kthread_stop(g_linux_wlan->txq_thread);
#if (RX_BH_TYPE == RX_BH_KTHREAD)
if (&g_linux_wlan->rx_sem != NULL)
- linux_wlan_unlock(&g_linux_wlan->rx_sem);
+ up(&g_linux_wlan->rx_sem);
if (g_linux_wlan->rx_bh_thread != NULL) {
kthread_stop(g_linux_wlan->rx_bh_thread);
/* Start the network interface queue for this device */
PRINT_D(INIT_DBG, "Starting netifQ\n");
netif_start_queue(ndev);
-/* linux_wlan_lock(&close_exit_sync); */
+/* down(&close_exit_sync); */
return 0;
}
#endif
#endif
}
- linux_wlan_unlock(&close_exit_sync);
+ up(&close_exit_sync);
nic->mac_opened = 0;
return 0;
void *txq_lock;
/*Added by Amr - BugID_4720*/
- void *txq_add_to_head_lock;
+ struct semaphore *txq_add_to_head_lock;
void *txq_spinlock;
unsigned long txq_spinlock_flags;
**/
PRINT_D(TX_DBG, "Wake the txq_handling\n");
- p->os_func.os_signal(p->txq_wait);
-
-
+ up(p->txq_wait);
}
static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
/*Added by Amr - BugID_4720*/
p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
- p->os_func.os_signal(p->txq_add_to_head_lock);
+ up(p->txq_add_to_head_lock);
/**
* wake up TX queue
**/
- p->os_func.os_signal(p->txq_wait);
+ up(p->txq_wait);
PRINT_D(TX_DBG, "Wake up the txq_handler\n");
/*Added by Amr - BugID_4720*/
PRINT_D(TX_DBG, "Adding config packet ...\n");
if (p->quit) {
PRINT_D(TX_DBG, "Return due to clear function\n");
- p->os_func.os_signal(p->cfg_wait);
+ up(p->cfg_wait);
return 0;
}
break;
} while (0);
/*Added by Amr - BugID_4720*/
- p->os_func.os_signal(p->txq_add_to_head_lock);
+ up(p->txq_add_to_head_lock);
p->txq_exit = 1;
PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
do {
if (p->quit) {
PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n");
- p->os_func.os_signal(p->cfg_wait);
+ up(p->cfg_wait);
break;
}
rqe = wilc_wlan_rxq_remove();
**/
PRINT_D(RX_DBG, "p->cfg_seq_no = %d - rsp.seq_no = %d\n", p->cfg_seq_no, rsp.seq_no);
if (p->cfg_seq_no == rsp.seq_no) {
- p->os_func.os_signal(p->cfg_wait);
+ up(p->cfg_wait);
}
} else if (rsp.type == WILC_CFG_RSP_STATUS) {
/**
rqe->buffer_size = size;
PRINT_D(RX_DBG, "rxq entery Size= %d - Address = %p\n", rqe->buffer_size, rqe->buffer);
wilc_wlan_rxq_add(rqe);
- p->os_func.os_signal(p->rxq_wait);
+ up(p->rxq_wait);
}
} else {
#ifndef MEMORY_STATIC