mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-30 11:38:15 +00:00 
			
		
		
		
	bf537-stamp: remove already defined is_zero_ether_addr and is_multicast_ether_addr
and move is_valid_ether_addr board file Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
		
							parent
							
								
									c2f896b8fc
								
							
						
					
					
						commit
						b8f4162a4f
					
				| @ -30,8 +30,25 @@ | |||||||
| #include <command.h> | #include <command.h> | ||||||
| #include <asm/blackfin.h> | #include <asm/blackfin.h> | ||||||
| #include <asm/io.h> | #include <asm/io.h> | ||||||
|  | #include <net.h> | ||||||
| #include "ether_bf537.h" | #include "ether_bf537.h" | ||||||
| 
 | 
 | ||||||
|  | /**
 | ||||||
|  |  * is_valid_ether_addr - Determine if the given Ethernet address is valid | ||||||
|  |  * @addr: Pointer to a six-byte array containing the Ethernet address | ||||||
|  |  * | ||||||
|  |  * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not | ||||||
|  |  * a multicast address, and is not FF:FF:FF:FF:FF:FF. | ||||||
|  |  * | ||||||
|  |  * Return true if the address is valid. | ||||||
|  |  */ | ||||||
|  | static inline int is_valid_ether_addr(const u8 * addr) | ||||||
|  | { | ||||||
|  | 	/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
 | ||||||
|  | 	 * explicitly check for it here. */ | ||||||
|  | 	return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| DECLARE_GLOBAL_DATA_PTR; | DECLARE_GLOBAL_DATA_PTR; | ||||||
| 
 | 
 | ||||||
| #define POST_WORD_ADDR 0xFF903FFC | #define POST_WORD_ADDR 0xFF903FFC | ||||||
|  | |||||||
| @ -69,42 +69,3 @@ void SoftResetPHY(void); | |||||||
| void DumpPHYRegs(void); | void DumpPHYRegs(void); | ||||||
| 
 | 
 | ||||||
| int SetupSystemRegs(int *opmode); | int SetupSystemRegs(int *opmode); | ||||||
| 
 |  | ||||||
| /**
 |  | ||||||
|  * is_zero_ether_addr - Determine if give Ethernet address is all zeros. |  | ||||||
|  * @addr: Pointer to a six-byte array containing the Ethernet address |  | ||||||
|  * |  | ||||||
|  * Return true if the address is all zeroes. |  | ||||||
|  */ |  | ||||||
| static inline int is_zero_ether_addr(const u8 * addr) |  | ||||||
| { |  | ||||||
| 	return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /**
 |  | ||||||
|  * is_multicast_ether_addr - Determine if the Ethernet address is a multicast. |  | ||||||
|  * @addr: Pointer to a six-byte array containing the Ethernet address |  | ||||||
|  * |  | ||||||
|  * Return true if the address is a multicast address. |  | ||||||
|  * By definition the broadcast address is also a multicast address. |  | ||||||
|  */ |  | ||||||
| static inline int is_multicast_ether_addr(const u8 * addr) |  | ||||||
| { |  | ||||||
| 	return (0x01 & addr[0]); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /**
 |  | ||||||
|  * is_valid_ether_addr - Determine if the given Ethernet address is valid |  | ||||||
|  * @addr: Pointer to a six-byte array containing the Ethernet address |  | ||||||
|  * |  | ||||||
|  * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not |  | ||||||
|  * a multicast address, and is not FF:FF:FF:FF:FF:FF. |  | ||||||
|  * |  | ||||||
|  * Return true if the address is valid. |  | ||||||
|  */ |  | ||||||
| static inline int is_valid_ether_addr(const u8 * addr) |  | ||||||
| { |  | ||||||
| 	/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
 |  | ||||||
| 	 * explicitly check for it here. */ |  | ||||||
| 	return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); |  | ||||||
| } |  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user