mt76: add headroom and tailroom to mt76_mcu_ops data structure

Introduce headroom and tailroom to mt76_mcu_ops data structure in order
to unify the routine used for mcu message allocation. This is a
preliminary patch to add mt7663u support

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2020-04-06 12:20:12 +02:00
committed by Felix Fietkau
parent ea4f4d216d
commit 72c9380e70
9 changed files with 51 additions and 57 deletions
+5 -4
View File
@@ -6,10 +6,11 @@
#include "mt76.h"
struct sk_buff *
mt76_mcu_msg_alloc(const void *data, int head_len,
int data_len, int tail_len)
mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
int data_len)
{
int length = head_len + data_len + tail_len;
const struct mt76_mcu_ops *ops = dev->mcu_ops;
int length = ops->headroom + data_len + ops->tailroom;
struct sk_buff *skb;
skb = alloc_skb(length, GFP_KERNEL);
@@ -17,7 +18,7 @@ mt76_mcu_msg_alloc(const void *data, int head_len,
return NULL;
memset(skb->head, 0, length);
skb_reserve(skb, head_len);
skb_reserve(skb, ops->headroom);
if (data && data_len)
skb_put_data(skb, data, data_len);