| 209 | ****************************************************************************/ |
| 210 | |
| 211 | static FAR struct netdev_upperhalf_s * |
| 212 | netdev_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 |
no test coverage detected