X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Feth.h;h=ed2413839b02c508875c8e2cf6ed90187b50a424;hb=e25abecb6a6ff52917d44d1331e5af831aeceb9c;hp=3caacb59c725f7ac0d65433a896976985e3ae7ca;hpb=27b6bdaf73e1e61b8ab8760547b68929e7be8837;p=bertos.git diff --git a/bertos/drv/eth.h b/bertos/drv/eth.h index 3caacb59..ed241383 100644 --- a/bertos/drv/eth.h +++ b/bertos/drv/eth.h @@ -36,20 +36,26 @@ * * $WIZ$ module_name = "eth" * $WIZ$ module_configuration = "bertos/cfg/cfg_eth.h" - * $WIZ$ module_supports = "at91sam7x" + * $WIZ$ module_supports = "at91sam7x or sam3x" + * $WIZ$ module_hw = "bertos/hw/hw_eth.h", "bertos/hw/hw_eth.c" */ #ifndef DRV_ETH_H #define DRV_ETH_H +#include "hw/hw_eth.h" +#include "cfg/cfg_eth.h" + +#include + #include + #define ETH_ADDR_LEN 6 #define ETH_HEAD_LEN 14 #define ETH_DATA_LEN 1500 #define ETH_FRAME_LEN (ETH_HEAD_LEN + ETH_DATA_LEN) - -#define ETH_TYPE_IP 0x0800 +#define ETH_TYPE_IP 0x0800 typedef union Ethernet { @@ -119,10 +125,15 @@ INLINE bool eth_addrCmp(const uint8_t *addr1, const uint8_t *addr2) (addr1[5] ^ addr2[5])); } +ssize_t eth_putFrame(const uint8_t *buf, size_t len); +void eth_sendFrame(void); + +size_t eth_getFrameLen(void); +ssize_t eth_getFrame(uint8_t *buf, size_t len); + ssize_t eth_send(const uint8_t *buf, size_t len); ssize_t eth_recv(uint8_t *buf, size_t len); -int eth_init(void); -extern uint8_t mac_addr[ETH_ADDR_LEN]; +int eth_init(void); #endif /* DRV_ETH_H */