/* //////////////////////////////////////////////////////////////////////////// */
#include "wilc_wlan_if.h"
-#include "wilc_wlan.h"
+#include "wilc_wfi_netdevice.h"
+#include "wilc_wlan_cfg.h"
/********************************************
*
********************************************/
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(u8 *buff, u32 size);
u32 wilc_get_chipid(u8 update);
-u16 Set_machw_change_vir_if(bool bValue);
static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
- /* unsigned long flags; */
+ wilc_wlan_dev_t *p = &g_wlan;
if (tqe == p->txq_head) {
p->txq_head = tqe->next;
static struct txq_entry_t *wilc_wlan_txq_remove_from_head(void)
{
struct txq_entry_t *tqe;
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
unsigned long flags;
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
if (p->txq_head) {
tqe = p->txq_head;
p->txq_head = tqe->next;
- if (p->txq_head) {
+ if (p->txq_head)
p->txq_head->prev = NULL;
- }
+
p->txq_entries -= 1;
static void wilc_wlan_txq_add_to_tail(struct txq_entry_t *tqe)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
unsigned long flags;
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
unsigned long flags;
if (linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
CFG_PKTS_TIMEOUT))
static inline int Update_TCP_track_session(u32 index, u32 Ack)
{
- if (Ack > Acks_keep_track_info[index].Bigger_Ack_num) {
+ if (Ack > Acks_keep_track_info[index].Bigger_Ack_num)
Acks_keep_track_info[index].Bigger_Ack_num = Ack;
- }
return 0;
}
}
static inline int remove_TCP_related(void)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
unsigned long flags;
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
u8 *buffer = tqe->buffer;
unsigned short h_proto;
int i;
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
unsigned long flags;
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
break;
}
}
- if (i == Opened_TCP_session) {
+ if (i == Opened_TCP_session)
add_TCP_track_session(0, 0, seq_no);
- }
+
add_TCP_Pending_Ack(Ack_no, i, tqe);
}
-static int wilc_wlan_txq_filter_dup_tcp_ack(void)
+static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
{
-
+ perInterface_wlan_t *nic;
+ struct wilc *wilc;
u32 i = 0;
u32 Dropped = 0;
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
- spin_lock_irqsave(&g_linux_wlan->txq_spinlock, p->txq_spinlock_flags);
+ nic = netdev_priv(dev);
+ wilc = nic->wilc;
+
+ spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
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;
PendingAcks_arrBase = 0;
- spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock,
- p->txq_spinlock_flags);
+ spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags);
while (Dropped > 0) {
/*consume the semaphore count of the removed packet*/
- linux_wlan_lock_timeout(&g_linux_wlan->txq_event, 1);
+ linux_wlan_lock_timeout(&wilc->txq_event, 1);
Dropped--;
}
static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
struct txq_entry_t *tqe;
PRINT_D(TX_DBG, "Adding config packet ...\n");
int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, u32 buffer_size,
wilc_tx_complete_func_t func)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
struct txq_entry_t *tqe;
if (p->quit)
int wilc_wlan_txq_add_mgmt_pkt(void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
struct txq_entry_t *tqe;
if (p->quit)
static struct txq_entry_t *wilc_wlan_txq_get_first(void)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
struct txq_entry_t *tqe;
unsigned long flags;
return tqe;
}
-static int wilc_wlan_rxq_add(struct rxq_entry_t *rqe)
+static int wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
if (p->quit)
return 0;
- mutex_lock(&g_linux_wlan->rxq_cs);
+ mutex_lock(&wilc->rxq_cs);
if (p->rxq_head == NULL) {
PRINT_D(RX_DBG, "Add to Queue head\n");
rqe->next = NULL;
}
p->rxq_entries += 1;
PRINT_D(RX_DBG, "Number of queue entries: %d\n", p->rxq_entries);
- mutex_unlock(&g_linux_wlan->rxq_cs);
+ mutex_unlock(&wilc->rxq_cs);
return p->rxq_entries;
}
-static struct rxq_entry_t *wilc_wlan_rxq_remove(void)
+static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
PRINT_D(RX_DBG, "Getting rxQ element\n");
if (p->rxq_head) {
struct rxq_entry_t *rqe;
- mutex_lock(&g_linux_wlan->rxq_cs);
+ mutex_lock(&wilc->rxq_cs);
rqe = p->rxq_head;
p->rxq_head = p->rxq_head->next;
p->rxq_entries -= 1;
PRINT_D(RX_DBG, "RXQ entries decreased\n");
- mutex_unlock(&g_linux_wlan->rxq_cs);
+ mutex_unlock(&wilc->rxq_cs);
return rqe;
}
PRINT_D(RX_DBG, "Nothing to get from Q\n");
usleep_range(2 * 1000, 2 * 1000);
/* Make sure chip is awake. This is an extra step that can be removed */
/* later to avoid the bus access overhead */
- if ((wilc_get_chipid(true) == 0)) {
+ if ((wilc_get_chipid(true) == 0))
wilc_debug(N_ERR, "Couldn't read chip id. Wake up failed\n");
- }
+
} while ((wilc_get_chipid(true) == 0) && ((++trials % 3) == 0));
} while (wilc_get_chipid(true) == 0);
/* later to avoid the bus access overhead */
g_wlan.hif_func.hif_read_reg(0xf1, &clk_status_reg);
- if ((clk_status_reg & 0x1) == 0) {
+ if ((clk_status_reg & 0x1) == 0)
wilc_debug(N_ERR, "clocks still OFF. Wake up failed\n");
- }
+
}
/* in case of failure, Reset the wakeup bit to introduce a new edge on the next loop */
if ((clk_status_reg & 0x1) == 0) {
/* Make sure chip is awake. This is an extra step that can be removed */
/* later to avoid the bus access overhead */
- if ((wilc_get_chipid(true) == 0)) {
+ if ((wilc_get_chipid(true) == 0))
wilc_debug(N_ERR, "Couldn't read chip id. Wake up failed\n");
- }
+
} while ((wilc_get_chipid(true) == 0) && ((++trials % 3) == 0));
} while (wilc_get_chipid(true) == 0);
* Tx, Rx queue handle functions
*
********************************************/
-int wilc_wlan_handle_txq(u32 *pu32TxqCount)
+int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
int i, entries = 0;
int counter;
int timeout;
u32 vmm_table[WILC_VMM_TBL_SIZE];
+ perInterface_wlan_t *nic;
+ struct wilc *wilc;
+
+ nic = netdev_priv(dev);
+ wilc = nic->wilc;
p->txq_exit = 0;
do {
if (p->quit)
break;
- linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
+ linux_wlan_lock_timeout(&wilc->txq_add_to_head_cs,
CFG_PKTS_TIMEOUT);
#ifdef TCP_ACK_FILTER
- wilc_wlan_txq_filter_dup_tcp_ack();
+ wilc_wlan_txq_filter_dup_tcp_ack(dev);
#endif
/**
* build the vmm list
i = 0;
sum = 0;
do {
- /* if ((tqe != NULL) && (i < (8)) && */
- /* if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE-1)) && */
if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1)) /* reserve last entry to 0 */) {
- if (tqe->type == WILC_CFG_PKT) {
+ if (tqe->type == WILC_CFG_PKT)
vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET;
- }
- else if (tqe->type == WILC_NET_PKT) {
+
+ else if (tqe->type == WILC_NET_PKT)
vmm_sz = ETH_ETHERNET_HDR_OFFSET;
- }
- else {
+
+ else
vmm_sz = HOST_HDR_OFFSET;
- }
+
vmm_sz += tqe->buffer_size;
PRINT_D(TX_DBG, "VMM Size before alignment = %d\n", vmm_sz);
if (vmm_sz & 0x3) { /* has to be word aligned */
vmm_sz = (vmm_sz + 4) & ~0x3;
}
- if ((sum + vmm_sz) > LINUX_TX_SIZE) {
+ if ((sum + vmm_sz) > LINUX_TX_SIZE)
break;
- }
+
PRINT_D(TX_DBG, "VMM Size AFTER alignment = %d\n", vmm_sz);
vmm_table[i] = vmm_sz / 4; /* table take the word size */
PRINT_D(TX_DBG, "VMMTable entry size = %d\n", vmm_table[i]);
}
} while (!p->quit);
- if (!ret) {
+ if (!ret)
goto _end_;
- }
timeout = 200;
do {
* Get the entries
**/
entries = ((reg >> 3) & 0x3f);
- /* entries = ((reg>>3)&0x2f); */
break;
} else {
release_bus(RELEASE_ALLOW_SLEEP);
break;
}
- if (!ret) {
+ if (!ret)
break;
- }
if (entries == 0) {
PRINT_WRN(GENERIC_DBG, "[wilc txq]: no more buffer in the chip (reg: %08x), retry later [[ %d, %x ]]\n", reg, i, vmm_table[i - 1]);
}
} while (1);
- if (!ret) {
+ if (!ret)
goto _end_;
- }
+
if (entries == 0) {
ret = WILC_TX_ERR_NO_BUF;
goto _end_;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
#ifdef TCP_ACK_FILTER
- if (tqe->tcp_PendingAck_index != NOT_TCP_ACK) {
+ if (tqe->tcp_PendingAck_index != NOT_TCP_ACK)
Pending_Acks_info[tqe->tcp_PendingAck_index].txqe = NULL;
- }
#endif
kfree(tqe);
} else {
if (ret != 1)
break;
} while (0);
- up(&g_linux_wlan->txq_add_to_head_cs);
+ up(&wilc->txq_add_to_head_cs);
p->txq_exit = 1;
PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
return ret;
}
-static void wilc_wlan_handle_rxq(void)
+static void wilc_wlan_handle_rxq(struct wilc *wilc)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
int offset = 0, size, has_packet = 0;
u8 *buffer;
struct rxq_entry_t *rqe;
do {
if (p->quit) {
PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n");
- up(&g_linux_wlan->cfg_event);
+ up(&wilc->cfg_event);
break;
}
- rqe = wilc_wlan_rxq_remove();
+ rqe = wilc_wlan_rxq_remove(wilc);
if (rqe == NULL) {
PRINT_D(RX_DBG, "nothing in the queue - exit 1st do-while\n");
break;
break;
}
-/*bug 3887: [AP] Allow Management frames to be passed to the host*/
#define IS_MANAGMEMENT 0x100
#define IS_MANAGMEMENT_CALLBACK 0x080
#define IS_MGMT_STATUS_SUCCES 0x040
/* reset mgmt indicator bit, to use pkt_offeset in furthur calculations */
pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES);
- WILC_WFI_mgmt_rx(&buffer[offset + HOST_HDR_OFFSET], pkt_len);
+ WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len);
}
- /* BUG4530 fix */
else
{
if (!is_cfg_packet) {
if (pkt_len > 0) {
- frmw_to_linux(&buffer[offset],
+ frmw_to_linux(wilc,
+ &buffer[offset],
pkt_len,
pkt_offset);
has_packet = 1;
- mac_cfg.rx_indicate(&buffer[pkt_offset + offset], pkt_len, &rsp);
+ wilc_wlan_cfg_indicate_rx(&buffer[pkt_offset + offset], pkt_len, &rsp);
if (rsp.type == WILC_CFG_RSP) {
/**
* wake up the waiting task...
**/
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) {
- up(&g_linux_wlan->cfg_event);
- }
+ if (p->cfg_seq_no == rsp.seq_no)
+ up(&wilc->cfg_event);
} else if (rsp.type == WILC_CFG_RSP_STATUS) {
/**
* Call back to indicate status...
**/
- linux_wlan_mac_indicate(WILC_MAC_INDICATE_STATUS);
+ linux_wlan_mac_indicate(wilc, WILC_MAC_INDICATE_STATUS);
} else if (rsp.type == WILC_CFG_RSP_SCAN) {
- linux_wlan_mac_indicate(WILC_MAC_INDICATE_SCAN);
+ linux_wlan_mac_indicate(wilc, WILC_MAC_INDICATE_SCAN);
}
}
}
#endif
kfree(rqe);
- if (has_packet) {
+ if (has_packet)
linux_wlan_rx_complete();
- }
+
} while (1);
p->rxq_exit = 1;
#endif
}
-static void wilc_wlan_handle_isr_ext(u32 int_status)
+static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
#ifdef MEMORY_STATIC
u32 offset = p->rx_buffer_offset;
#endif
rqe->buffer = buffer;
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);
+ wilc_wlan_rxq_add(wilc, rqe);
}
} else {
#ifndef MEMORY_STATIC
#endif
}
}
- wilc_wlan_handle_rxq();
+ wilc_wlan_handle_rxq(wilc);
}
-void wilc_handle_isr(void)
+void wilc_handle_isr(void *wilc)
{
u32 int_status;
acquire_bus(ACQUIRE_AND_WAKEUP);
g_wlan.hif_func.hif_read_int(&int_status);
- if (int_status & PLL_INT_EXT) {
+ if (int_status & PLL_INT_EXT)
wilc_pllupdate_isr_ext(int_status);
- }
+
if (int_status & DATA_INT_EXT) {
- wilc_wlan_handle_isr_ext(int_status);
+ wilc_wlan_handle_isr_ext(wilc, int_status);
#ifndef WILC_OPTIMIZE_SLEEP_INT
/* Chip is up and talking*/
genuChipPSstate = CHIP_WAKEDUP;
#endif
}
- if (int_status & SLEEP_INT_EXT) {
+ if (int_status & SLEEP_INT_EXT)
wilc_sleeptimer_isr_ext(int_status);
- }
if (!(int_status & (ALL_INT_EXT))) {
#ifdef WILC_SDIO
********************************************/
int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
u32 offset;
u32 addr, size, size2, blksz;
u8 *dma_buffer;
********************************************/
int wilc_wlan_start(void)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
u32 reg = 0;
int ret;
u32 chipid;
void wilc_wlan_global_reset(void)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
acquire_bus(ACQUIRE_AND_WAKEUP);
p->hif_func.hif_write_reg(WILC_GLB_RESET_0, 0x0);
}
int wilc_wlan_stop(void)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
u32 reg = 0;
int ret;
u8 timeout = 10;
return ret;
}
-void wilc_wlan_cleanup(void)
+void wilc_wlan_cleanup(struct net_device *dev)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
struct txq_entry_t *tqe;
struct rxq_entry_t *rqe;
u32 reg = 0;
int ret;
+ perInterface_wlan_t *nic;
+ struct wilc *wilc;
+
+ nic = netdev_priv(dev);
+ wilc = nic->wilc;
p->quit = 1;
do {
} while (1);
do {
- rqe = wilc_wlan_rxq_remove();
+ rqe = wilc_wlan_rxq_remove(wilc);
if (rqe == NULL)
break;
#ifndef MEMORY_STATIC
static int wilc_wlan_cfg_commit(int type, u32 drvHandler)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
wilc_cfg_frame_t *cfg = &p->cfg_frame;
int total_len = p->cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE;
int seq_no = p->cfg_seq_no % 256;
int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
int commit, u32 drvHandler)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
u32 offset;
int ret_size;
p->cfg_frame_offset = 0;
offset = p->cfg_frame_offset;
- ret_size = mac_cfg.cfg_wid_set(p->cfg_frame.frame, offset, (u16)wid,
- buffer, buffer_size);
+ ret_size = wilc_wlan_cfg_set_wid(p->cfg_frame.frame, offset, (u16)wid,
+ buffer, buffer_size);
offset += ret_size;
p->cfg_frame_offset = offset;
}
int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
{
- wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
+ wilc_wlan_dev_t *p = &g_wlan;
u32 offset;
int ret_size;
p->cfg_frame_offset = 0;
offset = p->cfg_frame_offset;
- ret_size = mac_cfg.cfg_wid_get(p->cfg_frame.frame, offset, (u16)wid);
+ ret_size = wilc_wlan_cfg_get_wid(p->cfg_frame.frame, offset, (u16)wid);
offset += ret_size;
p->cfg_frame_offset = offset;
{
int ret;
- ret = mac_cfg.cfg_wid_get_val((u16)wid, buffer, buffer_size);
+ ret = wilc_wlan_cfg_get_wid_value((u16)wid, buffer, buffer_size);
return ret;
}
return chipid;
}
-#ifdef COMPLEMENT_BOOT
-u8 core_11b_ready(void)
-{
- u32 reg_val;
-
- acquire_bus(ACQUIRE_ONLY);
- g_wlan.hif_func.hif_write_reg(0x16082c, 1);
- g_wlan.hif_func.hif_write_reg(0x161600, 0x90);
- g_wlan.hif_func.hif_read_reg(0x161600, ®_val);
- release_bus(RELEASE_ONLY);
-
- if (reg_val == 0x90)
- return 0;
- else
- return 1;
-}
-#endif
-
int wilc_wlan_init(wilc_wlan_inp_t *inp)
{
/***
* mac interface init
**/
- if (!mac_cfg.cfg_init(wilc_debug)) {
+ if (!wilc_wlan_cfg_init(wilc_debug)) {
/* ENOBUFS 105 */
ret = -105;
goto _fail_;
}
-u16 Set_machw_change_vir_if(bool bValue)
+u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue)
{
u16 ret;
u32 reg;
+ perInterface_wlan_t *nic;
+ struct wilc *wilc;
+
+ nic = netdev_priv(dev);
+ wilc = nic->wilc;
/*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/
- mutex_lock(&g_linux_wlan->hif_cs);
+ mutex_lock(&wilc->hif_cs);
ret = (&g_wlan)->hif_func.hif_read_reg(WILC_CHANGING_VIR_IF, ®);
- if (!ret) {
+ if (!ret)
PRINT_ER("Error while Reading reg WILC_CHANGING_VIR_IF\n");
- }
if (bValue)
reg |= BIT(31);
ret = (&g_wlan)->hif_func.hif_write_reg(WILC_CHANGING_VIR_IF, reg);
- if (!ret) {
+ if (!ret)
PRINT_ER("Error while writing reg WILC_CHANGING_VIR_IF\n");
- }
- mutex_unlock(&g_linux_wlan->hif_cs);
+
+ mutex_unlock(&wilc->hif_cs);
return ret;
}