Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07e5f716 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: check integrity of received AMSDU packets"

parents 81cd3931 66989652
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1050,8 +1050,6 @@ static int wil_cfg80211_change_iface(struct wiphy *wiphy,
	compressed_rx_status = wil->use_compressed_rx_status;
	if (type == NL80211_IFTYPE_MONITOR)
		wil->use_compressed_rx_status = false;
	else if (wdev->iftype == NL80211_IFTYPE_MONITOR)
		wil->use_compressed_rx_status =  true;

	/* do not reset FW when there are active VIFs,
	 * because it can cause significant disruption
+9 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/moduleparam.h>
@@ -313,6 +313,7 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
	/* statistics */
	memset(&sta->stats, 0, sizeof(sta->stats));
	sta->stats.tx_latency_min_us = U32_MAX;
	wil_sta_info_amsdu_init(sta);
}

static void _wil6210_disconnect_complete(struct wil6210_vif *vif,
@@ -723,6 +724,13 @@ void wil_bcast_fini_all(struct wil6210_priv *wil)
	}
}

void wil_sta_info_amsdu_init(struct wil_sta_info *sta)
{
	sta->amsdu_drop_sn = -1;
	sta->amsdu_drop_tid = -1;
	sta->amsdu_drop = 0;
}

int wil_priv_init(struct wil6210_priv *wil)
{
	uint i;
+1 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -98,7 +98,6 @@ int wil_set_capabilities(struct wil6210_priv *wil)
		set_bit(hw_capa_no_flash, wil->hw_capa);
		wil->use_enhanced_dma_hw = true;
		wil->use_rx_hw_reordering = true;
		wil->use_compressed_rx_status = true;
		if (wil_ipa_offload())
			/* IPA offload must use single MSI */
			n_msi = 1;
+17 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/etherdevice.h>
@@ -935,7 +935,9 @@ void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid,
			dev_kfree_skb(skb);
			goto stats;
		}
	} else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) {
	} else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate &&
		   /* pass EAPOL packets to local net stack only */
		   (wil_skb_get_protocol(skb) != htons(ETH_P_PAE))) {
		if (mcast) {
			/* send multicast frames both to higher layers in
			 * local net stack and back to the wireless medium
@@ -1003,6 +1005,7 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
{
	int cid, security;
	struct wil6210_priv *wil = ndev_to_wil(ndev);
	struct wil6210_vif *vif = ndev_to_vif(ndev);
	struct wil_net_stats *stats;

	wil->txrx_ops.get_netif_rx_params(skb, &cid, &security);
@@ -1011,6 +1014,18 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)

	skb_orphan(skb);

	/* pass only EAPOL packets as plaintext */
	if (vif->privacy && !security &&
	    wil_skb_get_protocol(skb) != htons(ETH_P_PAE)) {
		wil_dbg_txrx(wil,
			     "Rx drop plaintext frame with %d bytes in secure network\n",
			     skb->len);
		dev_kfree_skb(skb);
		ndev->stats.rx_dropped++;
		stats->rx_dropped++;
		return;
	}

	if (security && (wil->txrx_ops.rx_crypto_check(wil, skb) != 0)) {
		dev_kfree_skb(skb);
		ndev->stats.rx_dropped++;
+8 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: ISC */
/*
 * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
 */

#ifndef WIL6210_TXRX_H
@@ -625,6 +625,13 @@ static inline u8 *wil_skb_get_sa(struct sk_buff *skb)
	return eth->h_source;
}

static inline __be16 wil_skb_get_protocol(struct sk_buff *skb)
{
	struct ethhdr *eth = (void *)skb->data;

	return eth->h_proto;
}

static inline bool wil_need_txstat(struct sk_buff *skb)
{
	const u8 *da = wil_skb_get_da(skb);
Loading