MCPcopy Create free account
hub / github.com/apache/nuttx / netdev_upper_alloc

Function netdev_upper_alloc

drivers/net/netdev_upperhalf.c:211–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209 ****************************************************************************/
210
211static FAR struct netdev_upperhalf_s *
212netdev_upper_alloc(FAR struct netdev_lowerhalf_s *dev, size_t extra_size)
213{
214 /* Allocate the upper-half data structure */
215
216 FAR struct netdev_upperhalf_s *upper;
217
218 DEBUGASSERT(dev != NULL && dev->netdev.d_private == NULL);
219
220 upper = kmm_zalloc(sizeof(struct netdev_upperhalf_s) + extra_size);
221 if (upper == NULL)
222 {
223 nerr("ERROR: Allocation failed\n");
224 return NULL;
225 }
226
227 upper->lower = dev;
228 dev->netdev.d_private = upper;
229
230 return upper;
231}
232
233/****************************************************************************
234 * Name: netdev_upper_can_tx

Callers 1

netdev_lower_registerFunction · 0.85

Calls 1

kmm_zallocFunction · 0.85

Tested by

no test coverage detected