apps/netutils/netinit: MAC address configuration was represented by type long long. That is a problem for architectures that do not support typle long long. Replaces by two long configuration items.
This commit is contained in:
parent
8c36ec3f33
commit
87c1083357
@ -476,15 +476,26 @@ config NETINIT_SWMAC
|
|||||||
|
|
||||||
endchoice # MAC address selection
|
endchoice # MAC address selection
|
||||||
|
|
||||||
config NETINIT_MACADDR
|
config NETINIT_MACADDR_1
|
||||||
hex "Fixed MAC address"
|
hex "Fixed MAC address (bytes 0-3)"
|
||||||
default 0x00e0deadbeef if NET_ETHERNET
|
default 0xdeadbeef
|
||||||
default 0x00fade00deadbeef if !NET_ETHERNET && NET_6LOWPAN
|
|
||||||
depends on NETINIT_SWMAC && (NET_ETHERNET || NET_6LOWPAN)
|
depends on NETINIT_SWMAC && (NET_ETHERNET || NET_6LOWPAN)
|
||||||
---help---
|
---help---
|
||||||
If the hardware has no built-in MAC address and if the NETINIT_SWMAC
|
If the hardware has no built-in MAC address and if the NETINIT_SWMAC
|
||||||
option is selected, then the fixed, software-assigned MAC address
|
option is selected, then the fixed, software-assigned MAC address
|
||||||
MAC address must provided with this selection.
|
MAC address must provided with this selection. This setting provides
|
||||||
|
the least significant 4 bytes of the 6-8 byte MAC address.
|
||||||
|
|
||||||
|
config NETINIT_MACADDR_2
|
||||||
|
hex "Fixed MAC address (bytes 4-5/7)"
|
||||||
|
default 0x00e0 if NET_ETHERNET
|
||||||
|
default 0x00fade00 if !NET_ETHERNET && NET_6LOWPAN
|
||||||
|
depends on NETINIT_SWMAC && (NET_ETHERNET || NET_6LOWPAN)
|
||||||
|
---help---
|
||||||
|
If the hardware has no built-in MAC address and if the NETINIT_SWMAC
|
||||||
|
option is selected, then the fixed, software-assigned MAC address
|
||||||
|
MAC address must provided with this selection. This setting provides
|
||||||
|
the least significant 2-4 bytes of the 6-8 byte MAC address.
|
||||||
|
|
||||||
endif # NETINIT_NOMAC
|
endif # NETINIT_NOMAC
|
||||||
|
|
||||||
|
@ -300,12 +300,13 @@ static void netinit_set_macaddr(void)
|
|||||||
#if defined(CONFIG_NET_ETHERNET)
|
#if defined(CONFIG_NET_ETHERNET)
|
||||||
/* Use the configured, fixed MAC address */
|
/* Use the configured, fixed MAC address */
|
||||||
|
|
||||||
mac[0] = (CONFIG_NETINIT_MACADDR >> (8 * 5)) & 0xff;
|
mac[0] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 1)) & 0xff;
|
||||||
mac[1] = (CONFIG_NETINIT_MACADDR >> (8 * 4)) & 0xff;
|
mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
|
||||||
mac[2] = (CONFIG_NETINIT_MACADDR >> (8 * 3)) & 0xff;
|
|
||||||
mac[3] = (CONFIG_NETINIT_MACADDR >> (8 * 2)) & 0xff;
|
mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
|
||||||
mac[4] = (CONFIG_NETINIT_MACADDR >> (8 * 1)) & 0xff;
|
mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
|
||||||
mac[5] = (CONFIG_NETINIT_MACADDR >> (8 * 0)) & 0xff;
|
mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
|
||||||
|
mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
|
||||||
|
|
||||||
/* Set the MAC address */
|
/* Set the MAC address */
|
||||||
|
|
||||||
@ -314,14 +315,15 @@ static void netinit_set_macaddr(void)
|
|||||||
#elif defined(HAVE_EADDR)
|
#elif defined(HAVE_EADDR)
|
||||||
/* Use the configured, fixed extended address */
|
/* Use the configured, fixed extended address */
|
||||||
|
|
||||||
eaddr[0] = (CONFIG_NETINIT_MACADDR >> (8 * 7)) & 0xff;
|
eaddr[0] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 3)) & 0xff;
|
||||||
eaddr[1] = (CONFIG_NETINIT_MACADDR >> (8 * 6)) & 0xff;
|
eaddr[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 2)) & 0xff;
|
||||||
eaddr[2] = (CONFIG_NETINIT_MACADDR >> (8 * 5)) & 0xff;
|
eaddr[2] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 1)) & 0xff;
|
||||||
eaddr[3] = (CONFIG_NETINIT_MACADDR >> (8 * 4)) & 0xff;
|
eaddr[3] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
|
||||||
eaddr[4] = (CONFIG_NETINIT_MACADDR >> (8 * 3)) & 0xff;
|
|
||||||
eaddr[5] = (CONFIG_NETINIT_MACADDR >> (8 * 2)) & 0xff;
|
eaddr[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
|
||||||
eaddr[6] = (CONFIG_NETINIT_MACADDR >> (8 * 1)) & 0xff;
|
eaddr[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
|
||||||
eaddr[7] = (CONFIG_NETINIT_MACADDR >> (8 * 0)) & 0xff;
|
eaddr[6] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
|
||||||
|
eaddr[7] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
|
||||||
|
|
||||||
/* Set the 6LoWPAN extended address */
|
/* Set the 6LoWPAN extended address */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user