mwifiex: rx path enhancement to derive priv only once
We derive mwifiex_private structure which is per interface from received skb's rx_info. Once priv is derived, same priv can be propagated to other functions instead of callee deriving priv from rx_info again. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
3a5b8a1685
commit
f3b369e40a
@@ -146,20 +146,16 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv,
|
||||
* to the kernel.
|
||||
*/
|
||||
int
|
||||
mwifiex_process_mgmt_packet(struct mwifiex_adapter *adapter,
|
||||
mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct rxpd *rx_pd;
|
||||
struct mwifiex_private *priv;
|
||||
u16 pkt_len;
|
||||
|
||||
if (!skb)
|
||||
return -1;
|
||||
|
||||
rx_pd = (struct rxpd *)skb->data;
|
||||
priv = mwifiex_get_priv_by_id(adapter, rx_pd->bss_num, rx_pd->bss_type);
|
||||
if (!priv)
|
||||
return -1;
|
||||
|
||||
skb_pull(skb, le16_to_cpu(rx_pd->rx_pkt_offset));
|
||||
skb_pull(skb, sizeof(pkt_len));
|
||||
@@ -190,20 +186,11 @@ mwifiex_process_mgmt_packet(struct mwifiex_adapter *adapter,
|
||||
* the function creates a blank SKB, fills it with the data from the
|
||||
* received buffer and then sends this new SKB to the kernel.
|
||||
*/
|
||||
int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb)
|
||||
int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
|
||||
{
|
||||
struct mwifiex_rxinfo *rx_info;
|
||||
struct mwifiex_private *priv;
|
||||
|
||||
if (!skb)
|
||||
return -1;
|
||||
|
||||
rx_info = MWIFIEX_SKB_RXCB(skb);
|
||||
priv = mwifiex_get_priv_by_id(adapter, rx_info->bss_num,
|
||||
rx_info->bss_type);
|
||||
if (!priv)
|
||||
return -1;
|
||||
|
||||
skb->dev = priv->netdev;
|
||||
skb->protocol = eth_type_trans(skb, priv->netdev);
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
@@ -225,7 +212,7 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb)
|
||||
* fragments. Currently we fail the Filesndl-ht.scr script
|
||||
* for UDP, hence this fix
|
||||
*/
|
||||
if ((adapter->iface_type == MWIFIEX_USB) &&
|
||||
if ((priv->adapter->iface_type == MWIFIEX_USB) &&
|
||||
(skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE))
|
||||
skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE);
|
||||
|
||||
|
Reference in New Issue
Block a user