summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2012-08-03 18:06:01 -0700
committerJohn W. Linville <linville@tuxdriver.com>2012-08-06 15:12:47 -0400
commitbda1b1b77918ea340bbfb2938a0fd7d5203e430c (patch)
tree93471bc59f809ca22e2ab89f7273370fcff6f321
parent7d273ef32a0d68f2751f74f7401de78f3c95afa8 (diff)
mwifiex: correction in MSDU padding logic
Padding arithmetic will always work for MSDUs provided first MSDU ends on 4-byte boundary. Fixing it by making sure that all MSDU ends on 4-byte boundary. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwifiex/11n_aggr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index 04222f27665f..395f1bfd4102 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -82,8 +82,8 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
/* Add payload */
memcpy(skb_put(skb_aggr, skb_src->len), skb_src->data, skb_src->len);
- *pad = (((skb_src->len + LLC_SNAP_LEN) & 3)) ? (4 - (((skb_src->len +
- LLC_SNAP_LEN)) & 3)) : 0;
+ /* Add padding for new MSDU to start from 4 byte boundary */
+ *pad = (4 - ((unsigned long)skb_aggr->tail & 0x3)) % 4;
return skb_aggr->len + *pad;
}