]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/net.h
Merge branch 'master' of git://git.denx.de/u-boot-coldfire
[people/ms/u-boot.git] / include / net.h
index ac44d614ca335e390d801e3be50aaac6acccac71..06320c6514c9543923f109a0300e8e0e91a78057 100644 (file)
@@ -86,11 +86,13 @@ enum eth_state_t {
  * @iobase: The base address of the hardware registers
  * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env
  * @phy_interface: PHY interface to use - see PHY_INTERFACE_MODE_...
+ * @max_speed: Maximum speed of Ethernet connection supported by MAC
  */
 struct eth_pdata {
        phys_addr_t iobase;
        unsigned char enetaddr[6];
        int phy_interface;
+       int max_speed;
 };
 
 enum eth_recv_flags {
@@ -235,6 +237,23 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
 int eth_getenv_enetaddr(const char *name, uchar *enetaddr);
 int eth_setenv_enetaddr(const char *name, const uchar *enetaddr);
 
+/**
+ * eth_setenv_enetaddr_by_index() - set the MAC address environment variable
+ *
+ * This sets up an environment variable with the given MAC address (@enetaddr).
+ * The environment variable to be set is defined by <@base_name><@index>addr.
+ * If @index is 0 it is omitted. For common Ethernet this means ethaddr,
+ * eth1addr, etc.
+ *
+ * @base_name:  Base name for variable, typically "eth"
+ * @index:      Index of interface being updated (>=0)
+ * @enetaddr:   Pointer to MAC address to put into the variable
+ * @return 0 if OK, other value on error
+ */
+int eth_setenv_enetaddr_by_index(const char *base_name, int index,
+                                uchar *enetaddr);
+
+
 /*
  * Get the hardware address for an ethernet interface .
  * Args:
@@ -250,7 +269,7 @@ int eth_getenv_enetaddr_by_index(const char *base_name, int index,
 int eth_init(void);                    /* Initialize the device */
 int eth_send(void *packet, int length);           /* Send a packet */
 
-#ifdef CONFIG_API
+#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
 int eth_receive(void *packet, int length); /* Receive a packet*/
 extern void (*push_packet)(void *packet, int length);
 #endif
@@ -318,6 +337,8 @@ struct vlan_ethernet_hdr {
 #define PROT_ARP       0x0806          /* IP ARP protocol              */
 #define PROT_RARP      0x8035          /* IP ARP protocol              */
 #define PROT_VLAN      0x8100          /* IEEE 802.1q protocol         */
+#define PROT_IPV6      0x86dd          /* IPv6 over bluebook           */
+#define PROT_PPP_SES   0x8864          /* PPPoE session messages       */
 
 #define IPPROTO_ICMP    1      /* Internet Control Message Protocol    */
 #define IPPROTO_UDP    17      /* User Datagram Protocol               */
@@ -444,20 +465,14 @@ struct icmp_hdr {
 #define IP_ICMP_HDR_SIZE       (IP_HDR_SIZE + ICMP_HDR_SIZE)
 
 /*
- * Maximum packet size; used to allocate packet storage.
- * TFTP packets can be 524 bytes + IP header + ethernet header.
- * Lets be conservative, and go for 38 * 16.  (Must also be
- * a multiple of 32 bytes).
- */
-/*
- * AS.HARNOIS : Better to set PKTSIZE to maximum size because
- * traffic type is not always controlled
- * maximum packet size =  1518
+ * Maximum packet size; used to allocate packet storage. Use
+ * the maxium Ethernet frame size as specified by the Ethernet
+ * standard including the 802.1Q tag (VLAN tagging).
+ * maximum packet size =  1522
  * maximum packet size and multiple of 32 bytes =  1536
  */
-#define PKTSIZE                        1518
+#define PKTSIZE                        1522
 #define PKTSIZE_ALIGN          1536
-/*#define PKTSIZE              608*/
 
 /*
  * Maximum receive ring size; that is, the number of packets