sta_rx.c revision 8ed1303321914a70ad580c1d034898e43c39b065
15e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao/* 25e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * Marvell Wireless LAN device driver: station RX data handling 35e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 45e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * Copyright (C) 2011, Marvell International Ltd. 55e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 65e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * This software file (the "File") is distributed by Marvell International 75e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * Ltd. under the terms of the GNU General Public License Version 2, June 1991 85e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * (the "License"). You may use, redistribute and/or modify this File in 95e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * accordance with the terms and conditions of the License, a copy of which 105e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * is available by writing to the Free Software Foundation, Inc., 115e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 125e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 135e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 145e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 155e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 165e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * ARE EXPRESSLY DISCLAIMED. The License provides additional details about 175e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * this warranty disclaimer. 185e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao */ 195e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 205e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "decl.h" 215e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "ioctl.h" 225e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "util.h" 235e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "fw.h" 245e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "main.h" 255e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "11n_aggr.h" 265e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao#include "11n_rxreorder.h" 275e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 285e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao/* 295e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * This function processes the received packet and forwards it 305e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * to kernel/upper layer. 315e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 325e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * This function parses through the received packet and determines 335e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * if it is a debug packet or normal packet. 345e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 355e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * For non-debug packets, the function chops off unnecessary leading 365e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * header bytes, reconstructs the packet as an ethernet frame or 375e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 802.2/llc/snap frame as required, and sends it to kernel/upper layer. 385e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 395e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * The completion callback is called after processing in complete. 405e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao */ 415e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhaoint mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, 425e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct sk_buff *skb) 435e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao{ 44270e58e8898c8be40451ebee45b6c9b5bd5db04bYogesh Ashok Powar int ret; 455e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 465e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; 475e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct rx_packet_hdr *rx_pkt_hdr; 485e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct rxpd *local_rx_pd; 495e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao int hdr_chop; 505e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct ethhdr *eth_hdr; 515e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao u8 rfc1042_eth_hdr[ETH_ALEN] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 525e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 535e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd = (struct rxpd *) (skb->data); 545e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 555e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao rx_pkt_hdr = (struct rx_packet_hdr *) ((u8 *) local_rx_pd + 565e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd->rx_pkt_offset); 575e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 585e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if (!memcmp(&rx_pkt_hdr->rfc1042_hdr, 595e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr))) { 605e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao /* 615e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * Replace the 803 header and rfc1042 header (llc/snap) with an 625e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * EthernetII header, keep the src/dst and snap_type 635e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * (ethertype). 645e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * The firmware only passes up SNAP frames converting 655e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * all RX Data from 802.11 to 802.2/LLC/SNAP frames. 665e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * To create the Ethernet II, just move the src, dst address 675e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * right before the snap_type. 685e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao */ 695e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao eth_hdr = (struct ethhdr *) 705e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao ((u8 *) &rx_pkt_hdr->eth803_hdr 715e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao + sizeof(rx_pkt_hdr->eth803_hdr) + 725e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao sizeof(rx_pkt_hdr->rfc1042_hdr) 735e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao - sizeof(rx_pkt_hdr->eth803_hdr.h_dest) 745e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao - sizeof(rx_pkt_hdr->eth803_hdr.h_source) 755e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao - sizeof(rx_pkt_hdr->rfc1042_hdr.snap_type)); 765e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 775e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao memcpy(eth_hdr->h_source, rx_pkt_hdr->eth803_hdr.h_source, 785e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao sizeof(eth_hdr->h_source)); 795e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao memcpy(eth_hdr->h_dest, rx_pkt_hdr->eth803_hdr.h_dest, 805e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao sizeof(eth_hdr->h_dest)); 815e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 825e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao /* Chop off the rxpd + the excess memory from the 802.2/llc/snap 835e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao header that was removed. */ 845e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao hdr_chop = (u8 *) eth_hdr - (u8 *) local_rx_pd; 855e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } else { 865e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao /* Chop off the rxpd */ 875e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao hdr_chop = (u8 *) &rx_pkt_hdr->eth803_hdr - 885e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao (u8 *) local_rx_pd; 895e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } 905e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 915e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao /* Chop off the leading header bytes so the it points to the start of 925e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao either the reconstructed EthII frame or the 802.2/llc/snap frame */ 935e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao skb_pull(skb, hdr_chop); 945e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 955e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao priv->rxpd_rate = local_rx_pd->rx_rate; 965e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 975e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao priv->rxpd_htinfo = local_rx_pd->ht_info; 985e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 995e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao ret = mwifiex_recv_packet(adapter, skb); 1005e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if (ret == -1) 1015e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao dev_err(adapter->dev, "recv packet failed\n"); 1025e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1035e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao return ret; 1045e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao} 1055e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1065e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao/* 1075e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * This function processes the received buffer. 1085e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 1095e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * The function looks into the RxPD and performs sanity tests on the 1105e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * received buffer to ensure its a valid packet, before processing it 1115e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * further. If the packet is determined to be aggregated, it is 1125e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * de-aggregated accordingly. Non-unicast packets are sent directly to 1135e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * the kernel/upper layers. Unicast packets are handed over to the 1145e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * Rx reordering routine if 11n is enabled. 1155e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * 1165e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * The completion callback is called after processing in complete. 1175e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao */ 1185e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhaoint mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, 1195e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct sk_buff *skb) 1205e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao{ 1215e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao int ret = 0; 1225e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct rxpd *local_rx_pd; 1235e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); 1245e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct rx_packet_hdr *rx_pkt_hdr; 1255e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao u8 ta[ETH_ALEN]; 126270e58e8898c8be40451ebee45b6c9b5bd5db04bYogesh Ashok Powar u16 rx_pkt_type; 1275e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao struct mwifiex_private *priv = adapter->priv[rx_info->bss_index]; 1285e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1298ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar if (!priv) 1308ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar return -1; 1318ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar 1325e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd = (struct rxpd *) (skb->data); 1335e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao rx_pkt_type = local_rx_pd->rx_pkt_type; 1345e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1355e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao rx_pkt_hdr = (struct rx_packet_hdr *) ((u8 *) local_rx_pd + 1365e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd->rx_pkt_offset); 1375e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1385e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if ((local_rx_pd->rx_pkt_offset + local_rx_pd->rx_pkt_length) > 1395e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao (u16) skb->len) { 1405e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao dev_err(adapter->dev, "wrong rx packet: len=%d," 1415e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao " rx_pkt_offset=%d, rx_pkt_length=%d\n", skb->len, 1425e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd->rx_pkt_offset, local_rx_pd->rx_pkt_length); 1435e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao priv->stats.rx_dropped++; 1445e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao dev_kfree_skb_any(skb); 1455e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao return ret; 1465e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } 1473b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar 1485e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if (local_rx_pd->rx_pkt_type == PKT_TYPE_AMSDU) { 1493b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar struct sk_buff_head list; 1503b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar struct sk_buff *rx_skb; 1513b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar 1523b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar __skb_queue_head_init(&list); 1533b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar 1543b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar skb_pull(skb, local_rx_pd->rx_pkt_offset); 1553b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar skb_trim(skb, local_rx_pd->rx_pkt_length); 1563b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar 1573b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, 1583b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar priv->wdev->iftype, 0, false); 1593b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar 1603b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar while (!skb_queue_empty(&list)) { 1613b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar rx_skb = __skb_dequeue(&list); 1623b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar ret = mwifiex_recv_packet(adapter, rx_skb); 1633b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar if (ret == -1) 1643b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar dev_err(adapter->dev, "Rx of A-MSDU failed"); 1653b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar } 1663b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar return 0; 1675e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } 1683b8ab88acaceb505aa06ef3bbf3a73b92470ae78Yogesh Ashok Powar 1695e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao /* 1705e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * If the packet is not an unicast packet then send the packet 1715e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao * directly to os. Don't pass thru rx reordering 1725e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao */ 1735e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if (!IS_11N_ENABLED(priv) || 1745e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao memcmp(priv->curr_addr, rx_pkt_hdr->eth803_hdr.h_dest, ETH_ALEN)) { 1755e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao mwifiex_process_rx_packet(adapter, skb); 1765e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao return ret; 1775e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } 1785e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1795e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if (mwifiex_queuing_ra_based(priv)) { 1805e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao memcpy(ta, rx_pkt_hdr->eth803_hdr.h_source, ETH_ALEN); 1815e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } else { 1825e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao if (rx_pkt_type != PKT_TYPE_BAR) 1835e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao priv->rx_seq[local_rx_pd->priority] = 1845e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd->seq_num; 1855e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao memcpy(ta, priv->curr_bss_params.bss_descriptor.mac_address, 1865e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao ETH_ALEN); 1875e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao } 1885e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1895e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao /* Reorder and send to OS */ 1905e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao ret = mwifiex_11n_rx_reorder_pkt(priv, local_rx_pd->seq_num, 1915e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao local_rx_pd->priority, ta, 1925e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao (u8) local_rx_pd->rx_pkt_type, 193a5ffddb70c5cab29fa00e2fdf12217b64b940796Amitkumar Karwar skb); 1945e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 1958ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar if (ret || (rx_pkt_type == PKT_TYPE_BAR)) 1965e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao dev_kfree_skb_any(skb); 1978ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar 1988ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar if (ret) 1998ed1303321914a70ad580c1d034898e43c39b065Yogesh Ashok Powar priv->stats.rx_dropped++; 2005e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao 2015e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao return ret; 2025e6e3a92b9a4c9416b17f468fa5c7fa2233b8b4eBing Zhao} 203