drivers: wireless: Add support for ioctl(fd, SIOCGIFADDR, ...) to gs2200m.c

Summary:
- This commit adds support for ioctl(fd, SIOCGIFADDR, ...) to gs2200m.c

Impact:
- Only affects ioctl(fd, SIOCGIFADDR, ...) with gs2200m
- Need to update apps/wireless/gs2200m as well

Testing:
- Tested with spresense:wifi
- Tested with dhcpc

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2020-10-12 19:48:18 +09:00 committed by Alin Jerpelea
parent f12d49076c
commit df952074eb

View File

@ -2674,7 +2674,15 @@ static int gs2200m_ioctl_ifreq(FAR struct gs2200m_dev_s *dev,
dev->net_dev.d_mac.ether.ether_addr_octet, 6);
break;
case SIOCSIFADDR:
case SIOCGIFADDR:
getreq = true;
memcpy(&inaddr->sin_addr,
&dev->net_dev.d_ipaddr,
sizeof(dev->net_dev.d_ipaddr)
);
break;
case SIOCSIFADDR:
memcpy(&dev->net_dev.d_ipaddr,
&inaddr->sin_addr, sizeof(inaddr->sin_addr)
);