You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ethernet.h 685B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _GPXE_ETHERNET_H
  2. #define _GPXE_ETHERNET_H
  3. /** @file
  4. *
  5. * Ethernet protocol
  6. *
  7. */
  8. #include <stdint.h>
  9. #include <gpxe/netdevice.h>
  10. #include <gpxe/if_ether.h>
  11. extern struct ll_protocol ethernet_protocol;
  12. extern const char * eth_ntoa ( const void *ll_addr );
  13. /**
  14. * Allocate Ethernet device
  15. *
  16. * @v priv_size Size of driver private data
  17. * @ret netdev Network device, or NULL
  18. */
  19. static inline struct net_device * alloc_etherdev ( size_t priv_size ) {
  20. struct net_device *netdev;
  21. netdev = alloc_netdev ( priv_size );
  22. if ( netdev ) {
  23. netdev->ll_protocol = &ethernet_protocol;
  24. netdev->max_pkt_len = ETH_FRAME_LEN;
  25. }
  26. return netdev;
  27. }
  28. #endif /* _GPXE_ETHERNET_H */