#include <linux/completion.h>
#include "wilc_wlan_if.h"
#include "wilc_wlan.h"
#include "wilc_wfi_netdevice.h"
#include "wilc_wlan_cfg.h"
static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP;
static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
{
mutex_lock(&wilc->hif_cs);
if (acquire == ACQUIRE_AND_WAKEUP)
chip_wakeup(wilc);
}
static inline void release_bus(struct wilc *wilc, BUS_RELEASE_T release)
{
if (release == RELEASE_ALLOW_SLEEP)
chip_allow_sleep(wilc);
mutex_unlock(&wilc->hif_cs);
}
static void wilc_wlan_txq_remove(struct wilc *wilc, struct txq_entry_t *tqe)
{
if (tqe == wilc->txq_head) {
wilc->txq_head = tqe->next;
if (wilc->txq_head)
wilc->txq_head->prev = NULL;
} else if (tqe == wilc->txq_tail) {
wilc->txq_tail = (tqe->prev);
if (wilc->txq_tail)
wilc->txq_tail->next = NULL;
} else {
tqe->prev->next