37 #include "contiki-net.h"
40 #include "lib/error.h"
41 #include "net/ethernet-drv.h"
43 #include "net/ethernet.h"
50 void __fastcall__ (* init)(uint16_t reg);
51 uint16_t (* poll)(void);
52 void __fastcall__ (* send)(uint16_t len);
58 ethernet_init(
struct ethernet_config *config)
60 static const char signature[4] = {0x65, 0x74, 0x68, 0x01};
64 struct mod_ctrl module_control = {cfs_read};
68 if(module_control.callerdata < 0) {
69 log_message(config->name,
": File not found");
73 byte = mod_load(&module_control);
74 if(byte != MLOAD_OK) {
75 log_message(config->name, byte == MLOAD_ERR_MEM?
": Out of memory":
81 module = module_control.module;
83 for(byte = 0; byte < 4; ++byte) {
84 if(module->signature[byte] != signature[byte]) {
85 log_message(config->name,
": No ETH driver");
98 module->buffer = uip_buf;
100 module->init(config->addr);
108 return module->poll();