netdev_upperhalf.c: support alloc iob from CAN buffer pool

when the network card type is NET_LL_CAN, packets are defaultly
allocated from the can buffer.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-08-11 20:16:25 +08:00
committed by Alan C. Assis
parent 3e025b5a03
commit 6144b51848
+11 -1
View File
@@ -1705,7 +1705,17 @@ FAR netpkt_t *netpkt_alloc(FAR struct netdev_lowerhalf_s *dev,
return NULL;
}
pkt = iob_tryalloc(false);
#ifdef CONFIG_NET_CAN
if (dev->netdev.d_lltype == NET_LL_CAN)
{
pkt = can_iob_timedalloc(0);
}
else
#endif
{
pkt = iob_tryalloc(false);
}
if (pkt == NULL)
{
atomic_fetch_add(&dev->quota_ptr[type], 1);