summaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)Author
2012-05-23net: Add link-local addressing supportJoe Hershberger
Code based on networking/zcip.c in busybox commit 8531d76a15890c2c535908ce888b2e2aed35b172 Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: Separate ArpRequest() into lower-level funcJoe Hershberger
Link-local support will need to send ARP packets, but needs more fine-grained control over the contents. Split the implementation into 2 parts so link-local can share the code. Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: Don't copy every packet that waits for an ARPJoe Hershberger
Use the NetArpTxPacket for the ARP packet, not to hold what used to be in NetTxPacket. This saves a copy and makes the code easier to understand. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Fix net buffer initializationJoe Hershberger
A new non-static function net_init() will initialize buffers and read from the environment. Only update from the env on each entry to NetLoop(). Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Remove unused parameter from NetInitLoop()Joe Hershberger
Noone uses it. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Remove static allocation for MAC address in PingSend()Joe Hershberger
Don't force ARP clients to return the MAC address if they don't care (such as ping) Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: Add option CONFIG_BOOTP_MAY_FAILJoe Hershberger
This is useful if you want to look for a DHCP server, but try some other settings if not available. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Fix unused variable compile warningJoe Hershberger
If CONFIG_BOOTP_SERVERIP is not defined, unused variable warning is reported. This was fixed upstream using a compiler feature instead of a simple reorder of the statements. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: Add net_update_ether() to handle ARP and Ping repliesJoe Hershberger
When the network is VLAN or SNAP, net_update_ether() will preserve the original Ethernet packet header and simply replace the src and dest MACs and the protocol Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Refactor to separate the UDP handler from the ARP handlerJoe Hershberger
Call a built-in dummy if none is registered... don't require protocols to register a handler (eliminating dummies) NetConsole now uses the ARP handler when waiting on arp (instead of needing a #define hack in arp.c) Clear handlers at the end of net loop Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Refactor to protect access to the NetState variableJoe Hershberger
Changes to NetState now go through an accessor function called net_set_state() Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: Refactor to use NetSendPacket instead of eth_send directlyJoe Hershberger
Use this entry-point consistently across the net/ code Use a static inline function to preserve code size Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Refactor ping receive handlerJoe Hershberger
There is no need to call through the handler... inline it Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: Move debug trace to point of actionJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Refactor bootp packet length computationsJoe Hershberger
Eliminate pointer subtraction that recovers values computed earlier Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Refactor packet length computationsJoe Hershberger
Save the length when it is computed instead of forgetting it and subtracting pointers to figure it out again. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: Refactor NetSendUDPPacket to share more codeJoe Hershberger
Share more of the code that is common between ARP vs not. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Refactor IP, UPD, and ICMP header writing functionsJoe Hershberger
ICMP (ping) was reimplementing IP header code... it now shares code. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: cosmetic: Replace magic numbers in arp.c with constantsJoe Hershberger
Use field names and sizes when accessing ARP packets Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Rename tmp to reply_ip_addr in arp.cJoe Hershberger
Renamed for clarity Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: cosmetic: Alphabetize includes in net.cJoe Hershberger
Easier to find when alphabetized Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Rename OPT_SIZE to OPT_FIELD_SIZEJoe Hershberger
Clearer constant name. Also remove related BOOTP_SIZE which was unused and doesn't take into account VLAN packets. Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Rename CDPHandler to cdp_receiveJoe Hershberger
This is not called as a handler, so don't name it that way Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Rename "x" to "eth_proto"Joe Hershberger
x is a poor variable name Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: cosmetic: Add a more explicit comment about 802.2Joe Hershberger
Make the comment more accurate about the header including SNAP Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: cosmetic: Rename parameter len to payload_lenJoe Hershberger
This name more explicitly claims that it does not include the header size Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: cosmetic: Un-typedef ICMP_tJoe Hershberger
Remove typedef and lower-case name Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Un-typedef ARP_tJoe Hershberger
Remove typedef and lower-case letters Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Un-typedef VLAN_Ethernet_tJoe Hershberger
Eliminate the typedef and remove capital letters Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Un-typedef Ethernet_tJoe Hershberger
Separate the Ethernet header from the 802 header. Base the size constants on the structs. Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Split struct ip_udp_hdr into ip_hdrJoe Hershberger
Add a structure that only contains IP header fields to be used by functions that don't need UDP Rename IP_HDR_SIZE_NO_UDP to IP_HDR_SIZE Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: cosmetic: Un-typedef IP_tJoe Hershberger
Rename IP header related things to IP_UDP. The existing definition of IP_t includes UDP header, so name it to accurately describe the structure. Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: Move RARP receive logic out of net.cJoe Hershberger
Separate this functionality out of the net.c behemoth Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: Move PING out of net.cJoe Hershberger
Separate this functionality out of the net.c behemoth Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-23net: Move ARP out of net.cJoe Hershberger
Separate this functionality out of the net.c behemoth Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Mike Frysinger <[email protected]>
2012-05-23net: Encapsulate CDP packet identificationJoe Hershberger
Checking for CDP packets should be encapsulated, not copied code. Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: Move CDP out of net.cJoe Hershberger
Separate this functionality out of the net.c behemoth Signed-off-by: Joe Hershberger <[email protected]>
2012-05-23net: Move MAC-seeded rand out of bootp.cJoe Hershberger
Make the MAC-seeded random number generator available to /net in general. MAC-seeded rand will be needed by link-local as well, so give it an interface. Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: move bootfile init into eth_initializeMike Frysinger
All arches init this the same way, so move the logic into the core net code to avoid duplicating it everywhere else. Signed-off-by: Mike Frysinger <[email protected]> Reviewed-by: Joe Hershberger <[email protected]>
2012-05-15net: punt bd->bi_ip_addrMike Frysinger
This field gets read in one place (by "bdinfo"), and we can replace that with getenv("ipaddr"). After all, the bi_ip_addr field is kept up-to-date implicitly with the value of the ipaddr env var. Signed-off-by: Mike Frysinger <[email protected]> Reviewed-by: Joe Hershberger <[email protected]>
2012-05-15net: cosmetic: tftp.* checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: cosmetic: sntp.* checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: cosmetic: rarp.* checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: cosmetic: nfs.* checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: cosmetic: net.c checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: cosmetic: eth.c checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: cosmetic: bootp.* checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-05-15net: Remove volatile from net APIJoe Hershberger
Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2012-04-03net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall backEric Miao
Ignore the return value of eth_getenv_enetaddr_by_index(), and if it fails, fall back to use dev->enetaddr, which could be filled up by the ethernet device driver: With the current code, introduced with below commit, eth_write_hwaddr() will fail immediately if there is no eth<n>addr in the environment variables. However, e.g. for an overo based product that uses the SMSC911x ethernet chip (with the MAC address set via EEPROM connected to the SMSC911x chip), the MAC address is still OK. On mx28 boards that are depending on the OCOTP bits to set the MAC address (like the Denx m28 board), the OCOTP bits should be used instead of failing on the environment variables. Actually, this was the original behavior, and was later changed by commit 7616e7850804c7c69e0a22c179dfcba9e8f3f587. Signed-off-by: Eric Miao <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Dirk Behme <[email protected]> CC: Stefan Roese <[email protected]> CC: Eric Miao <[email protected]> CC: Wolfgang Denk <[email protected]> CC: Philip Balister <[email protected]> CC: Zach Sadecki <[email protected]>
2012-03-18bootstage: Plumb in bootstage calls for basic operationsSimon Glass
This inserts bootstage calls into tftp, usb start and bootm. We could go further, but this is a reasonable start to illustrate the concept. Signed-off-by: Simon Glass <[email protected]>