Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0ca9900 authored by Kalle Valo's avatar Kalle Valo
Browse files

Merge ath-next from ath.git

Major changes:

ath9k

* add random number generator support (CONFIG_ATH9K_HWRNG)
parents 9b2761cb 7c97b72a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1139,7 +1139,7 @@ static ssize_t ath10k_read_htt_max_amsdu_ampdu(struct file *file,
{
	struct ath10k *ar = file->private_data;
	char buf[64];
	u8 amsdu = 3, ampdu = 64;
	u8 amsdu, ampdu;
	unsigned int len;

	mutex_lock(&ar->conf_mutex);
+2 −1
Original line number Diff line number Diff line
@@ -250,7 +250,8 @@ static int ath10k_install_peer_wep_keys(struct ath10k_vif *arvif,
	lockdep_assert_held(&ar->conf_mutex);

	if (WARN_ON(arvif->vif->type != NL80211_IFTYPE_AP &&
		    arvif->vif->type != NL80211_IFTYPE_ADHOC))
		    arvif->vif->type != NL80211_IFTYPE_ADHOC &&
		    arvif->vif->type != NL80211_IFTYPE_MESH_POINT))
		return -EINVAL;

	spin_lock_bh(&ar->data_lock);
+43 −18
Original line number Diff line number Diff line
@@ -4312,34 +4312,58 @@ void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb)
	ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_RESUME_REQ_EVENTID\n");
}

static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
static int ath10k_wmi_alloc_chunk(struct ath10k *ar, u32 req_id,
				  u32 num_units, u32 unit_len)
{
	dma_addr_t paddr;
	u32 pool_size;
	u32 pool_size = 0;
	int idx = ar->wmi.num_mem_chunks;
	void *vaddr = NULL;

	pool_size = num_units * round_up(unit_len, 4);
	if (ar->wmi.num_mem_chunks == ARRAY_SIZE(ar->wmi.mem_chunks))
		return -ENOMEM;

	while (!vaddr && num_units) {
		pool_size = num_units * round_up(unit_len, 4);
		if (!pool_size)
			return -EINVAL;

	ar->wmi.mem_chunks[idx].vaddr = dma_alloc_coherent(ar->dev,
							   pool_size,
							   &paddr,
							   GFP_KERNEL);
	if (!ar->wmi.mem_chunks[idx].vaddr) {
		ath10k_warn(ar, "failed to allocate memory chunk\n");
		return -ENOMEM;
		vaddr = kzalloc(pool_size, GFP_KERNEL | __GFP_NOWARN);
		if (!vaddr)
			num_units /= 2;
	}

	memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
	if (!num_units)
		return -ENOMEM;

	paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_TO_DEVICE);
	if (dma_mapping_error(ar->dev, paddr)) {
		kfree(vaddr);
		return -ENOMEM;
	}

	ar->wmi.mem_chunks[idx].vaddr = vaddr;
	ar->wmi.mem_chunks[idx].paddr = paddr;
	ar->wmi.mem_chunks[idx].len = pool_size;
	ar->wmi.mem_chunks[idx].req_id = req_id;
	ar->wmi.num_mem_chunks++;

	return num_units;
}

static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
				     u32 num_units, u32 unit_len)
{
	int ret;

	while (num_units) {
		ret = ath10k_wmi_alloc_chunk(ar, req_id, num_units, unit_len);
		if (ret < 0)
			return ret;

		num_units -= ret;
	}

	return 0;
}

@@ -7717,10 +7741,11 @@ void ath10k_wmi_free_host_mem(struct ath10k *ar)

	/* free the host memory chunks requested by firmware */
	for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
		dma_free_coherent(ar->dev,
		dma_unmap_single(ar->dev,
				 ar->wmi.mem_chunks[i].paddr,
				 ar->wmi.mem_chunks[i].len,
				  ar->wmi.mem_chunks[i].vaddr,
				  ar->wmi.mem_chunks[i].paddr);
				 DMA_TO_DEVICE);
		kfree(ar->wmi.mem_chunks[i].vaddr);
	}

	ar->wmi.num_mem_chunks = 0;
+1 −1
Original line number Diff line number Diff line
@@ -767,7 +767,7 @@ ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
	if (info->flags & IEEE80211_TX_CTL_NO_ACK)
		flags |= AR5K_TXDESC_NOACK;

	rc_flags = info->control.rates[0].flags;
	rc_flags = bf->rates[0].flags;

	hw_rate = ath5k_get_rate_hw_value(ah->hw, info, bf, 0);

+2 −2
Original line number Diff line number Diff line
@@ -3930,8 +3930,8 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
		ath6kl_band_5ghz.ht_cap.mcs.rx_mask[0] = 0xff;
		ath6kl_band_2ghz.ht_cap.mcs.rx_mask[1] = 0xff;
		ath6kl_band_5ghz.ht_cap.mcs.rx_mask[1] = 0xff;
		ar->hw.tx_ant = 2;
		ar->hw.rx_ant = 2;
		ar->hw.tx_ant = 0x3; /* mask, 2 antenna */
		ar->hw.rx_ant = 0x3;
	} else {
		ath6kl_band_2ghz.ht_cap.mcs.rx_mask[0] = 0xff;
		ath6kl_band_5ghz.ht_cap.mcs.rx_mask[0] = 0xff;
Loading