mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
wil6210: add support for headroom configuration
Add module parameter for configuring the headroom size in the skb allocation. Change-Id: Ie0190a6c8fa19c7121ad77b8a9a913ce876800fe Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> [liord@codeaurora.org: SPDX license] Signed-off-by: Lior David <liord@codeaurora.org>
This commit is contained in:
parent
c214ad2ab4
commit
60742fce45
3 changed files with 32 additions and 26 deletions
|
|
@ -1,18 +1,7 @@
|
|||
// SPDX-License-Identifier: ISC
|
||||
/*
|
||||
* Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
|
||||
* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <linux/etherdevice.h>
|
||||
|
|
@ -41,6 +30,32 @@ MODULE_PARM_DESC(rx_large_buf, " allocate 8KB RX buffers, default - no");
|
|||
/* Drop Tx packets in case Tx ring is full */
|
||||
bool drop_if_ring_full;
|
||||
|
||||
#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;
|
||||
|
|
@ -623,7 +638,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);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,6 @@
|
|||
// SPDX-License-Identifier: ISC
|
||||
/*
|
||||
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <linux/etherdevice.h>
|
||||
|
|
@ -182,10 +171,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);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ extern bool rx_large_buf;
|
|||
extern bool debug_fw;
|
||||
extern bool disable_ap_sme;
|
||||
extern bool ftm_mode;
|
||||
extern ushort headroom_size;
|
||||
extern bool drop_if_ring_full;
|
||||
extern uint max_assoc_sta;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue