gs2200m: Retry indefinately on GS2200M_IOC_ASSOC failure

Author: Alan Carvalho de Assis <engenharia03@siam.ind.br>

    Run nxstyle again gs2200m_main.c file and fix issues

Author: YAMAMOTO Takashi <yamamoto@midokura.com>

    gs2200m: Retry indefinately on GS2200M_IOC_ASSOC failure

    The ioctl doesn't return why it failed.
    It might or might not be a transient failure.

    In my environment, gs2200m often returns the following for AT+WA.
    It usually works after a few retries.

    [   12.110000] _parse_pkt_in_s1: +++++ 0:(msize=19, msg=WLAN CONNECT ERROR|)
    [   12.110000] _parse_pkt_in_s1: +++++ 1:(msize=6, msg=ERROR|)
This commit is contained in:
YAMAMOTO Takashi 2020-02-05 18:45:43 -03:00 committed by Alan Carvalho de Assis
parent e738fbedba
commit 2f4b309b1b

View File

@ -376,6 +376,7 @@ read_req(int fd, FAR const struct usrsock_request_common_s *com_hdr,
{
return -errno;
}
if (rlen + sizeof(*com_hdr) != reqsize)
{
return -EMSGSIZE;
@ -1350,12 +1351,16 @@ static int gs2200m_loop(FAR struct gs2200m_s *priv)
amsg.key = priv->key;
amsg.mode = priv->mode;
amsg.ch = priv->ch;
ret = ioctl(priv->gsfd, GS2200M_IOC_ASSOC, (unsigned long)&amsg);
if (0 != ret)
while (true)
{
fprintf(stderr, "association failed : invalid ssid or key \n");
goto errout;
ret = ioctl(priv->gsfd, GS2200M_IOC_ASSOC, (unsigned long)&amsg);
if (0 == ret)
{
break;
}
fprintf(stderr, "association failed : retrying\n");
}
while (true)