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

Commit 6d1f422f authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: add support for headroom configuration"

parents 1f6573a3 a5ec93c3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -657,8 +657,6 @@ int wil_priv_init(struct wil6210_priv *wil)

	/* edma configuration can be updated via debugfs before allocation */
	wil->num_rx_status_rings = WIL_DEFAULT_NUM_RX_STATUS_RINGS;
	wil->use_compressed_rx_status = true;
	wil->use_rx_hw_reordering = true;
	wil->tx_status_ring_order = WIL_TX_SRING_SIZE_ORDER_DEFAULT;

	/* Rx status ring size should be bigger than the number of RX buffers
@@ -1147,6 +1145,15 @@ void wil_refresh_fw_capabilities(struct wil6210_priv *wil)

		wil->platform_ops.set_features(wil->platform_handle, features);
	}

	if (test_bit(WMI_FW_CAPABILITY_BACK_WIN_SIZE_64,
		     wil->fw_capabilities)) {
		wil->max_agg_wsize = WIL_MAX_AGG_WSIZE_64;
		wil->max_ampdu_size = WIL_MAX_AMPDU_SIZE_128;
	} else {
		wil->max_agg_wsize = WIL_MAX_AGG_WSIZE;
		wil->max_ampdu_size = WIL_MAX_AMPDU_SIZE;
	}
}

void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ int wil_set_capabilities(struct wil6210_priv *wil)
		set_bit(hw_capa_no_flash, wil->hw_capa);
		wil->use_enhanced_dma_hw = true;
		wil->use_rx_hw_reordering = true;
		wil->use_compressed_rx_status = true;
		wil_fw_name = ftm_mode ? WIL_FW_NAME_FTM_TALYN :
			      WIL_FW_NAME_TALYN;
		if (wil_fw_verify_file_exists(wil, wil_fw_name))
+4 −4
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ void wil_tid_ampdu_rx_free(struct wil6210_priv *wil,
/* ADDBA processing */
static u16 wil_agg_size(struct wil6210_priv *wil, u16 req_agg_wsize)
{
	u16 max_agg_size = min_t(u16, WIL_MAX_AGG_WSIZE, WIL_MAX_AMPDU_SIZE /
	u16 max_agg_size = min_t(u16, wil->max_agg_wsize, wil->max_ampdu_size /
				 (mtu_max + WIL_MAX_MPDU_OVERHEAD));

	if (!req_agg_wsize)
@@ -364,11 +364,11 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
	if (status == WLAN_STATUS_SUCCESS) {
		if (req_agg_wsize == 0) {
			wil_dbg_misc(wil, "Suggest BACK wsize %d\n",
				     WIL_MAX_AGG_WSIZE);
			agg_wsize = WIL_MAX_AGG_WSIZE;
				     wil->max_agg_wsize);
			agg_wsize = wil->max_agg_wsize;
		} else {
			agg_wsize = min_t(u16,
					  WIL_MAX_AGG_WSIZE, req_agg_wsize);
					  wil->max_agg_wsize, req_agg_wsize);
		}
	}

+27 −1
Original line number Diff line number Diff line
@@ -43,6 +43,32 @@ bool rx_large_buf;
module_param(rx_large_buf, bool, 0444);
MODULE_PARM_DESC(rx_large_buf, " allocate 8KB RX buffers, default - no");

#define WIL6210_MAX_HEADROOM_SIZE	(256)

ushort headroom_size; /* = 0; */
static int headroom_size_set(const char *val, const struct kernel_param *kp)
{
	int ret;

	ret = param_set_uint(val, kp);
	if (ret)
		return ret;

	if (headroom_size > WIL6210_MAX_HEADROOM_SIZE)
		return -EINVAL;

	return 0;
}

static const struct kernel_param_ops headroom_ops = {
	.set = headroom_size_set,
	.get = param_get_ushort,
};

module_param_cb(headroom_size, &headroom_ops, &headroom_size, 0644);
MODULE_PARM_DESC(headroom_size,
		 " headroom size for rx skb allocation, default - 0");

static inline uint wil_rx_snaplen(void)
{
	return rx_align_2 ? 6 : 0;
@@ -610,7 +636,7 @@ static int wil_rx_refill(struct wil6210_priv *wil, int count)
	u32 next_tail;
	int rc = 0;
	int headroom = ndev->type == ARPHRD_IEEE80211_RADIOTAP ?
			WIL6210_RTAP_SIZE : 0;
			WIL6210_RTAP_SIZE : headroom_size;

	for (; next_tail = wil_ring_next_tail(v),
	     (next_tail != v->swhead) && (count-- > 0);
+2 −1
Original line number Diff line number Diff line
@@ -177,10 +177,11 @@ static int wil_ring_alloc_skb_edma(struct wil6210_priv *wil,
		return -EAGAIN;
	}

	skb = dev_alloc_skb(sz);
	skb = dev_alloc_skb(sz + headroom_size);
	if (unlikely(!skb))
		return -ENOMEM;

	skb_reserve(skb, headroom_size);
	skb_put(skb, sz);

	/**
Loading