lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111211515.LI4B5m1i-lkp@intel.com>
Date:   Sun, 21 Nov 2021 15:50:22 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luca Coelho <luciano.coelho@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Miri Korenblit <miriam.rachel.korenblit@...el.com>
Subject: drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:1966
 iwl_mvm_rx_mpdu_mq() warn: inconsistent indenting

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   923dcc5eb0c111eccd51cc7ce1658537e3c38b25
commit: ce712478a458fc9ae7488b511088d43d311ccd2e iwlwifi: mvm: Support new rate_n_flags for REPLY_RX_MPDU_CMD and RX_NO_DATA_NOTIF
date:   4 weeks ago
config: mips-randconfig-m031-20211104 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

smatch warnings:
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:1966 iwl_mvm_rx_mpdu_mq() warn: inconsistent indenting

vim +1966 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1637  
c630b477caf789 Sara Sharon           2018-04-09  1638  void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
c630b477caf789 Sara Sharon           2018-04-09  1639  			struct iwl_rx_cmd_buffer *rxb, int queue)
c630b477caf789 Sara Sharon           2018-04-09  1640  {
c630b477caf789 Sara Sharon           2018-04-09  1641  	struct ieee80211_rx_status *rx_status;
c630b477caf789 Sara Sharon           2018-04-09  1642  	struct iwl_rx_packet *pkt = rxb_addr(rxb);
c630b477caf789 Sara Sharon           2018-04-09  1643  	struct iwl_rx_mpdu_desc *desc = (void *)pkt->data;
c630b477caf789 Sara Sharon           2018-04-09  1644  	struct ieee80211_hdr *hdr;
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1645  	u32 len;
efc0ec5afb6e14 Johannes Berg         2020-12-09  1646  	u32 pkt_len = iwl_rx_packet_payload_len(pkt);
c630b477caf789 Sara Sharon           2018-04-09  1647  	u32 rate_n_flags, gp2_on_air_rise;
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1648  	u16 phy_info;
c630b477caf789 Sara Sharon           2018-04-09  1649  	struct ieee80211_sta *sta = NULL;
c630b477caf789 Sara Sharon           2018-04-09  1650  	struct sk_buff *skb;
c630b477caf789 Sara Sharon           2018-04-09  1651  	u8 crypt_len = 0, channel, energy_a, energy_b;
c630b477caf789 Sara Sharon           2018-04-09  1652  	size_t desc_size;
6721039d5b8adf Shaul Triebitz        2018-07-02  1653  	struct iwl_mvm_rx_phy_data phy_data = {
6721039d5b8adf Shaul Triebitz        2018-07-02  1654  		.info_type = IWL_RX_PHY_INFO_TYPE_NONE,
6721039d5b8adf Shaul Triebitz        2018-07-02  1655  	};
9bf13bee2d74a3 Johannes Berg         2018-11-20  1656  	bool csi = false;
ce712478a458fc Luca Coelho           2021-10-17  1657  	u32 format;
ce712478a458fc Luca Coelho           2021-10-17  1658  	bool is_sgi;
c630b477caf789 Sara Sharon           2018-04-09  1659  
c630b477caf789 Sara Sharon           2018-04-09  1660  	if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)))
c630b477caf789 Sara Sharon           2018-04-09  1661  		return;
c630b477caf789 Sara Sharon           2018-04-09  1662  
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1663  	if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1664  		desc_size = sizeof(*desc);
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1665  	else
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1666  		desc_size = IWL_RX_DESC_SIZE_V1;
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1667  
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1668  	if (unlikely(pkt_len < desc_size)) {
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1669  		IWL_DEBUG_DROP(mvm, "Bad REPLY_RX_MPDU_CMD size\n");
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1670  		return;
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1671  	}
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1672  
3681021fc6af58 Johannes Berg         2019-11-15  1673  	if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
c630b477caf789 Sara Sharon           2018-04-09  1674  		rate_n_flags = le32_to_cpu(desc->v3.rate_n_flags);
c630b477caf789 Sara Sharon           2018-04-09  1675  		channel = desc->v3.channel;
c630b477caf789 Sara Sharon           2018-04-09  1676  		gp2_on_air_rise = le32_to_cpu(desc->v3.gp2_on_air_rise);
c630b477caf789 Sara Sharon           2018-04-09  1677  		energy_a = desc->v3.energy_a;
c630b477caf789 Sara Sharon           2018-04-09  1678  		energy_b = desc->v3.energy_b;
6721039d5b8adf Shaul Triebitz        2018-07-02  1679  
6721039d5b8adf Shaul Triebitz        2018-07-02  1680  		phy_data.d0 = desc->v3.phy_data0;
6721039d5b8adf Shaul Triebitz        2018-07-02  1681  		phy_data.d1 = desc->v3.phy_data1;
6721039d5b8adf Shaul Triebitz        2018-07-02  1682  		phy_data.d2 = desc->v3.phy_data2;
6721039d5b8adf Shaul Triebitz        2018-07-02  1683  		phy_data.d3 = desc->v3.phy_data3;
c630b477caf789 Sara Sharon           2018-04-09  1684  	} else {
c630b477caf789 Sara Sharon           2018-04-09  1685  		rate_n_flags = le32_to_cpu(desc->v1.rate_n_flags);
c630b477caf789 Sara Sharon           2018-04-09  1686  		channel = desc->v1.channel;
c630b477caf789 Sara Sharon           2018-04-09  1687  		gp2_on_air_rise = le32_to_cpu(desc->v1.gp2_on_air_rise);
c630b477caf789 Sara Sharon           2018-04-09  1688  		energy_a = desc->v1.energy_a;
c630b477caf789 Sara Sharon           2018-04-09  1689  		energy_b = desc->v1.energy_b;
6721039d5b8adf Shaul Triebitz        2018-07-02  1690  
6721039d5b8adf Shaul Triebitz        2018-07-02  1691  		phy_data.d0 = desc->v1.phy_data0;
6721039d5b8adf Shaul Triebitz        2018-07-02  1692  		phy_data.d1 = desc->v1.phy_data1;
6721039d5b8adf Shaul Triebitz        2018-07-02  1693  		phy_data.d2 = desc->v1.phy_data2;
6721039d5b8adf Shaul Triebitz        2018-07-02  1694  		phy_data.d3 = desc->v1.phy_data3;
c630b477caf789 Sara Sharon           2018-04-09  1695  	}
ce712478a458fc Luca Coelho           2021-10-17  1696  	if (iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP,
ce712478a458fc Luca Coelho           2021-10-17  1697  				    REPLY_RX_MPDU_CMD, 0) < 4) {
ce712478a458fc Luca Coelho           2021-10-17  1698  		rate_n_flags = iwl_new_rate_from_v1(rate_n_flags);
ce712478a458fc Luca Coelho           2021-10-17  1699  		IWL_DEBUG_DROP(mvm, "Got old format rate, converting. New rate: 0x%x\n",
ce712478a458fc Luca Coelho           2021-10-17  1700  			       rate_n_flags);
ce712478a458fc Luca Coelho           2021-10-17  1701  	}
ce712478a458fc Luca Coelho           2021-10-17  1702  	format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK;
c630b477caf789 Sara Sharon           2018-04-09  1703  
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1704  	len = le16_to_cpu(desc->mpdu_len);
6721039d5b8adf Shaul Triebitz        2018-07-02  1705  
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1706  	if (unlikely(len + desc_size > pkt_len)) {
efc0ec5afb6e14 Johannes Berg         2020-12-09  1707  		IWL_DEBUG_DROP(mvm, "FW lied about packet len\n");
efc0ec5afb6e14 Johannes Berg         2020-12-09  1708  		return;
efc0ec5afb6e14 Johannes Berg         2020-12-09  1709  	}
efc0ec5afb6e14 Johannes Berg         2020-12-09  1710  
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1711  	phy_info = le16_to_cpu(desc->phy_info);
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1712  	phy_data.d4 = desc->phy_data4;
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1713  
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1714  	if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD)
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1715  		phy_data.info_type =
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1716  			le32_get_bits(phy_data.d1,
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1717  				      IWL_RX_PHY_DATA1_INFO_TYPE_MASK);
b8aba27cdc0ea6 Johannes Berg         2020-12-09  1718  
c630b477caf789 Sara Sharon           2018-04-09  1719  	hdr = (void *)(pkt->data + desc_size);
c630b477caf789 Sara Sharon           2018-04-09  1720  	/* Dont use dev_alloc_skb(), we'll have enough headroom once
c630b477caf789 Sara Sharon           2018-04-09  1721  	 * ieee80211_hdr pulled.
c630b477caf789 Sara Sharon           2018-04-09  1722  	 */
c630b477caf789 Sara Sharon           2018-04-09  1723  	skb = alloc_skb(128, GFP_ATOMIC);
c630b477caf789 Sara Sharon           2018-04-09  1724  	if (!skb) {
c630b477caf789 Sara Sharon           2018-04-09  1725  		IWL_ERR(mvm, "alloc_skb failed\n");
c630b477caf789 Sara Sharon           2018-04-09  1726  		return;
c630b477caf789 Sara Sharon           2018-04-09  1727  	}
c630b477caf789 Sara Sharon           2018-04-09  1728  
c630b477caf789 Sara Sharon           2018-04-09  1729  	if (desc->mac_flags2 & IWL_RX_MPDU_MFLG2_PAD) {
c630b477caf789 Sara Sharon           2018-04-09  1730  		/*
c630b477caf789 Sara Sharon           2018-04-09  1731  		 * If the device inserted padding it means that (it thought)
c630b477caf789 Sara Sharon           2018-04-09  1732  		 * the 802.11 header wasn't a multiple of 4 bytes long. In
c630b477caf789 Sara Sharon           2018-04-09  1733  		 * this case, reserve two bytes at the start of the SKB to
c630b477caf789 Sara Sharon           2018-04-09  1734  		 * align the payload properly in case we end up copying it.
c630b477caf789 Sara Sharon           2018-04-09  1735  		 */
c630b477caf789 Sara Sharon           2018-04-09  1736  		skb_reserve(skb, 2);
514c30696fbc25 Luca Coelho           2018-06-24  1737  	}
514c30696fbc25 Luca Coelho           2018-06-24  1738  
18ead597daa17a Golan Ben Ami         2018-02-05  1739  	rx_status = IEEE80211_SKB_RXCB(skb);
18ead597daa17a Golan Ben Ami         2018-02-05  1740  
dabf9844385885 Johannes Berg         2018-04-26  1741  	/* This may be overridden by iwl_mvm_rx_he() to HE_RU */
ce712478a458fc Luca Coelho           2021-10-17  1742  	switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) {
dabf9844385885 Johannes Berg         2018-04-26  1743  	case RATE_MCS_CHAN_WIDTH_20:
dabf9844385885 Johannes Berg         2018-04-26  1744  		break;
dabf9844385885 Johannes Berg         2018-04-26  1745  	case RATE_MCS_CHAN_WIDTH_40:
dabf9844385885 Johannes Berg         2018-04-26  1746  		rx_status->bw = RATE_INFO_BW_40;
dabf9844385885 Johannes Berg         2018-04-26  1747  		break;
dabf9844385885 Johannes Berg         2018-04-26  1748  	case RATE_MCS_CHAN_WIDTH_80:
dabf9844385885 Johannes Berg         2018-04-26  1749  		rx_status->bw = RATE_INFO_BW_80;
dabf9844385885 Johannes Berg         2018-04-26  1750  		break;
dabf9844385885 Johannes Berg         2018-04-26  1751  	case RATE_MCS_CHAN_WIDTH_160:
dabf9844385885 Johannes Berg         2018-04-26  1752  		rx_status->bw = RATE_INFO_BW_160;
dabf9844385885 Johannes Berg         2018-04-26  1753  		break;
dabf9844385885 Johannes Berg         2018-04-26  1754  	}
dabf9844385885 Johannes Berg         2018-04-26  1755  
ce712478a458fc Luca Coelho           2021-10-17  1756  	if (format == RATE_MCS_HE_MSK)
6721039d5b8adf Shaul Triebitz        2018-07-02  1757  		iwl_mvm_rx_he(mvm, skb, &phy_data, rate_n_flags,
6721039d5b8adf Shaul Triebitz        2018-07-02  1758  			      phy_info, queue);
6721039d5b8adf Shaul Triebitz        2018-07-02  1759  
6721039d5b8adf Shaul Triebitz        2018-07-02  1760  	iwl_mvm_decode_lsig(skb, &phy_data);
c630b477caf789 Sara Sharon           2018-04-09  1761  
780e87c29e7768 Johannes Berg         2015-09-03  1762  	/*
780e87c29e7768 Johannes Berg         2015-09-03  1763  	 * Keep packets with CRC errors (and with overrun) for monitor mode
780e87c29e7768 Johannes Berg         2015-09-03  1764  	 * (otherwise the firmware discards them) but mark them as bad.
780e87c29e7768 Johannes Berg         2015-09-03  1765  	 */
e365e7de63e5b6 Johannes Berg         2020-09-30  1766  	if (!(desc->status & cpu_to_le32(IWL_RX_MPDU_STATUS_CRC_OK)) ||
e365e7de63e5b6 Johannes Berg         2020-09-30  1767  	    !(desc->status & cpu_to_le32(IWL_RX_MPDU_STATUS_OVERRUN_OK))) {
780e87c29e7768 Johannes Berg         2015-09-03  1768  		IWL_DEBUG_RX(mvm, "Bad CRC or FIFO: 0x%08X.\n",
e365e7de63e5b6 Johannes Berg         2020-09-30  1769  			     le32_to_cpu(desc->status));
780e87c29e7768 Johannes Berg         2015-09-03  1770  		rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
780e87c29e7768 Johannes Berg         2015-09-03  1771  	}
fbe4112791b8fe Sara Sharon           2016-04-04  1772  	/* set the preamble flag if appropriate */
ce712478a458fc Luca Coelho           2021-10-17  1773  	if (format == RATE_MCS_CCK_MSK &&
486af86332c7f0 Johannes Berg         2018-10-29  1774  	    phy_info & IWL_RX_MPDU_PHY_SHORT_PREAMBLE)
7fdd69c5af2160 Johannes Berg         2017-04-26  1775  		rx_status->enc_flags |= RX_ENC_FLAG_SHORTPRE;
780e87c29e7768 Johannes Berg         2015-09-03  1776  
fbe4112791b8fe Sara Sharon           2016-04-04  1777  	if (likely(!(phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD))) {
18ead597daa17a Golan Ben Ami         2018-02-05  1778  		u64 tsf_on_air_rise;
18ead597daa17a Golan Ben Ami         2018-02-05  1779  
286ca8eb4d0a97 Luca Coelho           2019-07-12  1780  		if (mvm->trans->trans_cfg->device_family >=
3681021fc6af58 Johannes Berg         2019-11-15  1781  		    IWL_DEVICE_FAMILY_AX210)
18ead597daa17a Golan Ben Ami         2018-02-05  1782  			tsf_on_air_rise = le64_to_cpu(desc->v3.tsf_on_air_rise);
18ead597daa17a Golan Ben Ami         2018-02-05  1783  		else
18ead597daa17a Golan Ben Ami         2018-02-05  1784  			tsf_on_air_rise = le64_to_cpu(desc->v1.tsf_on_air_rise);
18ead597daa17a Golan Ben Ami         2018-02-05  1785  
18ead597daa17a Golan Ben Ami         2018-02-05  1786  		rx_status->mactime = tsf_on_air_rise;
fbe4112791b8fe Sara Sharon           2016-04-04  1787  		/* TSF as indicated by the firmware is at INA time */
fbe4112791b8fe Sara Sharon           2016-04-04  1788  		rx_status->flag |= RX_FLAG_MACTIME_PLCP_START;
bd6fc6552b053f Liad Kaufman          2018-03-04  1789  	}
bd6fc6552b053f Liad Kaufman          2018-03-04  1790  
18ead597daa17a Golan Ben Ami         2018-02-05  1791  	rx_status->device_timestamp = gp2_on_air_rise;
65b9425ce9aa10 Tova Mussai           2019-08-01  1792  	if (iwl_mvm_is_band_in_rx_supported(mvm)) {
65b9425ce9aa10 Tova Mussai           2019-08-01  1793  		u8 band = BAND_IN_RX_STATUS(desc->mac_phy_idx);
65b9425ce9aa10 Tova Mussai           2019-08-01  1794  
65b9425ce9aa10 Tova Mussai           2019-08-01  1795  		rx_status->band = iwl_mvm_nl80211_band_from_rx_msdu(band);
65b9425ce9aa10 Tova Mussai           2019-08-01  1796  	} else {
18ead597daa17a Golan Ben Ami         2018-02-05  1797  		rx_status->band = channel > 14 ? NL80211_BAND_5GHZ :
57fbcce37be7c1 Johannes Berg         2016-04-12  1798  			NL80211_BAND_2GHZ;
65b9425ce9aa10 Tova Mussai           2019-08-01  1799  	}
18ead597daa17a Golan Ben Ami         2018-02-05  1800  	rx_status->freq = ieee80211_channel_to_frequency(channel,
780e87c29e7768 Johannes Berg         2015-09-03  1801  							 rx_status->band);
18ead597daa17a Golan Ben Ami         2018-02-05  1802  	iwl_mvm_get_signal_strength(mvm, rx_status, rate_n_flags, energy_a,
18ead597daa17a Golan Ben Ami         2018-02-05  1803  				    energy_b);
fbe4112791b8fe Sara Sharon           2016-04-04  1804  
fbe4112791b8fe Sara Sharon           2016-04-04  1805  	/* update aggregation data for monitor sake on default queue */
fbe4112791b8fe Sara Sharon           2016-04-04  1806  	if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) {
fbe4112791b8fe Sara Sharon           2016-04-04  1807  		bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE;
fbe4112791b8fe Sara Sharon           2016-04-04  1808  
fbe4112791b8fe Sara Sharon           2016-04-04  1809  		rx_status->flag |= RX_FLAG_AMPDU_DETAILS;
5213e8a8a28d2c Johannes Berg         2018-10-25  1810  		/*
5213e8a8a28d2c Johannes Berg         2018-10-25  1811  		 * Toggle is switched whenever new aggregation starts. Make
5213e8a8a28d2c Johannes Berg         2018-10-25  1812  		 * sure ampdu_reference is never 0 so we can later use it to
5213e8a8a28d2c Johannes Berg         2018-10-25  1813  		 * see if the frame was really part of an A-MPDU or not.
5213e8a8a28d2c Johannes Berg         2018-10-25  1814  		 */
fbe4112791b8fe Sara Sharon           2016-04-04  1815  		if (toggle_bit != mvm->ampdu_toggle) {
fbe4112791b8fe Sara Sharon           2016-04-04  1816  			mvm->ampdu_ref++;
5213e8a8a28d2c Johannes Berg         2018-10-25  1817  			if (mvm->ampdu_ref == 0)
5213e8a8a28d2c Johannes Berg         2018-10-25  1818  				mvm->ampdu_ref++;
fbe4112791b8fe Sara Sharon           2016-04-04  1819  			mvm->ampdu_toggle = toggle_bit;
fbe4112791b8fe Sara Sharon           2016-04-04  1820  		}
1f7698abedeeb3 Johannes Berg         2018-11-08  1821  		rx_status->ampdu_reference = mvm->ampdu_ref;
fbe4112791b8fe Sara Sharon           2016-04-04  1822  	}
780e87c29e7768 Johannes Berg         2015-09-03  1823  
3864be551405b5 Luca Coelho           2019-01-30  1824  	if (unlikely(mvm->monitor_on))
3864be551405b5 Luca Coelho           2019-01-30  1825  		iwl_mvm_add_rtap_sniffer_config(mvm, skb);
3864be551405b5 Luca Coelho           2019-01-30  1826  
780e87c29e7768 Johannes Berg         2015-09-03  1827  	rcu_read_lock();
780e87c29e7768 Johannes Berg         2015-09-03  1828  
e365e7de63e5b6 Johannes Berg         2020-09-30  1829  	if (desc->status & cpu_to_le32(IWL_RX_MPDU_STATUS_SRC_STA_FOUND)) {
e365e7de63e5b6 Johannes Berg         2020-09-30  1830  		u8 id = le32_get_bits(desc->status, IWL_RX_MPDU_STATUS_STA_ID);
780e87c29e7768 Johannes Berg         2015-09-03  1831  
be9ae34ead42f8 Nathan Errera         2020-10-08  1832  		if (!WARN_ON_ONCE(id >= mvm->fw->ucode_capa.num_stations)) {
780e87c29e7768 Johannes Berg         2015-09-03  1833  			sta = rcu_dereference(mvm->fw_id_to_mac_id[id]);
780e87c29e7768 Johannes Berg         2015-09-03  1834  			if (IS_ERR(sta))
780e87c29e7768 Johannes Berg         2015-09-03  1835  				sta = NULL;
780e87c29e7768 Johannes Berg         2015-09-03  1836  		}
780e87c29e7768 Johannes Berg         2015-09-03  1837  	} else if (!is_multicast_ether_addr(hdr->addr2)) {
780e87c29e7768 Johannes Berg         2015-09-03  1838  		/*
780e87c29e7768 Johannes Berg         2015-09-03  1839  		 * This is fine since we prevent two stations with the same
780e87c29e7768 Johannes Berg         2015-09-03  1840  		 * address from being added.
780e87c29e7768 Johannes Berg         2015-09-03  1841  		 */
780e87c29e7768 Johannes Berg         2015-09-03  1842  		sta = ieee80211_find_sta_by_ifaddr(mvm->hw, hdr->addr2, NULL);
780e87c29e7768 Johannes Berg         2015-09-03  1843  	}
780e87c29e7768 Johannes Berg         2015-09-03  1844  
b1fdc2505abcb7 Johannes Berg         2021-02-05  1845  	if (iwl_mvm_rx_crypto(mvm, sta, hdr, rx_status, phy_info, desc,
b1fdc2505abcb7 Johannes Berg         2021-02-05  1846  			      le32_to_cpu(pkt->len_n_flags), queue,
b1fdc2505abcb7 Johannes Berg         2021-02-05  1847  			      &crypt_len)) {
b1fdc2505abcb7 Johannes Berg         2021-02-05  1848  		kfree_skb(skb);
b1fdc2505abcb7 Johannes Berg         2021-02-05  1849  		goto out;
b1fdc2505abcb7 Johannes Berg         2021-02-05  1850  	}
b1fdc2505abcb7 Johannes Berg         2021-02-05  1851  
780e87c29e7768 Johannes Berg         2015-09-03  1852  	if (sta) {
780e87c29e7768 Johannes Berg         2015-09-03  1853  		struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1854  		struct ieee80211_vif *tx_blocked_vif =
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1855  			rcu_dereference(mvm->csa_tx_blocked_vif);
10b2b2019d810f Sara Sharon           2016-03-20  1856  		u8 baid = (u8)((le32_to_cpu(desc->reorder_data) &
10b2b2019d810f Sara Sharon           2016-03-20  1857  			       IWL_RX_MPDU_REORDER_BAID_MASK) >>
10b2b2019d810f Sara Sharon           2016-03-20  1858  			       IWL_RX_MPDU_REORDER_BAID_SHIFT);
6c042d7505d082 Sara Sharon           2018-06-12  1859  		struct iwl_fw_dbg_trigger_tlv *trig;
6c042d7505d082 Sara Sharon           2018-06-12  1860  		struct ieee80211_vif *vif = mvmsta->vif;
780e87c29e7768 Johannes Berg         2015-09-03  1861  
7d9d0d562b54d2 Luca Coelho           2018-04-12  1862  		if (!mvm->tcm.paused && len >= sizeof(*hdr) &&
7d9d0d562b54d2 Luca Coelho           2018-04-12  1863  		    !is_multicast_ether_addr(hdr->addr1) &&
7d9d0d562b54d2 Luca Coelho           2018-04-12  1864  		    ieee80211_is_data(hdr->frame_control) &&
7d9d0d562b54d2 Luca Coelho           2018-04-12  1865  		    time_after(jiffies, mvm->tcm.ts + MVM_TCM_PERIOD))
7d9d0d562b54d2 Luca Coelho           2018-04-12  1866  			schedule_delayed_work(&mvm->tcm.work, 0);
7d9d0d562b54d2 Luca Coelho           2018-04-12  1867  
780e87c29e7768 Johannes Berg         2015-09-03  1868  		/*
780e87c29e7768 Johannes Berg         2015-09-03  1869  		 * We have tx blocked stations (with CS bit). If we heard
780e87c29e7768 Johannes Berg         2015-09-03  1870  		 * frames from a blocked station on a new channel we can
780e87c29e7768 Johannes Berg         2015-09-03  1871  		 * TX to it again.
780e87c29e7768 Johannes Berg         2015-09-03  1872  		 */
6c042d7505d082 Sara Sharon           2018-06-12  1873  		if (unlikely(tx_blocked_vif) && tx_blocked_vif == vif) {
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1874  			struct iwl_mvm_vif *mvmvif =
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1875  				iwl_mvm_vif_from_mac80211(tx_blocked_vif);
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1876  			struct iwl_rx_sta_csa rx_sta_csa = {
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1877  				.all_sta_unblocked = true,
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1878  				.vif = tx_blocked_vif,
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1879  			};
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1880  
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1881  			if (mvmvif->csa_target_freq == rx_status->freq)
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1882  				iwl_mvm_sta_modify_disable_tx_ap(mvm, sta,
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1883  								 false);
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1884  			ieee80211_iterate_stations_atomic(mvm->hw,
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1885  							  iwl_mvm_rx_get_sta_block_tx,
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1886  							  &rx_sta_csa);
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1887  
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1888  			if (rx_sta_csa.all_sta_unblocked) {
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1889  				RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL);
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1890  				/* Unblock BCAST / MCAST station */
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1891  				iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, false);
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1892  				cancel_delayed_work_sync(&mvm->cs_tx_unblock_dwork);
e5d153ec54f029 Emmanuel Grumbach     2021-02-05  1893  			}
d3a108a48dc670 Andrei Otcheretianski 2016-02-28  1894  		}
780e87c29e7768 Johannes Berg         2015-09-03  1895  
ecaf71de414345 Gregory Greenman      2017-11-01  1896  		rs_update_last_rssi(mvm, mvmsta, rx_status);
780e87c29e7768 Johannes Berg         2015-09-03  1897  
6c042d7505d082 Sara Sharon           2018-06-12  1898  		trig = iwl_fw_dbg_trigger_on(&mvm->fwrt,
6c042d7505d082 Sara Sharon           2018-06-12  1899  					     ieee80211_vif_to_wdev(vif),
6c042d7505d082 Sara Sharon           2018-06-12  1900  					     FW_DBG_TRIGGER_RSSI);
6c042d7505d082 Sara Sharon           2018-06-12  1901  
6c042d7505d082 Sara Sharon           2018-06-12  1902  		if (trig && ieee80211_is_beacon(hdr->frame_control)) {
780e87c29e7768 Johannes Berg         2015-09-03  1903  			struct iwl_fw_dbg_trigger_low_rssi *rssi_trig;
780e87c29e7768 Johannes Berg         2015-09-03  1904  			s32 rssi;
780e87c29e7768 Johannes Berg         2015-09-03  1905  
780e87c29e7768 Johannes Berg         2015-09-03  1906  			rssi_trig = (void *)trig->data;
780e87c29e7768 Johannes Berg         2015-09-03  1907  			rssi = le32_to_cpu(rssi_trig->rssi);
780e87c29e7768 Johannes Berg         2015-09-03  1908  
6c042d7505d082 Sara Sharon           2018-06-12  1909  			if (rx_status->signal < rssi)
7174beb60c5320 Johannes Berg         2017-06-01  1910  				iwl_fw_dbg_collect_trig(&mvm->fwrt, trig,
7174beb60c5320 Johannes Berg         2017-06-01  1911  							NULL);
780e87c29e7768 Johannes Berg         2015-09-03  1912  		}
780e87c29e7768 Johannes Berg         2015-09-03  1913  
780e87c29e7768 Johannes Berg         2015-09-03  1914  		if (ieee80211_is_data(hdr->frame_control))
59ca9572dee98f Johannes Berg         2020-09-26  1915  			iwl_mvm_rx_csum(mvm, sta, skb, pkt);
a571f5f635ef40 Sara Sharon           2015-12-07  1916  
5ab2ba931255d8 Sara Sharon           2016-03-29  1917  		if (iwl_mvm_is_dup(sta, queue, rx_status, hdr, desc)) {
a571f5f635ef40 Sara Sharon           2015-12-07  1918  			kfree_skb(skb);
cb2de6bb4f1296 Sara Sharon           2017-02-13  1919  			goto out;
a571f5f635ef40 Sara Sharon           2015-12-07  1920  		}
62d23403d4a201 Sara Sharon           2016-03-06  1921  
62d23403d4a201 Sara Sharon           2016-03-06  1922  		/*
62d23403d4a201 Sara Sharon           2016-03-06  1923  		 * Our hardware de-aggregates AMSDUs but copies the mac header
62d23403d4a201 Sara Sharon           2016-03-06  1924  		 * as it to the de-aggregated MPDUs. We need to turn off the
62d23403d4a201 Sara Sharon           2016-03-06  1925  		 * AMSDU bit in the QoS control ourselves.
9dfa21517a75d6 Sara Sharon           2017-02-14  1926  		 * In addition, HW reverses addr3 and addr4 - reverse it back.
62d23403d4a201 Sara Sharon           2016-03-06  1927  		 */
62d23403d4a201 Sara Sharon           2016-03-06  1928  		if ((desc->mac_flags2 & IWL_RX_MPDU_MFLG2_AMSDU) &&
62d23403d4a201 Sara Sharon           2016-03-06  1929  		    !WARN_ON(!ieee80211_is_data_qos(hdr->frame_control))) {
62d23403d4a201 Sara Sharon           2016-03-06  1930  			u8 *qc = ieee80211_get_qos_ctl(hdr);
62d23403d4a201 Sara Sharon           2016-03-06  1931  
62d23403d4a201 Sara Sharon           2016-03-06  1932  			*qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT;
a56cb4f0d82635 Sara Sharon           2017-01-31  1933  
286ca8eb4d0a97 Luca Coelho           2019-07-12  1934  			if (mvm->trans->trans_cfg->device_family ==
e4d7220813e986 Sara Sharon           2017-12-19  1935  			    IWL_DEVICE_FAMILY_9000) {
e4d7220813e986 Sara Sharon           2017-12-19  1936  				iwl_mvm_flip_address(hdr->addr3);
9dfa21517a75d6 Sara Sharon           2017-02-14  1937  
e4d7220813e986 Sara Sharon           2017-12-19  1938  				if (ieee80211_has_a4(hdr->frame_control))
e4d7220813e986 Sara Sharon           2017-12-19  1939  					iwl_mvm_flip_address(hdr->addr4);
9dfa21517a75d6 Sara Sharon           2017-02-14  1940  			}
62d23403d4a201 Sara Sharon           2016-03-06  1941  		}
5d43eab6632df3 Sara Sharon           2017-02-02  1942  		if (baid != IWL_RX_REORDER_DATA_INVALID_BAID) {
5d43eab6632df3 Sara Sharon           2017-02-02  1943  			u32 reorder_data = le32_to_cpu(desc->reorder_data);
5d43eab6632df3 Sara Sharon           2017-02-02  1944  
5d43eab6632df3 Sara Sharon           2017-02-02  1945  			iwl_mvm_agg_rx_received(mvm, reorder_data, baid);
5d43eab6632df3 Sara Sharon           2017-02-02  1946  		}
780e87c29e7768 Johannes Berg         2015-09-03  1947  	}
780e87c29e7768 Johannes Berg         2015-09-03  1948  
ce712478a458fc Luca Coelho           2021-10-17  1949  	is_sgi = format == RATE_MCS_HE_MSK ?
ce712478a458fc Luca Coelho           2021-10-17  1950  		iwl_he_is_sgi(rate_n_flags) :
ce712478a458fc Luca Coelho           2021-10-17  1951  		rate_n_flags & RATE_MCS_SGI_MSK;
ce712478a458fc Luca Coelho           2021-10-17  1952  
ce712478a458fc Luca Coelho           2021-10-17  1953  	if (!(format == RATE_MCS_CCK_MSK) && is_sgi)
7fdd69c5af2160 Johannes Berg         2017-04-26  1954  		rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
ce712478a458fc Luca Coelho           2021-10-17  1955  	if (rate_n_flags & RATE_MCS_LDPC_MSK)
7fdd69c5af2160 Johannes Berg         2017-04-26  1956  		rx_status->enc_flags |= RX_ENC_FLAG_LDPC;
ce712478a458fc Luca Coelho           2021-10-17  1957  	if (format == RATE_MCS_HT_MSK) {
77e409455f4171 Sara Sharon           2017-01-11  1958  		u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >>
780e87c29e7768 Johannes Berg         2015-09-03  1959  			RATE_MCS_STBC_POS;
da6a4352e7c867 Johannes Berg         2017-04-26  1960  		rx_status->encoding = RX_ENC_HT;
ce712478a458fc Luca Coelho           2021-10-17  1961  		rx_status->rate_idx = RATE_HT_MCS_INDEX(rate_n_flags);
7fdd69c5af2160 Johannes Berg         2017-04-26  1962  		rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
ce712478a458fc Luca Coelho           2021-10-17  1963  	} else if (format == RATE_MCS_VHT_MSK) {
77e409455f4171 Sara Sharon           2017-01-11  1964  		u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >>
780e87c29e7768 Johannes Berg         2015-09-03  1965  			RATE_MCS_STBC_POS;
8613c94815fcdd Johannes Berg         2017-04-26 @1966  			rx_status->nss =
ce712478a458fc Luca Coelho           2021-10-17  1967  			((rate_n_flags & RATE_MCS_NSS_MSK) >>
ce712478a458fc Luca Coelho           2021-10-17  1968  			RATE_MCS_NSS_POS) + 1;
ce712478a458fc Luca Coelho           2021-10-17  1969  		rx_status->rate_idx = rate_n_flags & RATE_MCS_CODE_MSK;
da6a4352e7c867 Johannes Berg         2017-04-26  1970  		rx_status->encoding = RX_ENC_VHT;
7fdd69c5af2160 Johannes Berg         2017-04-26  1971  		rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
780e87c29e7768 Johannes Berg         2015-09-03  1972  		if (rate_n_flags & RATE_MCS_BF_MSK)
7fdd69c5af2160 Johannes Berg         2017-04-26  1973  			rx_status->enc_flags |= RX_ENC_FLAG_BF;
ce712478a458fc Luca Coelho           2021-10-17  1974  	} else if (!(format == RATE_MCS_HE_MSK)) {
ce712478a458fc Luca Coelho           2021-10-17  1975  		int rate = iwl_mvm_legacy_hw_idx_to_mac80211_idx(rate_n_flags,
780e87c29e7768 Johannes Berg         2015-09-03  1976  								 rx_status->band);
cb2de6bb4f1296 Sara Sharon           2017-02-13  1977  
cb2de6bb4f1296 Sara Sharon           2017-02-13  1978  		if (WARN(rate < 0 || rate > 0xFF,
cb2de6bb4f1296 Sara Sharon           2017-02-13  1979  			 "Invalid rate flags 0x%x, band %d,\n",
cb2de6bb4f1296 Sara Sharon           2017-02-13  1980  			 rate_n_flags, rx_status->band)) {
cb2de6bb4f1296 Sara Sharon           2017-02-13  1981  			kfree_skb(skb);
cb2de6bb4f1296 Sara Sharon           2017-02-13  1982  			goto out;
cb2de6bb4f1296 Sara Sharon           2017-02-13  1983  		}
cb2de6bb4f1296 Sara Sharon           2017-02-13  1984  		rx_status->rate_idx = rate;
780e87c29e7768 Johannes Berg         2015-09-03  1985  	}
780e87c29e7768 Johannes Berg         2015-09-03  1986  
fbe4112791b8fe Sara Sharon           2016-04-04  1987  	/* management stuff on default queue */
fbe4112791b8fe Sara Sharon           2016-04-04  1988  	if (!queue) {
fbe4112791b8fe Sara Sharon           2016-04-04  1989  		if (unlikely((ieee80211_is_beacon(hdr->frame_control) ||
fbe4112791b8fe Sara Sharon           2016-04-04  1990  			      ieee80211_is_probe_resp(hdr->frame_control)) &&
fbe4112791b8fe Sara Sharon           2016-04-04  1991  			     mvm->sched_scan_pass_all ==
fbe4112791b8fe Sara Sharon           2016-04-04  1992  			     SCHED_SCAN_PASS_ALL_ENABLED))
fbe4112791b8fe Sara Sharon           2016-04-04  1993  			mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_FOUND;
fbe4112791b8fe Sara Sharon           2016-04-04  1994  
fbe4112791b8fe Sara Sharon           2016-04-04  1995  		if (unlikely(ieee80211_is_beacon(hdr->frame_control) ||
fbe4112791b8fe Sara Sharon           2016-04-04  1996  			     ieee80211_is_probe_resp(hdr->frame_control)))
9285ec4c8b61d4 Jason A. Donenfeld    2019-06-21  1997  			rx_status->boottime_ns = ktime_get_boottime_ns();
fbe4112791b8fe Sara Sharon           2016-04-04  1998  	}
780e87c29e7768 Johannes Berg         2015-09-03  1999  
de1887c064b999 Luca Coelho           2019-04-16  2000  	if (iwl_mvm_create_skb(mvm, skb, hdr, len, crypt_len, rxb)) {
de1887c064b999 Luca Coelho           2019-04-16  2001  		kfree_skb(skb);
de1887c064b999 Luca Coelho           2019-04-16  2002  		goto out;
de1887c064b999 Luca Coelho           2019-04-16  2003  	}
de1887c064b999 Luca Coelho           2019-04-16  2004  
b915c10174fb7d Sara Sharon           2016-03-23  2005  	if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc))
9bf13bee2d74a3 Johannes Berg         2018-11-20  2006  		iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue,
9bf13bee2d74a3 Johannes Berg         2018-11-20  2007  						sta, csi);
cb2de6bb4f1296 Sara Sharon           2017-02-13  2008  out:
f5e28eac1a890e Johannes Berg         2015-12-06  2009  	rcu_read_unlock();
780e87c29e7768 Johannes Berg         2015-09-03  2010  }
585a6fccf5b843 Sara Sharon           2015-12-01  2011  

:::::: The code at line 1966 was first introduced by commit
:::::: 8613c94815fcdd358638a22fed50c3f172042aa2 mac80211: rename ieee80211_rx_status::vht_nss to just nss

:::::: TO: Johannes Berg <johannes.berg@...el.com>
:::::: CC: Johannes Berg <johannes.berg@...el.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (34098 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ