NSH wireless setup: Move call to nsh_associate(). It should be possible to associate with an AP when DHCPC is disabled.

This commit is contained in:
Gregory Nutt 2017-05-09 06:39:08 -06:00
parent 8029b81548
commit 5fbf2fd8d1

View File

@ -309,7 +309,7 @@ static void nsh_netinit_configure(void)
#ifdef CONFIG_NET_IPv4
/* Set up our host address */
#if !defined(CONFIG_NSH_DHCPC)
#ifndef CONFIG_NSH_DHCPC
addr.s_addr = HTONL(CONFIG_NSH_IPADDR);
#else
addr.s_addr = 0;
@ -353,22 +353,22 @@ static void nsh_netinit_configure(void)
#endif /* CONFIG_NET_ICMPv6_AUTOCONF */
#endif /* CONFIG_NET_IPv6 */
#if defined(CONFIG_NSH_DNS)
#ifdef CONFIG_NSH_DNS
addr.s_addr = HTONL(CONFIG_NSH_DNSIPADDR);
netlib_set_ipv4dnsaddr(&addr);
#endif
#if defined(CONFIG_NSH_DHCPC)
/* Get the MAC address of the NIC */
netlib_getmacaddr(NET_DEVNAME, mac);
#ifdef CONFIG_WIRELESS_WAPI
/* Associate the wlan */
/* Associate the wlan with an access point. */
nsh_associate(NET_DEVNAME);
#endif
#ifdef CONFIG_NSH_DHCPC
/* Get the MAC address of the NIC */
netlib_getmacaddr(NET_DEVNAME, mac);
/* Set up the DHCPC modules */
handle = dhcpc_open(&mac, IFHWADDRLEN);