]> git.sur5r.net Git - u-boot/blobdiff - include/net.h
MX35: mx35pdk: make use of GPIO framework
[u-boot] / include / net.h
index 01f7159a0781aae480d55d1fc3373e6197c12b9e..ce54825085569a29c7242958a06956882b6138d6 100644 (file)
@@ -128,7 +128,18 @@ extern int eth_get_dev_index (void);               /* get the device index */
 extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
 extern int eth_getenv_enetaddr(char *name, uchar *enetaddr);
 extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr);
-extern int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr);
+
+/*
+ * Get the hardware address for an ethernet interface .
+ * Args:
+ *     base_name - base name for device (normally "eth")
+ *     index - device index number (0 for first)
+ *     enetaddr - returns 6 byte hardware address
+ * Returns:
+ *     Return true if the address is valid.
+ */
+extern int eth_getenv_enetaddr_by_index(const char *base_name, int index,
+                                       uchar *enetaddr);
 
 extern int usb_eth_initialize(bd_t *bi);
 extern int eth_init(bd_t *bis);                        /* Initialize the device */
@@ -141,6 +152,18 @@ extern int eth_rx(void);                   /* Check for received packets */
 extern void eth_halt(void);                    /* stop SCC */
 extern char *eth_get_name(void);               /* get name of current device */
 
+/*
+ * Set the hardware address for an ethernet interface based on 'eth%daddr'
+ * environment variable (or just 'ethaddr' if eth_number is 0).
+ * Args:
+ *     base_name - base name for device (normally "eth")
+ *     eth_number - value of %d (0 for first device of this type)
+ * Returns:
+ *     0 is success, non-zero is error status from driver.
+ */
+int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
+                    int eth_number);
+
 #ifdef CONFIG_MCAST_TFTP
 int eth_mcast_join( IPaddr_t mcast_addr, u8 join);
 u32 ether_crc (size_t len, unsigned char const *p);
@@ -364,7 +387,8 @@ extern int          NetState;               /* Network loop state           */
 extern int             NetRestartWrap;         /* Tried all network devices    */
 #endif
 
-typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP } proto_t;
+typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP,
+              TFTPSRV } proto_t;
 
 /* from net/net.c */
 extern char    BootFile[128];                  /* Boot File name               */