Merged in masayuki2009/nuttx.nuttx/fix_macaddr_for_rndis (pull request #889)

configs: Fix mac address settings for rndis

Recently CONFIG_NETINIT_MACADDR_2 and CONFIG_NETINIT_MACADDR_1
were newly introduced instead of CONFIG_NETINIT_MACADDR.
This PR conforms to this change.

Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2019-06-11 11:18:18 +00:00 committed by Gregory Nutt
parent 6498ec8d02
commit 6d4c99f2aa
5 changed files with 25 additions and 24 deletions

View File

@ -116,14 +116,14 @@ int lc823450_bringup(void)
lc823450_wm8776initialize(0);
#endif
#if defined(CONFIG_RNDIS) && defined(CONFIG_NETINIT_MACADDR)
#if defined(CONFIG_RNDIS)
uint8_t mac[6];
mac[0] = 0xa0; /* TODO */
mac[1] = (CONFIG_NETINIT_MACADDR >> (8 * 4)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR >> (8 * 0)) & 0xff;
mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
usbdev_rndis_initialize(mac);
#endif

View File

@ -306,16 +306,16 @@ int stm32_bringup(void)
}
#endif
#if defined(CONFIG_RNDIS) && defined(CONFIG_NETINIT_MACADDR)
#if defined(CONFIG_RNDIS)
/* Set up a MAC address for the RNDIS device. */
uint8_t mac[6];
mac[0] = 0xa0; /* TODO */
mac[1] = (CONFIG_NETINIT_MACADDR >> (8 * 4)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR >> (8 * 0)) & 0xff;
mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
usbdev_rndis_initialize(mac);
#endif

View File

@ -47,6 +47,7 @@ CONFIG_NETDEVICES=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETINIT_DRIPADDR=0x0
CONFIG_NETINIT_MACADDR_1=0xdeadcafe
CONFIG_NETINIT_MACADDR_2=0x00e0
CONFIG_NETINIT_NETMASK=0x0
CONFIG_NETINIT_NOMAC=y
CONFIG_NETINIT_THREAD=y

View File

@ -427,14 +427,14 @@ int stm32_bringup(void)
}
#endif
#if defined(CONFIG_RNDIS) && defined(CONFIG_NETINIT_MACADDR)
#if defined(CONFIG_RNDIS)
uint8_t mac[6];
mac[0] = 0xa0; /* TODO */
mac[1] = (CONFIG_NETINIT_MACADDR >> (8 * 4)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR >> (8 * 0)) & 0xff;
mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
usbdev_rndis_initialize(mac);
#endif

View File

@ -364,16 +364,16 @@ int stm32_max3421e_setup(void)
}
#endif
#if defined(CONFIG_RNDIS) && defined(CONFIG_NETINIT_MACADDR)
#if defined(CONFIG_RNDIS)
{
uint8_t mac[6];
mac[0] = 0xa0; /* TODO */
mac[1] = (CONFIG_NETINIT_MACADDR >> (8 * 4)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR >> (8 * 0)) & 0xff;
mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
ret = usbdev_rndis_initialize(mac);
if (ret < 0)