Commit a0a2034e authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: add gfp to mt76_mcu_msg_alloc signature

Introduce __mt76_mcu_msg_alloc utility routine in order to specify gfp
flags for mcu message allocation.
Acked-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 64d60725
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
#include "mt76.h" #include "mt76.h"
struct sk_buff * struct sk_buff *
mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data, __mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
int data_len) int data_len, gfp_t gfp)
{ {
const struct mt76_mcu_ops *ops = dev->mcu_ops; const struct mt76_mcu_ops *ops = dev->mcu_ops;
int length = ops->headroom + data_len + ops->tailroom; int length = ops->headroom + data_len + ops->tailroom;
struct sk_buff *skb; struct sk_buff *skb;
skb = alloc_skb(length, GFP_KERNEL); skb = alloc_skb(length, gfp);
if (!skb) if (!skb)
return NULL; return NULL;
...@@ -25,7 +25,7 @@ mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data, ...@@ -25,7 +25,7 @@ mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
return skb; return skb;
} }
EXPORT_SYMBOL_GPL(mt76_mcu_msg_alloc); EXPORT_SYMBOL_GPL(__mt76_mcu_msg_alloc);
struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
unsigned long expires) unsigned long expires)
......
...@@ -1345,8 +1345,15 @@ int mt76s_rd_rp(struct mt76_dev *dev, u32 base, ...@@ -1345,8 +1345,15 @@ int mt76s_rd_rp(struct mt76_dev *dev, u32 base,
struct mt76_reg_pair *data, int len); struct mt76_reg_pair *data, int len);
struct sk_buff * struct sk_buff *
__mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
int data_len, gfp_t gfp);
static inline struct sk_buff *
mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data, mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
int data_len); int data_len)
{
return __mt76_mcu_msg_alloc(dev, data, data_len, GFP_KERNEL);
}
void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb); void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb);
struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
unsigned long expires); unsigned long expires);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment