#define BLOCK_ACK_REQ_SIZE 0x14
#define FALSE_FRMWR_CHANNEL 100
+#define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
+#define DEFAULT_LINK_SPEED 72
+
struct cfg_param_attr {
struct cfg_param_val cfg_attr_info;
};
if (result)
PRINT_ER("Failed to send scan paramters config packet\n");
- up(&hif_sema_wait_response);
+ if (pstrStatistics->link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH &&
+ pstrStatistics->link_speed != DEFAULT_LINK_SPEED)
+ wilc_enable_tcp_ack_filter(true);
+ else if (pstrStatistics->link_speed != DEFAULT_LINK_SPEED)
+ wilc_enable_tcp_ack_filter(false);
+
+ if (pstrStatistics != &vif->wilc->dummy_statistics)
+ up(&hif_sema_wait_response);
return 0;
}
return -EFAULT;
}
- down(&hif_sema_wait_response);
+ if (stats != &vif->wilc->dummy_statistics)
+ down(&hif_sema_wait_response);
return result;
}
return;
}
- if (vif->hif_drv->hif_state == HOST_IF_CONNECTED) {
- s32 result = 0;
- struct host_if_msg msg;
-
- memset(&msg, 0, sizeof(struct host_if_msg));
-
- msg.id = HOST_IF_MSG_GET_RSSI;
- msg.vif = vif;
+ if (vif->hif_drv->hif_state == HOST_IF_CONNECTED)
+ wilc_get_statistics(vif, &vif->wilc->dummy_statistics);
- result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (result) {
- PRINT_ER("Failed to send get host channel param's message queue ");
- return;
- }
- }
periodic_rssi.data = (unsigned long)vif;
mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000));
}
static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq)
{
- ack_session_info[tcp_session].seq_num = seq;
- ack_session_info[tcp_session].bigger_ack_num = 0;
- ack_session_info[tcp_session].src_port = src_prt;
- ack_session_info[tcp_session].dst_port = dst_prt;
- tcp_session++;
-
+ if (tcp_session < 2 * MAX_TCP_SESSION) {
+ ack_session_info[tcp_session].seq_num = seq;
+ ack_session_info[tcp_session].bigger_ack_num = 0;
+ ack_session_info[tcp_session].src_port = src_prt;
+ 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;
}
static inline int update_tcp_session(u32 index, u32 ack)
{
- if (ack > ack_session_info[index].bigger_ack_num)
+ if (index < 2 * MAX_TCP_SESSION &&
+ ack > ack_session_info[index].bigger_ack_num)
ack_session_info[index].bigger_ack_num = ack;
return 0;
}
static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
struct txq_entry_t *txqe)
{
- if (pending_acks < MAX_PENDING_ACKS) {
+ if (pending_base + pending_acks < MAX_PENDING_ACKS) {
pending_acks_info[pending_base + pending_acks].ack_num = ack;
pending_acks_info[pending_base + pending_acks].txqe = txqe;
pending_acks_info[pending_base + pending_acks].session_index = session_index;
(u32)tcp_hdr_ptr[11];
for (i = 0; i < tcp_session; i++) {
- if (ack_session_info[i].seq_num == seq_no) {
+ if (i < 2 * MAX_TCP_SESSION &&
+ ack_session_info[i].seq_num == seq_no) {
update_tcp_session(i, ack_no);
break;
}
spin_lock_irqsave(&wilc->txq_spinlock, wilc->txq_spinlock_flags);
for (i = pending_base; i < (pending_base + pending_acks); i++) {
+ if (i >= MAX_PENDING_ACKS ||
+ pending_acks_info[i].session_index >= 2 * MAX_TCP_SESSION)
+ break;
if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv,
tqe->status);
- if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK)
+ if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK &&
+ tqe->tcp_pending_ack_idx < MAX_PENDING_ACKS)
pending_acks_info[tqe->tcp_pending_ack_idx].txqe = NULL;
kfree(tqe);
} else {