Commit f2b551fa authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'wireless-drivers-next-2021-12-23' of...

Merge tag 'wireless-drivers-next-2021-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for v5.17

Third set of patches for v5.17, and the final one if all goes well. We
have Specific Absorption Rate (SAR) support for both mt76 and rtw88.
Also iwlwifi should be now W=1 warning free. But otherwise nothing
really special this time, business as usual.

Major changes:

mt76
 * Specific Absorption Rate (SAR) support
 * mt7921: new PCI ids
 * mt7921: 160 MHz channel support

iwlwifi
 * fix W=1 and sparse warnings
 * BNJ hardware support
 * add new killer device ids
 * support for Time-Aware-SAR (TAS) from the BIOS
 * Optimized Connectivity Experience (OCE) scan support

rtw88
 * hardware scan
 * Specific Absorption Rate (SAR) support

ath11k
 * qca6390/wcn6855: report signal and tx bitrate
 * qca6390: rfkill support
 * qca6390/wcn6855: regdb.bin support

ath5k
 * switch to rate table based lookup

wilc1000
 * spi: reset/enable GPIO support

* tag 'wireless-drivers-next-2021-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next: (148 commits)
  mt76: mt7921: fix a possible race enabling/disabling runtime-pm
  wilc1000: Document enable-gpios and reset-gpios properties
  wilc1000: Add reset/enable GPIO support to SPI driver
  wilc1000: Convert static "chipid" variable to device-local variable
  rtw89: 8852a: correct bit definition of dfs_en
  rtw88: don't consider deep PS mode when transmitting packet
  ath11k: Fix unexpected return buffer manager error for QCA6390
  ath11k: add support of firmware logging for WCN6855
  ath11k: Fix napi related hang
  ath10k: replace strlcpy with strscpy
  rtw88: support SAR via kernel common API
  rtw88: 8822c: add ieee80211_ops::hw_scan
  iwlwifi: mei: wait before mapping the shared area
  iwlwifi: mei: clear the ownership when the driver goes down
  iwlwifi: yoyo: fix issue with new DBGI_SRAM region read.
  iwlwifi: fw: fix some scan kernel-doc
  iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ
  iwlwifi: mvm: remove card state notification code
  iwlwifi: mvm: drop too short packets silently
  iwlwifi: mvm: fix AUX ROC removal
  ...
====================

Link: https://lore.kernel.org/r/20211223141108.78808C36AE9@smtp.kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents bb53bcb2 d430dffb
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -32,6 +32,21 @@ properties:
  clock-names:
    const: rtc

  enable-gpios:
    maxItems: 1
    description: Used by wilc1000-spi to determine the GPIO line
      connected to the ENABLE line.  If specified, reset-gpios
      must be specified as well as otherwise the driver cannot
      ensure the timing required between asserting ENABLE
      and deasserting RESET.  This should be declared as an
      active-high signal.

  reset-gpios:
    maxItems: 1
    description: Used by wilc1000-spi to determine the GPIO line
      connected to the RESET line.  This should be declared as an
      active-low signal.

required:
  - compatible
  - interrupts
@@ -40,6 +55,8 @@ additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    spi {
      #address-cells = <1>;
      #size-cells = <0>;
@@ -51,6 +68,8 @@ examples:
        interrupts = <27 0>;
        clocks = <&pck1>;
        clock-names = "rtc";
        enable-gpios = <&pioA 5 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&pioA 6 GPIO_ACTIVE_LOW>;
      };
    };

+3 −3
Original line number Diff line number Diff line
@@ -1522,7 +1522,7 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
	mutex_lock(&ar->dump_mutex);

	dump_data = (struct ath10k_dump_file_data *)(buf);
	strlcpy(dump_data->df_magic, "ATH10K-FW-DUMP",
	strscpy(dump_data->df_magic, "ATH10K-FW-DUMP",
		sizeof(dump_data->df_magic));
	dump_data->len = cpu_to_le32(len);

@@ -1543,11 +1543,11 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
	dump_data->vht_cap_info = cpu_to_le32(ar->vht_cap_info);
	dump_data->num_rf_chains = cpu_to_le32(ar->num_rf_chains);

	strlcpy(dump_data->fw_ver, ar->hw->wiphy->fw_version,
	strscpy(dump_data->fw_ver, ar->hw->wiphy->fw_version,
		sizeof(dump_data->fw_ver));

	dump_data->kernel_ver_code = 0;
	strlcpy(dump_data->kernel_ver, init_utsname()->release,
	strscpy(dump_data->kernel_ver, init_utsname()->release,
		sizeof(dump_data->kernel_ver));

	dump_data->tv_sec = cpu_to_le64(crash_data->timestamp.tv_sec);
+9 −3
Original line number Diff line number Diff line
@@ -175,8 +175,11 @@ static void __ath11k_ahb_ext_irq_disable(struct ath11k_base *ab)

		ath11k_ahb_ext_grp_disable(irq_grp);

		if (irq_grp->napi_enabled) {
			napi_synchronize(&irq_grp->napi);
			napi_disable(&irq_grp->napi);
			irq_grp->napi_enabled = false;
		}
	}
}

@@ -300,7 +303,10 @@ static void ath11k_ahb_ext_irq_enable(struct ath11k_base *ab)
	for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
		struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];

		if (!irq_grp->napi_enabled) {
			napi_enable(&irq_grp->napi);
			irq_grp->napi_enabled = true;
		}
		ath11k_ahb_ext_grp_enable(irq_grp);
	}
}
+106 −4
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.target_ce_count = 11,
		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq8074,
		.svc_to_ce_map_len = 21,
		.rfkill_pin = 0,
		.rfkill_cfg = 0,
		.rfkill_on_level = 0,
		.single_pdev_only = false,
		.rxdma1_enable = true,
		.num_rxmda_per_pdev = 1,
@@ -84,6 +87,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.num_peers = 512,
		.supports_suspend = false,
		.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
		.supports_regdb = false,
		.fix_l1ss = true,
		.credit_flow = false,
		.max_tx_ring = DP_TCL_NUM_RING_MAX,
@@ -91,6 +95,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.supports_dynamic_smps_6ghz = false,
		.alloc_cacheable_memory = true,
		.wakeup_mhi = false,
		.supports_rssi_stats = false,
		.fw_wmi_diag_event = false,
	},
	{
		.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -113,6 +119,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.target_ce_count = 11,
		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq6018,
		.svc_to_ce_map_len = 19,
		.rfkill_pin = 0,
		.rfkill_cfg = 0,
		.rfkill_on_level = 0,
		.single_pdev_only = false,
		.rxdma1_enable = true,
		.num_rxmda_per_pdev = 1,
@@ -142,6 +151,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.num_peers = 512,
		.supports_suspend = false,
		.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
		.supports_regdb = false,
		.fix_l1ss = true,
		.credit_flow = false,
		.max_tx_ring = DP_TCL_NUM_RING_MAX,
@@ -149,6 +159,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.supports_dynamic_smps_6ghz = false,
		.alloc_cacheable_memory = true,
		.wakeup_mhi = false,
		.supports_rssi_stats = false,
		.fw_wmi_diag_event = false,
	},
	{
		.name = "qca6390 hw2.0",
@@ -171,6 +183,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.target_ce_count = 9,
		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
		.svc_to_ce_map_len = 14,
		.rfkill_pin = 48,
		.rfkill_cfg = 0,
		.rfkill_on_level = 1,
		.single_pdev_only = true,
		.rxdma1_enable = false,
		.num_rxmda_per_pdev = 2,
@@ -199,6 +214,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.num_peers = 512,
		.supports_suspend = true,
		.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
		.supports_regdb = true,
		.fix_l1ss = true,
		.credit_flow = true,
		.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
@@ -206,6 +222,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.supports_dynamic_smps_6ghz = false,
		.alloc_cacheable_memory = false,
		.wakeup_mhi = true,
		.supports_rssi_stats = true,
		.fw_wmi_diag_event = true,
	},
	{
		.name = "qcn9074 hw1.0",
@@ -228,6 +246,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.target_ce_count = 9,
		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qcn9074,
		.svc_to_ce_map_len = 18,
		.rfkill_pin = 0,
		.rfkill_cfg = 0,
		.rfkill_on_level = 0,
		.rxdma1_enable = true,
		.num_rxmda_per_pdev = 1,
		.rx_mac_buf_ring = false,
@@ -256,6 +277,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.num_peers = 128,
		.supports_suspend = false,
		.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
		.supports_regdb = false,
		.fix_l1ss = true,
		.credit_flow = false,
		.max_tx_ring = DP_TCL_NUM_RING_MAX,
@@ -263,6 +285,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.supports_dynamic_smps_6ghz = true,
		.alloc_cacheable_memory = true,
		.wakeup_mhi = false,
		.supports_rssi_stats = false,
		.fw_wmi_diag_event = false,
	},
	{
		.name = "wcn6855 hw2.0",
@@ -285,6 +309,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.target_ce_count = 9,
		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
		.svc_to_ce_map_len = 14,
		.rfkill_pin = 0,
		.rfkill_cfg = 0,
		.rfkill_on_level = 0,
		.single_pdev_only = true,
		.rxdma1_enable = false,
		.num_rxmda_per_pdev = 2,
@@ -313,6 +340,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.num_peers = 512,
		.supports_suspend = true,
		.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
		.supports_regdb = true,
		.fix_l1ss = false,
		.credit_flow = true,
		.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
@@ -320,6 +348,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.supports_dynamic_smps_6ghz = false,
		.alloc_cacheable_memory = false,
		.wakeup_mhi = true,
		.supports_rssi_stats = true,
		.fw_wmi_diag_event = true,
	},
	{
		.name = "wcn6855 hw2.1",
@@ -342,6 +372,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.target_ce_count = 9,
		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
		.svc_to_ce_map_len = 14,
		.rfkill_pin = 0,
		.rfkill_cfg = 0,
		.rfkill_on_level = 0,
		.single_pdev_only = true,
		.rxdma1_enable = false,
		.num_rxmda_per_pdev = 2,
@@ -369,6 +402,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.num_peers = 512,
		.supports_suspend = true,
		.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
		.supports_regdb = true,
		.fix_l1ss = false,
		.credit_flow = true,
		.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
@@ -376,6 +410,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.supports_dynamic_smps_6ghz = false,
		.alloc_cacheable_memory = false,
		.wakeup_mhi = true,
		.supports_rssi_stats = true,
		.fw_wmi_diag_event = true,
	},
};

@@ -736,10 +772,12 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab,
	return ret;
}

static int ath11k_core_fetch_board_data_api_1(struct ath11k_base *ab,
					      struct ath11k_board_data *bd)
int ath11k_core_fetch_board_data_api_1(struct ath11k_base *ab,
				       struct ath11k_board_data *bd,
				       const char *name)
{
	bd->fw = ath11k_core_firmware_request(ab, ATH11K_DEFAULT_BOARD_FILE);
	bd->fw = ath11k_core_firmware_request(ab, name);

	if (IS_ERR(bd->fw))
		return PTR_ERR(bd->fw);

@@ -767,7 +805,7 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd)
		goto success;

	ab->bd_api = 1;
	ret = ath11k_core_fetch_board_data_api_1(ab, bd);
	ret = ath11k_core_fetch_board_data_api_1(ab, bd, ATH11K_DEFAULT_BOARD_FILE);
	if (ret) {
		ath11k_err(ab, "failed to fetch board-2.bin or board.bin from %s\n",
			   ab->hw_params.fw.dir);
@@ -779,6 +817,18 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd)
	return 0;
}

int ath11k_core_fetch_regdb(struct ath11k_base *ab, struct ath11k_board_data *bd)
{
	int ret;

	ret = ath11k_core_fetch_board_data_api_1(ab, bd, ATH11K_REGDB_FILE_NAME);
	if (ret)
		ath11k_dbg(ab, ATH11K_DBG_BOOT, "failed to fetch %s from %s\n",
			   ATH11K_REGDB_FILE_NAME, ab->hw_params.fw.dir);

	return ret;
}

static void ath11k_core_stop(struct ath11k_base *ab)
{
	if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags))
@@ -1009,6 +1059,27 @@ static int ath11k_core_start(struct ath11k_base *ab,
	return ret;
}

static int ath11k_core_rfkill_config(struct ath11k_base *ab)
{
	struct ath11k *ar;
	int ret = 0, i;

	if (!(ab->target_caps.sys_cap_info & WMI_SYS_CAP_INFO_RFKILL))
		return 0;

	for (i = 0; i < ab->num_radios; i++) {
		ar = ab->pdevs[i].ar;

		ret = ath11k_mac_rfkill_config(ar);
		if (ret && ret != -EOPNOTSUPP) {
			ath11k_warn(ab, "failed to configure rfkill: %d", ret);
			return ret;
		}
	}

	return ret;
}

int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
{
	int ret;
@@ -1055,6 +1126,13 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
		goto err_core_stop;
	}
	ath11k_hif_irq_enable(ab);

	ret = ath11k_core_rfkill_config(ab);
	if (ret && ret != -EOPNOTSUPP) {
		ath11k_err(ab, "failed to config rfkill: %d\n", ret);
		goto err_core_stop;
	}

	mutex_unlock(&ab->core_lock);

	return 0;
@@ -1120,6 +1198,7 @@ void ath11k_core_halt(struct ath11k *ar)
	cancel_delayed_work_sync(&ar->scan.timeout);
	cancel_work_sync(&ar->regd_update_work);
	cancel_work_sync(&ab->update_11d_work);
	cancel_work_sync(&ab->rfkill_work);

	rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], NULL);
	synchronize_rcu();
@@ -1127,6 +1206,28 @@ void ath11k_core_halt(struct ath11k *ar)
	idr_init(&ar->txmgmt_idr);
}

static void ath11k_rfkill_work(struct work_struct *work)
{
	struct ath11k_base *ab = container_of(work, struct ath11k_base, rfkill_work);
	struct ath11k *ar;
	bool rfkill_radio_on;
	int i;

	spin_lock_bh(&ab->base_lock);
	rfkill_radio_on = ab->rfkill_radio_on;
	spin_unlock_bh(&ab->base_lock);

	for (i = 0; i < ab->num_radios; i++) {
		ar = ab->pdevs[i].ar;
		if (!ar)
			continue;

		/* notify cfg80211 radio state change */
		ath11k_mac_rfkill_enable_radio(ar, rfkill_radio_on);
		wiphy_rfkill_set_hw_state(ar->hw->wiphy, !rfkill_radio_on);
	}
}

static void ath11k_update_11d(struct work_struct *work)
{
	struct ath11k_base *ab = container_of(work, struct ath11k_base, update_11d_work);
@@ -1333,6 +1434,7 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
	init_waitqueue_head(&ab->qmi.cold_boot_waitq);
	INIT_WORK(&ab->restart_work, ath11k_core_restart);
	INIT_WORK(&ab->update_11d_work, ath11k_update_11d);
	INIT_WORK(&ab->rfkill_work, ath11k_rfkill_work);
	timer_setup(&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry, 0);
	init_completion(&ab->htc_suspend);
	init_completion(&ab->wow.wakeup_completed);
+16 −1
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ struct ath11k_ext_irq_grp {
	u32 num_irq;
	u32 grp_id;
	u64 timestamp;
	bool napi_enabled;
	struct napi_struct napi;
	struct net_device napi_ndev;
};
@@ -382,10 +383,13 @@ struct ath11k_sta {
	struct work_struct update_wk;
	struct work_struct set_4addr_wk;
	struct rate_info txrate;
	u32 peer_nss;
	struct rate_info last_txrate;
	u64 rx_duration;
	u64 tx_duration;
	u8 rssi_comb;
	s8 rssi_beacon;
	s8 chain_signal[IEEE80211_MAX_CHAINS];
	struct ath11k_htt_tx_stats *tx_stats;
	struct ath11k_rx_peer_stats *rx_stats;

@@ -416,6 +420,10 @@ enum ath11k_state {
/* Antenna noise floor */
#define ATH11K_DEFAULT_NOISE_FLOOR -95

#define ATH11K_INVALID_RSSI_FULL -1

#define ATH11K_INVALID_RSSI_EMPTY -128

struct ath11k_fw_stats {
	struct dentry *debugfs_fwstats;
	u32 pdev_id;
@@ -736,7 +744,6 @@ struct ath11k_base {
	u32 wlan_init_status;
	int irq_num[ATH11K_IRQ_NUM_MAX];
	struct ath11k_ext_irq_grp ext_irq_grp[ATH11K_EXT_IRQ_GRP_NUM_MAX];
	struct napi_struct *napi;
	struct ath11k_targ_cap target_caps;
	u32 ext_service_bitmap[WMI_SERVICE_EXT_BM_SIZE];
	bool pdevs_macaddr_valid;
@@ -779,6 +786,10 @@ struct ath11k_base {

	struct ath11k_dbring_cap *db_caps;
	u32 num_db_cap;
	struct work_struct rfkill_work;

	/* true means radio is on */
	bool rfkill_radio_on;

	/* To synchronize 11d scan vdev id */
	struct mutex vdev_id_11d_lock;
@@ -969,6 +980,10 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
void ath11k_core_free(struct ath11k_base *ath11k);
int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
			  struct ath11k_board_data *bd);
int ath11k_core_fetch_regdb(struct ath11k_base *ab, struct ath11k_board_data *bd);
int ath11k_core_fetch_board_data_api_1(struct ath11k_base *ab,
				       struct ath11k_board_data *bd,
				       const char *name);
void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd);
int ath11k_core_check_dt(struct ath11k_base *ath11k);

Loading