mwifiex: fix hang issue for USB chipsets

Bug 60815 - Interface hangs in mwifiex_usb
https://bugzilla.kernel.org/show_bug.cgi?id=60815

We have 4 bytes of interface header for packets delivered to SDIO
and PCIe, but not for USB interface.

In Tx AMSDU case, currently 4 bytes of garbage data is unnecessarily
appended for USB packets. This sometimes leads to a firmware hang,
because it may not interpret the data packet correctly.

Problem is fixed by removing this redundant headroom for USB.

Cc: <stable@vger.kernel.org> # 3.5+
Tested-by: Dmitry Khromov <icechrome@gmail.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Amitkumar Karwar 2013-09-24 19:31:24 -07:00 committed by John W. Linville
parent 1e43692cdb
commit bd1c6142ed
3 changed files with 4 additions and 4 deletions

View file

@ -150,7 +150,7 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv,
*/ */
int int
mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
struct mwifiex_ra_list_tbl *pra_list, int headroom, struct mwifiex_ra_list_tbl *pra_list,
int ptrindex, unsigned long ra_list_flags) int ptrindex, unsigned long ra_list_flags)
__releases(&priv->wmm.ra_list_spinlock) __releases(&priv->wmm.ra_list_spinlock)
{ {
@ -160,6 +160,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
int pad = 0, ret; int pad = 0, ret;
struct mwifiex_tx_param tx_param; struct mwifiex_tx_param tx_param;
struct txpd *ptx_pd = NULL; struct txpd *ptx_pd = NULL;
int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN;
skb_src = skb_peek(&pra_list->skb_head); skb_src = skb_peek(&pra_list->skb_head);
if (!skb_src) { if (!skb_src) {

View file

@ -26,7 +26,7 @@
int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
struct sk_buff *skb); struct sk_buff *skb);
int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
struct mwifiex_ra_list_tbl *ptr, int headroom, struct mwifiex_ra_list_tbl *ptr,
int ptr_index, unsigned long flags) int ptr_index, unsigned long flags)
__releases(&priv->wmm.ra_list_spinlock); __releases(&priv->wmm.ra_list_spinlock);

View file

@ -1239,8 +1239,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) && if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) &&
mwifiex_is_11n_aggragation_possible(priv, ptr, mwifiex_is_11n_aggragation_possible(priv, ptr,
adapter->tx_buf_size)) adapter->tx_buf_size))
mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN, mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags);
ptr_index, flags);
/* ra_list_spinlock has been freed in /* ra_list_spinlock has been freed in
mwifiex_11n_aggregate_pkt() */ mwifiex_11n_aggregate_pkt() */
else else