Exemple #1
0
int ath10k_htt_setup(struct ath10k_htt *htt)
{
	struct ath10k *ar = htt->ar;
	int status;

	init_completion(&htt->target_version_received);

	status = ath10k_htt_h2t_ver_req_msg(htt);
	if (status)
		return status;

	status = wait_for_completion_timeout(&htt->target_version_received,
					     HTT_TARGET_VERSION_TIMEOUT_HZ);
	if (status == 0) {
		ath10k_warn(ar, "htt version request timed out\n");
		return -ETIMEDOUT;
	}

	status = ath10k_htt_verify_version(htt);
	if (status) {
		ath10k_warn(ar, "failed to verify htt version: %d\n",
			    status);
		return status;
	}

	status = htt->tx_ops->htt_send_frag_desc_bank_cfg(htt);
	if (status)
		return status;

	status = htt->tx_ops->htt_send_rx_ring_cfg(htt);
	if (status) {
		ath10k_warn(ar, "failed to setup rx ring: %d\n",
			    status);
		return status;
	}

	status = ath10k_htt_h2t_aggr_cfg_msg(htt,
					     htt->max_num_ampdu,
					     htt->max_num_amsdu);
	if (status) {
		ath10k_warn(ar, "failed to setup amsdu=%d/ampdu=%d limit: %d\n",
			    htt->max_num_ampdu, htt->max_num_amsdu, status);
		return status;
	}

	return 0;
}
Exemple #2
0
Fichier : htt.c Projet : 7799/linux
int ath10k_htt_attach_target(struct ath10k_htt *htt)
{
	int status;

	init_completion(&htt->target_version_received);

	status = ath10k_htt_h2t_ver_req_msg(htt);
	if (status)
		return status;

	status = wait_for_completion_timeout(&htt->target_version_received,
						HTT_TARGET_VERSION_TIMEOUT_HZ);
	if (status <= 0) {
		ath10k_warn("htt version request timed out\n");
		return -ETIMEDOUT;
	}

	status = ath10k_htt_verify_version(htt);
	if (status)
		return status;

	return ath10k_htt_send_rx_ring_cfg_ll(htt);
}