38 #include "contiki-net.h"
41 #include "lib/error.h"
42 #include "net/ethernet-drv.h"
44 #include "net/ethernet.h"
51 void __fastcall__ (* init)(u16_t reg);
53 void __fastcall__ (* send)(u16_t len);
59 ethernet_init(
struct ethernet_config *config)
61 static const char signature[4] = {0x65, 0x74, 0x68, 0x01};
65 struct mod_ctrl module_control = {cfs_read};
69 if(module_control.callerdata < 0) {
70 log_message(config->name,
": File not found");
74 byte = mod_load(&module_control);
75 if(byte != MLOAD_OK) {
76 log_message(config->name, byte == MLOAD_ERR_MEM?
": Out of memory":
82 module = module_control.module;
84 for(byte = 0; byte < 4; ++byte) {
85 if(module->signature[byte] != signature[byte]) {
86 log_message(config->name,
": No ETH driver");
99 module->buffer = uip_buf;
101 module->init(config->addr);
109 return module->poll();