Merged in masayuki2009/nuttx.apps/gs2200m_with_dhcp (pull request #189)

wireless/gs2200m: Add dhcp client handlings in ioctl_request()

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2019-07-30 10:51:07 +00:00 committed by Gregory Nutt
parent 49e08ca3a9
commit 1980c30738

View File

@ -58,6 +58,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <net/if.h>
#include <nuttx/net/usrsock.h> #include <nuttx/net/usrsock.h>
#include <nuttx/wireless/gs2200m.h> #include <nuttx/wireless/gs2200m.h>
@ -546,6 +547,7 @@ static int close_request(int fd, FAR struct gs2200m_s *priv,
if (SOCK_DGRAM == usock->type && 'z' == cid) if (SOCK_DGRAM == usock->type && 'z' == cid)
{ {
/* the udp socket is not bound */ /* the udp socket is not bound */
goto errout; goto errout;
} }
@ -1262,9 +1264,25 @@ static int ioctl_request(int fd, FAR struct gs2200m_s *priv,
{ {
FAR struct usrsock_request_ioctl_s *req = hdrbuf; FAR struct usrsock_request_ioctl_s *req = hdrbuf;
struct usrsock_message_req_ack_s resp; struct usrsock_message_req_ack_s resp;
struct gs2200m_ifreq_msg imsg;
int ret = -EINVAL; int ret = -EINVAL;
/* TODO */ switch (req->cmd)
{
case SIOCSIFADDR:
case SIOCSIFDSTADDR:
case SIOCSIFNETMASK:
memset(&imsg.ifr, 0, sizeof(imsg.ifr));
(void)read(fd, &imsg.ifr, sizeof(imsg.ifr));
break;
default:
break;
}
imsg.cmd = req->cmd;
ret = ioctl(priv->gsfd, GS2200M_IOC_IFREQ, (unsigned long)&imsg);
/* Send ACK response */ /* Send ACK response */