X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fnet.h;h=f1671e38deaf745224901ec9d252cccf62b179bd;hb=cdc7732f3737f2bb97b77eb3d7c9da344bb73612;hp=d17173d818a4fb9160aa8fed65a6f56ab263c457;hpb=1733259d25015c28c47990ec11af99b3f62f811c;p=u-boot diff --git a/include/net.h b/include/net.h index d17173d818..f1671e38de 100644 --- a/include/net.h +++ b/include/net.h @@ -93,6 +93,14 @@ struct eth_pdata { int phy_interface; }; +enum eth_recv_flags { + /* + * Check hardware device for new packets (otherwise only return those + * which are already in the memory buffer ready to process) + */ + ETH_RECV_CHECK_DEVICE = 1 << 0, +}; + /** * struct eth_ops - functions of Ethernet MAC controllers * @@ -111,7 +119,9 @@ struct eth_pdata { * 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 @@ -120,7 +130,7 @@ struct eth_pdata { struct eth_ops { int (*start)(struct udevice *dev); int (*send)(struct udevice *dev, void *packet, int length); - int (*recv)(struct udevice *dev, uchar **packetp); + int (*recv)(struct udevice *dev, int flags, uchar **packetp); int (*free_pkt)(struct udevice *dev, uchar *packet, int length); void (*stop)(struct udevice *dev); #ifdef CONFIG_MCAST_TFTP @@ -803,8 +813,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); /**********************************************************************/