Commit e7bb4e71 authored by Kalle Valo's avatar Kalle Valo
Browse files
ath.git patches for v5.12. Major changes:

ath10k

* support setting SAR limits via nl80211
parents badc6ac3 bb2d2dfd
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = true,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA988X_HW_2_0_VERSION,
@@ -124,6 +125,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = true,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA9887_HW_1_0_VERSION,
@@ -159,6 +161,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA6174_HW_3_2_VERSION,
@@ -189,6 +192,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.tx_stats_over_pktlog = false,
		.bmi_large_size_download = true,
		.supports_peer_stats_info = true,
		.dynamic_sar_support = true,
	},
	{
		.id = QCA6174_HW_2_1_VERSION,
@@ -223,6 +227,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA6174_HW_2_1_VERSION,
@@ -257,6 +262,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA6174_HW_3_0_VERSION,
@@ -291,6 +297,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA6174_HW_3_2_VERSION,
@@ -329,6 +336,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.fw_diag_ce_download = true,
		.tx_stats_over_pktlog = false,
		.supports_peer_stats_info = true,
		.dynamic_sar_support = true,
	},
	{
		.id = QCA99X0_HW_2_0_DEV_VERSION,
@@ -369,6 +377,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA9984_HW_1_0_DEV_VERSION,
@@ -416,6 +425,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA9888_HW_2_0_DEV_VERSION,
@@ -460,6 +470,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA9377_HW_1_0_DEV_VERSION,
@@ -494,6 +505,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA9377_HW_1_1_DEV_VERSION,
@@ -530,6 +542,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = true,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA9377_HW_1_1_DEV_VERSION,
@@ -557,6 +570,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.ast_skid_limit = 0x10,
		.num_wds_entries = 0x20,
		.uart_pin_workaround = true,
		.dynamic_sar_support = false,
	},
	{
		.id = QCA4019_HW_1_0_DEV_VERSION,
@@ -598,6 +612,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = false,
	},
	{
		.id = WCN3990_HW_1_0_DEV_VERSION,
@@ -625,6 +640,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = false,
		.fw_diag_ce_download = false,
		.tx_stats_over_pktlog = false,
		.dynamic_sar_support = true,
	},
};

+3 −1
Original line number Diff line number Diff line
@@ -1019,7 +1019,6 @@ struct ath10k {
	enum ath10k_hw_rev hw_rev;
	u16 dev_id;
	u32 chip_id;
	enum ath10k_dev_type dev_type;
	u32 target_version;
	u8 fw_version_major;
	u32 fw_version_minor;
@@ -1296,6 +1295,9 @@ struct ath10k {
	bool coex_support;
	int coex_gpio_pin;

	s32 tx_power_2g_limit;
	s32 tx_power_5g_limit;

	/* must be last */
	u8 drv_priv[] __aligned(sizeof(void *));
};
+4 −0
Original line number Diff line number Diff line
@@ -449,6 +449,10 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
	}

	ep = &htc->endpoint[eid];
	if (ep->service_id == ATH10K_HTC_SVC_ID_UNUSED) {
		ath10k_warn(ar, "htc rx endpoint %d is not connected\n", eid);
		goto out;
	}

	payload_len = __le16_to_cpu(hdr->len);

+1 −1
Original line number Diff line number Diff line
@@ -2241,7 +2241,7 @@ struct htt_rx_chan_info {
 * Should be: sizeof(struct htt_host_rx_desc) + max rx MSDU size,
 * rounded up to a cache line size.
 */
#define HTT_RX_BUF_SIZE 1920
#define HTT_RX_BUF_SIZE 2048
#define HTT_RX_MSDU_SIZE (HTT_RX_BUF_SIZE - (int)sizeof(struct htt_rx_desc))

/* Refill a bunch of RX buffers for each refill round so that FW/HW can handle
+16 −16
Original line number Diff line number Diff line
@@ -2781,13 +2781,13 @@ static void ath10k_htt_rx_addba(struct ath10k *ar, struct htt_resp *resp)
	peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID);

	ath10k_dbg(ar, ATH10K_DBG_HTT,
		   "htt rx addba tid %hu peer_id %hu size %hhu\n",
		   "htt rx addba tid %u peer_id %u size %u\n",
		   tid, peer_id, ev->window_size);

	spin_lock_bh(&ar->data_lock);
	peer = ath10k_peer_find_by_id(ar, peer_id);
	if (!peer) {
		ath10k_warn(ar, "received addba event for invalid peer_id: %hu\n",
		ath10k_warn(ar, "received addba event for invalid peer_id: %u\n",
			    peer_id);
		spin_unlock_bh(&ar->data_lock);
		return;
@@ -2802,7 +2802,7 @@ static void ath10k_htt_rx_addba(struct ath10k *ar, struct htt_resp *resp)
	}

	ath10k_dbg(ar, ATH10K_DBG_HTT,
		   "htt rx start rx ba session sta %pM tid %hu size %hhu\n",
		   "htt rx start rx ba session sta %pM tid %u size %u\n",
		   peer->addr, tid, ev->window_size);

	ieee80211_start_rx_ba_session_offl(arvif->vif, peer->addr, tid);
@@ -2821,13 +2821,13 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct htt_resp *resp)
	peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID);

	ath10k_dbg(ar, ATH10K_DBG_HTT,
		   "htt rx delba tid %hu peer_id %hu\n",
		   "htt rx delba tid %u peer_id %u\n",
		   tid, peer_id);

	spin_lock_bh(&ar->data_lock);
	peer = ath10k_peer_find_by_id(ar, peer_id);
	if (!peer) {
		ath10k_warn(ar, "received addba event for invalid peer_id: %hu\n",
		ath10k_warn(ar, "received addba event for invalid peer_id: %u\n",
			    peer_id);
		spin_unlock_bh(&ar->data_lock);
		return;
@@ -2842,7 +2842,7 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct htt_resp *resp)
	}

	ath10k_dbg(ar, ATH10K_DBG_HTT,
		   "htt rx stop rx ba session sta %pM tid %hu\n",
		   "htt rx stop rx ba session sta %pM tid %u\n",
		   peer->addr, tid);

	ieee80211_stop_rx_ba_session_offl(arvif->vif, peer->addr, tid);
@@ -3102,7 +3102,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb)
		return;
	}

	ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch ind num records %hu num resps %hu seq %hu\n",
	ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch ind num records %u num resps %u seq %u\n",
		   num_records, num_resp_ids,
		   le16_to_cpu(resp->tx_fetch_ind.fetch_seq_num));

@@ -3127,12 +3127,12 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb)
		max_num_msdus = le16_to_cpu(record->num_msdus);
		max_num_bytes = le32_to_cpu(record->num_bytes);

		ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch record %i peer_id %hu tid %hhu msdus %zu bytes %zu\n",
		ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch record %i peer_id %u tid %u msdus %zu bytes %zu\n",
			   i, peer_id, tid, max_num_msdus, max_num_bytes);

		if (unlikely(peer_id >= ar->htt.tx_q_state.num_peers) ||
		    unlikely(tid >= ar->htt.tx_q_state.num_tids)) {
			ath10k_warn(ar, "received out of range peer_id %hu tid %hhu\n",
			ath10k_warn(ar, "received out of range peer_id %u tid %u\n",
				    peer_id, tid);
			continue;
		}
@@ -3146,7 +3146,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb)
		 */

		if (unlikely(!txq)) {
			ath10k_warn(ar, "failed to lookup txq for peer_id %hu tid %hhu\n",
			ath10k_warn(ar, "failed to lookup txq for peer_id %u tid %u\n",
				    peer_id, tid);
			continue;
		}
@@ -3259,7 +3259,7 @@ static void ath10k_htt_rx_tx_mode_switch_ind(struct ath10k *ar,
	threshold = MS(info1, HTT_TX_MODE_SWITCH_IND_INFO1_THRESHOLD);

	ath10k_dbg(ar, ATH10K_DBG_HTT,
		   "htt rx tx mode switch ind info0 0x%04hx info1 0x%04hx enable %d num records %zd mode %d threshold %hu\n",
		   "htt rx tx mode switch ind info0 0x%04hx info1 0x%04x enable %d num records %zd mode %d threshold %u\n",
		   info0, info1, enable, num_records, mode, threshold);

	len += sizeof(resp->tx_mode_switch_ind.records[0]) * num_records;
@@ -3296,7 +3296,7 @@ static void ath10k_htt_rx_tx_mode_switch_ind(struct ath10k *ar,

		if (unlikely(peer_id >= ar->htt.tx_q_state.num_peers) ||
		    unlikely(tid >= ar->htt.tx_q_state.num_tids)) {
			ath10k_warn(ar, "received out of range peer_id %hu tid %hhu\n",
			ath10k_warn(ar, "received out of range peer_id %u tid %u\n",
				    peer_id, tid);
			continue;
		}
@@ -3310,7 +3310,7 @@ static void ath10k_htt_rx_tx_mode_switch_ind(struct ath10k *ar,
		 */

		if (unlikely(!txq)) {
			ath10k_warn(ar, "failed to lookup txq for peer_id %hu tid %hhu\n",
			ath10k_warn(ar, "failed to lookup txq for peer_id %u tid %u\n",
				    peer_id, tid);
			continue;
		}
@@ -3348,7 +3348,7 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate)
			return i;
	}

	ath10k_warn(ar, "Invalid legacy rate %hhd peer stats", rate);
	ath10k_warn(ar, "Invalid legacy rate %d peer stats", rate);
	return -EINVAL;
}

@@ -3502,13 +3502,13 @@ ath10k_update_per_peer_tx_stats(struct ath10k *ar,
		return;

	if (txrate.flags == WMI_RATE_PREAMBLE_VHT && txrate.mcs > 9) {
		ath10k_warn(ar, "Invalid VHT mcs %hhd peer stats",  txrate.mcs);
		ath10k_warn(ar, "Invalid VHT mcs %d peer stats",  txrate.mcs);
		return;
	}

	if (txrate.flags == WMI_RATE_PREAMBLE_HT &&
	    (txrate.mcs > 7 || txrate.nss < 1)) {
		ath10k_warn(ar, "Invalid HT mcs %hhd nss %hhd peer stats",
		ath10k_warn(ar, "Invalid HT mcs %d nss %d peer stats",
			    txrate.mcs, txrate.nss);
		return;
	}
Loading