Commit f31e5584 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: use short names to fix over 80 issue in tcp_process()

Use short variable names to avoid line over 80 chars checkpatch warning
in tcp_process().

struct pending_acks_info     --> struct pending_ack
int tcp_pending_ack_idx      --> int ack_idx
u32 pending_ack              --> u32 pending_ack_idx
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a3178da4
......@@ -115,7 +115,7 @@ struct ack_session_info {
u16 status;
};
struct pending_acks_info {
struct pending_acks {
u32 ack_num;
u32 session_index;
struct txq_entry_t *txqe;
......@@ -123,10 +123,10 @@ struct pending_acks_info {
struct tcp_ack_filter {
struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION];
struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS];
struct pending_acks pending_acks[MAX_PENDING_ACKS];
u32 pending_base;
u32 tcp_session;
u32 pending_acks;
u32 pending_acks_idx;
bool enabled;
};
......
......@@ -125,14 +125,14 @@ static inline int add_tcp_pending_ack(struct wilc_vif *vif, u32 ack,
struct txq_entry_t *txqe)
{
struct tcp_ack_filter *f = &vif->ack_filter;
u32 i = f->pending_base + f->pending_acks;
u32 i = f->pending_base + f->pending_acks_idx;
if (i < MAX_PENDING_ACKS) {
f->pending_acks_info[i].ack_num = ack;
f->pending_acks_info[i].txqe = txqe;
f->pending_acks_info[i].session_index = session_index;
txqe->tcp_pending_ack_idx = i;
f->pending_acks++;
f->pending_acks[i].ack_num = ack;
f->pending_acks[i].txqe = txqe;
f->pending_acks[i].session_index = session_index;
txqe->ack_idx = i;
f->pending_acks_idx++;
}
return 0;
}
......@@ -200,24 +200,24 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_lock_irqsave(&wilc->txq_spinlock, flags);
for (i = f->pending_base;
i < (f->pending_base + f->pending_acks); i++) {
i < (f->pending_base + f->pending_acks_idx); i++) {
u32 index;
u32 bigger_ack_num;
if (i >= MAX_PENDING_ACKS)
break;
index = f->pending_acks_info[i].session_index;
index = f->pending_acks[i].session_index;
if (index >= 2 * MAX_TCP_SESSION)
break;
bigger_ack_num = f->ack_session_info[index].bigger_ack_num;
if (f->pending_acks_info[i].ack_num < bigger_ack_num) {
if (f->pending_acks[i].ack_num < bigger_ack_num) {
struct txq_entry_t *tqe;
tqe = f->pending_acks_info[i].txqe;
tqe = f->pending_acks[i].txqe;
if (tqe) {
wilc_wlan_txq_remove(wilc, tqe);
tqe->status = 1;
......@@ -229,7 +229,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
}
}
}
f->pending_acks = 0;
f->pending_acks_idx = 0;
f->tcp_session = 0;
if (f->pending_base == 0)
......@@ -275,7 +275,7 @@ static int wilc_wlan_txq_add_cfg_pkt(struct wilc_vif *vif, u8 *buffer,
tqe->buffer_size = buffer_size;
tqe->tx_complete_func = NULL;
tqe->priv = NULL;
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
tqe->ack_idx = NOT_TCP_ACK;
if (wilc_wlan_txq_add_to_head(vif, tqe)) {
kfree(tqe);
......@@ -307,7 +307,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
tqe->tx_complete_func = func;
tqe->priv = priv;
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
tqe->ack_idx = NOT_TCP_ACK;
if (vif->ack_filter.enabled)
tcp_process(dev, tqe);
wilc_wlan_txq_add_to_tail(dev, tqe);
......@@ -335,7 +335,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
tqe->buffer_size = buffer_size;
tqe->tx_complete_func = func;
tqe->priv = priv;
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
tqe->ack_idx = NOT_TCP_ACK;
wilc_wlan_txq_add_to_tail(dev, tqe);
return 1;
}
......@@ -668,9 +668,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
tqe->status = 1;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK &&
tqe->tcp_pending_ack_idx < MAX_PENDING_ACKS)
vif->ack_filter.pending_acks_info[tqe->tcp_pending_ack_idx].txqe = NULL;
if (tqe->ack_idx != NOT_TCP_ACK &&
tqe->ack_idx < MAX_PENDING_ACKS)
vif->ack_filter.pending_acks[tqe->ack_idx].txqe = NULL;
kfree(tqe);
} while (--entries);
......
......@@ -212,7 +212,7 @@
struct txq_entry_t {
struct list_head list;
int type;
int tcp_pending_ack_idx;
int ack_idx;
u8 *buffer;
int buffer_size;
void *priv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment