wilc->txq_tail = tqe;
}
wilc->txq_entries += 1;
- PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", wilc->txq_entries);
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
- PRINT_D(TX_DBG, "Wake the txq_handling\n");
-
up(&wilc->txq_event);
}
wilc->txq_head = tqe;
}
wilc->txq_entries += 1;
- netdev_dbg(vif->ndev, "Number of entries in TxQ = %d\n", wilc->txq_entries);
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
up(&wilc->txq_add_to_head_cs);
up(&wilc->txq_event);
- netdev_dbg(vif->ndev, "Wake up the txq_handler\n");
return 0;
}
ack_session_info[tcp_session].dst_port = dst_prt;
tcp_session++;
}
- PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", tcp_session, seq);
return 0;
}
if (pending_acks_info[i].ack_num < ack_session_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) {
wilc_wlan_txq_remove(wilc, tqe);
tqe->tx_complete_func = NULL;
tqe->priv = NULL;
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
- netdev_dbg(vif->ndev, "Adding the config packet at the Queue tail\n");
if (wilc_wlan_txq_add_to_head(vif, tqe))
return 0;
tqe->tx_complete_func = func;
tqe->priv = priv;
- PRINT_D(TX_DBG, "Adding mgmt packet at the Queue tail\n");
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
if (is_tcp_ack_filter_enabled())
tcp_process(dev, tqe);
tqe->tx_complete_func = func;
tqe->priv = priv;
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
- PRINT_D(TX_DBG, "Adding Network packet at the Queue tail\n");
wilc_wlan_txq_add_to_tail(dev, tqe);
return 1;
}
mutex_lock(&wilc->rxq_cs);
if (!wilc->rxq_head) {
- PRINT_D(RX_DBG, "Add to Queue head\n");
rqe->next = NULL;
wilc->rxq_head = rqe;
wilc->rxq_tail = rqe;
} else {
- PRINT_D(RX_DBG, "Add to Queue tail\n");
wilc->rxq_tail->next = rqe;
rqe->next = NULL;
wilc->rxq_tail = rqe;
}
wilc->rxq_entries += 1;
- PRINT_D(RX_DBG, "Number of queue entries: %d\n", wilc->rxq_entries);
mutex_unlock(&wilc->rxq_cs);
return wilc->rxq_entries;
}
static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc)
{
- PRINT_D(RX_DBG, "Getting rxQ element\n");
if (wilc->rxq_head) {
struct rxq_entry_t *rqe;
rqe = wilc->rxq_head;
wilc->rxq_head = wilc->rxq_head->next;
wilc->rxq_entries -= 1;
- PRINT_D(RX_DBG, "RXQ entries decreased\n");
mutex_unlock(&wilc->rxq_cs);
return rqe;
}
- PRINT_D(RX_DBG, "Nothing to get from Q\n");
return NULL;
}
wilc_lock_timeout(wilc, &wilc->txq_add_to_head_cs,
CFG_PKTS_TIMEOUT);
wilc_wlan_txq_filter_dup_tcp_ack(dev);
- PRINT_D(TX_DBG, "Getting the head of the TxQ\n");
tqe = wilc_wlan_txq_get_first(wilc);
i = 0;
sum = 0;
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)
vmm_sz = (vmm_sz + 4) & ~0x3;
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;
- PRINT_D(TX_DBG, "VMMTable entry size = %d\n",
- vmm_table[i]);
-
- if (tqe->type == WILC_CFG_PKT) {
+ if (tqe->type == WILC_CFG_PKT)
vmm_table[i] |= BIT(10);
- PRINT_D(TX_DBG, "VMMTable entry changed for CFG packet = %d\n", vmm_table[i]);
- }
vmm_table[i] = cpu_to_le32(vmm_table[i]);
i++;
sum += vmm_sz;
- PRINT_D(TX_DBG, "sum = %d\n", sum);
tqe = wilc_wlan_txq_get_next(wilc, tqe);
} else {
break;
ret = wilc->hif_func->hif_read_reg(wilc,
WILC_HOST_TX_CTRL,
®);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't read reg vmm_tbl_entry..\n");
+ if (!ret)
break;
- }
if ((reg & 0x1) == 0) {
- PRINT_D(TX_DBG, "Writing VMM table ... with Size = %d\n", ((i + 1) * 4));
break;
} else {
counter++;
if (counter > 200) {
counter = 0;
- PRINT_D(TX_DBG, "Looping in tx ctrl , forcce quit\n");
ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0);
break;
}
- PRINT_WRN(GENERIC_DBG, "[wilc txq]: warn, vmm table not clear yet, wait...\n");
}
} while (!wilc->quit);
timeout = 200;
do {
ret = wilc->hif_func->hif_block_tx(wilc, WILC_VMM_TBL_RX_SHADOW_BASE, (u8 *)vmm_table, ((i + 1) * 4));
- if (!ret) {
- wilc_debug(N_ERR, "ERR block TX of VMM table.\n");
+ if (!ret)
break;
- }
ret = wilc->hif_func->hif_write_reg(wilc,
WILC_HOST_VMM_CTL,
0x2);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't write reg host_vmm_ctl..\n");
+ if (!ret)
break;
- }
do {
ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, ®);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't read reg host_vmm_ctl..\n");
+ if (!ret)
break;
- }
if ((reg >> 2) & 0x1) {
entries = ((reg >> 3) & 0x3f);
break;
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]);
ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, ®);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't read reg WILC_HOST_TX_CTRL..\n");
+ if (!ret)
break;
- }
reg &= ~BIT(0);
ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't write reg WILC_HOST_TX_CTRL..\n");
+ if (!ret)
break;
- }
break;
} else {
break;
acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
ret = wilc->hif_func->hif_clear_int_ext(wilc, ENABLE_TX_VMM);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't start tx VMM ...\n");
+ if (!ret)
goto _end_;
- }
ret = wilc->hif_func->hif_block_tx_ext(wilc, 0, txb, offset);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc txq]: fail can't block tx ext...\n");
+ if (!ret)
goto _end_;
- }
_end_:
do {
if (wilc->quit) {
- PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n");
up(&wilc->cfg_event);
break;
}
rqe = wilc_wlan_rxq_remove(wilc);
- if (!rqe) {
- PRINT_D(RX_DBG, "nothing in the queue - exit 1st do-while\n");
+ if (!rqe)
break;
- }
+
buffer = rqe->buffer;
size = rqe->buffer_size;
- PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n",
- size, buffer);
offset = 0;
do {
tp_len = (header >> 11) & 0x7ff;
pkt_len = header & 0x7ff;
- if (pkt_len == 0 || tp_len == 0) {
- wilc_debug(N_RXQ, "[wilc rxq]: data corrupt, packet len or tp_len is 0 [%d][%d]\n", pkt_len, tp_len);
+ if (pkt_len == 0 || tp_len == 0)
break;
- }
#define IS_MANAGMEMENT 0x100
#define IS_MANAGMEMENT_CALLBACK 0x080
wilc_wlan_cfg_indicate_rx(wilc, &buffer[pkt_offset + offset], pkt_len, &rsp);
if (rsp.type == WILC_CFG_RSP) {
- PRINT_D(RX_DBG, "wilc->cfg_seq_no = %d - rsp.seq_no = %d\n", wilc->cfg_seq_no, rsp.seq_no);
if (wilc->cfg_seq_no == rsp.seq_no)
up(&wilc->cfg_event);
} else if (rsp.type == WILC_CFG_RSP_STATUS) {
else
mdelay(WILC_PLL_TO_SPI);
- while (!(ISWILC1000(wilc_get_chipid(wilc, true)) && --trials)) {
- PRINT_D(TX_DBG, "PLL update retrying\n");
+ while (!(ISWILC1000(wilc_get_chipid(wilc, true)) && --trials))
mdelay(1);
- }
}
static void wilc_sleeptimer_isr_ext(struct wilc *wilc, u32 int_stats1)
size = ((int_status & 0x7fff) << 2);
while (!size && retries < 10) {
- u32 time = 0;
-
- wilc_debug(N_ERR, "RX Size equal zero ... Trying to read it again for %d time\n", time++);
wilc->hif_func->hif_read_size(wilc, &size);
size = ((size & 0x7fff) << 2);
retries++;
if (LINUX_RX_SIZE - offset < size)
offset = 0;
- if (wilc->rx_buffer) {
+ if (wilc->rx_buffer)
buffer = &wilc->rx_buffer[offset];
- } else {
- wilc_debug(N_ERR, "[wilc isr]: fail Rx Buffer is NULL...drop the packets (%d)\n", size);
+ else
goto _end_;
- }
wilc->hif_func->hif_clear_int_ext(wilc,
DATA_INT_CLR | ENABLE_RX_VMM);
ret = wilc->hif_func->hif_block_rx_ext(wilc, 0, buffer, size);
- if (!ret) {
- wilc_debug(N_ERR, "[wilc isr]: fail block rx...\n");
+ if (!ret)
goto _end_;
- }
_end_:
if (ret) {
offset += size;
dma_buffer = kmalloc(blksz, GFP_KERNEL);
if (!dma_buffer) {
ret = -EIO;
- PRINT_ER("Can't allocate buffer for firmware download IO error\n ");
goto _fail_1;
}
- PRINT_D(INIT_DBG, "Downloading firmware size = %d ...\n", buffer_size);
-
offset = 0;
do {
memcpy(&addr, &buffer[offset], 4);
if (!ret) {
ret = -EIO;
- PRINT_ER("Can't download firmware IO error\n ");
goto _fail_;
}
PRINT_D(INIT_DBG, "Offset = %d\n", offset);
acquire_bus(wilc, ACQUIRE_ONLY);
ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg);
if (!ret) {
- wilc_debug(N_ERR, "[wilc start]: fail write reg vmm_core_cfg...\n");
release_bus(wilc, RELEASE_ONLY);
ret = -EIO;
return ret;
ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_1, reg);
if (!ret) {
- wilc_debug(N_ERR, "[wilc start]: fail write WILC_GP_REG_1 ...\n");
release_bus(wilc, RELEASE_ONLY);
ret = -EIO;
return ret;
ret = wilc->hif_func->hif_read_reg(wilc, 0x1000, &chipid);
if (!ret) {
- wilc_debug(N_ERR, "[wilc start]: fail read reg 0x1000 ...\n");
release_bus(wilc, RELEASE_ONLY);
ret = -EIO;
return ret;
ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®);
if (!ret) {
- PRINT_ER("Error while reading reg\n");
release_bus(wilc, RELEASE_ALLOW_SLEEP);
return ret;
}
reg &= ~BIT(10);
ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg);
if (!ret) {
- PRINT_ER("Error while writing reg\n");
release_bus(wilc, RELEASE_ALLOW_SLEEP);
return ret;
}
ret = wilc->hif_func->hif_read_reg(wilc,
WILC_GLB_RESET_0, ®);
if (!ret) {
- PRINT_ER("Error while reading reg\n");
release_bus(wilc, RELEASE_ALLOW_SLEEP);
return ret;
}
- PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n",
- reg, timeout);
if ((reg & BIT(10))) {
- PRINT_D(GENERIC_DBG, "Bit 10 not reset : Retry %d\n",
- timeout);
reg &= ~BIT(10);
ret = wilc->hif_func->hif_write_reg(wilc,
WILC_GLB_RESET_0,
reg);
timeout--;
} else {
- PRINT_D(GENERIC_DBG, "Bit 10 reset after : Retry %d\n",
- timeout);
ret = wilc->hif_func->hif_read_reg(wilc,
WILC_GLB_RESET_0,
®);
if (!ret) {
- PRINT_ER("Error while reading reg\n");
release_bus(wilc, RELEASE_ALLOW_SLEEP);
return ret;
}
- PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n",
- reg, timeout);
break;
}
acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®);
- if (!ret) {
- PRINT_ER("Error while reading reg\n");
+ if (!ret)
release_bus(wilc, RELEASE_ALLOW_SLEEP);
- }
- PRINT_ER("Writing ABORT reg\n");
+
ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0,
(reg | ABORT_INT));
- if (!ret) {
- PRINT_ER("Error while writing reg\n");
+ if (!ret)
release_bus(wilc, RELEASE_ALLOW_SLEEP);
- }
+
release_bus(wilc, RELEASE_ALLOW_SLEEP);
wilc->hif_func->hif_deinit(NULL);
}
netdev_dbg(vif->ndev, "Get Timed Out\n");
ret_size = 0;
}
- netdev_dbg(vif->ndev, "[WILC]Get Response received\n");
wilc->cfg_frame_in_use = 0;
wilc->cfg_frame_offset = 0;
wilc->cfg_seq_no += 1;
if (!wilc->tx_buffer)
wilc->tx_buffer = kmalloc(LINUX_TX_SIZE, GFP_KERNEL);
- PRINT_D(TX_DBG, "wilc->tx_buffer = %p\n", wilc->tx_buffer);
if (!wilc->tx_buffer) {
ret = -ENOBUFS;
if (!wilc->rx_buffer)
wilc->rx_buffer = kmalloc(LINUX_RX_SIZE, GFP_KERNEL);
- PRINT_D(TX_DBG, "wilc->rx_buffer =%p\n", wilc->rx_buffer);
+
if (!wilc->rx_buffer) {
ret = -ENOBUFS;
PRINT_ER("Can't allocate Rx Buffer");