Commit e7f767a7 authored by Avinash Patil's avatar Avinash Patil Committed by John W. Linville

mwifiex: use map/unmap APIs in TX and RX to reduce memcpy

This patch is an enhacement to mwifiex_pcie driver to use
map/unmap PCI memory APIs. This reduces one memcpy each in TX
path and RX path, and enhances throughput.
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent fbd7e7ac
...@@ -278,14 +278,16 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, ...@@ -278,14 +278,16 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); dev_dbg(adapter->dev, "data: -EBUSY is returned\n");
break; break;
case -1: case -1:
adapter->data_sent = false; if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false;
dev_err(adapter->dev, "%s: host_to_card failed: %#x\n", dev_err(adapter->dev, "%s: host_to_card failed: %#x\n",
__func__, ret); __func__, ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb_aggr, 1, ret); mwifiex_write_data_complete(adapter, skb_aggr, 1, ret);
return 0; return 0;
case -EINPROGRESS: case -EINPROGRESS:
adapter->data_sent = false; if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false;
break; break;
case 0: case 0:
mwifiex_write_data_complete(adapter, skb_aggr, 1, ret); mwifiex_write_data_complete(adapter, skb_aggr, 1, ret);
......
This diff is collapsed.
...@@ -159,4 +159,15 @@ mwifiex_pcie_txbd_empty(struct pcie_service_card *card, u32 rdptr) ...@@ -159,4 +159,15 @@ mwifiex_pcie_txbd_empty(struct pcie_service_card *card, u32 rdptr)
return 0; return 0;
} }
static inline int
mwifiex_pcie_txbd_not_full(struct pcie_service_card *card)
{
if (((card->txbd_wrptr & MWIFIEX_TXBD_MASK) !=
(card->txbd_rdptr & MWIFIEX_TXBD_MASK)) ||
((card->txbd_wrptr & MWIFIEX_BD_FLAG_ROLLOVER_IND) !=
(card->txbd_rdptr & MWIFIEX_BD_FLAG_ROLLOVER_IND)))
return 1;
return 0;
}
#endif /* _MWIFIEX_PCIE_H */ #endif /* _MWIFIEX_PCIE_H */
...@@ -117,14 +117,16 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, ...@@ -117,14 +117,16 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); dev_dbg(adapter->dev, "data: -EBUSY is returned\n");
break; break;
case -1: case -1:
adapter->data_sent = false; if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false;
dev_err(adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", dev_err(adapter->dev, "mwifiex_write_data_async failed: 0x%X\n",
ret); ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, ret); mwifiex_write_data_complete(adapter, skb, 0, ret);
break; break;
case -EINPROGRESS: case -EINPROGRESS:
adapter->data_sent = false; if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false;
break; break;
case 0: case 0:
mwifiex_write_data_complete(adapter, skb, 0, ret); mwifiex_write_data_complete(adapter, skb, 0, ret);
......
...@@ -1208,13 +1208,15 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv, ...@@ -1208,13 +1208,15 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
ra_list_flags); ra_list_flags);
break; break;
case -1: case -1:
adapter->data_sent = false; if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false;
dev_err(adapter->dev, "host_to_card failed: %#x\n", ret); dev_err(adapter->dev, "host_to_card failed: %#x\n", ret);
adapter->dbg.num_tx_host_to_card_failure++; adapter->dbg.num_tx_host_to_card_failure++;
mwifiex_write_data_complete(adapter, skb, 0, ret); mwifiex_write_data_complete(adapter, skb, 0, ret);
break; break;
case -EINPROGRESS: case -EINPROGRESS:
adapter->data_sent = false; if (adapter->iface_type != MWIFIEX_PCIE)
adapter->data_sent = false;
default: default:
break; break;
} }
......
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