diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/11n_aggr.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/11n_aggr.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/wmm.c | 32 |
4 files changed, 25 insertions, 11 deletions
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c index 1a453a605b3f..9e63d16365e3 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.c +++ b/drivers/net/wireless/mwifiex/11n_aggr.c | |||
@@ -193,7 +193,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
193 | skb_src = skb_dequeue(&pra_list->skb_head); | 193 | skb_src = skb_dequeue(&pra_list->skb_head); |
194 | 194 | ||
195 | pra_list->total_pkts_size -= skb_src->len; | 195 | pra_list->total_pkts_size -= skb_src->len; |
196 | pra_list->total_pkts--; | ||
197 | 196 | ||
198 | atomic_dec(&priv->wmm.tx_pkts_queued); | 197 | atomic_dec(&priv->wmm.tx_pkts_queued); |
199 | 198 | ||
@@ -269,7 +268,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
269 | skb_queue_tail(&pra_list->skb_head, skb_aggr); | 268 | skb_queue_tail(&pra_list->skb_head, skb_aggr); |
270 | 269 | ||
271 | pra_list->total_pkts_size += skb_aggr->len; | 270 | pra_list->total_pkts_size += skb_aggr->len; |
272 | pra_list->total_pkts++; | ||
273 | 271 | ||
274 | atomic_inc(&priv->wmm.tx_pkts_queued); | 272 | atomic_inc(&priv->wmm.tx_pkts_queued); |
275 | 273 | ||
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.h b/drivers/net/wireless/mwifiex/11n_aggr.h index 9c6dca7ab02c..900e1c62a0cc 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.h +++ b/drivers/net/wireless/mwifiex/11n_aggr.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define _MWIFIEX_11N_AGGR_H_ | 21 | #define _MWIFIEX_11N_AGGR_H_ |
22 | 22 | ||
23 | #define PKT_TYPE_AMSDU 0xE6 | 23 | #define PKT_TYPE_AMSDU 0xE6 |
24 | #define MIN_NUM_AMSDU 2 | ||
24 | 25 | ||
25 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, | 26 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, |
26 | struct sk_buff *skb); | 27 | struct sk_buff *skb); |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 4f4042809f23..907ab746dc4b 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -173,7 +173,6 @@ struct mwifiex_ra_list_tbl { | |||
173 | struct sk_buff_head skb_head; | 173 | struct sk_buff_head skb_head; |
174 | u8 ra[ETH_ALEN]; | 174 | u8 ra[ETH_ALEN]; |
175 | u32 total_pkts_size; | 175 | u32 total_pkts_size; |
176 | u32 total_pkts; | ||
177 | u32 is_11n_enabled; | 176 | u32 is_11n_enabled; |
178 | }; | 177 | }; |
179 | 178 | ||
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index 69e260b41711..eda24474c1fc 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -121,7 +121,6 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra) | |||
121 | memcpy(ra_list->ra, ra, ETH_ALEN); | 121 | memcpy(ra_list->ra, ra, ETH_ALEN); |
122 | 122 | ||
123 | ra_list->total_pkts_size = 0; | 123 | ra_list->total_pkts_size = 0; |
124 | ra_list->total_pkts = 0; | ||
125 | 124 | ||
126 | dev_dbg(adapter->dev, "info: allocated ra_list %p\n", ra_list); | 125 | dev_dbg(adapter->dev, "info: allocated ra_list %p\n", ra_list); |
127 | 126 | ||
@@ -648,7 +647,6 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter, | |||
648 | skb_queue_tail(&ra_list->skb_head, skb); | 647 | skb_queue_tail(&ra_list->skb_head, skb); |
649 | 648 | ||
650 | ra_list->total_pkts_size += skb->len; | 649 | ra_list->total_pkts_size += skb->len; |
651 | ra_list->total_pkts++; | ||
652 | 650 | ||
653 | atomic_inc(&priv->wmm.tx_pkts_queued); | 651 | atomic_inc(&priv->wmm.tx_pkts_queued); |
654 | 652 | ||
@@ -975,6 +973,28 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter, | |||
975 | } | 973 | } |
976 | 974 | ||
977 | /* | 975 | /* |
976 | * This function checks if 11n aggregation is possible. | ||
977 | */ | ||
978 | static int | ||
979 | mwifiex_is_11n_aggragation_possible(struct mwifiex_private *priv, | ||
980 | struct mwifiex_ra_list_tbl *ptr, | ||
981 | int max_buf_size) | ||
982 | { | ||
983 | int count = 0, total_size = 0; | ||
984 | struct sk_buff *skb, *tmp; | ||
985 | |||
986 | skb_queue_walk_safe(&ptr->skb_head, skb, tmp) { | ||
987 | total_size += skb->len; | ||
988 | if (total_size >= max_buf_size) | ||
989 | break; | ||
990 | if (++count >= MIN_NUM_AMSDU) | ||
991 | return true; | ||
992 | } | ||
993 | |||
994 | return false; | ||
995 | } | ||
996 | |||
997 | /* | ||
978 | * This function sends a single packet to firmware for transmission. | 998 | * This function sends a single packet to firmware for transmission. |
979 | */ | 999 | */ |
980 | static void | 1000 | static void |
@@ -1001,7 +1021,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv, | |||
1001 | dev_dbg(adapter->dev, "data: dequeuing the packet %p %p\n", ptr, skb); | 1021 | dev_dbg(adapter->dev, "data: dequeuing the packet %p %p\n", ptr, skb); |
1002 | 1022 | ||
1003 | ptr->total_pkts_size -= skb->len; | 1023 | ptr->total_pkts_size -= skb->len; |
1004 | ptr->total_pkts--; | ||
1005 | 1024 | ||
1006 | if (!skb_queue_empty(&ptr->skb_head)) | 1025 | if (!skb_queue_empty(&ptr->skb_head)) |
1007 | skb_next = skb_peek(&ptr->skb_head); | 1026 | skb_next = skb_peek(&ptr->skb_head); |
@@ -1027,7 +1046,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv, | |||
1027 | skb_queue_tail(&ptr->skb_head, skb); | 1046 | skb_queue_tail(&ptr->skb_head, skb); |
1028 | 1047 | ||
1029 | ptr->total_pkts_size += skb->len; | 1048 | ptr->total_pkts_size += skb->len; |
1030 | ptr->total_pkts++; | ||
1031 | tx_info->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT; | 1049 | tx_info->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT; |
1032 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, | 1050 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, |
1033 | ra_list_flags); | 1051 | ra_list_flags); |
@@ -1213,11 +1231,9 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) | |||
1213 | mwifiex_send_delba(priv, tid_del, ra, 1); | 1231 | mwifiex_send_delba(priv, tid_del, ra, 1); |
1214 | } | 1232 | } |
1215 | } | 1233 | } |
1216 | /* Minimum number of AMSDU */ | ||
1217 | #define MIN_NUM_AMSDU 2 | ||
1218 | |||
1219 | if (mwifiex_is_amsdu_allowed(priv, tid) && | 1234 | if (mwifiex_is_amsdu_allowed(priv, tid) && |
1220 | (ptr->total_pkts >= MIN_NUM_AMSDU)) | 1235 | mwifiex_is_11n_aggragation_possible(priv, ptr, |
1236 | adapter->tx_buf_size)) | ||
1221 | mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN, | 1237 | mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN, |
1222 | ptr_index, flags); | 1238 | ptr_index, flags); |
1223 | /* ra_list_spinlock has been freed in | 1239 | /* ra_list_spinlock has been freed in |