static ssize_t ath10k_write_htt_max_amsdu_ampdu(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct ath10k *ar = file->private_data; int res; char buf[64]; unsigned int amsdu, ampdu; simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); /* make sure that buf is null terminated */ buf[sizeof(buf) - 1] = 0; res = sscanf(buf, "%u %u", &amsdu, &du); if (res != 2) return -EINVAL; mutex_lock(&ar->conf_mutex); res = ath10k_htt_h2t_aggr_cfg_msg(&ar->htt, ampdu, amsdu); if (res) goto out; res = count; ar->debug.htt_max_amsdu = amsdu; ar->debug.htt_max_ampdu = ampdu; out: mutex_unlock(&ar->conf_mutex); return res; }
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; }