diff --git a/inc/ip65.h b/inc/ip65.h index d389376..0760af2 100644 --- a/inc/ip65.h +++ b/inc/ip65.h @@ -23,30 +23,6 @@ // extern uint8_t ip65_error; -// MAC address of local machine (will be overwritten if ip65_init is called) -// -extern uint8_t cfg_mac[6]; - -// IP address of local machine (will be overwritten if dhcp_init is called) -// -extern uint32_t cfg_ip; - -// Netmask of local network (will be overwritten if dhcp_init is called) -// -extern uint32_t cfg_netmask; - -// IP address of router on local network (will be overwritten if dhcp_init is called) -// -extern uint32_t cfg_gateway; - -// IP address of dns server to use (will be overwritten if dhcp_init is called) -// -extern uint32_t cfg_dns; - -// Will be set to address of DHCP server that configuration was obtained from -// -extern uint32_t dhcp_server; - // Driver initialization parameter values // #ifdef __APPLE2__ @@ -67,6 +43,14 @@ extern uint32_t dhcp_server; // bool __fastcall__ ip65_init(uint8_t drv_init); +// Access to Ethernet configuration +// +// Access to the three items below is only valid after ip65_init returned false. +// +extern uint8_t cfg_mac[6]; // MAC address of local machine +extern char eth_driver_name[]; // Zero terminated string containing driver name +extern uint8_t* eth_driver_io_base; // Ethernet chip I/O base address used by driver + // Main IP polling loop // // This routine should be periodically called by an application at any time @@ -120,6 +104,16 @@ uint32_t __fastcall__ parse_dotted_quad(char* quad); // bool dhcp_init(void); +// Access to IP configuration +// +// The five items below will be overwritten if dhcp_init is called. +// +extern uint32_t cfg_ip; // IP address of local machine +extern uint32_t cfg_netmask; // Netmask of local network +extern uint32_t cfg_gateway; // IP address of router on local network +extern uint32_t cfg_dns; // IP address of DNS server to use +extern uint32_t dhcp_server; // Address of DHCP server that config was obtained from + // Resolve a string containing a hostname (or a dotted quad) to an IP address // // Inputs: hostname: Zero terminated string containing either a DNS hostname diff --git a/ip65/Makefile b/ip65/Makefile index 24d77b3..8e146dd 100644 --- a/ip65/Makefile +++ b/ip65/Makefile @@ -23,6 +23,7 @@ IP65OBJS=\ dottedquad_c.o \ download.o \ download_c.o \ + driver_c.o \ eth.o \ http.o \ http_c.o \ diff --git a/ip65/driver_c.s b/ip65/driver_c.s new file mode 100644 index 0000000..718fe71 --- /dev/null +++ b/ip65/driver_c.s @@ -0,0 +1,11 @@ +.include "../inc/common.inc" + +.export _eth_driver_name +.export _eth_driver_io_base + +.import eth_driver_name +.import eth_driver_io_base + +_eth_driver_name := eth_driver_name + +_eth_driver_io_base := eth_driver_io_base