]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/net.h
sparse: Simplify multiple logic
[people/ms/u-boot.git] / include / net.h
index b9c13f282cd347df2e2346f2c32267e90a5a64d4..ebed29ad577e898aecfefcfad784510f7ff6ea28 100644 (file)
@@ -119,7 +119,9 @@ enum eth_recv_flags {
  * mcast: Join or leave a multicast group (for TFTP) - optional
  * write_hwaddr: Write a MAC address to the hardware (used to pass it to Linux
  *              on some platforms like ARM). This function expects the
- *              eth_pdata::enetaddr field to be populated - optional
+ *              eth_pdata::enetaddr field to be populated. The method can
+ *              return -ENOSYS to indicate that this is not implemented for
+                this hardware - optional.
  * read_rom_hwaddr: Some devices have a backup of the MAC address stored in a
  *                 ROM on the board. This is how the driver should expose it
  *                 to the network stack. This function should fill in the
@@ -147,7 +149,9 @@ struct udevice *eth_get_dev(void); /* get the current device */
  */
 struct udevice *eth_get_dev_by_name(const char *devname);
 unsigned char *eth_get_ethaddr(void); /* get the current device MAC */
+
 /* Used only when NetConsole is enabled */
+int eth_is_active(struct udevice *dev); /* Test device for active state */
 int eth_init_state_only(void); /* Set active state */
 void eth_halt_state_only(void); /* Set passive state */
 #endif
@@ -193,6 +197,8 @@ static inline unsigned char *eth_get_ethaddr(void)
        return NULL;
 }
 
+/* Used only when NetConsole is enabled */
+int eth_is_active(struct eth_device *dev); /* Test device for active state */
 /* Set active state */
 static inline __attribute__((always_inline)) int eth_init_state_only(void)
 {
@@ -227,8 +233,8 @@ void eth_set_current(void);         /* set nterface to ethcur var */
 
 int eth_get_dev_index(void);           /* get the device index */
 void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
-int eth_getenv_enetaddr(char *name, uchar *enetaddr);
-int eth_setenv_enetaddr(char *name, const uchar *enetaddr);
+int eth_getenv_enetaddr(const char *name, uchar *enetaddr);
+int eth_setenv_enetaddr(const char *name, const uchar *enetaddr);
 
 /*
  * Get the hardware address for an ethernet interface .
@@ -510,7 +516,7 @@ enum proto_t {
        TFTPSRV, TFTPPUT, LINKLOCAL
 };
 
-extern char    net_boot_file_name[128];/* Boot File name */
+extern char    net_boot_file_name[1024];/* Boot File name */
 /* The actual transferred size of the bootfile (in bytes) */
 extern u32     net_boot_file_size;
 /* Boot file size in blocks as reported by the DHCP server */
@@ -811,8 +817,18 @@ void copy_filename(char *dst, const char *src, int size);
 /* get a random source port */
 unsigned int random_port(void);
 
-/* Update U-Boot over TFTP */
-int update_tftp(ulong addr);
+/**
+ * update_tftp - Update firmware over TFTP (via DFU)
+ *
+ * This function updates board's firmware via TFTP
+ *
+ * @param addr - memory address where data is stored
+ * @param interface - the DFU medium name - e.g. "mmc"
+ * @param devstring - the DFU medium number - e.g. "1"
+ *
+ * @return - 0 on success, other value on failure
+ */
+int update_tftp(ulong addr, char *interface, char *devstring);
 
 /**********************************************************************/