diff --git a/components/tdls/core/src/wlan_tdls_ct.c b/components/tdls/core/src/wlan_tdls_ct.c index f62a5e1fd9..a269ee723d 100644 --- a/components/tdls/core/src/wlan_tdls_ct.c +++ b/components/tdls/core/src/wlan_tdls_ct.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -229,8 +229,8 @@ static void tdls_ct_sampling_tx_rx(struct tdls_vdev_priv_obj *tdls_vdev, qdf_mem_copy(mac_table, tdls_vdev->ct_peer_table, (sizeof(struct tdls_conn_tracker_mac_table)) * mac_entries); - qdf_mem_set(tdls_vdev->ct_peer_table, 0, - (sizeof(struct tdls_conn_tracker_mac_table)) * mac_entries); + qdf_mem_set(tdls_vdev->ct_peer_table, + (sizeof(struct tdls_conn_tracker_mac_table)) * mac_entries, 0); tdls_vdev->valid_mac_entries = 0; @@ -250,7 +250,8 @@ static void tdls_ct_sampling_tx_rx(struct tdls_vdev_priv_obj *tdls_vdev, } void tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, - struct qdf_mac_addr *mac_addr) + struct qdf_mac_addr *mac_addr, + struct qdf_mac_addr *dest_mac_addr) { struct tdls_vdev_priv_obj *tdls_vdev_obj; struct tdls_soc_priv_obj *tdls_soc_obj; @@ -268,6 +269,9 @@ void tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, if (qdf_is_macaddr_group(mac_addr)) return; + if (qdf_is_macaddr_group(dest_mac_addr)) + return; + if (qdf_mem_cmp(vdev->vdev_mlme.macaddr, mac_addr, QDF_MAC_ADDR_SIZE) == 0) return; diff --git a/components/tdls/core/src/wlan_tdls_ct.h b/components/tdls/core/src/wlan_tdls_ct.h index 00e03f20d1..64af4b84e2 100644 --- a/components/tdls/core/src/wlan_tdls_ct.h +++ b/components/tdls/core/src/wlan_tdls_ct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -58,6 +58,7 @@ void tdls_implicit_enable(struct tdls_vdev_priv_obj *tdls_vdev); * tdls_update_rx_pkt_cnt() - Update rx packet count * @vdev: vdev object manager * @mac_addr: mac address of the data + * @dest_mac_addr: dest mac address of the data * * Increase the rx packet count, if the sender is not bssid and the packet is * not broadcast and multicast packet @@ -70,7 +71,8 @@ void tdls_implicit_enable(struct tdls_vdev_priv_obj *tdls_vdev); * Return: None */ void tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, - struct qdf_mac_addr *mac_addr); + struct qdf_mac_addr *mac_addr, + struct qdf_mac_addr *dest_mac_addr); /** * tdls_update_tx_pkt_cnt() - update tx packet diff --git a/components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h b/components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h index 3d6570772c..62e0a872bb 100644 --- a/components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h +++ b/components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -196,11 +196,13 @@ QDF_STATUS ucfg_tdls_set_operating_mode( * ucfg_tdls_update_rx_pkt_cnt() - update rx pkt count * @vdev: tdls vdev object * @mac_addr: peer mac address + * @dest_mac_addr: dest mac address * * Return: None */ void ucfg_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, - struct qdf_mac_addr *mac_addr); + struct qdf_mac_addr *mac_addr, + struct qdf_mac_addr *dest_mac_addr); /** * ucfg_tdls_update_tx_pkt_cnt() - update tx pkt count diff --git a/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c b/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c index cd86729d8a..c08507750e 100644 --- a/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c +++ b/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -937,13 +937,14 @@ QDF_STATUS ucfg_tdls_set_operating_mode( } void ucfg_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, - struct qdf_mac_addr *mac_addr) + struct qdf_mac_addr *mac_addr, + struct qdf_mac_addr *dest_mac_addr) { QDF_STATUS status; status = wlan_objmgr_vdev_try_get_ref(vdev, WLAN_TDLS_NB_ID); if (status != QDF_STATUS_SUCCESS) return; - tdls_update_rx_pkt_cnt(vdev, mac_addr); + tdls_update_rx_pkt_cnt(vdev, mac_addr, dest_mac_addr); wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID); } diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 92de4f5808..25cbe615ee 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1992,7 +1992,7 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context, struct sk_buff *next = NULL; struct hdd_station_ctx *sta_ctx = NULL; unsigned int cpu_index; - struct qdf_mac_addr *mac_addr; + struct qdf_mac_addr *mac_addr, *dest_mac_addr; bool wake_lock = false; uint8_t pkt_type = 0; bool track_arp = false; @@ -2081,9 +2081,11 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context, QDF_DP_TRACE_RX_PACKET_RECORD, 0, QDF_RX)); + dest_mac_addr = (struct qdf_mac_addr *)(skb->data); mac_addr = (struct qdf_mac_addr *)(skb->data+QDF_MAC_ADDR_SIZE); - ucfg_tdls_update_rx_pkt_cnt(adapter->vdev, mac_addr); + ucfg_tdls_update_rx_pkt_cnt(adapter->vdev, mac_addr, + dest_mac_addr); skb->dev = adapter->dev; skb->protocol = eth_type_trans(skb, skb->dev);