Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266637
b: refs/heads/master
c: d85c5fe
h: refs/heads/master
i:
  266635: 19ed62d
v: v3
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Oct 3, 2011
1 parent 75218d3 commit f531e60
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c34559b4a6df32e4af1b073397fa4dc189a5485
refs/heads/master: d85c5fe462fe3531f607fda787e9c80617e35437
2 changes: 0 additions & 2 deletions trunk/drivers/net/wireless/mwifiex/11n_aggr.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
skb_src = skb_dequeue(&pra_list->skb_head);

pra_list->total_pkts_size -= skb_src->len;
pra_list->total_pkts--;

atomic_dec(&priv->wmm.tx_pkts_queued);

Expand Down Expand Up @@ -269,7 +268,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
skb_queue_tail(&pra_list->skb_head, skb_aggr);

pra_list->total_pkts_size += skb_aggr->len;
pra_list->total_pkts++;

atomic_inc(&priv->wmm.tx_pkts_queued);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/mwifiex/11n_aggr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define _MWIFIEX_11N_AGGR_H_

#define PKT_TYPE_AMSDU 0xE6
#define MIN_NUM_AMSDU 2

int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
struct sk_buff *skb);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/mwifiex/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ struct mwifiex_ra_list_tbl {
struct sk_buff_head skb_head;
u8 ra[ETH_ALEN];
u32 total_pkts_size;
u32 total_pkts;
u32 is_11n_enabled;
};

Expand Down
32 changes: 24 additions & 8 deletions trunk/drivers/net/wireless/mwifiex/wmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra)
memcpy(ra_list->ra, ra, ETH_ALEN);

ra_list->total_pkts_size = 0;
ra_list->total_pkts = 0;

dev_dbg(adapter->dev, "info: allocated ra_list %p\n", ra_list);

Expand Down Expand Up @@ -648,7 +647,6 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
skb_queue_tail(&ra_list->skb_head, skb);

ra_list->total_pkts_size += skb->len;
ra_list->total_pkts++;

atomic_inc(&priv->wmm.tx_pkts_queued);

Expand Down Expand Up @@ -974,6 +972,28 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
return NULL;
}

/*
* This function checks if 11n aggregation is possible.
*/
static int
mwifiex_is_11n_aggragation_possible(struct mwifiex_private *priv,
struct mwifiex_ra_list_tbl *ptr,
int max_buf_size)
{
int count = 0, total_size = 0;
struct sk_buff *skb, *tmp;

skb_queue_walk_safe(&ptr->skb_head, skb, tmp) {
total_size += skb->len;
if (total_size >= max_buf_size)
break;
if (++count >= MIN_NUM_AMSDU)
return true;
}

return false;
}

/*
* This function sends a single packet to firmware for transmission.
*/
Expand Down Expand Up @@ -1001,7 +1021,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
dev_dbg(adapter->dev, "data: dequeuing the packet %p %p\n", ptr, skb);

ptr->total_pkts_size -= skb->len;
ptr->total_pkts--;

if (!skb_queue_empty(&ptr->skb_head))
skb_next = skb_peek(&ptr->skb_head);
Expand All @@ -1027,7 +1046,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
skb_queue_tail(&ptr->skb_head, skb);

ptr->total_pkts_size += skb->len;
ptr->total_pkts++;
tx_info->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
ra_list_flags);
Expand Down Expand Up @@ -1213,11 +1231,9 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
mwifiex_send_delba(priv, tid_del, ra, 1);
}
}
/* Minimum number of AMSDU */
#define MIN_NUM_AMSDU 2

if (mwifiex_is_amsdu_allowed(priv, tid) &&
(ptr->total_pkts >= MIN_NUM_AMSDU))
mwifiex_is_11n_aggragation_possible(priv, ptr,
adapter->tx_buf_size))
mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN,
ptr_index, flags);
/* ra_list_spinlock has been freed in
Expand Down

0 comments on commit f531e60

Please sign in to comment.