mac80211.c (f53be9c4bef6858df46d7bd9246a72789e63d5fc) mac80211.c (90723da664f53928c8a72c87b2b6d875ef657043)
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2/*
3 * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
6 */
7#include <linux/kernel.h>
8#include <linux/slab.h>

--- 708 unchanged lines hidden (view full) ---

717 struct ieee80211_tx_control *control, struct sk_buff *skb)
718{
719 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
720 struct ieee80211_sta *sta = control->sta;
721 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
722 struct ieee80211_hdr *hdr = (void *)skb->data;
723 bool offchannel = IEEE80211_SKB_CB(skb)->flags &
724 IEEE80211_TX_CTL_TX_OFFCHAN;
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2/*
3 * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
6 */
7#include <linux/kernel.h>
8#include <linux/slab.h>

--- 708 unchanged lines hidden (view full) ---

717 struct ieee80211_tx_control *control, struct sk_buff *skb)
718{
719 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
720 struct ieee80211_sta *sta = control->sta;
721 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
722 struct ieee80211_hdr *hdr = (void *)skb->data;
723 bool offchannel = IEEE80211_SKB_CB(skb)->flags &
724 IEEE80211_TX_CTL_TX_OFFCHAN;
725 u32 link_id = u32_get_bits(info->control.flags,
726 IEEE80211_TX_CTRL_MLO_LINK);
727 struct ieee80211_sta *tmp_sta = sta;
725
726 if (iwl_mvm_is_radio_killed(mvm)) {
727 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n");
728 goto drop;
729 }
730
731 if (offchannel &&
732 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) &&

--- 17 unchanged lines hidden (view full) ---

750 if (ap_sta_id < mvm->fw->ucode_capa.num_stations) {
751 /* mac80211 holds rcu read lock */
752 sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]);
753 if (IS_ERR_OR_NULL(sta))
754 goto drop;
755 }
756 }
757
728
729 if (iwl_mvm_is_radio_killed(mvm)) {
730 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n");
731 goto drop;
732 }
733
734 if (offchannel &&
735 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) &&

--- 17 unchanged lines hidden (view full) ---

753 if (ap_sta_id < mvm->fw->ucode_capa.num_stations) {
754 /* mac80211 holds rcu read lock */
755 sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]);
756 if (IS_ERR_OR_NULL(sta))
757 goto drop;
758 }
759 }
760
761 if (tmp_sta && !sta && link_id != IEEE80211_LINK_UNSPECIFIED &&
762 !ieee80211_is_probe_resp(hdr->frame_control)) {
763 /* translate MLD addresses to LINK addresses */
764 struct ieee80211_link_sta *link_sta =
765 rcu_dereference(tmp_sta->link[link_id]);
766 struct ieee80211_bss_conf *link_conf =
767 rcu_dereference(info->control.vif->link_conf[link_id]);
768 struct ieee80211_mgmt *mgmt;
769
770 if (WARN_ON(!link_sta || !link_conf))
771 goto drop;
772
773 /* if sta is NULL, the frame is a management frame */
774 mgmt = (void *)hdr;
775 memcpy(mgmt->da, link_sta->addr, ETH_ALEN);
776 memcpy(mgmt->sa, link_conf->addr, ETH_ALEN);
777 memcpy(mgmt->bssid, link_conf->bssid, ETH_ALEN);
778 }
779
758 iwl_mvm_tx_skb(mvm, skb, sta);
759 return;
760 drop:
761 ieee80211_free_txskb(hw, skb);
762}
763
764void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
765{

--- 5482 unchanged lines hidden ---
780 iwl_mvm_tx_skb(mvm, skb, sta);
781 return;
782 drop:
783 ieee80211_free_txskb(hw, skb);
784}
785
786void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
787{

--- 5482 unchanged lines hidden ---